Skip to content

Commit a292f9e

Browse files
committed
QOL 0.9.1
This version introduces some QOL changes: - Fixed issue with dates formatting. - Added shortcuts - Added refresh on context menu
1 parent 9a85397 commit a292f9e

File tree

8 files changed

+47
-10
lines changed

8 files changed

+47
-10
lines changed

Core/_Database/Functions/_CreateAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal static int Create(NewEntry entry)
1616
{
1717
string query = $@"
1818
INSERT INTO Account (CustomerName, CRM, Domain, creationDate)
19-
VALUES ('{HttpUtility.HtmlEncode(entry.customerName)}', '{HttpUtility.HtmlEncode(entry.crmNumber)}', '{HttpUtility.HtmlEncode(entry.tenantDomain)}', '{DateTime.Now.ToString()}');
19+
VALUES ('{HttpUtility.HtmlEncode(entry.customerName)}', '{HttpUtility.HtmlEncode(entry.crmNumber)}', '{HttpUtility.HtmlEncode(entry.tenantDomain)}', '{DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss")}');
2020
SELECT last_insert_rowid();";
2121

2222
using (SqliteConnection connection = new SqliteConnection(DatabaseManager.connectionString))

Core/_Database/Functions/_EditCoreAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static bool UpdateAccount(int accountId, NewEntry changedProps, string lo
1717
{
1818
string query = $@"
1919
UPDATE Account
20-
SET CustomerName = '{HttpUtility.HtmlEncode(changedProps.customerName)}', CRM = '{HttpUtility.HtmlEncode(changedProps.crmNumber)}', ModifyDate = '{DateTime.Now}'
20+
SET CustomerName = '{HttpUtility.HtmlEncode(changedProps.customerName)}', CRM = '{HttpUtility.HtmlEncode(changedProps.crmNumber)}', ModifyDate = '{DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss")}'
2121
WHERE Id = '{accountId}'";
2222

2323
// Open connection to the database

Core/_Database/Functions/_FetchAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ internal static AccountProp Fetch(int id)
4949
phone = reader.IsDBNull(reader.GetOrdinal("Phone")) ? null : reader.GetString(reader.GetOrdinal("Phone")),
5050
recoveryEmail = reader.IsDBNull(reader.GetOrdinal("RecoveryEmail")) ? null : reader.GetString(reader.GetOrdinal("RecoveryEmail")),
5151
notes = reader.IsDBNull(reader.GetOrdinal("Notes")) ? null : reader.GetString(reader.GetOrdinal("Notes")),
52-
modifyDate = reader.IsDBNull(reader.GetOrdinal("ModifyDate")) ? DateTime.Now : DateTime.Parse(reader.GetString(reader.GetOrdinal("ModifyDate"))),
52+
modifyDate = reader.IsDBNull(reader.GetOrdinal("ModifyDate")) ? DateTime.Parse(DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss")) : DateTime.Parse(reader.GetString(reader.GetOrdinal("ModifyDate"))),
5353
isArchived = reader.IsDBNull(reader.GetOrdinal("isArchived")) ? 0 : reader.GetInt32(reader.GetOrdinal("isArchived"))
5454
//creationDate = reader.GetString(reader.GetOrdinal("CustomerName")),
5555
};

Forms/AppDash.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Forms/AppDash.cs

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public partial class AppDash : Form
3737
private const int ExportToJsonContextId = 1003;
3838
private const int ImportFromJsonContextId = 1004;
3939
private const int DeveloperInfoContextId = 1005;
40+
private const int RefreshDatabaseList = 1006;
4041
protected override CreateParams CreateParams
4142
{
4243
get
@@ -55,12 +56,14 @@ protected override void OnHandleCreated(EventArgs e)
5556
IntPtr systemMenuHandle = GetSystemMenu(this.Handle, false);
5657
if (systemMenuHandle != IntPtr.Zero)
5758
{
58-
AppendMenu(systemMenuHandle, MF_STRING, ChangeDBContextId, "Set Database");
59+
AppendMenu(systemMenuHandle, MF_STRING, ChangeDBContextId, "Set Database\tF3");
5960
AppendMenu(systemMenuHandle, MF_SEPARATOR, 0, string.Empty);
6061
AppendMenu(systemMenuHandle, MF_STRING, ExportToJsonContextId, "Export to json");
6162
AppendMenu(systemMenuHandle, MF_STRING, ImportFromJsonContextId, "Import from json");
6263
AppendMenu(systemMenuHandle, MF_SEPARATOR, 0, string.Empty);
63-
AppendMenu(systemMenuHandle, MF_STRING, DeveloperInfoContextId, "Developer Info");
64+
AppendMenu(systemMenuHandle, MF_STRING, RefreshDatabaseList, "Refresh accounts\tF5");
65+
AppendMenu(systemMenuHandle, MF_SEPARATOR, 0, string.Empty);
66+
AppendMenu(systemMenuHandle, MF_STRING, DeveloperInfoContextId, "Developer Info\tF1");
6467
}
6568
}
6669
protected override void WndProc(ref Message m)
@@ -92,9 +95,32 @@ protected override void WndProc(ref Message m)
9295
{
9396
MessageBox.Show($"MiniCSP is an app developed by DevNoam for Microsoft 365 resellers. Contact info: contact@noamsapir.me", "Developer info");
9497
}
98+
if (menuID == RefreshDatabaseList)
99+
{
100+
FetchAll(selectedId);
101+
}
102+
103+
}
104+
}
95105

106+
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
107+
{
108+
if (keyData == (Keys.F1))
109+
{
110+
MessageBox.Show($"MiniCSP is an app developed by DevNoam for Microsoft 365 resellers. Contact info: contact@noamsapir.me", "Developer info");
111+
}
112+
if (keyData == (Keys.F3))
113+
{
114+
DatabaseManager.ReplaceDatabase();
96115
}
116+
if (keyData == (Keys.F5))
117+
{
118+
FetchAll(selectedId);
119+
}
120+
121+
return base.ProcessCmdKey(ref msg, keyData);
97122
}
123+
98124
#endregion
99125
public AppDash()
100126
{
@@ -412,7 +438,7 @@ private void EditCoreAccount()
412438
FetchAll(selectedId);
413439
}
414440

415-
ModifiedDate.Text = DateTime.Now.ToString();
441+
ModifiedDate.Text = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss");
416442
}
417443
}
418444

@@ -488,7 +514,7 @@ private void Edit_Click(object sender, EventArgs e)
488514
recoveryEmail = recoveryEmail.Text,
489515
password = Password.Text,
490516
notes = Notes.Text,
491-
modifyDate = DateTime.Now
517+
modifyDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss"))
492518
};
493519

494520
if (newAccountProp.domain == EditAccount.oldAccountProp.domain && newAccountProp.email == EditAccount.oldAccountProp.email &&
@@ -629,7 +655,7 @@ private void UploadQR_Click(object sender, EventArgs e)
629655
}
630656
else if (string.IsNullOrWhiteSpace(Email.Text))
631657
Email.Text = TOTP.mail;
632-
else if(TOTP.mail == "MINICSPFAILEDTOREADMAIL")
658+
else if (TOTP.mail == "MINICSPFAILEDTOREADMAIL")
633659
{
634660
//Do nothing, thats okay.
635661
}
@@ -678,5 +704,10 @@ private void GeneratePassword_Click(object sender, EventArgs e)
678704
else
679705
Password.Text = result;
680706
}
707+
708+
private void AppDash_Load(object sender, EventArgs e)
709+
{
710+
711+
}
681712
}
682713
}

MiniCSP.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
<ApplicationIcon>Properties\Icons\AppIcon.ico</ApplicationIcon>
1313
<Company>DevNoam (noamsapir.me)</Company>
1414
<Authors>DevNoam (noamsapir.me)</Authors>
15-
<Version>0.9.0.1</Version>
15+
<Version>0.9.1</Version>
1616
<Title>MiniCSP - Credentials manager</Title>
1717
<Copyright>DevNoam (noamsapir.me)</Copyright>
1818
<Description>View and manage CSP 365 global admins credentials</Description>
19+
<AssemblyVersion>0.9.1</AssemblyVersion>
20+
<FileVersion>0.9.1</FileVersion>
1921
</PropertyGroup>
2022

2123
<ItemGroup>

MiniCSP.csproj.user

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
</Compile>
1616
</ItemGroup>
1717
<ItemGroup>
18+
<EmbeddedResource Update="Forms\AppDash.resx">
19+
<SubType>Designer</SubType>
20+
</EmbeddedResource>
1821
<EmbeddedResource Update="Properties\Resources.resx">
1922
<SubType>Designer</SubType>
2023
</EmbeddedResource>

Properties/PublishProfiles/FolderProfile.pubxml.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
66
<PropertyGroup>
7-
<History>True|2024-08-26T20:50:33.9024670Z;True|2024-08-26T23:48:41.9390143+03:00;True|2024-08-24T17:41:19.1986686+03:00;True|2024-08-24T17:29:28.7592194+03:00;True|2024-04-25T11:38:33.4833945+03:00;True|2024-04-24T15:41:28.4389606+03:00;True|2024-04-24T12:45:02.2930555+03:00;True|2024-04-24T11:58:57.3430646+03:00;True|2024-04-24T11:51:53.1790232+03:00;True|2024-04-24T10:39:40.3893522+03:00;True|2024-04-24T10:38:52.5125434+03:00;True|2024-04-24T09:34:04.4237301+03:00;True|2024-04-23T23:39:19.5070852+03:00;True|2024-04-23T22:43:19.2298844+03:00;True|2024-04-23T22:39:44.1224267+03:00;True|2024-04-23T22:35:52.5512169+03:00;True|2024-04-23T22:26:05.1940519+03:00;True|2024-04-23T22:21:13.6471819+03:00;True|2024-04-23T21:56:09.9625239+03:00;True|2024-04-23T21:10:53.4144726+03:00;True|2024-04-23T20:25:22.4221582+03:00;True|2024-04-22T17:02:08.7355746+03:00;True|2024-04-22T17:00:02.1318236+03:00;True|2024-04-22T16:06:21.0635484+03:00;True|2024-04-22T16:04:41.9923167+03:00;True|2024-04-22T15:54:09.1507038+03:00;True|2024-04-21T15:25:16.7152249+03:00;True|2024-04-21T15:22:08.6693665+03:00;True|2024-04-19T02:49:56.0450669+03:00;True|2024-04-19T01:59:12.7787878+03:00;True|2024-04-19T01:27:57.4487987+03:00;True|2024-04-19T01:20:04.9585485+03:00;False|2024-04-19T01:19:01.2503177+03:00;False|2024-04-19T01:18:18.7268157+03:00;True|2024-04-19T01:08:55.1200168+03:00;</History>
7+
<History>True|2024-08-26T21:22:54.8862418Z;True|2024-08-26T23:50:33.9024670+03:00;True|2024-08-26T23:48:41.9390143+03:00;True|2024-08-24T17:41:19.1986686+03:00;True|2024-08-24T17:29:28.7592194+03:00;True|2024-04-25T11:38:33.4833945+03:00;True|2024-04-24T15:41:28.4389606+03:00;True|2024-04-24T12:45:02.2930555+03:00;True|2024-04-24T11:58:57.3430646+03:00;True|2024-04-24T11:51:53.1790232+03:00;True|2024-04-24T10:39:40.3893522+03:00;True|2024-04-24T10:38:52.5125434+03:00;True|2024-04-24T09:34:04.4237301+03:00;True|2024-04-23T23:39:19.5070852+03:00;True|2024-04-23T22:43:19.2298844+03:00;True|2024-04-23T22:39:44.1224267+03:00;True|2024-04-23T22:35:52.5512169+03:00;True|2024-04-23T22:26:05.1940519+03:00;True|2024-04-23T22:21:13.6471819+03:00;True|2024-04-23T21:56:09.9625239+03:00;True|2024-04-23T21:10:53.4144726+03:00;True|2024-04-23T20:25:22.4221582+03:00;True|2024-04-22T17:02:08.7355746+03:00;True|2024-04-22T17:00:02.1318236+03:00;True|2024-04-22T16:06:21.0635484+03:00;True|2024-04-22T16:04:41.9923167+03:00;True|2024-04-22T15:54:09.1507038+03:00;True|2024-04-21T15:25:16.7152249+03:00;True|2024-04-21T15:22:08.6693665+03:00;True|2024-04-19T02:49:56.0450669+03:00;True|2024-04-19T01:59:12.7787878+03:00;True|2024-04-19T01:27:57.4487987+03:00;True|2024-04-19T01:20:04.9585485+03:00;False|2024-04-19T01:19:01.2503177+03:00;False|2024-04-19T01:18:18.7268157+03:00;True|2024-04-19T01:08:55.1200168+03:00;</History>
88
<LastFailureDetails />
99
</PropertyGroup>
1010
</Project>

0 commit comments

Comments
 (0)