Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya Info Tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 93678be0
authored
Jun 02, 2014
by
Tapio Haapala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
siirtoa libin puolelle
1 parent
9a5df3c3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
228 additions
and
73 deletions
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/Card.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/ComputerPlace.cs → MoyaAdmin/MoyaAdminUI/MoyaAdminLib/ComputerPlace.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/Map.cs → MoyaAdmin/MoyaAdminUI/MoyaAdminLib/Map.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MoyaAPI/Maps.cs → MoyaAdmin/MoyaAdminUI/MoyaAdminLib/Maps.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/MoyaAdminLib.csproj
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MoyaAPI/Place.cs → MoyaAdmin/MoyaAdminUI/MoyaAdminLib/Place.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MoyaAPI/PlaceMap.cs → MoyaAdmin/MoyaAdminUI/MoyaAdminLib/PlaceMap.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MoyaAPI/RestClient.cs → MoyaAdmin/MoyaAdminUI/MoyaAdminLib/RestClient.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/User.cs → MoyaAdmin/MoyaAdminUI/MoyaAdminLib/User.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.Controls.EventUserEditor.resources
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.csproj.FileListAbsolute.txt
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/ApiSettings.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.Designer.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.resx
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MoyaAdminUI.csproj
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/UsersFinderForm.Designer.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/UsersFinderForm.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/Card.cs
View file @
93678be
...
...
@@ -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
);
}
}
}
}
}
}
}
}
MoyaAdmin/MoyaAdminUI/MoyaAdmin
UI
/ComputerPlace.cs
→
MoyaAdmin/MoyaAdminUI/MoyaAdmin
Lib
/ComputerPlace.cs
View file @
93678be
...
...
@@ -7,8 +7,9 @@ using System.Drawing;
using
System.Web.Script.Serialization
;
using
System.ComponentModel
;
using
MoyaAdminUI.MoyaAPI
;
using
MoyaAdminLib
;
namespace
MoyaAdmin
UI
namespace
MoyaAdmin
Lib
{
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
;
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdmin
UI
/Map.cs
→
MoyaAdmin/MoyaAdminUI/MoyaAdmin
Lib
/Map.cs
View file @
93678be
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
);
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdmin
UI/MoyaAPI
/Maps.cs
→
MoyaAdmin/MoyaAdminUI/MoyaAdmin
Lib
/Maps.cs
View file @
93678be
File moved
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/MoyaAdminLib.csproj
View file @
93678be
...
...
@@ -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" />
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdmin
UI/MoyaAPI
/Place.cs
→
MoyaAdmin/MoyaAdminUI/MoyaAdmin
Lib
/Place.cs
View file @
93678be
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
.
Defaul
t
.
ApiURL
,
HttpVerb
.
PUT
);
client
=
new
RestClient
(
RestClien
t
.
ApiURL
,
HttpVerb
.
PUT
);
client
.
PostData
=
ser
.
Serialize
(
this
);
client
.
MakeRequest
(
"placeadmin/place/"
+
id
);
}
else
{
//create
client
=
new
RestClient
(
Properties
.
Settings
.
Defaul
t
.
ApiURL
,
HttpVerb
.
POST
);
client
=
new
RestClient
(
RestClien
t
.
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
.
Defaul
t
.
ApiURL
,
HttpVerb
.
PUT
);
RestClient
client
=
new
RestClient
(
RestClien
t
.
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
.
Defaul
t
.
ApiURL
,
HttpVerb
.
PUT
);
RestClient
client
=
new
RestClient
(
RestClien
t
.
ApiURL
,
HttpVerb
.
PUT
);
string
json
=
client
.
MakeRequest
(
"placeadmin/place/"
+
id
+
"/reserve/"
+
userid
);
}
}
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdmin
UI/MoyaAPI
/PlaceMap.cs
→
MoyaAdmin/MoyaAdminUI/MoyaAdmin
Lib
/PlaceMap.cs
View file @
93678be
File moved
MoyaAdmin/MoyaAdminUI/MoyaAdmin
UI/MoyaAPI
/RestClient.cs
→
MoyaAdmin/MoyaAdminUI/MoyaAdmin
Lib
/RestClient.cs
View file @
93678be
...
...
@@ -7,8 +7,11 @@ using System.Security.Cryptography;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
MoyaAdmin
UI.MoyaAPI
namespace
MoyaAdmin
Lib
{
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
;
}
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdmin
UI
/User.cs
→
MoyaAdmin/MoyaAdminUI/MoyaAdmin
Lib
/User.cs
View file @
93678be
...
...
@@ -7,7 +7,7 @@ using System.Text;
using
System.Threading.Tasks
;
using
System.Web.Script.Serialization
;
namespace
MoyaAdmin
UI
namespace
MoyaAdmin
Lib
{
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
);
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.Controls.EventUserEditor.resources
0 → 100644
View file @
93678be
No preview for this file type
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.csproj.FileListAbsolute.txt
0 → 100644
View file @
93678be
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
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/ApiSettings.cs
View file @
93678be
using
System
;
using
MoyaAdminLib
;
using
MoyaAdminUI.MoyaAPI
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
...
...
@@ -25,6 +27,10 @@ namespace MoyaAdminUI
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
;
}
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.Designer.cs
View file @
93678be
...
...
@@ -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
;
}
}
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.cs
View file @
93678be
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
();
}
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.resx
View file @
93678be
This diff is collapsed.
Click to expand it.
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MoyaAdminUI.csproj
View file @
93678be
...
...
@@ -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>
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/UsersFinderForm.Designer.cs
View file @
93678be
...
...
@@ -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
;
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/UsersFinderForm.cs
View file @
93678be
...
...
@@ -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,6 +99,10 @@ namespace MoyaAdminUI
var
ser
=
new
JavaScriptSerializer
();
Card
card
=
ser
.
Deserialize
<
Card
>(
json
);
pictureBox1
.
ImageLocation
=
RestClient
.
GetRequestURL
(
Properties
.
Settings
.
Default
.
ApiURL
,
"card/GetImage/"
+
card
.
cardId
);
if
(
card
.
state
==
Card
.
CARD_STATE_PRINTED
)
CardState
.
Text
=
card
.
state
+
" in "
+
card
.
GetCardPlace
();
else
CardState
.
Text
=
card
.
state
;
/*
...
...
@@ -133,5 +137,10 @@ namespace MoyaAdminUI
}
* */
}
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
{
}
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment