public ScreenSet(int UserId) { this.UserId = UserId; lDataContext = new CommonFunction().JSDataContext(); this.applyCommand = new DelegateCommand(OnApplyCommandExecuted); Boolean isSelected; Boolean isDefault; IQueryable <DataSource.UserScreen> lUser = lDataContext.UserScreens.Where(p => p.UserId == UserId); foreach (DataSource.Screen l in lDataContext.Screens.Where(p => p.ParentId != null && p.Usable == true).OrderBy(p => p.ScreenId)) { isSelected = false; isDefault = false; if (lUser.Where(p => p.ScreenId == l.ScreenId).Count() > 0) { isSelected = true; } var lDefault = lUser.SingleOrDefault(p => p.ScreenId == l.ScreenId && p.Default == true); if (lDefault != null) { isDefault = true; } this.Add(new JSScreen { UserId = UserId, IsDefault = isDefault, IsSelected = isSelected, ScreenAvailable = l }); } }
private void myRadDataForm_DeletingItem(object sender, System.ComponentModel.CancelEventArgs e) { Window lWindows = Models.CommonFunction.GetApplicationWindow(); if (MessageBox.Show(lWindows, "Are you sure you want to delete?", "Delete", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel) { e.Cancel = true; } else { SunSeven.Models.HSEmployee lItem = myRadDataForm.CurrentItem as SunSeven.Models.HSEmployee; DataSource.JSDataContext lDataContext; lDataContext = new CommonFunction().JSDataContext(); try { var lDelEmpDept = lDataContext.Emp_Depts.Where(p => p.EmployeeId == lItem.Id); lDataContext.Emp_Depts.DeleteAllOnSubmit(lDelEmpDept); var lDelItem = lDataContext.Employees.Single(p => p.Id == lItem.Id); lDataContext.Employees.DeleteOnSubmit(lDelItem); lDataContext.SubmitChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message); e.Cancel = true; } } }
public commandCollection() { lDataContext = new CommonFunction().JSDataContext(); this.deleteCommand = new DelegateCommand(OnDeleteCommandExecuted); this.deletingCommand = new DelegateCommand(OnDeletingCommandExecuted); //this.homeCommand = new DelegateCommand(OnHomeCommandExecuted); }
public HSOrderHistory() { lDataContext = new CommonFunction().JSDataContext(); this.selectCommand = new DelegateCommand(OnSelectCommandExecuted); this.printCommand = new DelegateCommand(OnPrintCommandExecuted); // _salesPerson = new ObservableCollection<DataSource.vEmpDept>(); }
public Window1() { InitializeComponent(); lDataContext = new CommonFunction().JSDataContext(); }
public PriceHistoryWindow(int CustomerId, int ProductId, int?Unit) { InitializeComponent(); lDataContext = new CommonFunction().JSDataContext(); try { this.Header += " (" + lDataContext.Customers.SingleOrDefault(p => p.Id == CustomerId).Name + ")"; var lProduct = lDataContext.Products.SingleOrDefault(p => p.Id == ProductId); this.txtProduct.Text = lProduct.Name + " (" + lProduct.Description + ")"; this.txtProduct.Text += "\nUnit : " + lDataContext.SellingUnits.SingleOrDefault(p => p.Id == Unit).Unit; } catch (Exception ex) { MessageBox.Show(ex.Message); return; } var lPriceHist = from o in lDataContext.Orders join i in lDataContext.Invoices on o.InvoiceId equals i.Id join oi in lDataContext.OrderItems on o.Id equals oi.OrderId where o.CustomerId.Equals(CustomerId) && oi.ProductId.Equals(ProductId) && oi.SellingUnitId.Equals(Unit) select new { o.OrderDate, i.DeliveryDate, // Product = oi.Product.Name + " (" + oi.Product.Description + ")", // oi.SellingUnit.Unit, // VAT = oi.VatRate.Name, oi.UnitPrice, //Price = oi.UnitPrice + (oi.UnitPrice * (oi.VatRate.Rate / 100)), oi.Quantity }; gridPriceHistory.ItemsSource = lPriceHist; var lSalesHist = from o in lDataContext.Sales join oi in lDataContext.SalesItems on o.Id equals oi.SalesId where o.CustomerId.Equals(CustomerId) && oi.ProductId.Equals(ProductId) && oi.SellingUnitId.Equals(Unit) select new { o.SalesDate, o.ExpireDate, //Product = oi.Product.Name + " (" + oi.Product.Description + ")", //oi.SellingUnit.Unit, // VAT = oi.VatRate.Name, oi.UnitPrice, // Price = oi.UnitPrice + (oi.UnitPrice * (oi.VatRate.Rate / 100)) }; gridSalesHistory.ItemsSource = lSalesHist; }
public vmQuotationHistory() { lDataContext = new CommonFunction().JSDataContext(); this.searchCommand = new DelegateCommand(OnSearchCommandExecuted); this.StartDT = DateTime.Today.AddDays(-1); this.EndDT = DateTime.Today.AddDays(1).AddSeconds(-1); this.Type = 0; }
//static public event newOrderHander newOrderCommand; public OpenQuotation() { InitializeComponent(); lDataContext = new CommonFunction().JSDataContext(); this.DataContext = lDataContext.Sales; textBoxFilterValue.Focus(); //new vmSalesHistory(); }
public ScanEditor() { InitializeComponent(); lDataContext = new CommonFunction().JSDataContext(); DataContext = invoiceSet; MainPage.scanCommand -= MainPage_scanCommand; MainPage.scanCommand += MainPage_scanCommand; //this.RadGridView1.MouseDoubleClick += this.OnGridMouseDoubleClick; }
public vmQuotationHistory(int?Type) { lDataContext = new CommonFunction().JSDataContext(); this.searchCommand = new DelegateCommand(OnSearchCommandExecuted); this.StartDT = DateTime.Today.AddDays(-1); this.EndDT = DateTime.Today.AddDays(1).AddSeconds(-1); this.Type = Type; this.IsBusy = true; LoadingAsyncStart(); }
public Employee() { InitializeComponent(); lDataContext = new CommonFunction().JSDataContext(); this.DataContext = new vmEmployee(); if (MainPage.lCurrentUser.UserRole.Name == "Read Only") { this.myRadDataForm.CommandButtonsVisibility = Telerik.Windows.Controls.Data.DataForm.DataFormCommandButtonsVisibility.None; } }
public vmEmployee() { lDataContext = new CommonFunction().JSDataContext(); SalesPerson = new ObservableCollection <DataSource.vEmpDept>(); foreach (DataSource.vEmpDept l in lDataContext.vEmpDepts.Where(p => p.Department == "Sales")) { SalesPerson.Add(l); } DeliveryPerson = new ObservableCollection <DataSource.vEmpDept>(); foreach (DataSource.vEmpDept l in lDataContext.vEmpDepts.Where(p => p.Department == "Delivery")) { DeliveryPerson.Add(l); } }
public OpenSupply() { InitializeComponent(); lDataContext = new CommonFunction().JSDataContext(); dtPickerST.SelectedValue = DateTime.Today; dtPickerET.SelectedValue = DateTime.Today.AddDays(1).AddSeconds(-1); List <DataSource.OpenOrderResult> lOpenOrderSet = new List <DataSource.OpenOrderResult>(); foreach (DataSource.OpenOrderResult l in lDataContext.OpenOrder(null, null)) { lOpenOrderSet.Add(l); } this.DataContext = lOpenOrderSet; this.textBoxFilterValue.Focus(); }
public vmOrderHistory(int?Type, DateTime?pST, DateTime?pET) { lDataContext = new CommonFunction().JSDataContext(); this.searchCommand = new DelegateCommand(OnSearchCommandExecuted); this.updownCommand = new DelegateCommand(OnUpDownCommandExecuted); this.StartDT = (pST == null) ? DateTime.Today.AddDays(-1) : pST.Value; this.EndDT = (pET == null) ? DateTime.Today.AddDays(1).AddSeconds(-1) : pET.Value; this.Type = Type; if (lStaticOrderHistory == null) { this.IsBusy = true; lStaticOrderHistory = new ObservableCollection <HSOrderHistory>(); LoadingAsyncStart(); } }
public vmProduct() { lDataContext = new CommonFunction().JSDataContext(); _unitSet = new ObservableCollection <DataSource.SellingUnit>(); foreach (DataSource.SellingUnit l in lDataContext.SellingUnits) { _unitSet.Add(new DataSource.SellingUnit { Id = l.Id, Unit = l.Unit }); } _vatSet = new ObservableCollection <DataSource.VatRate>(); foreach (DataSource.VatRate l in lDataContext.VatRates) { _vatSet.Add(new DataSource.VatRate { Id = l.Id, Name = l.Name }); } _rootCategories = new ObservableCollection <DataSource.Category>(); foreach (DataSource.Category l in lDataContext.Categories.Where(p => p.ParentId == null)) { _rootCategories.Add(new DataSource.Category { Id = l.Id, Name = l.Name, ParentId = l.ParentId }); } _categories = new ObservableCollection <DataSource.Category>(); foreach (DataSource.Category l in lDataContext.Categories.Where(p => p.ParentId != null)) { _categories.Add(new DataSource.Category { Id = l.Id, Name = l.Name, ParentId = l.ParentId }); } }
public OpenQuotation(string pType) { InitializeComponent(); lDataContext = new CommonFunction().JSDataContext(); switch (pType) { case "QUOTATION": this.DataContext = lDataContext.Sales.Where(p => p.Master == false); this.Header = "Open Quotation"; break; case "MASTER": this.DataContext = lDataContext.Sales.Where(p => p.Master == true); this.Header = "Open Master Quotation"; break; } textBoxFilterValue.Focus(); //new vmSalesHistory(); }
public vmCustomer() { lDataContext = new CommonFunction().JSDataContext(); }
public HSSecurity() { lDataContext = new CommonFunction().JSDataContext(); this.screenCommand = new DelegateCommand(OnScreenCommandExecuted); //this.screenCommand.CanExecuteChanged += ScreenCommand_CanExecuteChanged; }
public HSSupplyItem() { lDataContext = new CommonFunction().JSDataContext(); this.priceHistoryCommand = new DelegateCommand(OnPriceHisotry); //this.deleteCommand = new DelegateCommand(OnDeleteItem); }
public vmProductLight() { lDataContext = new CommonFunction().JSDataContext(); }
public HSInvoice() { lDataContext = new CommonFunction().JSDataContext(); }