diff --git a/B3DealerClient/Windows/CarcassInStoreWindow_/CarcassInStoreContext.cs b/B3DealerClient/Windows/CarcassInStoreWindow_/CarcassInStoreContext.cs index 369ec62..b6a6ae3 100644 --- a/B3DealerClient/Windows/CarcassInStoreWindow_/CarcassInStoreContext.cs +++ b/B3DealerClient/Windows/CarcassInStoreWindow_/CarcassInStoreContext.cs @@ -9,7 +9,7 @@ namespace B3DealerClient.Windows.CarcassInStoreWindow_ { public class CarcassInStoreContext : NotificationObject { - private DateTime? mDate = DateTime.Today; + private DateTime? mDate; public DateTime? Date { @@ -21,7 +21,7 @@ namespace B3DealerClient.Windows.CarcassInStoreWindow_ } } - private DateTime? mArrivedDate; + private DateTime? mArrivedDate = DateTime.Today; public DateTime? ArrivedDate { diff --git a/B3DealerClient/Windows/CarcassSaleOutWindow_/CarcassSaleOutContext.cs b/B3DealerClient/Windows/CarcassSaleOutWindow_/CarcassSaleOutContext.cs index 8d3b61e..47ac14e 100644 --- a/B3DealerClient/Windows/CarcassSaleOutWindow_/CarcassSaleOutContext.cs +++ b/B3DealerClient/Windows/CarcassSaleOutWindow_/CarcassSaleOutContext.cs @@ -106,6 +106,7 @@ namespace B3DealerClient.Windows.CarcassSaleOutWindow_ mDmo = value; RaisePropertyChanged("Dmo"); RaisePropertyChanged("CanSave"); + RaisePropertyChanged("CanDelete"); } } diff --git a/B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreContext.cs b/B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreContext.cs index bb1aa3f..d1cab87 100644 --- a/B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreContext.cs +++ b/B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreContext.cs @@ -9,7 +9,7 @@ namespace B3DealerClient.Windows.FreshInStoreWindow_ { class FreshInStoreContext : NotificationObject { - private DateTime? mDate = DateTime.Today; + private DateTime? mDate; public DateTime? Date { @@ -21,7 +21,7 @@ namespace B3DealerClient.Windows.FreshInStoreWindow_ } } - private DateTime? mArrivedDate; + private DateTime? mArrivedDate = DateTime.Today; public DateTime? ArrivedDate { @@ -37,7 +37,7 @@ namespace B3DealerClient.Windows.FreshInStoreWindow_ public NameIDPair Supplier { get { return mSupplier; } } private NameIDPair mStore = new NameIDPair(); - public NameIDPair Store { get { return mStore; } } + public NameIDPair Store { get { return mStore; } } private decimal? mPics; public decimal? Pics @@ -81,6 +81,6 @@ namespace B3DealerClient.Windows.FreshInStoreWindow_ } } - public bool CanSave { get { return Pics > 0 && mDetail != null; } } + public bool CanSave { get { return Pics > 0 && mDetail != null; } } } } diff --git a/B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreWindow.xaml.cs b/B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreWindow.xaml.cs index 9603c02..8eb63fe 100644 --- a/B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreWindow.xaml.cs +++ b/B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreWindow.xaml.cs @@ -170,20 +170,18 @@ namespace B3DealerClient.Windows.FreshInStoreWindow_ foreach (var item in context.Dmo.Details) { var record = new FreshInStore_Record(); - record.DetailID = item.ID; record.Number = item.SecondNumber; record.Weight = item.Number; - InsertRecord(record); + InsertRecord(record, item); } } private void FillByDetailBtn_PreviewMouseDown(object sender, MouseButtonEventArgs e) { var record = new FreshInStore_Record(); - record.DetailID = context.Detail.ID; record.Number = context.Detail.SecondNumber; record.Weight = context.Detail.Number; - InsertRecord(record); + InsertRecord(record, context.Detail); } private void FinishBtn_PreviewMouseDown(object sender, MouseButtonEventArgs e) @@ -199,18 +197,18 @@ namespace B3DealerClient.Windows.FreshInStoreWindow_ private void SaveBtn_PreviewMouseDown(object sender, MouseButtonEventArgs e) { var record = new FreshInStore_Record(); - record.DetailID = context.Detail.ID; record.Number = context.Pics; record.Weight = context.Weight; - InsertRecord(record); + InsertRecord(record, context.Detail); } - void InsertRecord(FreshInStore_Record record) + void InsertRecord(FreshInStore_Record record, FreshInStore_Detail detail) { record.BillID = context.Dmo.ID; + record.DetailID = detail.ID; FreshInStoreBL.InsertRecord(record); - context.Detail.AlreadyNumber = record.Weight; - context.Detail.AlreadySecondNumber = record.Number; + detail.AlreadyNumber = record.Weight; + detail.AlreadySecondNumber = record.Number; } } }