public void vipFunction(SaleGroupViewModel sgvm) { ActivityLogService.Logger.LogFunctionCall(sgvm.GroupID); try { var vipVM = new VipAssociationViewModel(sgvm.GroupID); InteropService.OpenWindow(vipVM); } catch (Exception ex) { ActivityLogService.Logger.LogError(ex); MessageBox.Show("אירעה שגיאה בעת פתיחת חלון הלקוחות לעריכה. אנא נסה שוב מאוחר יותר."); } }
public void editFunction(SaleGroupViewModel sgvm) { ActivityLogService.Logger.LogFunctionCall(sgvm.GroupID); try { var group = DBService.GetService().LoadGroup(sgvm.GroupID); if (group.Sales.Count == 1) { var sale = SalesFactoryService.EditSale(group.Sales[0]); if (sale == null) { MessageBox.Show("אירעה שגיאה, אנא נסה שוב במועד מאוחר יותר."); } else if (DBService.GetService().EditSale(sale)) { MessageBox.Show("המבצע עודכן בהצלחה!"); refreshGroups(); } else { MessageBox.Show("אירעה שגיאה בזמן עריכת המבצע.\nלא בוצעו שינויים במבצע הקיים."); } } else { //### TODO: EditGroup form // re-arrange sales order // add ability to edit each sale // "delete" sale - change "isDeleted" to true MessageBox.Show("כרגע, לא ניתן לערוך קבוצת מבצעים."); } } catch (Exception ex) { MessageBox.Show(ex.Message); ActivityLogService.Logger.LogError(ex); } }