@@ -22,6 +22,7 @@ namespace FashionStoreWinForms.Forms
22
22
{
23
23
public partial class FRM_Main : Form , ILegacyWorkspaceContext , ILocalizationService
24
24
{
25
+ #nullable enable
25
26
readonly WorkspaceViewModel workspaceViewModel ;
26
27
readonly IStoreManagementService storeManagementService ;
27
28
@@ -43,6 +44,7 @@ public void SetCurrentStore(Store store)
43
44
#region ILocalizationService
44
45
public string AskProceedAndAbandonFormData => Resources . ASK_PROCEED_AND_ABANDON_FORM_DATA ;
45
46
#endregion
47
+ #nullable restore
46
48
47
49
bool AskForSaveIfNeeded ( )
48
50
{
@@ -85,32 +87,32 @@ async void FRM_Main_Load(object sender, EventArgs e)
85
87
}
86
88
void MI_Card_PointOfSale_Click ( object sender , EventArgs e )
87
89
{
88
- using ( FRM_Card_PointOfSale frm = new FRM_Card_PointOfSale ( ) )
89
- frm . ShowDialog ( this ) ;
90
+ using FRM_Card_PointOfSale frm = new FRM_Card_PointOfSale ( ) ;
91
+ frm . ShowDialog ( this ) ;
90
92
}
91
93
void MI_DressMatrix_Click ( object sender , EventArgs e )
92
94
{
93
- using ( FRM_DressMatrix frm = new FRM_DressMatrix ( ) )
94
- frm . ShowDialog ( this ) ;
95
+ using FRM_DressMatrix frm = new FRM_DressMatrix ( ) ;
96
+ frm . ShowDialog ( this ) ;
95
97
}
96
98
void MI_Sql_Click ( object sender , EventArgs e )
97
99
{
98
- using ( FRM_Sql frm = new FRM_Sql ( ) )
99
- frm . ShowDialog ( this ) ;
100
+ using FRM_Sql frm = new FRM_Sql ( ) ;
101
+ frm . ShowDialog ( this ) ;
100
102
}
101
103
void MI_UserSettings_Click ( object sender , EventArgs e )
102
104
{
103
- using ( FRM_UserSettings frm = new FRM_UserSettings ( ) )
104
- frm . ShowDialog ( this ) ;
105
+ using FRM_UserSettings frm = new FRM_UserSettings ( ) ;
106
+ frm . ShowDialog ( this ) ;
105
107
}
106
108
void MI_AddSku_Click ( object sender , EventArgs e ) { AddSku ( ) ; }
107
109
void MI_SearchSku_Click ( object sender , EventArgs e ) { SearchSku ( ) ; }
108
110
void MI_SalesJournal_Click ( object sender , EventArgs e )
109
111
{
110
112
PAN_Workplace . Controls . Clear ( ) ;
111
113
112
- using ( FRM_SalesJournal frmSalesJournal = new FRM_SalesJournal ( ) )
113
- frmSalesJournal . ShowDialog ( this ) ;
114
+ using FRM_SalesJournal frmSalesJournal = new FRM_SalesJournal ( ) ;
115
+ frmSalesJournal . ShowDialog ( this ) ;
114
116
}
115
117
void MI_Backup_Click ( object sender , EventArgs e )
116
118
{
@@ -159,6 +161,7 @@ void MI_Backup_Click(object sender, EventArgs e)
159
161
MessageBox . Show ( this , Resources . BACKUP_COMPLETED , Resources . MESSAGE , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
160
162
}
161
163
164
+ #nullable enable
162
165
#region Temporary mock StoreService
163
166
class MockStoreService : IStoreManagementService
164
167
{
@@ -195,13 +198,14 @@ public FRM_Main()
195
198
if ( a . PropertyName == nameof ( StoreSelectorViewModel . SelectedStore ) )
196
199
{
197
200
var storeVM = ( StoreSelectorViewModel ) s ;
198
- var store = await storeManagementService . GetStore ( storeVM . SelectedStore . StoreId ) ;
201
+ var store = await storeManagementService . GetStore ( storeVM . SelectedStore ! . StoreId ) ;
199
202
SetCurrentStore ( store ) ;
200
203
}
201
204
} ;
202
205
203
206
warehouseSelector1 . DataContext = workspaceViewModel . StoreSelector ;
204
207
}
208
+ #nullable restore
205
209
206
210
public void AddSku ( )
207
211
{
@@ -250,17 +254,15 @@ void MakeReport(PointOfSale in_pos = null)
250
254
251
255
if ( in_pos != null )
252
256
{
253
- using ( FRM_ReportParams frmParams = new FRM_ReportParams ( ) )
254
- {
255
- frmParams . ShowDialog ( this ) ;
256
- if ( ! frmParams . MakeReport )
257
- return ;
258
- articlePrefix = frmParams . ArticlePrefix != string . Empty ? frmParams . ArticlePrefix : null ;
259
- showPriceOfPurchase = Settings . Default . LastRepShowPriceOfPurchase ;
260
- showPriceOfSale = Settings . Default . LastRepShowPriceOfSale ;
261
- showPriceOfStock = Settings . Default . LastRepShowPriceOfStock ;
262
- showSizes = Settings . Default . LastRepShowSizes ;
263
- }
257
+ using FRM_ReportParams frmParams = new FRM_ReportParams ( ) ;
258
+ frmParams . ShowDialog ( this ) ;
259
+ if ( ! frmParams . MakeReport )
260
+ return ;
261
+ articlePrefix = frmParams . ArticlePrefix != string . Empty ? frmParams . ArticlePrefix : null ;
262
+ showPriceOfPurchase = Settings . Default . LastRepShowPriceOfPurchase ;
263
+ showPriceOfSale = Settings . Default . LastRepShowPriceOfSale ;
264
+ showPriceOfStock = Settings . Default . LastRepShowPriceOfStock ;
265
+ showSizes = Settings . Default . LastRepShowSizes ;
264
266
}
265
267
266
268
List < string > textLines = new List < string > ( ) ;
0 commit comments