public AddProductViewModel(IEventAggregator ea, IRegionManager rm, IUnityContainer container, ICouchBaseService service) { eventAggregator = ea; regionManager = rm; this.container = container; databaseService = service; Rules.Add(new DelegateRule<AddProductViewModel>(nameof(Name), "Nama harus diisi.", x => !string.IsNullOrEmpty(x.Name))); Rules.Add(new DelegateRule<AddProductViewModel>(nameof(Barcode), "barcode harus diisi.", x => !string.IsNullOrEmpty(x.Barcode))); UnitTypeList = new ObservableCollection<UnitTypeContext> { new UnitTypeContext { Name = "Pcs"} }; SelectedUnitType = UnitTypeList.ElementAtOrDefault(0); ImageSource = new BitmapImage(new Uri(@"../../Assets/Images/profile_icon.png", UriKind.RelativeOrAbsolute)); IsActive = true; CategoryList = new ObservableCollection<ProductCategoryContext>(); VendorList = new ObservableCollection<UserSimpleContext>(); TaxList = new ObservableCollection<TaxContext>(); eventAggregator.GetEvent<CategoryListUpdatedEvent>().Subscribe((string text) => LoadCategoryList()); eventAggregator.GetEvent<VendorListUpdatedEvent>().Subscribe((string text) => LoadVendorList()); eventAggregator.GetEvent<UnitTypeListUpdatedEvent>().Subscribe((string id) => LoadUnitTypeList(id)); }
public LoginViewModel(IRegionManager rm, ICouchBaseService service) { regionManager = rm; databaseService = service; //databaseService.DeleteDatabase(); }
public AddAccountViewModel(IEventAggregator ea, IRegionManager rm, ICouchBaseService service) { eventAggregator = ea; regionManager = rm; databaseService = service; AccountList = new List <AccountSimpleContext>(); }
public EmployeeViewModel(IEventAggregator ea, IRegionManager rm, IUnityContainer container, ICouchBaseService service) { eventAggregator = ea; regionManager = rm; this.container = container; databaseService = service; EmployeeList = new ObservableCollection <UserProfileContext>(); IsActive = true; eventAggregator.GetEvent <EmployeeListUpdateEvent>().Subscribe((string text) => LoadEmployeeList()); }
public AddUnitTypeViewModel(IRegionManager rm, IEventAggregator ea, ICouchBaseService service, IOfficeContext context) { regionManager = rm; eventAggregator = ea; this.context = context; databaseService = service; Rules.Add(new DelegateRule <AddUnitTypeViewModel>(nameof(Name), "Nama harus diisi.", x => !string.IsNullOrEmpty(x.Name))); Rules.Add(new DelegateRule <AddUnitTypeViewModel>(nameof(Barcode), "Kode barang harus diisi.", x => !string.IsNullOrEmpty(x.Barcode))); UnitTypeList = new ObservableCollection <UnitTypeContext>(); TaxList = new ObservableCollection <TaxContext>(); }
public AddCategoryViewModel(IEventAggregator ea, IRegionManager rm, ICouchBaseService service) { eventAggregator = ea; regionManager = rm; databaseService = service; IsActive = true; Rules.Add(new DelegateRule <AddCategoryViewModel>(nameof(Name), "Nama harus diisi", x => !string.IsNullOrEmpty(Name))); CategoryList = new ObservableCollection <ProductCategoryContext>(); }
public AddVendorViewModel(IEventAggregator ea, IRegionManager rm, ICouchBaseService service) { eventAggregator = ea; regionManager = rm; databaseService = service; IsActive = true; Rules.Add(new DelegateRule <AddVendorViewModel>(nameof(RegisterId), "No Register harus diisi.", x => !string.IsNullOrEmpty(x.RegisterId))); Rules.Add(new DelegateRule <AddVendorViewModel>(nameof(Name), "Nama harus diisi.", x => !string.IsNullOrEmpty(x.Name))); }
public AccountViewModel(IEventAggregator ea, IRegionManager rm, IUnityContainer container, ICouchBaseService service, IOfficeContext context) { eventAggregator = ea; regionManager = rm; this.container = container; this.context = context; databaseService = service; AccountList = new ObservableCollection <AccountSimpleContext>(); SubAccountList = new ObservableCollection <AccountInfoContext>(); LoadAccountList(); LoadSubAccountList(); eventAggregator.GetEvent <AccountListUpdateEvent>().Subscribe((string text) => LoadSubAccountList()); }
public AddCustomerViewModel(IEventAggregator ea, IRegionManager rm, ICouchBaseService service) { regionManager = rm; eventAggregator = ea; databaseService = service; DateOfBirth = DateTime.Now; IsActive = true; Rules.Add(new DelegateRule <AddCustomerViewModel>(nameof(RegisterId), "No Register harus diisi.", x => !string.IsNullOrEmpty(x.RegisterId))); Rules.Add(new DelegateRule <AddCustomerViewModel>(nameof(Name), "Nama harus diisi.", x => !string.IsNullOrEmpty(x.Name))); UserTypeList = new List <string> { "Personal", "Perusahaan" }; SelectedUserType = "Personal"; }
public AddEmployeeViewModel(IEventAggregator ea, IRegionManager rm, ICouchBaseService service, IOfficeContext context) { eventAggregator = ea; regionManager = rm; this.context = context; databaseService = service; DateOfBirth = DateTime.Now; EnterDate = DateTime.Now; IsActive = true; Rules.Add(new DelegateRule <AddEmployeeViewModel>(nameof(RegisterId), "No Register harus diisi.", x => !string.IsNullOrEmpty(x.RegisterId))); Rules.Add(new DelegateRule <AddEmployeeViewModel>(nameof(Name), "Nama harus diisi.", x => !string.IsNullOrEmpty(x.Name))); }
public ProductViewModel(IEventAggregator ea, IRegionManager rm, IUnityContainer container, ICouchBaseService service) { eventAggregator = ea; regionManager = rm; this.container = container; databaseService = service; CategoryList = new ObservableCollection <ProductCategoryContext>(); VendorList = new ObservableCollection <UserSimpleContext>(); ProductList = new ObservableCollection <ProductInfoContext>(); IsActive = true; LoadCategoryList(); LoadVendorList(); LoadProductList(); eventAggregator.GetEvent <ProductListUpdatedEvent>().Subscribe((string text) => LoadProductList()); eventAggregator.GetEvent <CategoryListUpdatedEvent>().Subscribe((string text) => LoadCategoryList()); eventAggregator.GetEvent <VendorListUpdatedEvent>().Subscribe((string text) => LoadVendorList()); }
public UnitTypeSettingViewModel(IRegionManager rm, ICouchBaseService service) { regionManager = rm; databaseService = service; }