Commit 93678be0 by Tapio Haapala

siirtoa libin puolelle

1 parent 9a5df3c3
......@@ -11,6 +11,8 @@ namespace MoyaAdminLib
{
public static string CARD_STATE_PRINTED = "PRINTED";
public static string CARD_BARCODE_PREFIX = "277";
public static string CARD_PLACE = "cardplace";
//{"cardId":3990,"state":"PENDING_VALIDATION","cardTemplate":"pelaaja","username":"Miketzu","wholeName":"Mirco Renko"}
public int cardId;
public string state;
......@@ -37,6 +39,95 @@ namespace MoyaAdminLib
return false;
}
public string GetCardPlace(){
if (this.state == Card.CARD_STATE_PRINTED)
{
string json = "";
RestClient client = new RestClient(RestClient.ApiURL);
try
{
json = client.MakeRequest("meta/v1/printedcard/" + this.cardId + "/card-filing");
}
catch (ApplicationException ex)
{
if (!ex.Message.Contains("HTTP NoContent"))
return "";
}
if (json != null && json != "")
{
MetaData data = getValue(json);
int bookNumber = 0;
int pageNumber = 0;
int slotNumber = 0;
getCardPlace(data, out bookNumber, out pageNumber, out slotNumber);
return bookNumber + "." + pageNumber + "." + slotNumber;
}
}
return "";
}
private MetaData getValue(string ret)
{
MetaData data = null;
if (ret != null && ret != "")
{
ret = ret.Trim();
if (ret.StartsWith("{") && ret.EndsWith("}"))
{
ret = ret.Replace("{", "");
ret = ret.Replace("}", "");
if (ret.Contains(":"))
{
data = new MetaData();
string[] fields = ret.Split(new string[] { ":" }, StringSplitOptions.RemoveEmptyEntries);
if (fields.Length == 2)
{
if (fields[0].StartsWith("\""))
fields[0] = fields[0].Substring(1, fields[0].Length - 1);
if (fields[0].EndsWith("\""))
fields[0] = fields[0].Substring(0, fields[0].Length - 1);
data.key = fields[0];
if (fields[1].StartsWith("\""))
fields[1] = fields[1].Substring(1, fields[1].Length - 1);
if (fields[1].EndsWith("\""))
fields[1] = fields[1].Substring(0, fields[1].Length - 1);
data.value = fields[1];
}
}
}
}
return data;
}
private void getCardPlace(MetaData data, out int bookNumber, out int pageNumber, out int slotNumber)
{
bookNumber = 0;
pageNumber = 0;
slotNumber = 0;
if (data != null)
{
if (data.key == CARD_PLACE)
{
if (data.value != null && data.value != "")
{
string[] fields = data.value.Split(new string[] { "." }, StringSplitOptions.None);
if (fields.Length > 2)
{
if (fields.Length == 3)
{
int.TryParse(fields[0], out bookNumber);
int.TryParse(fields[1], out pageNumber);
int.TryParse(fields[2], out slotNumber);
}
}
}
}
}
}
}
}
......@@ -7,8 +7,9 @@ using System.Drawing;
using System.Web.Script.Serialization;
using System.ComponentModel;
using MoyaAdminUI.MoyaAPI;
using MoyaAdminLib;
namespace MoyaAdminUI
namespace MoyaAdminLib
{
public class ComputerPlace
{
......@@ -226,7 +227,7 @@ namespace MoyaAdminUI
{
ComputerPlace.Cache.Clear();
RestClient client = new RestClient(Properties.Settings.Default.ApiURL);
RestClient client = new RestClient();
string json = client.MakeRequest("placeadmin/places/" + mapId);
var ser = new JavaScriptSerializer();
PlaceMap map = ser.Deserialize<PlaceMap>(json);
......@@ -250,7 +251,7 @@ namespace MoyaAdminUI
public static int DefaultWidth = 23;
public static int DefaultHeight = 23;
* */
internal void Reserve(User user)
public void Reserve(User user)
{
reserverUserCache = null;
buyerUserCache = null;
......
using MoyaAdminUI.MoyaAPI;
using MoyaAdminLib;
using MoyaAdminUI.MoyaAPI;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -37,7 +38,7 @@ namespace MoyaAdminUI
{
Map.Cache.Clear();
RestClient client = new RestClient(Properties.Settings.Default.ApiURL);
RestClient client = new RestClient();
string json = client.MakeRequest("placeadmin/maps");
var ser = new JavaScriptSerializer();
Maps maps = ser.Deserialize<Maps>(json);
......
......@@ -48,6 +48,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Card.cs" />
<Compile Include="ComputerPlace.cs" />
<Compile Include="Controls\EventUserEditor.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -58,17 +59,23 @@
<Compile Include="EventUsers.cs" />
<Compile Include="LuggageHold.cs" />
<Compile Include="LuggageHoldList.cs" />
<Compile Include="Map.cs" />
<Compile Include="Maps.cs" />
<Compile Include="MetaData.cs" />
<Compile Include="MetaDataList.cs" />
<Compile Include="OrgMeal.cs" />
<Compile Include="OrgMealList.cs" />
<Compile Include="Place.cs" />
<Compile Include="PlaceMap.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Randomizer.cs" />
<Compile Include="Reader.cs" />
<Compile Include="ReaderEvent.cs" />
<Compile Include="ReaderEventList.cs" />
<Compile Include="ReaderList.cs" />
<Compile Include="RestClient.cs" />
<Compile Include="Scanner.cs" />
<Compile Include="User.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
......
using System.Collections.Generic;
using MoyaAdminLib;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
......@@ -38,14 +39,14 @@ namespace MoyaAdminUI.MoyaAPI
if (id > 0)
{
// update
client = new RestClient(Properties.Settings.Default.ApiURL, HttpVerb.PUT);
client = new RestClient(RestClient.ApiURL, HttpVerb.PUT);
client.PostData = ser.Serialize(this);
client.MakeRequest("placeadmin/place/"+id);
}
else
{
//create
client = new RestClient(Properties.Settings.Default.ApiURL, HttpVerb.POST);
client = new RestClient(RestClient.ApiURL, HttpVerb.POST);
client.PostData = ser.Serialize(this);
client.MakeRequest("placeadmin/place");
}
......@@ -55,7 +56,7 @@ namespace MoyaAdminUI.MoyaAPI
internal void Release()
{
ComputerPlace.Cache.Clear();
RestClient client = new RestClient(Properties.Settings.Default.ApiURL, HttpVerb.PUT);
RestClient client = new RestClient(RestClient.ApiURL, HttpVerb.PUT);
string json = client.MakeRequest("placeadmin/place/"+ id+"/release");
}
......@@ -63,7 +64,7 @@ namespace MoyaAdminUI.MoyaAPI
internal void Reserve(int userid)
{
ComputerPlace.Cache.Clear();
RestClient client = new RestClient(Properties.Settings.Default.ApiURL, HttpVerb.PUT);
RestClient client = new RestClient(RestClient.ApiURL, HttpVerb.PUT);
string json = client.MakeRequest("placeadmin/place/" + id + "/reserve/" + userid);
}
}
......
......@@ -7,8 +7,11 @@ using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace MoyaAdminUI.MoyaAPI
namespace MoyaAdminLib
{
public enum HttpVerb
{
GET,
......@@ -23,9 +26,14 @@ namespace MoyaAdminUI.MoyaAPI
public string ContentType { get; set; }
public string PostData { get; set; }
public static string ApiApplicationKey;
public static string ApiUser;
public static string ApiPass;
public static string ApiURL;
public RestClient()
{
EndPoint = "";
EndPoint = ApiURL;
Method = HttpVerb.GET;
ContentType = "application/json";
......@@ -82,8 +90,8 @@ namespace MoyaAdminUI.MoyaAPI
public static string GetRequestURL(string server, string parameters)
{
int timestamp = ConvertToTimestamp(DateTime.Now);
string hash = CalculateSHA1("/" + parameters + "+" + Properties.Settings.Default.ApiApplicationKey + "+" + Properties.Settings.Default.ApiUser + "+" + timestamp + "+" + Properties.Settings.Default.ApiPass);
string url = server + "/rest/" + parameters + "?appkey=" + Properties.Settings.Default.ApiApplicationKey + "&appuser=" + Properties.Settings.Default.ApiUser + "&appstamp=" + timestamp + "&appmac=" + hash;
string hash = CalculateSHA1("/" + parameters + "+" + ApiApplicationKey + "+" + ApiUser + "+" + timestamp + "+" + ApiPass);
string url = server + "/rest/" + parameters + "?appkey=" + ApiApplicationKey + "&appuser=" + ApiUser + "&appstamp=" + timestamp + "&appmac=" + hash;
Console.WriteLine(url);
return url;
}
......
......@@ -7,7 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
namespace MoyaAdminUI
namespace MoyaAdminLib
{
public class User
{
......@@ -63,7 +63,7 @@ namespace MoyaAdminUI
public static void LoadAll()
{
User.Cache.Clear();
RestClient client = new RestClient(Properties.Settings.Default.ApiURL);
RestClient client = new RestClient();
string json = client.MakeRequest("user/eventusers");
var ser = new JavaScriptSerializer();
EventUsers users = ser.Deserialize<EventUsers>(json);
......
D:\Devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Debug\MoyaAdminLib.dll.config
D:\Devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Debug\MoyaAdminLib.dll
D:\Devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Debug\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.dll
D:\Devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.Controls.EventUserEditor.resources
D:\Devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.csproj.GenerateResource.Cache
using System;
using MoyaAdminLib;
using MoyaAdminUI.MoyaAPI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
......@@ -24,7 +26,11 @@ namespace MoyaAdminUI
Properties.Settings.Default.ApiUser = ApiUserTextBox.Text;
Properties.Settings.Default.ApiPass = ApiPassTextBox.Text;
Properties.Settings.Default.Save();
RestClient.ApiApplicationKey = Properties.Settings.Default.ApiApplicationKey;
RestClient.ApiPass = Properties.Settings.Default.ApiPass;
RestClient.ApiUser = Properties.Settings.Default.ApiUser;
RestClient.ApiURL = Properties.Settings.Default.ApiURL;
this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
......
......@@ -42,13 +42,13 @@
this.toolStripSaveButton = 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.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.usersToolStripPrintButton = new System.Windows.Forms.ToolStripButton();
this.cardLocationInputToolStripButton = new System.Windows.Forms.ToolStripButton();
this.incomingFormToolStripButton = new System.Windows.Forms.ToolStripButton();
this.cardInfoToolStripButton = new System.Windows.Forms.ToolStripButton();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.cloackRoomToolStripButton = new System.Windows.Forms.ToolStripButton();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.TopPanel = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.MapsComboBox = new System.Windows.Forms.ComboBox();
......@@ -57,6 +57,7 @@
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();
this.orgMealToolStripButton = new System.Windows.Forms.ToolStripButton();
((System.ComponentModel.ISupportInitialize)(this.MapPictureBox)).BeginInit();
this.toolStrip1.SuspendLayout();
this.TopPanel.SuspendLayout();
......@@ -144,8 +145,9 @@
this.cardLocationInputToolStripButton,
this.incomingFormToolStripButton,
this.cardInfoToolStripButton,
this.toolStripButton3,
this.toolStripButton1});
this.cloackRoomToolStripButton,
this.toolStripButton1,
this.orgMealToolStripButton});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1078, 25);
......@@ -184,6 +186,11 @@
this.UnlockToolStripButton.Text = "toolStripButton4";
this.UnlockToolStripButton.ToolTipText = "Unlock place map";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// usersToolStripPrintButton
//
this.usersToolStripPrintButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
......@@ -194,22 +201,6 @@
this.usersToolStripPrintButton.Text = "Users";
this.usersToolStripPrintButton.Click += new System.EventHandler(this.usersToolStripPrintButton_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// toolStripButton1
//
this.toolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
this.toolStripButton1.Text = "Api settings";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click_1);
//
// cardLocationInputToolStripButton
//
this.cardLocationInputToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
......@@ -240,14 +231,26 @@
this.cardInfoToolStripButton.Text = "Kortin tiedot";
this.cardInfoToolStripButton.Click += new System.EventHandler(this.cardInfoToolStripButton_Click);
//
// toolStripButton3
// cloackRoomToolStripButton
//
this.cloackRoomToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.cloackRoomToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("cloackRoomToolStripButton.Image")));
this.cloackRoomToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.cloackRoomToolStripButton.Name = "cloackRoomToolStripButton";
this.cloackRoomToolStripButton.Size = new System.Drawing.Size(23, 22);
this.cloackRoomToolStripButton.Text = "Cloack room";
this.cloackRoomToolStripButton.Click += new System.EventHandler(this.toolStripButton3_Click);
//
this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(23, 22);
this.toolStripButton3.Text = "Laukkuparkki";
// toolStripButton1
//
this.toolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
this.toolStripButton1.Text = "Api settings";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click_1);
//
// TopPanel
//
......@@ -318,6 +321,16 @@
this.panel2.Size = new System.Drawing.Size(752, 471);
this.panel2.TabIndex = 17;
//
// orgMealToolStripButton
//
this.orgMealToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.orgMealToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("orgMealToolStripButton.Image")));
this.orgMealToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.orgMealToolStripButton.Name = "orgMealToolStripButton";
this.orgMealToolStripButton.Size = new System.Drawing.Size(23, 22);
this.orgMealToolStripButton.Text = "Org Meal";
this.orgMealToolStripButton.Click += new System.EventHandler(this.orgMealToolStripButton_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
......@@ -368,12 +381,13 @@
private System.Windows.Forms.ToolStripButton cardLocationInputToolStripButton;
private System.Windows.Forms.ToolStripButton incomingFormToolStripButton;
private System.Windows.Forms.ToolStripButton cardInfoToolStripButton;
private System.Windows.Forms.ToolStripButton toolStripButton3;
private System.Windows.Forms.ToolStripButton cloackRoomToolStripButton;
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;
private System.Windows.Forms.ToolStripButton orgMealToolStripButton;
}
}
using MoyaAdminUI.MoyaAPI;
using MoyaAdminLib;
using MoyaAdminUI.MoyaAPI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
......@@ -30,6 +31,11 @@ namespace MoyaAdminUI
public MainForm()
{
InitializeComponent();
RestClient.ApiApplicationKey = Properties.Settings.Default.ApiApplicationKey;
RestClient.ApiPass = Properties.Settings.Default.ApiPass;
RestClient.ApiUser = Properties.Settings.Default.ApiUser;
RestClient.ApiURL = Properties.Settings.Default.ApiURL;
}
......@@ -121,6 +127,8 @@ namespace MoyaAdminUI
//Creating menuitems
MenuItem mi;
mi = new MenuItem("Create a new computer place...", new EventHandler(this.createNewComputerPlace));
mi.Enabled = (computerPlace == null);
menu.MenuItems.Add(mi);
......@@ -145,6 +153,10 @@ namespace MoyaAdminUI
mi.Enabled = (computerPlace != null);
menu.MenuItems.Add(mi);
mi = new MenuItem("Show buyer info", new EventHandler(this.showBuyerInfo));
mi.Enabled = (computerPlace == null);
menu.MenuItems.Add(mi);
menu.Show(this.MapPictureBox, clickedLocation);
}
else if (e.Button == MouseButtons.Left && multiMoveLastLocation == null)
......@@ -198,6 +210,8 @@ namespace MoyaAdminUI
this.MapPictureBox.Refresh();
}
private void selectAllInGroup(object sender, EventArgs e)
{
if (selectedPlace != null && selectedPlace.ReserverId > 0)
......@@ -242,6 +256,7 @@ namespace MoyaAdminUI
foreach (ListViewItem li in this.PlacesListView.SelectedItems)
{
ComputerPlace p = (ComputerPlace)li.Tag;
p.Reserve(frm.SelectedUser);
}
......@@ -1116,7 +1131,12 @@ namespace MoyaAdminUI
IncomingForm frm = new IncomingForm();
frm.Show();
}
private void showBuyerInfo(object sender, EventArgs e)
{
ShowCardInformation frm = new ShowCardInformation();
frm.Show();
}
private void cardInfoToolStripButton_Click(object sender, EventArgs e)
{
ShowCardInformation frm = new ShowCardInformation();
......@@ -1172,10 +1192,17 @@ namespace MoyaAdminUI
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
}
private void orgMealToolStripButton_Click(object sender, EventArgs e)
{
OrgMealCounter frm = new OrgMealCounter();
frm.Show();
}
......
......@@ -51,9 +51,6 @@
<Reference Include="AutoUpdateLib">
<HintPath>..\..\..\PrintServer\moyaPrintServer\moyaPrintServer\bin\Debug\AutoUpdateLib.dll</HintPath>
</Reference>
<Reference Include="MoyaAdminLib">
<HintPath>..\MoyaAdminLib\bin\Debug\MoyaAdminLib.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
......@@ -98,12 +95,7 @@
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Map.cs" />
<Compile Include="ComputerPlace.cs" />
<Compile Include="MoyaApi\Maps.cs" />
<Compile Include="MoyaUtils.cs" />
<Compile Include="MoyaApi\Place.cs" />
<Compile Include="MoyaApi\PlaceMap.cs" />
<Compile Include="OrgMealCounter.cs">
<SubType>Form</SubType>
</Compile>
......@@ -112,7 +104,6 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="MoyaApi\RestClient.cs" />
<Compile Include="Scanner.cs" />
<Compile Include="ShowCardInformation.cs">
<SubType>Form</SubType>
......@@ -120,7 +111,6 @@
<Compile Include="ShowCardInformation.Designer.cs">
<DependentUpon>ShowCardInformation.cs</DependentUpon>
</Compile>
<Compile Include="User.cs" />
<Compile Include="UserInfoForm.cs">
<SubType>Form</SubType>
</Compile>
......@@ -199,6 +189,12 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MoyaAdminLib\MoyaAdminLib.csproj">
<Project>{095ce28f-5b53-4203-85c6-3a9afd486407}</Project>
<Name>MoyaAdminLib</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>$(SolutionDir)/../../../\AutoUpdate\src\AutoPublish\bin\Debug\AutoPublish.exe $(ConfigurationName) $(ProjectName) $(SolutionDir) $(TargetPath)</PostBuildEvent>
......
......@@ -34,7 +34,6 @@
this.columnHeader2 = ((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.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);
......@@ -83,16 +82,6 @@
this.columnHeader4.Text = "Login";
this.columnHeader4.Width = 93;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(454, 412);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
//
// searchTextBox
//
this.searchTextBox.Location = new System.Drawing.Point(12, 32);
......@@ -141,7 +130,6 @@
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.searchTextBox);
this.Controls.Add(this.button1);
this.Controls.Add(this.usersListView);
this.Name = "UsersFinderForm";
this.Text = "Users Finder";
......@@ -159,7 +147,6 @@
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox searchTextBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Timer searchTimer;
......
......@@ -53,9 +53,9 @@ namespace MoyaAdminUI
{
if (searchString == "" ||
user.Login.ToLower().Contains(searchString) ||
user.Firstname.ToLower().Contains(searchString) ||
user.Lastname.ToLower().Contains(searchString) ||
user.Login.ToLower().Contains(searchString)
//user.Firstname.ToLower().Contains(searchString) ||
//user.Lastname.ToLower().Contains(searchString) ||
(user.Firstname.ToLower() + " " + user.Lastname.ToLower()).Contains(searchString)
)
{
ListViewItem lvi = new ListViewItem(user.Nick);
......@@ -99,7 +99,11 @@ namespace MoyaAdminUI
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;
if (card.state == Card.CARD_STATE_PRINTED)
CardState.Text = card.state + " in " + card.GetCardPlace();
else
CardState.Text = card.state;
/*
if (card.state == Card.CARD_STATE_PRINTED)
......@@ -133,5 +137,10 @@ namespace MoyaAdminUI
}
* */
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!