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