Commit e8fe2cb7 by Liv Haapala

Merge branch 'master' of gitlab.codecrew.fi:liv/moya-info-tools

Conflicts:
	MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.Designer.cs
	MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.cs
	MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.resx
2 parents 707e01d9 b180fb00
...@@ -54,13 +54,8 @@ namespace MoyaAdminUI ...@@ -54,13 +54,8 @@ namespace MoyaAdminUI
} }
} }
} }
/*
[Description("Binded to user")]
public int ReserverId
{
get { return APIreference.eventuserId; }
set { APIreference.eventuserId = value; }
}*/
public bool Dirty = false; public bool Dirty = false;
[Category("Place map")] [Category("Place map")]
...@@ -134,42 +129,70 @@ namespace MoyaAdminUI ...@@ -134,42 +129,70 @@ namespace MoyaAdminUI
get { return APIreference.name; } get { return APIreference.name; }
set { APIreference.name = value; } set { APIreference.name = value; }
} }
[Category("Reservation")]
User reserverUserCache = null;
[Category("Reservation"), DisplayName("Player"), Description("Person who will sit to place")]
public string ReserverUserName public string ReserverUserName
{ {
get get
{ {
if (APIreference.reserverId > 0) if (reserverUserCache == null)
{ {
if (getUser() == null) if (APIreference.eventuserId > 0)
{
foreach (User u in User.Cache)
{ {
return "ERR"; if (u.EventUserId == APIreference.eventuserId)
{
reserverUserCache = u;
break;
}
} }
else
return User.ToString();
} }
// Still no hit, use buyer
if (reserverUserCache == null)
{
foreach (User u in User.Cache)
{
if (u.EventUserId == APIreference.reserverId)
{
reserverUserCache = u;
break;
}
}
}
}
if (reserverUserCache == null)
return "free"; return "free";
else return
reserverUserCache.ToString();
} }
} }
[Category("Reservation")]
User buyerUserCache = null;
[Category("Reservation"), DisplayName("Buyer"), Description("Person who had payed place")]
public User User public User User
{ {
get get
{ {
return getUser(); if (buyerUserCache == null)
}
//set { }
}
private MoyaAdminUI.User getUser()
{ {
foreach (User u in User.Cache) foreach (User u in User.Cache)
{ {
if (u.EventUserId == APIreference.reserverId) if (u.EventUserId == APIreference.reserverId)
return u; {
buyerUserCache = u;
break;
}
}
} }
return null; return buyerUserCache;
} }
}
public Point GetPoint() public Point GetPoint()
{ {
return new Point(this.MapX, this.MapY); return new Point(this.MapX, this.MapY);
...@@ -218,6 +241,8 @@ namespace MoyaAdminUI ...@@ -218,6 +241,8 @@ namespace MoyaAdminUI
} }
public void Release() public void Release()
{ {
reserverUserCache = null;
buyerUserCache = null;
APIreference.Release(); APIreference.Release();
} }
...@@ -227,6 +252,8 @@ namespace MoyaAdminUI ...@@ -227,6 +252,8 @@ namespace MoyaAdminUI
* */ * */
internal void Reserve(User user) internal void Reserve(User user)
{ {
reserverUserCache = null;
buyerUserCache = null;
APIreference.Reserve(user.EventUserId); APIreference.Reserve(user.EventUserId);
} }
} }
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripSaveButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSaveButton = new System.Windows.Forms.ToolStripButton();
this.toolStripRefreshButton = new System.Windows.Forms.ToolStripButton(); this.toolStripRefreshButton = new System.Windows.Forms.ToolStripButton();
this.UnlockToolStripButton = new System.Windows.Forms.ToolStripButton();
this.usersToolStripPrintButton = new System.Windows.Forms.ToolStripButton(); this.usersToolStripPrintButton = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
...@@ -50,13 +51,18 @@ ...@@ -50,13 +51,18 @@
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.TopPanel = new System.Windows.Forms.Panel(); this.TopPanel = new System.Windows.Forms.Panel();
this.searchTextBox = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.MapsComboBox = new System.Windows.Forms.ComboBox(); this.MapsComboBox = new System.Windows.Forms.ComboBox();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.searchTimer = new System.Windows.Forms.Timer(this.components);
this.ImageRefreshTimer = new System.Windows.Forms.Timer(this.components);
this.panel2 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.MapPictureBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.MapPictureBox)).BeginInit();
this.toolStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout();
this.TopPanel.SuspendLayout(); this.TopPanel.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// placesContextMenuStrip // placesContextMenuStrip
...@@ -66,10 +72,10 @@ ...@@ -66,10 +72,10 @@
// //
// MapPictureBox // MapPictureBox
// //
this.MapPictureBox.Dock = System.Windows.Forms.DockStyle.Left; this.MapPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.MapPictureBox.Location = new System.Drawing.Point(0, 70); this.MapPictureBox.Location = new System.Drawing.Point(0, 45);
this.MapPictureBox.Name = "MapPictureBox"; this.MapPictureBox.Name = "MapPictureBox";
this.MapPictureBox.Size = new System.Drawing.Size(758, 426); this.MapPictureBox.Size = new System.Drawing.Size(752, 426);
this.MapPictureBox.TabIndex = 0; this.MapPictureBox.TabIndex = 0;
this.MapPictureBox.TabStop = false; this.MapPictureBox.TabStop = false;
this.MapPictureBox.Paint += new System.Windows.Forms.PaintEventHandler(this.MapPictureBox_Paint); this.MapPictureBox.Paint += new System.Windows.Forms.PaintEventHandler(this.MapPictureBox_Paint);
...@@ -81,9 +87,9 @@ ...@@ -81,9 +87,9 @@
// //
this.placeEditor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) this.placeEditor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.placeEditor.Location = new System.Drawing.Point(6, 178); this.placeEditor.Location = new System.Drawing.Point(6, 223);
this.placeEditor.Name = "placeEditor"; this.placeEditor.Name = "placeEditor";
this.placeEditor.Size = new System.Drawing.Size(269, 242); this.placeEditor.Size = new System.Drawing.Size(311, 242);
this.placeEditor.TabIndex = 13; this.placeEditor.TabIndex = 13;
// //
// PlacesListView // PlacesListView
...@@ -98,9 +104,10 @@ ...@@ -98,9 +104,10 @@
this.colY}); this.colY});
this.PlacesListView.ContextMenuStrip = this.placesContextMenuStrip; this.PlacesListView.ContextMenuStrip = this.placesContextMenuStrip;
this.PlacesListView.FullRowSelect = true; this.PlacesListView.FullRowSelect = true;
this.PlacesListView.Location = new System.Drawing.Point(6, 6); this.PlacesListView.HideSelection = false;
this.PlacesListView.Location = new System.Drawing.Point(6, 45);
this.PlacesListView.Name = "PlacesListView"; this.PlacesListView.Name = "PlacesListView";
this.PlacesListView.Size = new System.Drawing.Size(272, 166); this.PlacesListView.Size = new System.Drawing.Size(314, 172);
this.PlacesListView.TabIndex = 0; this.PlacesListView.TabIndex = 0;
this.PlacesListView.UseCompatibleStateImageBehavior = false; this.PlacesListView.UseCompatibleStateImageBehavior = false;
this.PlacesListView.View = System.Windows.Forms.View.Details; this.PlacesListView.View = System.Windows.Forms.View.Details;
...@@ -132,6 +139,7 @@ ...@@ -132,6 +139,7 @@
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripSaveButton, this.toolStripSaveButton,
this.toolStripRefreshButton, this.toolStripRefreshButton,
this.UnlockToolStripButton,
this.usersToolStripPrintButton, this.usersToolStripPrintButton,
this.toolStripSeparator1, this.toolStripSeparator1,
this.toolStripButton1, this.toolStripButton1,
...@@ -142,7 +150,7 @@ ...@@ -142,7 +150,7 @@
this.toolStripButton3}); this.toolStripButton3});
this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1042, 25); this.toolStrip1.Size = new System.Drawing.Size(1078, 25);
this.toolStrip1.TabIndex = 14; this.toolStrip1.TabIndex = 14;
this.toolStrip1.Text = "toolStrip1"; this.toolStrip1.Text = "toolStrip1";
this.toolStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStrip1_ItemClicked); this.toolStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStrip1_ItemClicked);
...@@ -167,6 +175,17 @@ ...@@ -167,6 +175,17 @@
this.toolStripRefreshButton.Text = "Refresh"; this.toolStripRefreshButton.Text = "Refresh";
this.toolStripRefreshButton.Click += new System.EventHandler(this.toolStripRefreshButton_Click); this.toolStripRefreshButton.Click += new System.EventHandler(this.toolStripRefreshButton_Click);
// //
// UnlockToolStripButton
//
this.UnlockToolStripButton.CheckOnClick = true;
this.UnlockToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.UnlockToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("UnlockToolStripButton.Image")));
this.UnlockToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.UnlockToolStripButton.Name = "UnlockToolStripButton";
this.UnlockToolStripButton.Size = new System.Drawing.Size(23, 22);
this.UnlockToolStripButton.Text = "toolStripButton4";
this.UnlockToolStripButton.ToolTipText = "Unlock place map";
//
// usersToolStripPrintButton // usersToolStripPrintButton
// //
this.usersToolStripPrintButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.usersToolStripPrintButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
...@@ -230,7 +249,6 @@ ...@@ -230,7 +249,6 @@
this.toolStripButton2.Name = "toolStripButton2"; this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(23, 22); this.toolStripButton2.Size = new System.Drawing.Size(23, 22);
this.toolStripButton2.Text = "Ruokailutilasto"; this.toolStripButton2.Text = "Ruokailutilasto";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
// //
// toolStripButton3 // toolStripButton3
// //
...@@ -246,11 +264,21 @@ ...@@ -246,11 +264,21 @@
this.TopPanel.Controls.Add(this.label3); this.TopPanel.Controls.Add(this.label3);
this.TopPanel.Controls.Add(this.MapsComboBox); this.TopPanel.Controls.Add(this.MapsComboBox);
this.TopPanel.Dock = System.Windows.Forms.DockStyle.Top; this.TopPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.TopPanel.Location = new System.Drawing.Point(0, 25); this.TopPanel.Location = new System.Drawing.Point(0, 0);
this.TopPanel.Name = "TopPanel"; this.TopPanel.Name = "TopPanel";
this.TopPanel.Size = new System.Drawing.Size(1042, 45); this.TopPanel.Size = new System.Drawing.Size(752, 45);
this.TopPanel.TabIndex = 15; this.TopPanel.TabIndex = 15;
// //
// searchTextBox
//
this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.searchTextBox.Location = new System.Drawing.Point(6, 21);
this.searchTextBox.Name = "searchTextBox";
this.searchTextBox.Size = new System.Drawing.Size(314, 20);
this.searchTextBox.TabIndex = 7;
this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged);
//
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
...@@ -272,34 +300,56 @@ ...@@ -272,34 +300,56 @@
// //
// panel1 // panel1
// //
this.panel1.Controls.Add(this.searchTextBox);
this.panel1.Controls.Add(this.PlacesListView); this.panel1.Controls.Add(this.PlacesListView);
this.panel1.Controls.Add(this.placeEditor); this.panel1.Controls.Add(this.placeEditor);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(758, 70); this.panel1.Location = new System.Drawing.Point(752, 25);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(284, 426); this.panel1.Size = new System.Drawing.Size(326, 471);
this.panel1.TabIndex = 16; this.panel1.TabIndex = 16;
// //
// searchTimer
//
this.searchTimer.Interval = 500;
this.searchTimer.Tick += new System.EventHandler(this.searchTimer_Tick);
//
// ImageRefreshTimer
//
this.ImageRefreshTimer.Tick += new System.EventHandler(this.ImageRefreshTimer_Tick);
//
// panel2
//
this.panel2.Controls.Add(this.MapPictureBox);
this.panel2.Controls.Add(this.TopPanel);
this.panel2.Dock = System.Windows.Forms.DockStyle.Left;
this.panel2.Location = new System.Drawing.Point(0, 25);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(752, 471);
this.panel2.TabIndex = 17;
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1042, 496); this.ClientSize = new System.Drawing.Size(1078, 496);
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);
this.Controls.Add(this.MapPictureBox); this.Controls.Add(this.panel2);
this.Controls.Add(this.TopPanel);
this.Controls.Add(this.toolStrip1); this.Controls.Add(this.toolStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm"; this.Name = "MainForm";
this.Text = "Moya Admin UI"; this.Text = "Moya Admin UI";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmComputerPlaces_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmComputerPlaces_FormClosing);
this.Load += new System.EventHandler(this.frmEditComputerPlace_Load); this.Load += new System.EventHandler(this.frmEditComputerPlace_Load);
this.SizeChanged += new System.EventHandler(this.MainForm_SizeChanged);
((System.ComponentModel.ISupportInitialize)(this.MapPictureBox)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.MapPictureBox)).EndInit();
this.toolStrip1.ResumeLayout(false); this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout(); this.toolStrip1.PerformLayout();
this.TopPanel.ResumeLayout(false); this.TopPanel.ResumeLayout(false);
this.TopPanel.PerformLayout(); this.TopPanel.PerformLayout();
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel2.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -330,6 +380,11 @@ ...@@ -330,6 +380,11 @@
private System.Windows.Forms.ToolStripButton cardInfoToolStripButton; private System.Windows.Forms.ToolStripButton cardInfoToolStripButton;
private System.Windows.Forms.ToolStripButton toolStripButton2; private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.ToolStripButton toolStripButton3; private System.Windows.Forms.ToolStripButton toolStripButton3;
private System.Windows.Forms.ToolStripButton UnlockToolStripButton;
private System.Windows.Forms.TextBox searchTextBox;
private System.Windows.Forms.Timer searchTimer;
private System.Windows.Forms.Timer ImageRefreshTimer;
private System.Windows.Forms.Panel panel2;
} }
} }
...@@ -45,6 +45,7 @@ namespace MoyaAdminUI ...@@ -45,6 +45,7 @@ namespace MoyaAdminUI
{ {
MessageBox.Show(ex.Message + "\r\nCannot connect to Moya.\r\nCheck Api url and key"); MessageBox.Show(ex.Message + "\r\nCannot connect to Moya.\r\nCheck Api url and key");
} }
} }
private void loadPlacemap() private void loadPlacemap()
...@@ -104,6 +105,7 @@ namespace MoyaAdminUI ...@@ -104,6 +105,7 @@ namespace MoyaAdminUI
Size borderSize = this.Size - this.ClientSize; Size borderSize = this.Size - this.ClientSize;
this.MapPictureBox.Load(RestClient.GetRequestURL(Properties.Settings.Default.ApiURL, "placeadmin/background/" + SelectedMap.Id)); this.MapPictureBox.Load(RestClient.GetRequestURL(Properties.Settings.Default.ApiURL, "placeadmin/background/" + SelectedMap.Id));
MapPictureBox.Size = this.MapPictureBox.Image.Size; MapPictureBox.Size = this.MapPictureBox.Image.Size;
panel2.Width = this.MapPictureBox.Image.Size.Width;
this.MinimumSize = this.MapPictureBox.Image.Size + new Size(0, this.TopPanel.Size.Height + 20) + new Size(this.panel1.MinimumSize.Width + 270, 0) + borderSize; this.MinimumSize = this.MapPictureBox.Image.Size + new Size(0, this.TopPanel.Size.Height + 20) + new Size(this.panel1.MinimumSize.Width + 270, 0) + borderSize;
} }
...@@ -609,6 +611,9 @@ namespace MoyaAdminUI ...@@ -609,6 +611,9 @@ namespace MoyaAdminUI
} }
else if (place.Taken) else if (place.Taken)
{ {
if (place.APIReference.eventuserId > 0)
brush = Brushes.Green;
else
brush = Brushes.Red; brush = Brushes.Red;
} }
else if (place.Buyable) else if (place.Buyable)
...@@ -661,7 +666,8 @@ namespace MoyaAdminUI ...@@ -661,7 +666,8 @@ namespace MoyaAdminUI
placeEditor.SelectedObject = selectedPlace; placeEditor.SelectedObject = selectedPlace;
} }
this.MapPictureBox.Refresh(); ImageRefreshTimer.Start();
} }
private void SaveButton_Click(object sender, EventArgs e) private void SaveButton_Click(object sender, EventArgs e)
...@@ -839,6 +845,8 @@ namespace MoyaAdminUI ...@@ -839,6 +845,8 @@ namespace MoyaAdminUI
{ {
mouseDownPoint = e.Location; mouseDownPoint = e.Location;
mouseDownComputerPlace = findPlace(mouseDownPoint); mouseDownComputerPlace = findPlace(mouseDownPoint);
//if (UnlockToolStripButton.Checked)
//{
if (mouseDownComputerPlace != null) if (mouseDownComputerPlace != null)
{ {
//editComputerPlace(mouseDownComputerPlace); //editComputerPlace(mouseDownComputerPlace);
...@@ -854,6 +862,7 @@ namespace MoyaAdminUI ...@@ -854,6 +862,7 @@ namespace MoyaAdminUI
{ {
editComputerPlace(null); editComputerPlace(null);
} }
//}
} }
} }
...@@ -892,10 +901,11 @@ namespace MoyaAdminUI ...@@ -892,10 +901,11 @@ namespace MoyaAdminUI
{ {
unsafe unsafe
{ {
// if drag start top of place then move // if drag start top of place then move
if (e.Button == MouseButtons.Left && mouseDownComputerPlace != null) if (UnlockToolStripButton.Checked && e.Button == MouseButtons.Left && mouseDownComputerPlace != null)
{ {
//drag & drop //drag & drop
...@@ -961,13 +971,39 @@ namespace MoyaAdminUI ...@@ -961,13 +971,39 @@ namespace MoyaAdminUI
MapPictureBox.Refresh(); MapPictureBox.Refresh();
} }
// if drag start from blank area then paint new places // if drag start from blank area then paint selection area
else if (e.Button == MouseButtons.Left && mouseDownComputerPlace == null) else if (e.Button == MouseButtons.Left && mouseDownComputerPlace == null)
{ {
//set multiselect range so we can draw the selectarea rectangle //set multiselect range so we can draw the selectarea rectangle
multiSelectStart = mouseDownPoint; multiSelectStart = mouseDownPoint;
multiSelectEnd = e.Location; multiSelectEnd = e.Location;
int Xleft, Xright, Yup, Ybottom;
if (mouseDownPoint.X > e.Location.X)
{
Xleft = e.Location.X;
Xright = mouseDownPoint.X;
}
else
{
Xleft = mouseDownPoint.X;
Xright = e.Location.X;
}
if (mouseDownPoint.Y > e.Location.Y)
{
Yup = e.Location.Y;
Ybottom = mouseDownPoint.Y;
}
else
{
Yup = mouseDownPoint.Y;
Ybottom = e.Location.Y;
}
multiSelectStart = new Point(Xleft, Yup);
multiSelectEnd = new Point(Xright, Ybottom);
//selecting items //selecting items
disableEvents = true; disableEvents = true;
this.PlacesListView.BeginUpdate(); this.PlacesListView.BeginUpdate();
...@@ -1087,10 +1123,55 @@ namespace MoyaAdminUI ...@@ -1087,10 +1123,55 @@ namespace MoyaAdminUI
frm.Show(); frm.Show();
} }
private void toolStripButton2_Click(object sender, EventArgs e) private void searchTextBox_TextChanged(object sender, EventArgs e)
{ {
searchTimer.Stop();
searchTimer.Start();
}
private void searchTimer_Tick(object sender, EventArgs e)
{
searchTimer.Stop();
ListView.ListViewItemCollection items = PlacesListView.Items;
PlacesListView.BeginUpdate();
if (searchTextBox.Text.Length > 0)
{
foreach (ListViewItem lvi in items)
{
ComputerPlace place = (ComputerPlace)lvi.Tag;
if (
place.Name == searchTextBox.Text
|| place.User != null
&& (
place.ReserverUserName.ToLower().Contains(searchTextBox.Text.ToLower())
|| place.User.ToString().ToLower().Contains(searchTextBox.Text.ToLower())
)
)
{
lvi.Selected = true;
}
else
lvi.Selected = false;
}
}
PlacesListView.EndUpdate();
} }
private void ImageRefreshTimer_Tick(object sender, EventArgs e)
{
ImageRefreshTimer.Stop();
this.MapPictureBox.Refresh();
}
private void MainForm_SizeChanged(object sender, EventArgs e)
{
}
} }
} }
...@@ -152,42 +152,58 @@ ...@@ -152,42 +152,58 @@
RK5CYII= RK5CYII=
</value> </value>
</data> </data>
<data name="UnlockToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJGSURBVDhPrZLpS9MBGMf35/QiQvJFZQekhJRKUR60xKl4
ZGnlJolHkld7oZZdrjzS5m0jJDdvHV7llZmbZ0gkBtmaxsyj5n6f/M0x+In1IvrC8+bh+/0+z/fhkf13
TI0aoz/NmZgzDfN+qIuBjpe06EqpL8sLdFH+DPNId+z85Cjr1lkctkmElSEESwfW6UrKC1Mpzlf6uqh7
Y2Z8gDWLmYXJVvIz4si9qSBLeYnFwRyWRjLIUclxUffGWJ8B4fswmYlyVNFnDok9VZSfZ9XTOwizKaTE
nv27Qa++EiytJEX4SojVT9QI00oSFT57G/Tryz2MjWW01z+muaaQJm0Bjdo8dCVqGkpzqdVkUVV0G+2D
W1QUplF+L9XDJd1B5wsNqwttsNzjLOGbEcfXTra+tGH/bMCx1O7uL0408DA7QbpJS+39HfG0CocpAftY
DJuDYaz1BrHxWg4zSTjM17G/u8yHV4GkXz0vNWjS3gVrD1sT8fx6G8XGm1AGq0+jCNlPd0OkW7w5rGBG
509yTIDUQMwrWLr4ORLJ+sBFVo3nCAvaR2T40e065hav9QUzVeODMlx6ZJmuVO3Mu94fgq0rgJVmH6fZ
brGt0x9ThRfXQr2lBnWabOyLemwdfizrT/Kj5wJ1jwKJCDtCifqUW7xi8Ga8+CDx8hNSg2pNJgujWiae
Hcb8/Dgf2yOYbwl1HkzMLK4tThbFhtwDxAV77TIoyvIsSI9FnaxwVs72+2beCHFeWzyYmFlcW5wsiq8E
eUn/4N8hk/0Gifq8WDRVD4YAAAAASUVORK5CYII=
</value>
</data>
<data name="usersToolStripPrintButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="usersToolStripPrintButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALrSURBVDhPjZJ5SBNQHMenhNoilMIiSiRSKpU8CjOdktKk YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALsSURBVDhPjZJ7SBNQGMWnRNkilMIiakiUVEvyUaj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GShh8jri+p4jtmURUtQ6pOWHwERXhVFoJ3OKyvxs/i5UpgFNc
O8bBaXkFdvMYgp4+h3/NMK5VDcC3sh++5X24qugBq7wHDiE8kCLv4wTFr15j3sAtLIHhXz2A6+oGuqwD lx3bPQl+x2Pw2icQdvcBQhpGcVE7jKC6IQRpBnGhph8cTT/cI4SgxN7EQVpws8m8jE9UCiukfhiXjA1M
tLI20CStoD5ugY+4CVRxs2bNkHbAhcvHOQ4fByysmVq7+iV8b5owK3pXNgZEK2vfNJY2aQbGkHfhSnED VTcYVffAqOwEvaIDgYo20BXtpjVL2Y0TAhGO80XYQXZkm+3Glwi6QmLXDiwuD4hR1bViLG8zDYyl7sX5
vIvqNfd25sTDkhGyamhoaKS1EwgMBkMvs0QWES5WvvQrqF6i5FfBM7cclIIasOuHEFo3CKa0FZceSEEK 0hackzeb7u3FTwaZGfHb2traxmwnEFgs1sbcMlVMtEL3KFiqnacVaeEv0YBW3ABesx6RTSNgKzvhd0sJ
5eG4u0+f1roF3YiICKO8PJF9WrFcwBVKRyjZZYvkJBHIKY9Af6gAObkQjsExOHzG6Y7Wsy06AQEBe3Nz SqQQB3wDB83WVVjGxMTYFBbKXLNK1WKBVDkWkF/1nZomAzXjDpi3a0BNL4FHeAJ2H/O8bvasiQWXy90q
C2xTRZIYTk7JM68k4bzr3XS4hCeq3Ci0U9q+HaHDYrH25OQIrTKKJOECYWkaj8fbvykRCP8ARTd+bLTN kRQ7Z8oqE/gFZfcD0qRz3vHZOBGdavChMY6Y+9aFBYfD2VJQIHXIkVdGi6XlWUKhcPuKRCD8Axv4flla
ZQsAAAAASUVORK5CYII= RbvVAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhE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4x+SPLLI3a153nG7qg2+gQkLDjJLa+MkyrrROssrdHS78dgxiDyVCcHRotFInkyxErfeP2ohAxrxGaXs
dignl2KwxS6fEI7LKzCW2rKftZj0+pyHx19pnfSmB+/elgAAAABJRU5ErkJggg== cE4exWSL3dtDOW7foARq3W6WJ+mVOR+fP14n9JodHaZ5AAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="cardLocationInputToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="cardLocationInputToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
...@@ -221,20 +237,20 @@ ...@@ -221,20 +237,20 @@
<data name="cardInfoToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="cardInfoToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAL4SURBVDhPdVNrSFNhGD5io/6YiEX+KKfTXZxOh6Wm5iXU YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAL1SURBVDhPdVNbSJNhGP7FRt2YiEVelNPp5pxOxVqm5iHU
1LPbmc7LvKWppGmmlSEEGmHbztzmXF6yTbP6k/QriKAfZRcSEhKjjMJAtPKnMAL/CHt73+OFJHrhgcN5 1H/ng4d5SlNJ00wrQwg0wrb9cydXzmxqVjdJV0EEXZQdSEhIjDIKA9HKS2EEuxn49r6/B5LohQd+eJ/n
n+f53vN872H2VE7fvkjWlhHFWkajNbbFaJb/HYWgZ3pHPeJ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nBAPDYp
RGOTgpIZBiCl2gNv55dhdv4rpJRbBEOaChdNuA0VaoRboFJwDrO6wuVXlVHDJQTZwT+Bz0trsLj0Ay7b KIl2CBS1Xng7vwyz819BUWnhDWkqXDT+NeSo4V+BSqpzmNMrnQF5BTVcfJBd3BP4vLQGi0s/4JJtGrJq
piGt2g0nqjyCcVrtbT9pBDEVbRWO1H+qYXQjC8OkQOlWKq8huqfAeMkLec1jkN/ihdzGOxvE3bOJVOG4 PXCsxssbZ9XfCpCGF1PRVqUZXYMnm3zBPAyTAqVXqb6K6J0C/UU/FLWOQnGbHwqb7wSJu2sTqaJxv9NN
30mmwW7cgVVthy9AO1Fy5QGUXn0IJgTXNRk43Ty+qkIOcbdluxWEEDFhktBjmecL4vW94xm1jg95jZ6f 7l7cgVVVl3+DdsJw+QEYrzwEE0LXM7FxqnVsVY4c4m7JdioMIWCiRJFHcs+VpGj6x3LqHR+Kmr0/C1rc
uU3uX5nV/HyC7ro34mRjERMaGYZcOj2YhDtFvyi5HkGIGZFIFXww6ozokMIsCpfVBIdEatA/GXuxiKMI v3JruflU9TV/zInmMiYyNgq5dHo4CbeLflFyPYQQMgKBPHx/3GnBAalZEC2pC4+IVaJ/JvYSEYcRZLKX
MtnPMEzQH5GbqgS3rfXtAAAAAElFTkSuQmCC YZiwP1wkqe371DsXAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="toolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="toolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
...@@ -267,6 +283,12 @@ ...@@ -267,6 +283,12 @@
TgDQASA1MVpwzwAAAABJRU5ErkJggg== TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<metadata name="searchTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>307, 17</value>
</metadata>
<metadata name="ImageRefreshTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>424, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA
......
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
// //
// bookNumericUpDown // bookNumericUpDown
// //
this.bookNumericUpDown.Enabled = false;
this.bookNumericUpDown.Location = new System.Drawing.Point(363, 159); this.bookNumericUpDown.Location = new System.Drawing.Point(363, 159);
this.bookNumericUpDown.Name = "bookNumericUpDown"; this.bookNumericUpDown.Name = "bookNumericUpDown";
this.bookNumericUpDown.ReadOnly = true; this.bookNumericUpDown.ReadOnly = true;
...@@ -172,6 +173,7 @@ ...@@ -172,6 +173,7 @@
// //
// pageNumericUpDown // pageNumericUpDown
// //
this.pageNumericUpDown.Enabled = false;
this.pageNumericUpDown.Location = new System.Drawing.Point(363, 185); this.pageNumericUpDown.Location = new System.Drawing.Point(363, 185);
this.pageNumericUpDown.Name = "pageNumericUpDown"; this.pageNumericUpDown.Name = "pageNumericUpDown";
this.pageNumericUpDown.ReadOnly = true; this.pageNumericUpDown.ReadOnly = true;
...@@ -180,6 +182,7 @@ ...@@ -180,6 +182,7 @@
// //
// slotNumericUpDown // slotNumericUpDown
// //
this.slotNumericUpDown.Enabled = false;
this.slotNumericUpDown.Location = new System.Drawing.Point(363, 211); this.slotNumericUpDown.Location = new System.Drawing.Point(363, 211);
this.slotNumericUpDown.Name = "slotNumericUpDown"; this.slotNumericUpDown.Name = "slotNumericUpDown";
this.slotNumericUpDown.ReadOnly = true; this.slotNumericUpDown.ReadOnly = true;
......
...@@ -30,14 +30,17 @@ ...@@ -30,14 +30,17 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.usersListView = new System.Windows.Forms.ListView(); this.usersListView = new System.Windows.Forms.ListView();
this.button1 = new System.Windows.Forms.Button();
this.searchTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.button1 = new System.Windows.Forms.Button();
this.searchTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.searchTimer = new System.Windows.Forms.Timer(this.components); this.searchTimer = new System.Windows.Forms.Timer(this.components);
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.CardState = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// usersListView // usersListView
...@@ -53,16 +56,37 @@ ...@@ -53,16 +56,37 @@
this.usersListView.FullRowSelect = true; this.usersListView.FullRowSelect = true;
this.usersListView.Location = new System.Drawing.Point(12, 58); this.usersListView.Location = new System.Drawing.Point(12, 58);
this.usersListView.Name = "usersListView"; this.usersListView.Name = "usersListView";
this.usersListView.Size = new System.Drawing.Size(570, 241); this.usersListView.Size = new System.Drawing.Size(517, 349);
this.usersListView.TabIndex = 0; this.usersListView.TabIndex = 0;
this.usersListView.UseCompatibleStateImageBehavior = false; this.usersListView.UseCompatibleStateImageBehavior = false;
this.usersListView.View = System.Windows.Forms.View.Details; this.usersListView.View = System.Windows.Forms.View.Details;
this.usersListView.SelectedIndexChanged += new System.EventHandler(this.usersListView_SelectedIndexChanged);
this.usersListView.DoubleClick += new System.EventHandler(this.usersListView_DoubleClick); this.usersListView.DoubleClick += new System.EventHandler(this.usersListView_DoubleClick);
// //
// columnHeader1
//
this.columnHeader1.Text = "Nick";
this.columnHeader1.Width = 118;
//
// columnHeader2
//
this.columnHeader2.Text = "Firstname";
this.columnHeader2.Width = 112;
//
// columnHeader3
//
this.columnHeader3.Text = "Lastname";
this.columnHeader3.Width = 150;
//
// columnHeader4
//
this.columnHeader4.Text = "Login";
this.columnHeader4.Width = 93;
//
// button1 // button1
// //
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(507, 305); this.button1.Location = new System.Drawing.Point(454, 412);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23); this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1; this.button1.TabIndex = 1;
...@@ -86,35 +110,35 @@ ...@@ -86,35 +110,35 @@
this.label1.TabIndex = 3; this.label1.TabIndex = 3;
this.label1.Text = "Search"; this.label1.Text = "Search";
// //
// columnHeader1 // searchTimer
//
this.columnHeader1.Text = "Nick";
this.columnHeader1.Width = 118;
//
// columnHeader2
//
this.columnHeader2.Text = "Firstname";
this.columnHeader2.Width = 112;
// //
// columnHeader3 this.searchTimer.Tick += new System.EventHandler(this.searchTimer_Tick);
// //
this.columnHeader3.Text = "Lastname"; // pictureBox1
this.columnHeader3.Width = 150;
// //
// columnHeader4 this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox1.Location = new System.Drawing.Point(535, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(260, 395);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 4;
this.pictureBox1.TabStop = false;
// //
this.columnHeader4.Text = "Login"; // CardState
this.columnHeader4.Width = 93;
// //
// searchTimer this.CardState.Location = new System.Drawing.Point(535, 412);
// this.CardState.Name = "CardState";
this.searchTimer.Tick += new System.EventHandler(this.searchTimer_Tick); this.CardState.ReadOnly = true;
this.CardState.Size = new System.Drawing.Size(260, 20);
this.CardState.TabIndex = 5;
// //
// UsersFinderForm // UsersFinderForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(594, 333); this.ClientSize = new System.Drawing.Size(807, 447);
this.Controls.Add(this.CardState);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.searchTextBox); this.Controls.Add(this.searchTextBox);
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
...@@ -122,6 +146,7 @@ ...@@ -122,6 +146,7 @@
this.Name = "UsersFinderForm"; this.Name = "UsersFinderForm";
this.Text = "Users Finder"; this.Text = "Users Finder";
this.Load += new System.EventHandler(this.UsersFinderForm_Load); this.Load += new System.EventHandler(this.UsersFinderForm_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -138,5 +163,7 @@ ...@@ -138,5 +163,7 @@
private System.Windows.Forms.TextBox searchTextBox; private System.Windows.Forms.TextBox searchTextBox;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Timer searchTimer; private System.Windows.Forms.Timer searchTimer;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.TextBox CardState;
} }
} }
\ No newline at end of file
using System; using MoyaAdminLib;
using MoyaAdminUI.MoyaAPI;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
...@@ -6,6 +8,7 @@ using System.Drawing; ...@@ -6,6 +8,7 @@ using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Windows.Forms; using System.Windows.Forms;
namespace MoyaAdminUI namespace MoyaAdminUI
...@@ -81,5 +84,22 @@ namespace MoyaAdminUI ...@@ -81,5 +84,22 @@ namespace MoyaAdminUI
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
} }
private void usersListView_SelectedIndexChanged(object sender, EventArgs e)
{
pictureBox1.Image = null;
if (usersListView.SelectedItems.Count != 1)
{
return;
}
User user = (User)usersListView.SelectedItems[0].Tag;
RestClient client = new RestClient(Properties.Settings.Default.ApiURL);
string json = client.MakeRequest("user/card/" + user.EventUserId);
var ser = new JavaScriptSerializer();
Card card = ser.Deserialize<Card>(json);
pictureBox1.ImageLocation = RestClient.GetRequestURL(Properties.Settings.Default.ApiURL, "card/GetImage/" + card.cardId);
CardState.Text = card.state;
}
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!