public ProductsComponents(FrContext Db, Product product)
 {
     InitializeComponent();
     DB = Db;
     Product = product;
     InitializeLookups();
 }
Exemplo n.º 2
0
 public Categories(CategoryTypes type)
 {
     InitializeComponent();
     DB = new FrContext();
     Type = type;
     FillLB();
 }
Exemplo n.º 3
0
        public Users()
        {
            InitializeComponent();

            DB = new FrContext();

            Group_CB.ItemsSource = Enum.GetValues(typeof(Groups));

            FillLB();
        }
Exemplo n.º 4
0
        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"));
            }
        }
Exemplo n.º 5
0
 public OutcomeTypes()
 {
     InitializeComponent();
     DB = new FrContext();
     FillLB();
 }
Exemplo n.º 6
0
        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
            {

            }
        }
Exemplo n.º 7
0
 public Login()
 {
     InitializeComponent();
     DB = new FrContext();
     var user = DB.Users.AsQueryable().ToList();
 }
Exemplo n.º 8
0
        private void Initialize()
        {
            try
            {
                DB = new FrContext();
                PersonCB.ItemsSource = DB.People.Where(p => p.Type == Type).OrderBy(p => p.Name).ToList();
                FillDG();
            }
            catch
            {

            }
        }
Exemplo n.º 9
0
        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
            {

            }
        }
Exemplo n.º 10
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                DB = new FrContext();
                FillLB();
                InitializeLookups();
            }
            catch
            {

            }
        }
Exemplo n.º 11
0
        private void Initialize()
        {
            try
            {
                DB = new FrContext();
                ComponentCB.ItemsSource = DB.Components.OrderBy(c => c.Name).ToList();
                UnitCB.ItemsSource = Enum.GetValues(typeof(Units));
                FillLB();
            }
            catch
            {

            }
        }
Exemplo n.º 12
0
        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
            {

            }
        }
Exemplo n.º 13
0
        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
            {

            }
        }
Exemplo n.º 14
0
 public AddCustomer(FrContext Db, string phone)
 {
     InitializeComponent();
     this.DataContext = new Person() { Type= PersonTypes.Customer, Balance=0, Phone = phone };
     this.DB = Db;
 }
Exemplo n.º 15
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                DB = new FrContext();
                FillLB();
                GetAccounts();
            }
            catch
            {

            }
        }
Exemplo n.º 16
0
 public Income()
 {
     InitializeComponent();
     DB = new FrContext();
     FillDG();
 }