public ClientPage() { _dc = new Models.CRMContext(); LinkDiscountCardCommand = new DelegateCommand(OnLinkDiscountCardCommandExecuted, () => { return(!DiscountCardEnabled && CurrentUser.HasPrivilege(Privilege.LinkDiscountCard)); }); UnlinkDiscountCardCommand = new DelegateCommand(OnUnlinkDiscountCardCommandExecuted, () => { return(DiscountCardEnabled && CurrentUser.HasPrivilege(Privilege.UnlinkDiscountCard)); }); AddVisitCommand = new DelegateCommand(OnAddAppointmentCommandExecuted, () => { return(AllowAddVisit); }); AddPaymentCommand = new DelegateCommand(OnAddPaymentCommandExecuted, () => { return(AllowAddPayment); }); EditCommand = new DelegateCommand(OnEditCommandExecuted, () => { return(AllowEditRow); }); DeleteCommand = new DelegateCommand(OnDeleteCommandExecuted, () => { return(AllowDeleteRow); }); ExportCommand = new DelegateCommand <object>(OnExportCommandExecuted, (x) => { return(_customer != null); }); DeleteCustomerCommand = new DelegateCommand(OnDeleteCustomerCommandExecuted, () => { return(_customer != null && _customer.ID > 0 && CurrentUser.HasPrivilege(Privilege.DeleteCustomer)); }); OnRecalculateDiscountCommand = new DelegateCommand(OnRecalculateDiscountCommandExecuted, () => { return(DiscountCardEnabled && CurrentUser.HasPrivilege(Privilege.LinkDiscountCard)); }); this.PropertyChanged += ClientPage_PropertyChanged; }
public FinancialTransaction() { _dc = new Models.CRMContext(); RefreshCommand = new DelegateCommand(onRefreshCommandExecute); ExportCommand = new DelegateCommand <object>(onExportCommandExecute); initDataSource(); }
public VisitHistory() { _dc = new Models.CRMContext(); RefreshCommand = new DelegateCommand(onRefreshCommandExecute); ExportCommand = new DelegateCommand <object>(onExportCommandExecute); initDataSource(); }
public Client() { _dc = new Models.CRMContext(); RefreshCommand = new DelegateCommand(onRefreshCommandExecute); ExportCommand = new DelegateCommand <object>(onExportCommandExecute); OnClientDoubleClickCommand = new DelegateCommand <RowDoubleClickEventArgs>(onClientDoubleClickCommandExecuted); initDataSource(); }
public BaseEditDialogViewModel(DialogMode mode, IDialogService dialogService, IMessageBoxService messageService) { _dc = new Models.CRMContext(); AllowSave = false; Mode = mode; DialogService = dialogService; MessageService = messageService; SesionService.ClearCache(); }
private void refresh() { if (_dc != null) { _dc.Dispose(); } _dc = new Models.CRMContext(); Users = _dc.Users.ToList(); }
private void refresh() { if (_dc != null) { _dc.Dispose(); } _dc = new Models.CRMContext(); Discounts = _dc.CumulativeDiscounts.ToList(); }
private void refresh() { if (_dc != null) { _dc.Dispose(); } _dc = new Models.CRMContext(); Services = _dc.Services.ToList(); }
public Dashboard() { OnNavigatingToClientView = new DelegateCommand(OnNavigatingToClientViewExecuted); OnTileClick = new DelegateCommand <Tile>(OnTileClickExecuted); using (var dc = new Models.CRMContext()) { _customers = dc.GetCustomerDashboardData(DateTime.Now).ToList(); }; FindData(); _findData = new DeferredExecuter() { Delay = 1000, Action = () => FindData() }; }
private void refreshData(int customerID) { _dc.Dispose(); _dc = new Models.CRMContext(); _customer = _dc.Customers .Where(x => x.ID == customerID) .Include(x => x.DiscountCard) .Include(x => x.Appointments) .Include(x => x.FinancialTransactions) .First(); _discountCard = _customer.DiscountCard; DiscountCardEnabled = _discountCard != null; VisitHistory = _customer.Appointments; FinancialTransactions = _customer.FinancialTransactions; refreshProperties(); }