public ProductsComponents(FrContext Db, Product product) { InitializeComponent(); DB = Db; Product = product; InitializeLookups(); }
public Categories(CategoryTypes type) { InitializeComponent(); DB = new FrContext(); Type = type; FillLB(); }
public Users() { InitializeComponent(); DB = new FrContext(); Group_CB.ItemsSource = Enum.GetValues(typeof(Groups)); FillLB(); }
public static string GetNumber(DateTime date, TransactionTypes Type) { FrContext DB = new FrContext(); if (Type == TransactionTypes.In || Type == TransactionTypes.Out) { var num = DB.Transfers.Where(p => p.Date.Year == date.Year && p.Date.Month == date.Month && p.Type == Type); return num.Count() != 0 ? (num.Max(p => p.Number) + 1).ToString() : string.Format("{0}001", date.ToString("yyMM")); } else if (Type == TransactionTypes.Buy || Type == TransactionTypes.ReBuy) { var num = DB.Transactions.Where(p => p.Date.Year == date.Year && p.Date.Month == date.Month && (p.Type == TransactionTypes.Buy || p.Type == TransactionTypes.ReBuy)); return num.Count() != 0 ? (num.Max(p => p.Number) + 1).ToString() : string.Format("{0}001", date.ToString("yyMM")); } else { var num = DB.Transactions.Where(p => p.Date.Year == date.Year && p.Date.Month == date.Month && (p.Type != TransactionTypes.Buy && p.Type != TransactionTypes.ReBuy)); return num.Count() != 0 ? (num.Max(p => p.Number) + 1).ToString() : string.Format("{0}001", date.ToString("yyMM")); } }
public OutcomeTypes() { InitializeComponent(); DB = new FrContext(); FillLB(); }
private void Initialize() { try { DB = new FrContext(); var Types = DB.OutcomeTypes.OrderBy(c => c.Name).ToList(); Types.Insert(0, new OutcomeType() { Id = 0, Name = "الكل" }); OutcomeTypeSearch.ItemsSource = Types; Type.ItemsSource = DB.OutcomeTypes.OrderBy(c => c.Name).ToList(); FillDG(); } catch { } }
public Login() { InitializeComponent(); DB = new FrContext(); var user = DB.Users.AsQueryable().ToList(); }
private void Initialize() { try { DB = new FrContext(); PersonCB.ItemsSource = DB.People.Where(p => p.Type == Type).OrderBy(p => p.Name).ToList(); FillDG(); } catch { } }
private void Initialize() { try { DB = new FrContext(); //components Component.ItemsSource = DB.Components.OrderBy(c => c.Name).ToList(); var components = DB.Components.OrderBy(c => c.Name).ToList(); components.Insert(0, new Component() { Id = 0, Name = "الكل" }); ComponentSearch.ItemsSource = components; //Types var categories = DB.Categories.Where(c => c.Type == CategoryTypes.Compontent).OrderBy(c => c.Name).ToList(); categories.Insert(0, new Category() { Id = 0, Name = "الكل" }); Category.ItemsSource = categories; CategorySearch.ItemsSource = categories; FillDG(); } catch { } }
private void Page_Loaded(object sender, RoutedEventArgs e) { try { DB = new FrContext(); FillLB(); InitializeLookups(); } catch { } }
private void Initialize() { try { DB = new FrContext(); ComponentCB.ItemsSource = DB.Components.OrderBy(c => c.Name).ToList(); UnitCB.ItemsSource = Enum.GetValues(typeof(Units)); FillLB(); } catch { } }
private void Initialize() { try { DB = new FrContext(); ComponentCB.ItemsSource = DB.Components.OrderBy(c => c.Name).ToList(); PersonCB.ItemsSource = DB.People.Where(p => p.Type == PersonTypes.Supplier).OrderBy(c => c.Name).ToList(); var suppliers = DB.People.Where(p => p.Type == PersonTypes.Supplier).OrderBy(c => c.Name).ToList(); suppliers.Insert(0, new Person() { Id = 0, Name = "الكل" }); PersonSearch.ItemsSource = suppliers; UnitCB.ItemsSource = Enum.GetValues(typeof(Units)); FillLB(); } catch { } }
private void Initialize() { try { DB = new FrContext(); ProductCB.ItemsSource = DB.Products.OrderBy(p => p.Name).ToList(); PersonLB.ItemsSource = DB.People.Where(p => p.Type == PersonTypes.Customer).OrderBy(p => p.Name).ToList(); TypeCB.ItemsSource = new[] { TransactionTypes.InHouse, TransactionTypes.Order, TransactionTypes.TakeAway, TransactionTypes.SellBack }; TypeSearchCB.ItemsSource = new object[] { "الكل", TransactionTypes.InHouse, TransactionTypes.Order, TransactionTypes.TakeAway, TransactionTypes.SellBack }; TypeCB.SelectedIndex = 1; var customers = DB.People.Where(p => p.Type == PersonTypes.Customer).OrderBy(p => p.Name).ToList(); customers.Insert(0, new Person() { Id = 0, Name = "الكل" }); PersonSearch.ItemsSource = customers; var categories = DB.Categories.Where(c => c.Type == CategoryTypes.Product).OrderBy(p => p.Name).ToList(); categories.Insert(0, new Category() { Id = 0, Name = "الكل" }); CategoryCB.ItemsSource = categories; CategoryCB.SelectedIndex = 0; FillLB(); } catch { } }
public AddCustomer(FrContext Db, string phone) { InitializeComponent(); this.DataContext = new Person() { Type= PersonTypes.Customer, Balance=0, Phone = phone }; this.DB = Db; }
private void Page_Loaded(object sender, RoutedEventArgs e) { try { DB = new FrContext(); FillLB(); GetAccounts(); } catch { } }
public Income() { InitializeComponent(); DB = new FrContext(); FillDG(); }