private void OpenCustomerLedgerddUpdateForm(bool isEdit)
        {
            try
            {
                frmCustomerLedgerMasterAddUpdate form = new frmCustomerLedgerMasterAddUpdate(isEdit);
                form.IsInChildMode = true;
                ExtensionMethods.AddChildFormToPanel(this, form, ExtensionMethods.MainPanel);
                form.WindowState = FormWindowState.Maximized;

                if (isEdit && dgvCustomerLedger.SelectedRows[0] != null)
                {
                    CustomerLedgerMaster existingItem = (CustomerLedgerMaster)dgvCustomerLedger.SelectedRows[0].DataBoundItem;
                    form.frmCustomerLedgerMasterAddUpdate_Fill_UsingExistingItem(existingItem);
                    form.LoadCustomerCompanyDiscountGrid();
                }
                form.FormClosed += Form_FormClosed;
                form.Show();

                if (!isEdit)
                {
                    CustomerLedgerMaster nextCust = new CustomerLedgerMaster()
                    {
                        CustomerLedgerName = txtSearch.Text
                    };
                    form.ConfigureCustomerLedger(nextCust);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result = MessageBox.Show(Constants.Messages.DeletePrompt, Constants.Messages.Confirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                if (result == DialogResult.Yes)
                {
                    if (dgvCustomerLedger.SelectedRows.Count == 0)
                    {
                        MessageBox.Show("Please select atleast one row to delete");
                    }

                    if (dgvCustomerLedger.SelectedRows[0] != null)
                    {
                        CustomerLedgerMaster existingItem = (CustomerLedgerMaster)dgvCustomerLedger.SelectedRows[0].DataBoundItem;
                        deleteCustomerLedger(existingItem);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                if (dgvCustomerLedger.SelectedRows.Count == 0)
                {
                    MessageBox.Show("Please select atleast one row to edit");
                }

                if (dgvCustomerLedger.SelectedRows[0] != null)
                {
                    frmCustomerLedgerMasterAddUpdate form = new frmCustomerLedgerMasterAddUpdate(true);
                    form.IsInChildMode = true;
                    ExtensionMethods.AddChildFormToPanel(this, form, ExtensionMethods.MainPanel);
                    form.WindowState = FormWindowState.Maximized;

                    CustomerLedgerMaster existingItem = (CustomerLedgerMaster)dgvCustomerLedger.SelectedRows[0].DataBoundItem;
                    form.frmCustomerLedgerMasterAddUpdate_Fill_UsingExistingItem(existingItem);
                    form.LoadCustomerCompanyDiscountGrid();

                    form.FormClosed += Form_FormClosed;
                    form.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            //Add
            if (keyData == (Keys.F9))
            {
                OpenCustomerLedgerddUpdateForm(false);
                return(true);
            }
            else if (keyData == Keys.F3)
            {
                if (dgvCustomerLedger.SelectedRows.Count == 0)
                {
                    MessageBox.Show("Please select atleast one row to edit");
                }

                OpenCustomerLedgerddUpdateForm(true);
                return(true);
            }
            else if (keyData == Keys.Delete)
            {
                DialogResult result = MessageBox.Show(Constants.Messages.DeletePrompt, Constants.Messages.Confirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                if (result == DialogResult.Yes)
                {
                    if (dgvCustomerLedger.SelectedRows.Count == 0)
                    {
                        MessageBox.Show("Please select atleast one row to delete");
                    }

                    CustomerLedgerMaster existingItem = (CustomerLedgerMaster)dgvCustomerLedger.SelectedRows[0].DataBoundItem;
                    deleteCustomerLedger(existingItem);
                }
                return(true);
            }
            else if (keyData == Keys.Down)
            {
                dgvCustomerLedger.Focus();
            }
            else if (keyData == Keys.Enter && IsInChildMode && dgvCustomerLedger.SelectedRows.Count > 0)
            {
                this.Close();
            }
            else if (keyData == Keys.Escape)
            {
                if (IsInChildMode)
                {
                    if (DialogResult.Yes == MessageBox.Show(Constants.Messages.ClosePrompt, Constants.Messages.Confirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                    {
                        this.Close();
                    }
                }
                else
                {
                    this.Close();
                }
            }

            return(base.ProcessCmdKey(ref msg, keyData));
        }
 private void deleteCustomerLedger(CustomerLedgerMaster customerLedger)
 {
     if (customerLedger != null)
     {
         applicationFacade.DeleteCustomerLedger(customerLedger.CustomerLedgerId);
         LoadDataGrid();
     }
 }
示例#6
0
 public int UpdateCustomerLedger(CustomerLedgerMaster p)
 {
     try
     {
         return(new CustomerLedgerMasterBiz(this.LoggedInUser).UpdateCustomerLedger(p));
     }
     catch (Exception)
     {
         throw;
     }
 }
 private void frmCustomerLedgerMaster_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         if (dgvCustomerLedger.CurrentRow != null)
         {
             this.LastSelectedCustomerLedger = dgvCustomerLedger.CurrentRow.DataBoundItem as CustomerLedgerMaster;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void dgvCustomerLedger_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             frmCustomerLedgerMasterAddUpdate form = new frmCustomerLedgerMasterAddUpdate(true);
             form.IsInChildMode = true;
             ExtensionMethods.AddChildFormToPanel(this, form, ExtensionMethods.MainPanel);
             CustomerLedgerMaster existingItem = (CustomerLedgerMaster)dgvCustomerLedger.CurrentRow.DataBoundItem;
             form.frmCustomerLedgerMasterAddUpdate_Fill_UsingExistingItem(existingItem);
             form.LoadCustomerCompanyDiscountGrid();
             form.FormClosed += Form_FormClosed;
             form.Show();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void FormCustomerLedgerMaster_FormClosed(object sender, FormClosedEventArgs e)
        {
            try
            {
                ExtensionMethods.RemoveChildFormToPanel(this, (Control)sender, ExtensionMethods.MainPanel);
                CustomerLedgerMaster selectedCustomer = (sender as frmCustomerLedgerMaster).LastSelectedCustomerLedger;
                if (selectedCustomer != null)
                {
                    ReceiptPaymentItem receiptPaymentForSelectedCust = new ReceiptPaymentItem()
                    {
                        VoucherTypeCode           = Constants.VoucherTypeCode.RECEIPTFROMCUSTOMER,
                        VoucherDate               = ExtensionMethods.ConvertToSystemDateFormat(dtReceiptPayment.Text),
                        LedgerType                = Constants.LedgerType.CustomerLedger,
                        LedgerTypeCode            = selectedCustomer.CustomerLedgerCode,
                        LedgerTypeName            = selectedCustomer.CustomerLedgerName,
                        PaymentMode               = Constants.PaymentMode.CASH,
                        BankAccountLedgerTypeCode = Convert.ToString(txtTransactAccount.Tag),
                        BankAccountLedgerTypeName = Convert.ToString(txtTransactAccount.Text),
                        ChequeDate                = DateTime.Now
                    };

                    TransactionEntity transactionEntity = new TransactionEntity()
                    {
                        EntityType = Constants.LedgerType.CustomerLedger,
                        EntityCode = selectedCustomer.CustomerLedgerCode
                    };

                    UpdateReceiptPaymentRow(receiptPaymentForSelectedCust);
                    LoadGridBillOutstanding(transactionEntity);

                    dgvReceiptFromCustomer.Focus();
                    dgvReceiptFromCustomer.CurrentCell = dgvReceiptFromCustomer.Rows[dgvReceiptFromCustomer.SelectedCells[0].RowIndex].Cells["ChequeNumber"];
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        //ADD/UPDATE/DELETE Functionality

        private void btnAddNew_Click(object sender, EventArgs e)
        {
            try
            {
                frmCustomerLedgerMasterAddUpdate form = new frmCustomerLedgerMasterAddUpdate(false);
                form.IsInChildMode = true;
                ExtensionMethods.AddChildFormToPanel(this, form, ExtensionMethods.MainPanel);
                form.WindowState = FormWindowState.Maximized;
                form.FormClosed += Form_FormClosed;
                form.Show();

                CustomerLedgerMaster nextCust = new CustomerLedgerMaster()
                {
                    CustomerLedgerName = txtSearch.Text
                };
                form.ConfigureCustomerLedger(nextCust);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#11
0
        private void StartMigration()
        {
            CompanyMaster        companyMaster        = new CompanyMaster();
            ItemMaster           itemMaster           = new ItemMaster();
            PersonRouteMaster    personRouteMaster    = new PersonRouteMaster();
            PersonalLedgerMaster personalLedgerMaster = new PersonalLedgerMaster();
            AccountLedgerMaster  accountLedgerMaster  = new AccountLedgerMaster();
            SupplierLedgerMaster supplierLedgerMaster = new SupplierLedgerMaster();
            CustomerLedgerMaster customerLedgerMaster = new CustomerLedgerMaster();
            BillOutstanding      billOutstanding      = new BillOutstanding();
            FIFO fifo = new FIFO();

            int result;

            grdDataMigration.Rows.Add("Company Master", "Processing", 0);
            result = 0;

            result = companyMaster.InsertCompanyMasterData();

            grdDataMigration.Rows[0].Cells[1].Value = "Completed";
            grdDataMigration.Rows[0].Cells[2].Value = result;

            grdDataMigration.Rows.Add("A.S.M.", "Processing", 0);
            result = 0;

            result = personRouteMaster.InsertASMData();

            grdDataMigration.Rows[1].Cells[1].Value = "Completed";
            grdDataMigration.Rows[1].Cells[2].Value = result;

            grdDataMigration.Rows.Add("R.S.M.", "Processing", 0);
            result = 0;

            result = personRouteMaster.InsertRSMData();

            grdDataMigration.Rows[2].Cells[1].Value = "Completed";
            grdDataMigration.Rows[2].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Z.S.M.", "Processing", 0);
            result = 0;

            result = personRouteMaster.InsertZSMData();

            grdDataMigration.Rows[3].Cells[1].Value = "Completed";
            grdDataMigration.Rows[3].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Sales Man", "Processing", 0);
            result = 0;

            result = personRouteMaster.InsertSalesManData();

            grdDataMigration.Rows[4].Cells[1].Value = "Completed";
            grdDataMigration.Rows[4].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Area", "Processing", 0);
            result = 0;

            result = personRouteMaster.InsertAreaData();

            grdDataMigration.Rows[5].Cells[1].Value = "Completed";
            grdDataMigration.Rows[5].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Route", "Processing", 0);
            result = 0;

            result = personRouteMaster.InsertRouteData();

            grdDataMigration.Rows[6].Cells[1].Value = "Completed";
            grdDataMigration.Rows[6].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Personal Details", "Processing", 0);
            result = 0;

            result = personalLedgerMaster.InsertPersonalLedgerMasterData();

            grdDataMigration.Rows[7].Cells[1].Value = "Completed";
            grdDataMigration.Rows[7].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Control Codes", "Processing", 0);
            result = 0;

            result = accountLedgerMaster.InsertControlCodesData();

            grdDataMigration.Rows[8].Cells[1].Value = "Completed";
            grdDataMigration.Rows[8].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Income Ledger", "Processing", 0);
            result = 0;

            result = accountLedgerMaster.InsertIncomeLedgerData();

            grdDataMigration.Rows[9].Cells[1].Value = "Completed";
            grdDataMigration.Rows[9].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Expenditure Ledger", "Processing", 0);
            result = 0;

            result = accountLedgerMaster.InsertExpenditureLedgerData();

            grdDataMigration.Rows[10].Cells[1].Value = "Completed";
            grdDataMigration.Rows[10].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Transaction Books", "Processing", 0);
            result = 0;

            result = accountLedgerMaster.InsertTransactionLedgerData();

            grdDataMigration.Rows[11].Cells[1].Value = "Completed";
            grdDataMigration.Rows[11].Cells[2].Value = result;

            grdDataMigration.Rows.Add("General Ledger", "Processing", 0);
            result = 0;

            result = accountLedgerMaster.InsertGeneralLedgerData();

            grdDataMigration.Rows[12].Cells[1].Value = "Completed";
            grdDataMigration.Rows[12].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Purchase Ledger", "Processing", 0);
            result = 0;

            result = accountLedgerMaster.InsertPurchaseLedgerData();

            grdDataMigration.Rows[13].Cells[1].Value = "Completed";
            grdDataMigration.Rows[13].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Sale Ledger", "Processing", 0);
            result = 0;

            result = accountLedgerMaster.InsertSaleLedgerData();

            grdDataMigration.Rows[14].Cells[1].Value = "Completed";
            grdDataMigration.Rows[14].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Item Master", "Processing", 0);
            result = 0;

            result = itemMaster.InsertItemMasterData();

            grdDataMigration.Rows[15].Cells[1].Value = "Completed";
            grdDataMigration.Rows[15].Cells[2].Value = result;

            grdDataMigration.Rows.Add("FIFO", "Processing", 0);
            result = 0;

            result = fifo.InsertFIFOData();

            grdDataMigration.Rows[16].Cells[1].Value = "Completed";
            grdDataMigration.Rows[16].Cells[2].Value = result;


            grdDataMigration.Rows.Add("Supplier Ledger", "Processing", 0);
            result = 0;

            result = supplierLedgerMaster.InsertSupplierLedgerMasterData();

            grdDataMigration.Rows[17].Cells[1].Value = "Completed";
            grdDataMigration.Rows[17].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Customer Ledger", "Processing", 0);
            result = 0;

            result = customerLedgerMaster.InsertCustomerLedgerMasterData(); //confirm mapping columns for columns having comments in CustomerLedgerMaster

            grdDataMigration.Rows[18].Cells[1].Value = "Completed";
            grdDataMigration.Rows[18].Cells[2].Value = result;

            //For below method check comments in CustomerLedgerMaster
            grdDataMigration.Rows.Add("Customer Company Discount", "Processing", 0);
            result = 0;

            result = customerLedgerMaster.InsertCustomerCompanyReferenceData();

            grdDataMigration.Rows[19].Cells[1].Value = "Completed";
            grdDataMigration.Rows[19].Cells[2].Value = result;


            //For below method check comments in CustomerLedgerMaster
            grdDataMigration.Rows.Add("Supplier Company Discount", "Processing", 0);
            result = 0;

            result = supplierLedgerMaster.InsertSupplierCompanyReferenceData();

            grdDataMigration.Rows[20].Cells[1].Value = "Completed";
            grdDataMigration.Rows[20].Cells[2].Value = result;

            grdDataMigration.Rows.Add("Bill Oustanding", "Processing", 0);
            result = 0;

            result = billOutstanding.InsertBillOutstandingData();

            grdDataMigration.Rows[21].Cells[1].Value = "Completed";
            grdDataMigration.Rows[21].Cells[2].Value = result;


            MessageBox.Show("Process Completed");
        }
示例#12
0
        public JsonResult SaveCustomer(CustomerVM A)
        {
            bool   status = false;
            string mes    = "";
            int    maxCus;

            maxCus = (from x in db.Customers where x.WarehouseID == A.WarehouseID select x).Max(p => p.CustomerID) + 1;
            //var c = db.Customers.Where(t => t.CustomerID == A.CustomerID).FirstOrDefault();
            int v = maxCus;

            if (ModelState.IsValid)
            {
                try
                {
                    using (PEPSIEntities dc = new PEPSIEntities())
                    {
                        Customer c = new Customer();
                        {
                            c.CustomerID      = maxCus;
                            c.CustomerName    = A.CustomerName;
                            c.ProprietorsName = A.ProprietorsName;
                            //c.CustomerShortName = A.ProprietorsName;
                            c.ContactPersonsName    = A.ProprietorsName;
                            c.WarehouseID           = A.WarehouseID;
                            c.CustomerTypeID        = A.CustomerTypeID;
                            c.CustomerAddress1      = A.CustomerAddress1;
                            c.CustomerAddress2      = A.CustomerAddress1;
                            c.CustomerPhone         = A.CustomerPhone;
                            c.CustomerMobilePhone   = A.CustomerPhone;
                            c.CustomerExecutiveID   = A.CustomerExecutiveID;
                            c.SalesPersonID         = A.SalesPersonID;
                            c.RegionID              = A.RegionID;
                            c.ClusterName           = A.ClusterName;
                            c.ProductRateID         = A.ProductRateID;
                            c.CustomerStartingDate  = DateTime.Today;
                            c.VATRegistrationNumber = A.VATRegistrationNumber;
                            c.ActiveStatus          = "A";
                            c.CreateBy              = User.Identity.Name;
                            c.CreateDate            = System.DateTime.Now;
                        }
                        dc.Customers.Add(c);
                        CustomerLedgerMaster cl = new CustomerLedgerMaster();
                        {
                            cl.CustomerID         = maxCus;
                            cl.CurrentBalance     = 0;
                            cl.BankGuranteeAmt    = 0;
                            cl.BlockedAmt         = 0;
                            cl.BookedAmt          = 0;
                            cl.CheckingFlag       = "Y";
                            cl.CreditAmt          = 0;
                            cl.OpeningBalance     = 0;
                            cl.PaymentAmt         = 0;
                            cl.ReplacementPayable = 0;
                            cl.ReturnAmt          = 0;
                            cl.TotalSequrityAmt   = 0;
                            cl.CustomerStatus     = "A";
                            cl.SequrityReceive    = 0;
                            cl.SequrityRefund     = 0;
                            cl.TotalSequrityAmt   = 0;
                            cl.LoadUnloadCharge   = 0;
                            cl.OutstandingAmt     = 0;
                            cl.InvoiceAmt         = 0;
                            cl.CreateBy           = User.Identity.Name;
                            cl.WarehouseID        = A.WarehouseID;
                            cl.CreateDate         = System.DateTime.Now;
                        }
                        dc.CustomerLedgerMasters.Add(cl);
                        TransportFareSetup tf = new TransportFareSetup();
                        tf.CustomerID   = maxCus;
                        tf.CustomerName = A.CustomerName;
                        tf.WarehouseID  = A.WarehouseID;
                        tf.Address      = A.CustomerAddress1;
                        tf.IsActive     = 1;
                        tf.Rate1        = 3000;
                        tf.Rate2        = 4000;
                        tf.Rate3        = 6000;
                        tf.Date         = DateTime.Today;
                        dc.TransportFareSetups.Add(tf);
                        // Save All Data
                        dc.SaveChanges();
                        status = true;
                        dc.Dispose();
                    }
                }
                catch (Exception ex)
                {
                    return(new JsonResult {
                        Data = new { status = status, mes = mes, v = v }
                    });
                    //throw ex;
                }
            }
            else
            {
                status = false;
            }

            return(new JsonResult {
                Data = new { status = status, mes = mes, v = v }
            });
        }
示例#13
0
        private void StartMigration()
        {
            CompanyMaster        companyMaster        = new CompanyMaster();
            ItemMaster           itemMaster           = new ItemMaster();
            PersonRouteMaster    personRouteMaster    = new PersonRouteMaster();
            PersonalLedgerMaster personalLedgerMaster = new PersonalLedgerMaster();
            AccountLedgerMaster  accountLedgerMaster  = new AccountLedgerMaster();
            SupplierLedgerMaster supplierLedgerMaster = new SupplierLedgerMaster();
            CustomerLedgerMaster customerLedgerMaster = new CustomerLedgerMaster();
            BillOutstanding      billOutstanding      = new BillOutstanding();
            FIFO fifo = new FIFO();
            PurchaseSaleBookHeaderMigration   purchaseSaleBookHeaderMigration   = new PurchaseSaleBookHeaderMigration();
            PurchaseSaleBookLineItemMigration purchaseSaleBookLineItemMigration = new PurchaseSaleBookLineItemMigration();
            TRN trn = new TRN();
            ReceiptPaymentMigration receiptPayment = new ReceiptPaymentMigration();
            BillOutStandingsAudjustmentMigration billOsAdjustment = new BillOutStandingsAudjustmentMigration();


            int result   = 0;
            int rowIndex = 0;

            SetProcessingText(grdDataMigration, "Company Master", rowIndex, "Processing", result, true);
            result = companyMaster.InsertCompanyMasterData();
            SetProcessingText(grdDataMigration, "Company Master", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "ASM", rowIndex, "Processing", result, true);
            result = personRouteMaster.InsertASMData();
            SetProcessingText(grdDataMigration, "ASM", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "RSM", rowIndex, "Processing", result, true);
            result = personRouteMaster.InsertRSMData();
            SetProcessingText(grdDataMigration, "RSM", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "ZSM", rowIndex, "Processing", result, true);
            result = personRouteMaster.InsertZSMData();
            SetProcessingText(grdDataMigration, "ZSM", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Sales Man", rowIndex, "Processing", result, true);
            result = personRouteMaster.InsertSalesManData();
            SetProcessingText(grdDataMigration, "Sales Man", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Area", rowIndex, "Processing", result, true);
            result = personRouteMaster.InsertAreaData();
            SetProcessingText(grdDataMigration, "Area", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Route", rowIndex, "Processing", result, true);
            result = personRouteMaster.InsertRouteData();
            SetProcessingText(grdDataMigration, "Route", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Personal Ledger", rowIndex, "Processing", result, true);
            result = personalLedgerMaster.InsertPersonalLedgerMasterData();
            SetProcessingText(grdDataMigration, "Personal Ledger", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Control Codes", rowIndex, "Processing", result, true);
            result = accountLedgerMaster.InsertControlCodesData();
            SetProcessingText(grdDataMigration, "Control Codes", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Income Ledger", rowIndex, "Processing", result, true);
            result = accountLedgerMaster.InsertIncomeLedgerData();
            SetProcessingText(grdDataMigration, "Income Ledger", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Expenditure Ledger", rowIndex, "Processing", result, true);
            result = accountLedgerMaster.InsertExpenditureLedgerData();
            SetProcessingText(grdDataMigration, "Expenditure Ledger", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Transaction Ledger", rowIndex, "Processing", result, true);
            result = accountLedgerMaster.InsertTransactionLedgerData();
            SetProcessingText(grdDataMigration, "Transaction Ledger", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "General Ledger", rowIndex, "Processing", result, true);
            result = accountLedgerMaster.InsertGeneralLedgerData();
            SetProcessingText(grdDataMigration, "General Ledger", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Purchase Ledger", rowIndex, "Processing", result, true);
            result = accountLedgerMaster.InsertPurchaseLedgerData();
            SetProcessingText(grdDataMigration, "Purchase Ledger", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Sale Ledger", rowIndex, "Processing", result, true);
            result = accountLedgerMaster.InsertSaleLedgerData();
            SetProcessingText(grdDataMigration, "Sale Ledger", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Item Master", rowIndex, "Processing", result, true);
            result = itemMaster.InsertItemMasterData();
            SetProcessingText(grdDataMigration, "Item Master", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Supplier Ledger", rowIndex, "Processing", result, true);
            result = supplierLedgerMaster.InsertSupplierLedgerMasterData();
            SetProcessingText(grdDataMigration, "Supplier Ledger", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Customer Ledger", rowIndex, "Processing", result, true);
            result = customerLedgerMaster.InsertCustomerLedgerMasterData(); //confirm mapping columns for columns having comments in CustomerLedgerMaster
            SetProcessingText(grdDataMigration, "Customer Ledger", rowIndex, "Completed", result, false);

            //result = 0;
            //rowIndex += 1;
            //SetProcessingText(grdDataMigration, "Customer Compnay Discount Ref", rowIndex, "Processing", result, true);
            //result = customerLedgerMaster.InsertCustomerCompanyReferenceData();
            //SetProcessingText(grdDataMigration, "Customer Compnay Discount Ref", rowIndex, "Completed", result, false);

            //result = 0;
            //rowIndex += 1;
            //SetProcessingText(grdDataMigration, "Suppiier Compnay Discount Ref", rowIndex, "Processing", result, true);
            //result = supplierLedgerMaster.InsertSupplierCompanyReferenceData();
            //SetProcessingText(grdDataMigration, "Suppiier Compnay Discount Ref", rowIndex, "Completed", result, false);

            /*------------------------------------------------------------*/

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "PurchaseSaleBookHeaderData", rowIndex, "Processing", result, true);
            result = purchaseSaleBookHeaderMigration.InsertPurchaseSaleBookHeaderData();
            SetProcessingText(grdDataMigration, "PurchaseSaleBookHeaderData", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "PurchaseSaleBookLineItemData", rowIndex, "Processing", result, true);
            result = purchaseSaleBookLineItemMigration.InsertPurchaseSaleBookLineItemData();
            SetProcessingText(grdDataMigration, "PurchaseSaleBookLineItemData", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Fifo", rowIndex, "Processing", result, true);
            result = fifo.InsertFIFOData();
            SetProcessingText(grdDataMigration, "Fifo", rowIndex, "Completed", result, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "Bill Outstanding", rowIndex, "Processing", result, true);
            result = billOutstanding.InsertBillOutstandingData();
            SetProcessingText(grdDataMigration, "Bill Outstanding", rowIndex, "Completed", result, false);


            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "TRN", rowIndex, "Processing", result, true);
            trn.InsertTRNData();
            SetProcessingText(grdDataMigration, "TRN", rowIndex, "Completed", 0, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "ReceiptPayment", rowIndex, "Processing", result, true);
            result = receiptPayment.InsertReceiptPaymentData();
            SetProcessingText(grdDataMigration, "ReceiptPayment", rowIndex, "Completed", 0, false);

            result    = 0;
            rowIndex += 1;
            SetProcessingText(grdDataMigration, "BillOutStandingsAudjustment", rowIndex, "Processing", result, true);
            result = billOsAdjustment.InsertBillOutStandingsAudjustmentData();
            SetProcessingText(grdDataMigration, "BillOutStandingsAudjustment", rowIndex, "Completed", 0, false);

            /* ---------------------------------------  ---------------------------------------*/

            MessageBox.Show("Process Completed");
        }
示例#14
0
 public void ConfigureCustomerLedger(CustomerLedgerMaster model)
 {
     txtCustSupplierName.Text = model.CustomerLedgerName;
 }
示例#15
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                //Set the cursor to appear as busy
                Cursor.Current = Cursors.WaitCursor;

                Choice               choice;
                LocalCentral         localCentral;
                CustomerLedgerMaster customerLedgerMaster = new CustomerLedgerMaster();

                if (String.IsNullOrWhiteSpace(txtCustSupplierName.Text))
                {
                    MessageBox.Show("Customer Name " + Constants.Messages.RequiredField);
                    return;
                }

                customerLedgerMaster.CustomerLedgerId = this.customerLedgerID;

                //values from User Control
                customerLedgerMaster.CustomerLedgerName      = txtCustSupplierName.Text;
                customerLedgerMaster.CustomerLedgerShortName = txtShortName.Text;
                customerLedgerMaster.Address       = txtAddress.Text;
                customerLedgerMaster.ContactPerson = txtContactPerson.Text;
                customerLedgerMaster.Telephone     = txtTelephone.Text;
                customerLedgerMaster.Mobile        = txtMobile.Text;
                customerLedgerMaster.OfficePhone   = txtPhoneO.Text;
                customerLedgerMaster.ResidentPhone = txtPhoneR.Text;
                customerLedgerMaster.EmailAddress  = txtEmailAddress.Text;
                customerLedgerMaster.OpeningBal    = ExtensionMethods.SafeConversionDecimal(txtOpeningBal.Text);
                customerLedgerMaster.CreditDebit   = Convert.ToString(cbxCreditDebit.SelectedItem);
                customerLedgerMaster.TaxRetail     = Convert.ToString(cbxTaxRetail.SelectedItem);
                customerLedgerMaster.Status        = Convert.ToBoolean(cbxStatus.SelectedItem);

                //values from User this form
                customerLedgerMaster.ZSMId      = String.IsNullOrWhiteSpace(tbxZSM.Text) ? null : (int?)tbxZSM.Tag;
                customerLedgerMaster.RSMId      = String.IsNullOrWhiteSpace(tbxRSM.Text) ? null : (int?)tbxRSM.Tag;
                customerLedgerMaster.ASMId      = String.IsNullOrWhiteSpace(tbxASM.Text) ? null : (int?)tbxASM.Tag;
                customerLedgerMaster.AreaId     = String.IsNullOrWhiteSpace(tbxSalesman.Text) ? null : (int?)tbxSalesman.Tag;
                customerLedgerMaster.SalesManId = String.IsNullOrWhiteSpace(tbxArea.Text) ? null : (int?)tbxArea.Tag;
                customerLedgerMaster.RouteId    = String.IsNullOrWhiteSpace(tbxRoute.Text) ? null : (int?)tbxRoute.Tag;

                customerLedgerMaster.DLNo           = tbxDL.Text;
                customerLedgerMaster.GSTNo          = tbxGST.Text;
                customerLedgerMaster.CINNo          = tbxCIN.Text;
                customerLedgerMaster.LINNo          = tbxLIN.Text;
                customerLedgerMaster.ServiceTaxNo   = tbxServiceTax.Text;
                customerLedgerMaster.PANNo          = tbxPAN.Text;
                customerLedgerMaster.CreditLimit    = ExtensionMethods.SafeConversionInt(tbxCredtLimit.Text) ?? default(int);
                customerLedgerMaster.CustomerTypeID = (cbxCustomerType.SelectedItem as CustomerType).CustomerTypeId;

                Enum.TryParse <Choice>(cbxLessExcise.SelectedValue.ToString(), out choice);
                customerLedgerMaster.IsLessExcise = choice == Choice.Yes;

                customerLedgerMaster.InterestTypeID = (cbxRateType.SelectedItem as RateType).RateTypeId;

                customerLedgerMaster.SaleBillFormat = tbxSaleBillFormat.Text;

                customerLedgerMaster.MaxOSAmount    = ExtensionMethods.SafeConversionDecimal(tbxMaxOSAmount.Text);
                customerLedgerMaster.MaxBillAmount  = ExtensionMethods.SafeConversionDecimal(tbxMaxBillAmmount.Text);
                customerLedgerMaster.MaxNumOfOSBill = ExtensionMethods.SafeConversionInt(tbxMaxNumberOfOSBill.Text);
                customerLedgerMaster.MaxGracePeriod = ExtensionMethods.SafeConversionInt(tbxMaxGracePeriod.Text);

                Enum.TryParse <Choice>(cbxFollowConditionStrictly.SelectedValue.ToString(), out choice);
                customerLedgerMaster.IsFollowConditionStrictly = choice == Choice.Yes;

                customerLedgerMaster.Discount = ExtensionMethods.SafeConversionDecimal(tbxDiscount.Text);

                Enum.TryParse <LocalCentral>(cbxLocaLCentral.SelectedValue.ToString(), out localCentral);
                customerLedgerMaster.CentralLocal = localCentral == LocalCentral.L ? "L" : "C";

                ///Get All the mapping for Company discount
                ///
                customerLedgerMaster.CustomerCopanyDiscountList = dgvCompanyDiscount.Rows
                                                                  .Cast <DataGridViewRow>()
                                                                  .Where(r => !String.IsNullOrWhiteSpace(Convert.ToString(r.Cells["Normal"].Value)) ||
                                                                         !String.IsNullOrWhiteSpace(Convert.ToString(r.Cells["Breakage"].Value)) ||
                                                                         !String.IsNullOrWhiteSpace(Convert.ToString(r.Cells["Expired"].Value))
                                                                         ).Select(x => new CustomerCopanyDiscount()
                {
                    CompanyID = (x.DataBoundItem as CustomerCopanyDiscount).CompanyID,
                    Normal    = (x.DataBoundItem as CustomerCopanyDiscount).Normal,
                    Breakage  = (x.DataBoundItem as CustomerCopanyDiscount).Breakage,
                    Expired   = (x.DataBoundItem as CustomerCopanyDiscount).Expired,
                    CustomerItemDiscountMapping = (x.DataBoundItem as CustomerCopanyDiscount).CustomerItemDiscountMapping
                }).ToList();


                int _result = 0;

                if (isInEditMode)
                {
                    _result = applicationFacade.UpdateCustomerLedger(customerLedgerMaster);
                }
                else
                {
                    _result = applicationFacade.AddCustomerLedger(customerLedgerMaster);
                }

                //Make the Cursor to default
                Cursor.Current = Cursors.Default;

                if (_result > 0)
                {
                    this.Close();
                }
                else
                {
                    MessageBox.Show(Constants.Messages.ErrorOccured);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#16
0
        public void frmCustomerLedgerMasterAddUpdate_Fill_UsingExistingItem(CustomerLedgerMaster customerLedgerMaster)
        {
            if (customerLedgerMaster != null)
            {
                ///Set CustomerId
                ///
                this.customerLedgerID = customerLedgerMaster.CustomerLedgerId;

                ///Fill user control data
                ///
                txtCode.Text                = customerLedgerMaster.CustomerLedgerCode;
                txtCustSupplierName.Text    = customerLedgerMaster.CustomerLedgerName;
                txtShortName.Text           = customerLedgerMaster.CustomerLedgerShortName;
                txtAddress.Text             = customerLedgerMaster.Address;
                txtContactPerson.Text       = customerLedgerMaster.ContactPerson;
                txtTelephone.Text           = customerLedgerMaster.Telephone;
                txtMobile.Text              = customerLedgerMaster.Mobile;
                txtPhoneO.Text              = customerLedgerMaster.OfficePhone;
                txtPhoneR.Text              = customerLedgerMaster.ResidentPhone;
                txtEmailAddress.Text        = customerLedgerMaster.EmailAddress;
                txtOpeningBal.Text          = Convert.ToString(customerLedgerMaster.OpeningBal);
                cbxCreditDebit.SelectedItem = customerLedgerMaster.CreditDebit == "C" ? Enums.TransType.C : Enums.TransType.D;
                cbxTaxRetail.SelectedItem   = customerLedgerMaster.TaxRetail == "T" ? Enums.TaxRetail.T : Enums.TaxRetail.R;
                cbxStatus.SelectedItem      = customerLedgerMaster.Status ? Enums.Status.Active : Enums.Status.Inactive;

                tbxZSM.Text = customerLedgerMaster.ZSMName;
                tbxZSM.Tag  = customerLedgerMaster.ZSMId;

                tbxRSM.Text = customerLedgerMaster.RSMName;
                tbxRSM.Tag  = customerLedgerMaster.RSMId;

                tbxASM.Text = customerLedgerMaster.ASMName;
                tbxASM.Tag  = customerLedgerMaster.ASMId;

                tbxSalesman.Text = customerLedgerMaster.SalesmanName;
                tbxSalesman.Tag  = customerLedgerMaster.SalesManId;

                tbxArea.Text = customerLedgerMaster.AreaName;
                tbxArea.Tag  = customerLedgerMaster.AreaId;

                tbxRoute.Text = customerLedgerMaster.RouteName;
                tbxRoute.Tag  = customerLedgerMaster.RouteId;

                tbxDL.Text         = customerLedgerMaster.DLNo;
                tbxGST.Text        = customerLedgerMaster.GSTNo;
                tbxCIN.Text        = customerLedgerMaster.CINNo;
                tbxLIN.Text        = customerLedgerMaster.LINNo;
                tbxServiceTax.Text = customerLedgerMaster.ServiceTaxNo;
                tbxPAN.Text        = customerLedgerMaster.PANNo;

                tbxCredtLimit.Text                      = Convert.ToString(customerLedgerMaster.CreditLimit);
                cbxCustomerType.SelectedValue           = customerLedgerMaster.CustomerTypeID;
                cbxLessExcise.SelectedItem              = customerLedgerMaster.IsLessExcise ? Choice.Yes : Choice.No;
                cbxRateType.SelectedValue               = customerLedgerMaster.InterestTypeID;
                tbxSaleBillFormat.Text                  = customerLedgerMaster.SaleBillFormat;
                tbxMaxOSAmount.Text                     = Convert.ToString(customerLedgerMaster.MaxOSAmount);
                tbxMaxBillAmmount.Text                  = Convert.ToString(customerLedgerMaster.MaxBillAmount);
                tbxMaxNumberOfOSBill.Text               = Convert.ToString(customerLedgerMaster.MaxNumOfOSBill);
                tbxMaxGracePeriod.Text                  = Convert.ToString(customerLedgerMaster.MaxGracePeriod);
                cbxFollowConditionStrictly.SelectedItem = customerLedgerMaster.IsFollowConditionStrictly ? Choice.Yes : Choice.No;
                tbxDiscount.Text             = Convert.ToString(customerLedgerMaster.Discount);
                cbxLocaLCentral.SelectedItem = customerLedgerMaster.CentralLocal == "L" ? LocalCentral.L : LocalCentral.C;
            }
        }