Exemple #1
0
        public frmSales()
        {
            InitializeComponent();
            GetCustomers();
            GetCurrency();
            GetPayType();

            Purchase.AccountingSystem dbContext = new Purchase.AccountingSystem();
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.Items.Load();
            dbContext.SaleInvoiceDetails.Where(y => y.SalesInvoicesId == i).Load();
            // This line of code is generated by Data Source Configuration Wizard
            grditem.DataSource           = dbContext.SaleInvoiceDetails.Local.ToBindingList();
            itemBindingSource.DataSource = dbContext.Items.Local.ToBindingList();
            // This line of code is generated by Data Source Configuration Wizard
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.VendorSets.Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource1.DataSource = dbContext.VendorSets.Local.ToBindingList();
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.CurrencySets.Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource2.DataSource = dbContext.CurrencySets.Local.ToBindingList();
        }
Exemple #2
0
        private void MenuEditBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (MessageBox.Show("هل تريد التعديل؟", "تأكيد", MessageBoxButtons.YesNo) !=
                DialogResult.Yes)
            {
                return;
            }
            if (navigationPane1.SelectedPage.Caption.Equals("المخازن"))
            {
                string Id        = StoreGrid.GetRowCellValue(StoreGrid.FocusedRowHandle, "Id").ToString();
                Form   storeForm = new Form();
                storeForm.Controls.Add(new StoresForm(Id));
                storeForm.BackColor     = System.Drawing.Color.White;
                storeForm.StartPosition = FormStartPosition.CenterScreen;
                storeForm.WindowState   = FormWindowState.Maximized;
                DialogResult x = storeForm.ShowDialog();
                if (x == DialogResult.Cancel)
                {
                    dbContext = new Purchase.AccountingSystem();
                    wharehousBindingSource.DataSource = dbContext.Wharehouses.ToList();
                    wharehousGridControl.RefreshDataSource();
                }
            }
            else
            if (navigationPane1.SelectedPage.Caption.Equals("الأصناف"))
            {
                string code     = ItemGrid.GetRowCellValue(ItemGrid.FocusedRowHandle, "Code").ToString();
                string Id       = ItemGrid.GetRowCellValue(ItemGrid.FocusedRowHandle, "Id").ToString();
                Form   ItemForm = new Form();
                ItemForm.Controls.Add(new ItemsForm(code, Id));
                ItemForm.BackColor     = System.Drawing.Color.White;
                ItemForm.StartPosition = FormStartPosition.CenterScreen;
                ItemForm.WindowState   = FormWindowState.Maximized;
                ItemForm.DialogResult  = DialogResult.Cancel;
                DialogResult x = ItemForm.ShowDialog();

                if (x == DialogResult.Cancel)
                {
                    dbContext = new Purchase.AccountingSystem();
                    itemBindingSource.DataSource = dbContext.Items.ToList();
                    itemGridControl.RefreshDataSource();
                }
            }
            else if (navigationPane1.SelectedPage.Caption.Equals("المجموعات"))
            {
                string Id        = ItemGroupGrid.GetRowCellValue(ItemGroupGrid.FocusedRowHandle, "Id").ToString();
                Form   GroupForm = new Form();
                GroupForm.Controls.Add(new GroupForms(Id));
                GroupForm.BackColor     = System.Drawing.Color.White;
                GroupForm.StartPosition = FormStartPosition.CenterScreen;
                GroupForm.WindowState   = FormWindowState.Maximized;
                DialogResult x = GroupForm.ShowDialog();
                if (x == DialogResult.Cancel)
                {
                    dbContext = new Purchase.AccountingSystem();
                    itemGroupGridControl.DataSource = dbContext.ItemGroups.ToList();
                    itemGroupGridControl.RefreshDataSource();
                }
            }
        }
 private void Refresh()
 {
     dbContext = new Purchase.AccountingSystem();
     dbContext.debentures.Load();
     debentureBindingSource.DataSource = dbContext.debentures.Local.ToBindingList();
     DebGrid.RefreshData();
 }
Exemple #4
0
        public void bankRefresh()
        {
            dbContext = new Purchase.AccountingSystem();
            dbContext.BankSets.Load();
            bindingSource3.DataSource = dbContext.BankSets.Local.ToBindingList();

            VendBankName.Refresh();
        }
Exemple #5
0
 public UserView()
 {
     InitializeComponent();
     // This line of code is generated by Data Source Configuration Wizard
     // Instantiate a new DBContext
     Purchase.AccountingSystem dbContext = new Purchase.AccountingSystem();
     // Call the Load method to get the data for the given DbSet from the database.
     dbContext.Users.Load();
     // This line of code is generated by Data Source Configuration Wizard
     bindingSource1.DataSource = dbContext.Users.Local.ToBindingList();
 }
 private void AccountLevel_EditValueChanged(object sender, EventArgs e)
 {
     if (AccountLevel.EditValue != null)
     {
         dbContextLevel2 = new Purchase.AccountingSystem();
         int level = (int)AccountLevel.EditValue;
         // Call the Load method to get the data for the given DbSet from the database.
         dbContextLevel2.TreeAccounts.Where(j => j.type == level || j.Id == level).Load();
         // This line of code is generated by Data Source Configuration Wizard
         bindingSource2.DataSource = dbContextLevel2.TreeAccounts.Local.ToBindingList();
     }
 }
Exemple #7
0
        public VenforVendpliersReview()
        {
            InitializeComponent();
            Vendor.Visible   = true;
            Supplier.Visible = false;
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            dbContext = new Purchase.AccountingSystem();
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.VendorSets.Load();
            // This line of code is generated by Data Source Configuration Wizard
            using (var db = new AccountingSystem())
            {
                var dc = from c in db.VendorSets
                         //where c.Id.Equals(InvoiceID)
                         select new
                {
                    c.VendorName,
                    c.VendorCompanyName,
                    c.VendorStatus,
                    c.VendorBankName,
                    c.VendorPhone1,
                    c.VendorTypeOfBalance
                };
                bindingSource1.DataSource = dc.ToList();
            }

            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.SupplierSets.Load();
            // This line of code is generated by Data Source Configuration Wizard
            using (var db = new AccountingSystem())
            {
                var dc = from c in db.SupplierSets
                         //where c.Id.Equals(InvoiceID)
                         select new
                {
                    c.SupplierName,
                    c.SupplierCompanyName,
                    c.SupplierStatus,
                    c.SupplierBankName,
                    c.SupplierPhone1,
                    c.SupplierTypeOfBalance
                };
                bindingSource2.DataSource = dc.ToList();
                //bindingSource2.DataSource = dbContext.SupplierSets.Local.ToBindingList();
            }
            ReprotStatus.SelectedIndex = 2;
        }
        public AddTreeAccount(int id)
        {
            InitializeComponent();
            Ini();
            db.TreeAccounts.Where(d => d.Id == id).Load();
            AccountTreeSource.DataSource = db.TreeAccounts.Local.ToBindingList();
            dbContextLevel2 = new Purchase.AccountingSystem();
            string test  = db.TreeAccounts.Select(d => d.type).First().ToString();
            int    level = int.Parse(test);

            // Call the Load method to get the data for the given DbSet from the database.
            dbContextLevel2.TreeAccounts.Where(j => j.type == level || j.Id == level).Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource2.DataSource = dbContextLevel2.TreeAccounts.Local.ToBindingList();
            isEditFrom = true;
        }
Exemple #9
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            Form storeForm = new Form();

            storeForm.Controls.Add(new StoresForm("AddStore"));
            storeForm.BackColor     = System.Drawing.Color.White;
            storeForm.StartPosition = FormStartPosition.CenterScreen;
            storeForm.WindowState   = FormWindowState.Maximized;
            DialogResult x = storeForm.ShowDialog();

            if (x == DialogResult.Cancel)
            {
                dbContextItems            = new Purchase.AccountingSystem();
                bindingSource2.DataSource = dbContextItems.Wharehouses.ToList();
                comboBoxStore.Refresh();
            }
        }
Exemple #10
0
        public AddBank()
        {
            InitializeComponent();
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            dbContext = new Purchase.AccountingSystem();
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.BankSets.Load();
            // This l bindingSource1.DataSource = dbContext.BankSets.Local.Select(b => b.BankName).Distinct().ToList();
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContextine of code is generated by Data Source Configuration Wizard

            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.BankSets.Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource1.DataSource = dbContext.BankSets.Local.ToBindingList();
        }
Exemple #11
0
        private void simpleButton6_Click(object sender, EventArgs e)
        {
            Form storeForm = new Form();

            storeForm.Controls.Add(new AddBank());
            storeForm.BackColor     = System.Drawing.Color.White;
            storeForm.StartPosition = FormStartPosition.CenterScreen;
            storeForm.Width         = 320;
            //storeForm.WindowState = FormWindowState.Maximized;
            DialogResult x = storeForm.ShowDialog();

            if (x == DialogResult.Cancel)
            {
                dbContext = new Purchase.AccountingSystem();
                bindingSource3.DataSource = dbContext.BankSets.ToList();
                VendBankName.Refresh();
            }
        }
Exemple #12
0
 public frmSalesReports()
 {
     InitializeComponent();
     GetCustomers();
     GetItems();
     // This line of code is generated by Data Source Configuration Wizard
     // Instantiate a new DBContext
     Purchase.AccountingSystem dbContext = new Purchase.AccountingSystem();
     // Call the Load method to get the data for the given DbSet from the database.
     dbContext.VendorSets.Load();
     // This line of code is generated by Data Source Configuration Wizard
     bindingSource1.DataSource = dbContext.VendorSets.Local.ToBindingList();
     // This line of code is generated by Data Source Configuration Wizard
     // Instantiate a new DBContext
     // Call the Load method to get the data for the given DbSet from the database.
     dbContext.Items.Load();
     // This line of code is generated by Data Source Configuration Wizard
     bindingSource2.DataSource = dbContext.Items.Local.ToBindingList();
 }
Exemple #13
0
        private void groupBtn_Click(object sender, EventArgs e)
        {
            FlyoutAction action = new FlyoutAction();

            action.Caption = "المجموعات";
            MyFlyoutDialog dialog = new MyFlyoutDialog(this.ParentForm, action, new GroupForms());

            dialog.AutoSizeMode  = System.Windows.Forms.AutoSizeMode.GrowOnly;
            dialog.StartPosition = FormStartPosition.CenterScreen;
            dialog.Width         = 200;
            DialogResult f = dialog.ShowDialog();

            if (f == DialogResult.Cancel)
            {
                dbContextItems            = new Purchase.AccountingSystem();
                bindingSource3.DataSource = dbContextItems.ItemGroups.ToList();
                ItemGroup.Refresh();
            }
        }
Exemple #14
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            //AddGroup AG = new AddGroup();
            Form storeForm = new AddGroup();

            //storeForm.Controls.Add(new AddCurrnceys());
            //storeForm.BackColor = System.Drawing.Color.White;
            storeForm.StartPosition = FormStartPosition.CenterScreen;
            //storeForm.Width = 320;
            //storeForm.WindowState = FormWindowState.Maximized;
            DialogResult x = storeForm.ShowDialog();

            if (x == DialogResult.Cancel)
            {
                dbContext = new Purchase.AccountingSystem();
                bindingSource1.DataSource = dbContext.Groups.ToList();
                Group.Refresh();
            }
        }
Exemple #15
0
        public Vendor()
        {
            InitializeComponent();

            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            dbContext = new Purchase.AccountingSystem();
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.CurrencySets.Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource1.DataSource = dbContext.CurrencySets.Local.ToBindingList();
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.AreasSets.Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource2.DataSource = dbContext.AreasSets.Local.ToBindingList();
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.BankSets.Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource3.DataSource = dbContext.BankSets.Local.ToBindingList();
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.BankBranches.Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource4.DataSource = dbContext.BankBranches.Local.ToBindingList();
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.TreeAccounts.Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource5.DataSource = dbContext.TreeAccounts.Local.ToBindingList();
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            // Call the Load method to get the data for the given DbSet from the database.
            dbContext.TreeAccounts.Load();
            // This line of code is generated by Data Source Configuration Wizard
            bindingSource6.DataSource = dbContext.TreeAccounts.Local.ToBindingList();
        }
        public InvoiceSearching(long flag)
        {
            ControlFlag = flag;
            InitializeComponent();
            //panelControl1.Hide();
            // This line of code is generated by Data Source Configuration Wizard
            // Instantiate a new DBContext
            Purchase.AccountingSystem dbContext = new Purchase.AccountingSystem();

            gridControl2.Hide();

            if (flag == InvoiceWorkflowState.Request)
            {
            }
            else if (flag == InvoiceWorkflowState.Approvement)
            {
                // Purchase.AccountingSystem dbContext = new Purchase.AccountingSystem();
                // Call the Load method to get the data for the given DbSet from the database.
                dbContext.Invoices.Where(a => a.WorkflowState == InvoiceWorkflowState.Request).Load();
                // This line of code is generated by Data Source Configuration Wizard
                gridControl1.DataSource = dbContext.Invoices.Local.ToBindingList();
            }
            else if (flag == InvoiceWorkflowState.Payment)
            {
                dbContext.Invoices.Where(a => a.WorkflowState == InvoiceWorkflowState.Approvement).Load();
                // This line of code is generated by Data Source Configuration Wizard
                gridControl1.DataSource = dbContext.Invoices.Local.ToBindingList();
            }
            else if (flag == InvoiceWorkflowState.Completed)
            {
                dbContext.Invoices.Where(a => a.WorkflowState == InvoiceWorkflowState.Payment).Load();
                // This line of code is generated by Data Source Configuration Wizard
                gridControl1.DataSource = dbContext.Invoices.Local.ToBindingList();
            }
            else if (flag == InvoiceWorkflowState.Return)
            {
                dbContext.Invoices.Where(a => a.WorkflowState == InvoiceWorkflowState.Completed).Load();
                // This line of code is generated by Data Source Configuration Wizard
                gridControl1.DataSource = dbContext.Invoices.Local.ToBindingList();
            }
        }
Exemple #17
0
 public AddArea()
 {
     InitializeComponent();
     dbContext = new Purchase.AccountingSystem();
 }
 private void Ini()
 {
     dbContext = new Purchase.AccountingSystem();
     dbContext.TreeAccounts.Where(d => d.parentId == 0).Load();
     bindingSource1.DataSource = dbContext.TreeAccounts.Local.ToBindingList();
 }
 private void RefreshTreeList()
 {
     dbContext = new Purchase.AccountingSystem();
     bindingSource1.DataSource = dbContext.TreeAccounts.ToList();
     treeList1.RefreshDataSource();
 }
Exemple #20
0
 private void DisplayInvoice(int InvoiceID)
 {
     using (var db = new AccountingSystem())
     {
         var dc = from c in db.SalesInvoices
                  where c.Id.Equals(InvoiceID)
                  select new
         {
             c.Id,
             c.InoviceNo,
             c.InvoiceDate,
             c.CustomerID,
             c.CurrencyID,
             c.Rate,
             c.PaymentType,
             c.ChequeNo,
             c.ChequeDate,
             c.Paid,
             c.Tax,
             c.Discount,
             c.Notes,
             c.Canceled
         };
         var list = dc.ToList();
         if (list.Count != 0)
         {
             i = list[0].Id;
             txtInvoiceNo.Tag        = list[0].Id.ToString();
             txtInvoiceNo.Text       = list[0].Id.ToString();
             txtInvoiceDate.Text     = list[0].InvoiceDate.ToString("yyyy-MM-dd");
             cmbCustomerID.EditValue = list[0].CustomerID;
             cmbCurreny.EditValue    = list[0].CurrencyID;
             if (list[0].CurrencyID != 1)
             {
                 txtRate.Enabled = true;
             }
             else
             {
                 txtRate.Enabled = false;
             }
             txtRate.Text             = list[0].Rate.ToString();
             cmbPaymentType.EditValue = list[0].PaymentType;
             txtChequeDate.EditValue  = list[0].ChequeDate;
             txtChequeNo.Text         = list[0].ChequeNo;
             txtTax.Text      = list[0].Tax.ToString();
             txtDiscount.Text = list[0].Discount.ToString();
             if (!string.IsNullOrEmpty(list[0].Notes))
             {
                 txtNotes.Text = list[0].Notes.ToString();
             }
             else
             {
                 txtNotes.Text = "";
             }
             if (list[0].Paid == 1)
             {
                 chkPaid.Checked = true;
             }
             if (list[0].Canceled == 1)
             {
                 chkCancel.Checked = true;
             }
             dbContext = new Purchase.AccountingSystem();
             // Call the Load method to get the data for the given DbSet from the database.
             dbContext.SaleInvoiceDetails.Where(y => y.SalesInvoicesId == i).Load();
             // This line of code is generated by Data Source Configuration Wizard
             grditem.DataSource = dbContext.SaleInvoiceDetails.Local.ToBindingList();
             grditem.RefreshDataSource();
             gridView1_RowUpdated(null, null);
         }
         else
         {
             MessageBox.Show("عفوا لاتوجد فاتورة بهذا الرقم", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }