public QuotationEditor(int SalesId) { InitializeComponent(); lDataContext = new CommonFunction().JSDataContext(); MainPage.CloseCommand -= MainPage_CloseCommand; MainPage.CloseCommand += MainPage_CloseCommand; HSQuotation lEditSales = new HSQuotation(); DataSource.Sale lSales = lDataContext.Sales.SingleOrDefault(p => p.Id == SalesId); if (lSales != null) { lEditSales.Id = lSales.Id; lEditSales.CustomerId = lSales.CustomerId.Value; lEditSales.SelectedCustomer = lSales.Customer; lEditSales.SalesDate = lSales.SalesDate; lEditSales.SellerId = lSales.SellerId; lEditSales.Description = lSales.Description; //lEditSales.Order = lEditSales.Order; //lEditSales.Order = lSales.Order; lEditSales.IsMaster = lSales.Master; lEditSales.ExpireDate = lSales.ExpireDate; //lEditSales.SalesPerson = new HSEmployee { Id = lSales.Id, SelectedPerson = lSales.Employee.Person }; lEditSales.DeleteEnabled = true; foreach (DataSource.SalesItem l in lSales.SalesItems) { lEditSales.SalesItems.Add(new HSOrderItem { Id = l.Id, CustomerId = lSales.CustomerId.Value, OrderId = l.SalesId.Value, ProductId = l.ProductId.Value, SelectedProduct = l.Product, UnitPrice = l.UnitPrice, VatId = l.VatId, SelectedVat = l.VatRate, Quantity = l.Quantity, SellingUnitId = l.SellingUnitId, SelectedSellingUnit = l.SellingUnit, ProductName = l.Product.Name, ProductDescription = l.Product.Description, VAT = l.VatRate.Name, Unit = (l.SellingUnit == null) ? "NA" : l.SellingUnit.Unit, Description = l.Description }); } this.DataContext = lEditSales; } }
public LoginViewModel() { if (ViewModelHelper.IsInDesignModeStatic == false) { this.initializeAllCommands(); lContext = new CommonFunction().JSDataContext(); //+ This is only neccessary if you want to display the appropriate image while typing the user name. //+ If you want a higher security level you wouldn't do this here ! //! Remember : ONLY for demonstration purposes I have used a local Collection this.getAllUser(); } }
public HSPerson() { lContext = new CommonFunction().JSDataContext(); }
public HSDepartment() { lDataContext = new CommonFunction().JSDataContext(); }
public HSRole() { lDataContext = new CommonFunction().JSDataContext(); }
public HSClientType() { lDataContext = new CommonFunction().JSDataContext(); }
public HSSellingUnit() { lDataContext = new CommonFunction().JSDataContext(); }
public HSSupplier() { lContext = new CommonFunction().JSDataContext(); }
public HSCustomer() { lContext = new CommonFunction().JSDataContext(); }
public HSProduct() { lDataContext = new CommonFunction().JSDataContext(); _productUnits = new ObservableCollection <HSProductUnit>(); }