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();
            }
        }
Beispiel #3
0
 public HSPerson()
 {
     lContext = new CommonFunction().JSDataContext();
 }
Beispiel #4
0
 public HSDepartment()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Beispiel #5
0
 public HSRole()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Beispiel #6
0
 public HSClientType()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
 public HSSellingUnit()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Beispiel #8
0
 public HSSupplier()
 {
     lContext = new CommonFunction().JSDataContext();
 }
Beispiel #9
0
 public HSCustomer()
 {
     lContext = new CommonFunction().JSDataContext();
 }
Beispiel #10
0
 public HSProduct()
 {
     lDataContext  = new CommonFunction().JSDataContext();
     _productUnits = new ObservableCollection <HSProductUnit>();
 }