@@ -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\t F3 " ) ;
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\t F5" ) ;
65+ AppendMenu ( systemMenuHandle , MF_SEPARATOR , 0 , string . Empty ) ;
66+ AppendMenu ( systemMenuHandle , MF_STRING , DeveloperInfoContextId , "Developer Info\t F1" ) ;
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}
0 commit comments