Example #1
0
        public HSSupply(int SupplierId)
        {
            lDataContext = new CommonFunction().JSDataContext();

            _supplyItems = new ObservableCollection <HSSupplyItem>();
            // _invoice = new HSInvoice();
        }
Example #2
0
        public HSOrder(int CutomerId)
        {
            lDataContext = new CommonFunction().JSDataContext();

            _orderItems = new ObservableCollection <HSOrderItem>();
            _invoice    = new HSInvoice();
        }
Example #3
0
        public vmSecurity()
        {
            lDataContext = new CommonFunction().JSDataContext();

            this.Employees = new List <Employee>();
            this.Roles     = new List <Role>();

            foreach (DataSource.Employee l in lDataContext.Employees)
            {
                this.Employees.Add(l);
            }

            foreach (DataSource.Role l in lDataContext.Roles)
            {
                this.Roles.Add(l);
            }
        }
Example #4
0
        public HSSupply()
        {
            lDataContext = new CommonFunction().JSDataContext();

            _supplyItems = new ObservableCollection <HSSupplyItem>();
            _invoice     = new HSInvoice();

            this.saveCommand    = new DelegateCommand(OnSaveCommandExecuted);
            this.AddNewCommand  = new DelegateCommand(OnAddNewCommandExecuted);
            this.deleteCommand  = new DelegateCommand(OnDeleteCommandExecuted);
            this.printCommand   = new DelegateCommand(OnPrintCommandExecuted);
            this.previewCommand = new DelegateCommand(OnPreviewCommandExecuted);
            this.invoiceCommand = new DelegateCommand(OnInvoiceCommandExecuted);
            this.closeCommand   = new DelegateCommand(OnCloseCommandExecuted);

            _invoice.InvoiceStatusId = 1;

            ButtonEnabled = false;
            DeleteEnabled = false;
            IsBusy        = false;
            Foreground    = "Blue";
        }
Example #5
0
 public vmSales()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Example #6
0
 public vmSupplier()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Example #7
0
 public HSPriceHistory()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Example #8
0
 public vmInvoice()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Example #9
0
        public static ObservableCollection <JSProduct> GetProductList()
        {
            if (productSet == null)
            {
                int?defaultUnitId = 0;
                SunSeven.DataSource.JSDataContext lDataContext = lDataContext = new CommonFunction().JSDataContext();

                productSet = new ObservableCollection <JSProduct>();

                foreach (SunSeven.DataSource.Product l in lDataContext.Products)
                {
                    ObservableCollection <HSProductUnit> productUnits = new ObservableCollection <HSProductUnit>();

                    //foreach (SunSeven.DataSource.ProductUnit ll in lDataContext.ProductUnits.Where(p => p.ProductId == l.Id).OrderBy(p => p.DisplayIndex))
                    //{
                    //    productUnits.Add(new HSProductUnit
                    //    {
                    //        ProductId = ll.ProductId,
                    //        UnitId = ll.SellingUnitId,
                    //        DisplayIndex = ll.DisplayIndex,
                    //        UnitName = ll.SellingUnit.Unit
                    //    });

                    //}

                    foreach (SunSeven.DataSource.ProductUnit ll in lDataContext.ProductUnits.Where(p => p.ProductId == l.Id))
                    {
                        productUnits.Add(new HSProductUnit
                        {
                            ProductId    = ll.ProductId,
                            UnitId       = ll.SellingUnitId,
                            DisplayIndex = ll.DisplayIndex,
                            UnitName     = ll.SellingUnit.Unit
                        });
                    }

                    if (productUnits.Count <= 0)
                    {
                        defaultUnitId = null;
                    }
                    else
                    {
                        defaultUnitId = productUnits.OrderBy(p => p.UnitId).First().UnitId;
                    }
                    //HSProductUnit lSelectedUnit = productUnits.FirstOrDefault(p => p.DisplayIndex == productUnits.Min(p2 => p2.DisplayIndex));

                    productSet.Add(new JSProduct
                    {
                        Id              = l.Id,
                        Category        = l.Category.Category1.Name,
                        subCategory     = l.Category.Name,
                        barCode         = l.BarCode,
                        ProductName     = l.Name,
                        VAT             = l.VatRate,
                        Description     = l.Description,
                        productUnits    = productUnits,
                        itemDescription = "",
                        SelectedUnitId  = defaultUnitId
                                          // SelectedUnit = lSelectedUnit
                    });
                }
            }

            return(productSet);
        }
Example #10
0
 public HSVatRate()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Example #11
0
 public HSCategory()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Example #12
0
 public vmSellingUnit()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Example #13
0
 public HSEmployee()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
Example #14
0
 public vmPeople()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }
 public vmConfiguration(object pGrid)
 {
     myGrid       = pGrid as RadGridView;
     lDataContext = new CommonFunction().JSDataContext();
 }
 public vmConfiguration()
 {
     lDataContext = new CommonFunction().JSDataContext();
 }