private void btnAllRecord_Click(object sender, EventArgs e) { CompanyGeneralReport objCom = new CompanyGeneralReport(); rptViewer objView = new rptViewer(); CompanyBL objBL = new CompanyBL(); var dt = objBL.SelectAllCom(); if (dt != null) { objCom.SetDataSource(dt); objView.crptViewer.ReportSource = objCom; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //objCom.SetParameterValue("@ComID", null); //CompanyBL obj = new CompanyBL(); //var dt = obj.Select(); //if (dt.Count > 0) //{ // objCom.SetDataSource(dt); //} // crptViewerCom.ReportSource = objCom; }
private void btnSave_Click(object sender, EventArgs e) { EmpSalaryBL objEMp = new EmpSalaryBL(); if (txtResign.Checked == false) { objEMp.EmployeeID = Convert.ToInt32(txtEmpId.Text); objEMp.Salary = Convert.ToDecimal(txtSalary.Text); objEMp.SalaryDate = Convert.ToDateTime(txtSalaryDate.Text); objEMp.Status = true; } else if (txtResign.Checked == true) { objEMp.EmployeeID = Convert.ToInt32(txtEmpId.Text); objEMp.Salary = Convert.ToDecimal(txtSalary.Text); objEMp.SalaryDate = Convert.ToDateTime(txtSalaryDate.Text); objEMp.ResignDate = Convert.ToDateTime(txtResignDate.Text); objEMp.Status = false; } objEMp.Save(); EmpSalaryReport objrpt = new EmpSalaryReport(); objrpt.SetParameterValue("@SalaryID", txtSalaryID.Text); rptViewer objview = new rptViewer(); objview.crptViewer.ReportSource = objrpt; objview.WindowState = FormWindowState.Normal; objview.ShowDialog(); btnAddnew.Enabled = true; }
private void btnCusName_Click(object sender, EventArgs e) { CustomerReport objCus = new CustomerReport(); rptViewer objView = new rptViewer(); if (!string.IsNullOrEmpty(txtSearch.Text)) { objCus.SetParameterValue("@CustomerID", txtSearch.Text); CustomerBL objBL = new CustomerBL() { CustomerID = Convert.ToInt32(txtSearch.Text), }; var dt = objBL.SelectByCus(); if (dt != null) { objCus.SetDataSource(dt); objView.crptViewer.ReportSource = objCus; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } //crptViewerCus.ReportSource = objCus; else { MessageBox.Show("No Record Found"); } txtSearch.Clear(); } else { MessageBox.Show("Please Enter Enter ID"); } }
private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtSearch.Text)) { MessageBox.Show("Please Enter Company id"); } else { PurLedger objrpt = new PurLedger(); rptViewer objview = new rptViewer(); objrpt.SetParameterValue("@CompanyID", txtSearch.Text); PurchaseLedgerBL objLedger = new PurchaseLedgerBL() { CompanyID = Convert.ToInt32(txtSearch.Text) }; DataTable dt = objLedger.Search(); if (dt != null) { objrpt.SetDataSource(dt); objview.crptViewer.ReportSource = objrpt; objview.WindowState = FormWindowState.Normal; objview.ShowDialog(); } } }
private void btnSearch_Click(object sender, EventArgs e) { ExpenseReport objrep = new ExpenseReport(); rptViewer objView = new rptViewer(); objrep.SetParameterValue("@mindate", txtMinDate.Value); objrep.SetParameterValue("@maxdate", txtmaxdate.Value); ExpenseBL objBL = new ExpenseBL() { mindate = Convert.ToDateTime(txtMinDate.Text), maxdate = Convert.ToDateTime(txtmaxdate.Text) }; var dt = objBL.SelectByDateDiff(); if (dt != null) { objrep.SetDataSource(dt); objView.crptViewer.ReportSource = objrep; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerExpense.ReportSource = objrep; }
private void btnSearch_Click(object sender, EventArgs e) { SaleGeneralReport objrep = new SaleGeneralReport(); rptViewer objView = new rptViewer(); objrep.SetParameterValue("@mindate", txtMinDate.Value); objrep.SetParameterValue("@maxdate", txtmaxdate.Value); SaleInvoiceBL obj = new SaleInvoiceBL() { mindate = Convert.ToDateTime(txtMinDate.Value), maxdate = Convert.ToDateTime(txtmaxdate.Value) }; DataTable dt = obj.SelectByDate(); if (dt.Rows.Count > 0) { objrep.SetDataSource(dt); objView.crptViewer.ReportSource = objrep; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } }
private void btnSearch_Click(object sender, EventArgs e) { PurReturnGeneralReport objRet = new PurReturnGeneralReport(); rptViewer objView = new rptViewer(); objRet.SetParameterValue("@MinDate", txtMinDate.Text); objRet.SetParameterValue("@MaxDate", txtmaxdate.Text); PurchaseReturnBL objBl = new PurchaseReturnBL() { minDate = Convert.ToDateTime(txtMinDate.Text), maxDate = Convert.ToDateTime(txtmaxdate.Text) }; var dt = objBl.SearchByDateDiff(); if (dt != null) { objRet.SetDataSource(dt); objView.crptViewer.ReportSource = objRet; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerPurchaseReturn.ReportSource = objRet; }
private void btnProd_Click(object sender, EventArgs e) { ProductReport objPro = new ProductReport(); rptViewer objView = new rptViewer(); if (!String.IsNullOrEmpty(txtSearch.Text)) { objPro.SetParameterValue("@ProductID", txtSearch.Text); ProductBL obj = new ProductBL() { ProductID = Convert.ToInt32(txtSearch.Text) }; var dt = obj.SearchByPRod(); if (dt != null) { objPro.SetDataSource(dt); objView.crptViewer.ReportSource = objPro; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); //crptViewerProd.ReportSource = objPro; txtSearch.Clear(); } else { MessageBox.Show("No Record Found"); } } else { MessageBox.Show("Please Enter Product ID"); } }
private void btnSearch_Click(object sender, EventArgs e) { SaleReturnGeneralReport objGen = new SaleReturnGeneralReport(); rptViewer objView = new rptViewer(); objGen.SetParameterValue("@MinDate", txtMinDate.Text); objGen.SetParameterValue("@MaxDate", txtmaxdate.Text); ReturnSaleBL obj = new ReturnSaleBL() { mindate = Convert.ToDateTime(txtMinDate.Text), maxdate = Convert.ToDateTime(txtmaxdate.Text) }; DataTable dt = obj.SelectDateDiff(); if (dt.Rows.Count > 0) { objGen.SetDataSource(dt); objView.crptViewer.ReportSource = objGen; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } //crptViewerReturn.ReportSource = objGen; else { MessageBox.Show("No Record Found"); } }
private void btnComName_Click(object sender, EventArgs e) { CompanyReport objcom = new CompanyReport(); rptViewer objView = new rptViewer(); if (!String.IsNullOrEmpty(txtSearch.Text)) { objcom.SetParameterValue("@ComID", txtSearch.Text); } CompanyBL obj = new CompanyBL() { CompanyID = Convert.ToInt32(txtSearch.Text) }; var dt = obj.SelectComId(); if (dt != null) { objcom.SetDataSource(dt); objView.crptViewer.ReportSource = objcom; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerCom.ReportSource = objcom; txtSearch.Clear(); }
private void btnPrintRoute_Click(object sender, EventArgs e) { if (txtRoute.Text == "---Select---") { MessageBox.Show("Please Enter Route Name"); } else if (dgvLedger.DataSource != null) { SaleLedgerByRoute objSale = new SaleLedgerByRoute(); rptViewer objView = new rptViewer(); objSale.SetParameterValue("@ZoneId", txtRoute.SelectedValue); SaleLedgerBL objLedger = new SaleLedgerBL() { ZoneId = Convert.ToInt32(txtRoute.SelectedValue) }; DataTable dt = objLedger.SearchByRoute(); if (dt != null) { objSale.SetDataSource(dt); objView.crptViewer.ReportSource = objSale; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); LoadRoute(); } } else if (dgvLedger.DataSource == null) { MessageBox.Show("No Record Showed"); } }
private void btnCusID_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtRinvoiceNo.Text)) { SaleReturnReport objRet = new SaleReturnReport(); rptViewer objView = new rptViewer(); objRet.SetParameterValue("@RinvoiceNo", txtRinvoiceNo.Text); ReturnSaleBL obj = new ReturnSaleBL() { RInvoice = Convert.ToInt32(txtRinvoiceNo.Text) }; DataTable dt = obj.Select(); if (dt.Rows.Count > 0) { objRet.SetDataSource(dt); objView.crptViewer.ReportSource = objRet; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); //crptViewerReturn.ReportSource = objRet; txtRinvoiceNo.Clear(); } else { MessageBox.Show("No Record Found"); } } else if (!string.IsNullOrEmpty(txtCus.Text)) { ReturnByCusReport objCus = new ReturnByCusReport(); rptViewer objView = new rptViewer(); objCus.SetParameterValue("@CusID", txtCus.Text); ReturnSaleBL obj = new ReturnSaleBL() { CustomerID = Convert.ToInt32(txtCus.Text) }; DataTable dt = obj.SelectByCus(); if (dt.Rows.Count > 0) { objCus.SetDataSource(dt); objView.crptViewer.ReportSource = objCus; objView.WindowState = FormWindowState.Normal; objView.ShowDialog(); txtCus.Clear(); } else { MessageBox.Show("No Record Found"); } } //crptViewerReturn.ReportSource = objCus; else { MessageBox.Show("Please Enter Customer ID OR Return Invoice"); } }
private void btnCusName_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(txtCus.Text)) { SaleByCusReport objSale = new SaleByCusReport(); rptViewer objView = new rptViewer(); objSale.SetParameterValue("@CusID", txtCus.Text); SaleInvoiceBL objsal = new SaleInvoiceBL() { CustomerID = Convert.ToInt32(txtCus.Text) }; DataTable dt = objsal.SelectByCus(); if (dt.Rows.Count > 0) { objSale.SetDataSource(dt); // btnCusprint.Visible = true; objView.crptViewer.ReportSource = objSale; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); txtCus.Clear(); } else { MessageBox.Show("No Record Found"); } } else if (!String.IsNullOrEmpty(txtinvoiceNo.Text)) { saleInvoiceReport objSale = new saleInvoiceReport(); rptViewer objView = new rptViewer(); objSale.SetParameterValue("@InvoiceNo", txtinvoiceNo.Text); SaleInvoiceBL obj = new SaleInvoiceBL() { InvoiceNo = Convert.ToInt32(txtinvoiceNo.Text) }; DataTable dt = obj.Search(); if (dt.Rows.Count > 0) { objSale.SetDataSource(dt); objView.crptViewer.ReportSource = objSale; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); txtinvoiceNo.Clear(); } //crptViewerSale.ReportSource = objSale; else { MessageBox.Show("No Record Found"); } } else { MessageBox.Show("Please Enter Customer ID OR Return Invoice"); } }
private void btnComName_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtComname.Text)) { PurReturnByComReport objRep = new PurReturnByComReport(); rptViewer objView = new rptViewer(); objRep.SetParameterValue("@ComID", txtComname.Text); PurchaseReturnBL objBl = new PurchaseReturnBL() { CompanyID = Convert.ToInt32(txtComname.Text) }; var dt = objBl.SearchByComId(); if (dt != null) { objRep.SetDataSource(dt); objView.crptViewer.ReportSource = objRep; objView.crptViewer.RefreshReport(); objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerPurchaseReturn.ReportSource = objRep; //crptViewerPurchaseReturn.RefreshReport(); } else if (!string.IsNullOrEmpty(txtInvoice.Text)) { PurReturnInvoiceReport objret = new PurReturnInvoiceReport(); rptViewer objView = new rptViewer(); objret.SetParameterValue("@PReturnID", txtInvoice.Text); PurchaseReturnBL objBl = new PurchaseReturnBL() { PReturnID = Convert.ToInt32(txtInvoice.Text) }; var dt = objBl.SearchByInovice(); if (dt != null) { objret.SetDataSource(dt); objView.crptViewer.ReportSource = objret; objView.crptViewer.RefreshReport(); objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerPurchaseReturn.ReportSource = objret; //crptViewerPurchaseReturn.RefreshReport(); } }
private void btnCusName_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtComname.Text)) { PurchaseReportCom objPur = new PurchaseReportCom(); rptViewer objView = new rptViewer(); objPur.SetParameterValue("@CompanyID", txtComname.Text); PurchaseInvoiceBL obj = new PurchaseInvoiceBL() { companyID = Convert.ToInt32(txtComname.Text) }; DataTable dt = obj.SelectByCompany(); if (dt.Rows.Count > 0) { objPur.SetDataSource(dt); objView.crptViewer.ReportSource = objPur; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } // crptViewerPurchase.ReportSource = objPur; } else if (!string.IsNullOrEmpty(txtInvoice.Text)) { PurchaseInvoiceReport objPurchase = new PurchaseInvoiceReport(); rptViewer objView = new rptViewer(); objPurchase.SetParameterValue("@PInvoice", txtInvoice.Text); PurchaseInvoiceBL obj = new PurchaseInvoiceBL() { PInvoice = Convert.ToInt32(txtInvoice.Text) }; DataTable dt = obj.Search(); if (dt.Rows.Count > 0) { objPurchase.SetDataSource(dt); objView.crptViewer.ReportSource = objPurchase; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerPurchase.ReportSource = objPurchase; txtInvoice.Clear(); } else { MessageBox.Show("Please Enter Company ID"); } }
private void btnSearch_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtRemainID.Text)) { PurRemainIDReport objrpt = new PurRemainIDReport(); rptViewer objView = new rptViewer(); objrpt.SetParameterValue("@RemainID", txtRemainID.Text); PurRemainBL objBl = new PurRemainBL() { PRemainID = Convert.ToInt32(txtRemainID.Text) }; var dt = objBl.SearchByRemainID(); if (dt != null) { objrpt.SetDataSource(dt); objView.crptViewer.ReportSource = objrpt; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerRemain.ReportSource = objrpt; } else if (!string.IsNullOrEmpty(txtComID.Text)) { PurLedger objrpt = new PurLedger(); rptViewer objview = new rptViewer(); objrpt.SetParameterValue("@CompanyID", txtComID.Text); PurchaseLedgerBL objLedger = new PurchaseLedgerBL() { CompanyID = Convert.ToInt32(txtComID.Text) }; DataTable dt = objLedger.Search(); if (dt != null) { objrpt.SetDataSource(dt); objview.crptViewer.ReportSource = objrpt; objview.WindowState = FormWindowState.Maximized; objview.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerRemain.ReportSource = objCom; } else { MessageBox.Show("Please Enter Company ID Or Remaining ID"); } }
private void btnCusName_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtRecoveryID.Text)) { SaleRecoveryIDReport objrpt = new SaleRecoveryIDReport(); rptViewer objView = new rptViewer(); objrpt.SetParameterValue("@RecoveryID", txtRecoveryID.Text); SaleRecoveryBL objBl = new SaleRecoveryBL() { SRecoveryID = Convert.ToInt32(txtRecoveryID.Text) }; var dt = objBl.SearchByRecoveryID(); if (dt != null) { objrpt.SetDataSource(dt); objView.crptViewer.ReportSource = objrpt; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); txtRecoveryID.Clear(); } else { MessageBox.Show("No Record Found"); } //crptViewerRecovery.ReportSource = objrpt; } else if (!string.IsNullOrEmpty(txtCusID.Text)) { SaleLedgerReport objSale = new SaleLedgerReport(); rptViewer objView = new rptViewer(); objSale.SetParameterValue("@CustomerID", txtCusID.Text); SaleLedgerBL objLedger = new SaleLedgerBL() { CustomerID = Convert.ToInt32(txtCusID.Text) }; DataTable dt = objLedger.Search(); if (dt != null) { objSale.SetDataSource(dt); objView.crptViewer.ReportSource = objSale; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); txtCusID.Clear(); } //crptViewerRecovery.ReportSource = objCus; else { MessageBox.Show("No Record Found"); } } }
private void btnCusName_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtsalaryID.Text)) { EmpSalaryReport objrpt = new EmpSalaryReport(); rptViewer objView = new rptViewer(); objrpt.SetParameterValue("@SalaryID", txtsalaryID.Text); EmpSalaryBL objBL = new EmpSalaryBL() { SalaryID = Convert.ToInt32(txtsalaryID.Text) }; var dt = objBL.SalaryIDSelect(); if (dt != null) { objrpt.SetDataSource(dt); objView.crptViewer.ReportSource = objrpt; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerEmp.ReportSource = objrpt; } else if (!string.IsNullOrEmpty(txtEmpID.Text)) { EmpAllSalaryReport obj = new EmpAllSalaryReport(); rptViewer objView = new rptViewer(); obj.SetParameterValue("@EmployeeID", txtEmpID.Text); EmpSalaryBL objBL = new EmpSalaryBL() { EmployeeID = Convert.ToInt32(txtEmpID.Text) }; var dt = objBL.EmployeeIDSelect(); if (dt != null) { obj.SetDataSource(dt); objView.crptViewer.ReportSource = obj; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerEmp.ReportSource = obj; } }
private void btnSave_Click(object sender, EventArgs e) { PurRemainBL objPur = new PurRemainBL() { CompanyID = Convert.ToInt32(txtComID.Text), Date = Convert.ToDateTime(txtDate.Text), ReturnCash = Convert.ToDecimal(txtReturnCash.Text) }; objPur.Save(); PurchaseLedgerBL objLedger = new PurchaseLedgerBL(); if (string.IsNullOrEmpty(txtDescription.Text)) { objLedger.PRemainID = Convert.ToInt32(txtRemainID.Text); objLedger.CompanyID = Convert.ToInt32(txtComID.Text); objLedger.Credit = 0; objLedger.Debit = Convert.ToDecimal(txtReturnCash.Text); objLedger.Date = Convert.ToDateTime(txtDate.Text); objLedger.Balance = Convert.ToDecimal(txtNewBalance.Text); objLedger.Description = "Credit"; } else { objLedger.PRemainID = Convert.ToInt32(txtRemainID.Text); objLedger.CompanyID = Convert.ToInt32(txtComID.Text); objLedger.Credit = 0; objLedger.Debit = Convert.ToDecimal(txtReturnCash.Text); objLedger.Date = Convert.ToDateTime(txtDate.Text); objLedger.Balance = Convert.ToDecimal(txtNewBalance.Text); objLedger.Description = txtDescription.Text; } objLedger.save(); (new PurchaseLedgerBL()).UpdateBalance(objLedger.Balance, objLedger.CompanyID); MessageBox.Show("Payment Paid " + txtReturnCash.Text); PurRemainIDReport objrpt = new PurRemainIDReport(); objrpt.SetParameterValue("@RemainID", txtRemainID.Text); rptViewer objView = new rptViewer(); objView.crptViewer.ReportSource = objrpt; objView.WindowState = FormWindowState.Normal; objView.ShowDialog(); ClearGroup(); }
private void btnAllRecord_Click(object sender, EventArgs e) { CustomerGeneralReport objCus = new CustomerGeneralReport(); rptViewer objView = new rptViewer(); CustomerBL objBL = new CustomerBL(); var dt = objBL.SelectAllCus(); if (dt != null) { objCus.SetDataSource(dt); objView.crptViewer.ReportSource = objCus; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } else { MessageBox.Show("No Record Found"); } //crptViewerCus.ReportSource = objCus; }
private void btnAllRecord_Click(object sender, EventArgs e) { ProductReport objPro = new ProductReport(); rptViewer objView = new rptViewer(); ProductBL obj = new ProductBL(); var dt = obj.SearchByPRodCom(); if (dt != null) { objPro.SetDataSource(dt); objView.crptViewer.ReportSource = objPro; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); //crptViewerProd.ReportSource = objPro; } else { MessageBox.Show("No Record Found"); } }
private void btnPrint_Click(object sender, EventArgs e) { if (isReport1) { SaleGeneralReport objrep = new SaleGeneralReport(); rptViewer objview = new rptViewer(); //objSale.SetDataSource =; objrep.SetParameterValue("@mindate", txtMinDate.Value); objrep.SetParameterValue("@maxdate", txtmaxdate.Value); objview.crptViewer.ReportSource = objrep; objview.WindowState = FormWindowState.Normal; objview.ShowDialog(); } else { SaleByCusReport objSale = new SaleByCusReport(); rptViewer objView = new rptViewer(); objSale.SetParameterValue("@CusName", txtCusnam.Text); objView.crptViewer.ReportSource = objSale; objView.WindowState = FormWindowState.Normal; objView.ShowDialog(); } }
//private void SumDetailProduct() //{ // decimal sum = 0; // for (int i = 0; i < dgvProduct.Rows.Count; ++i) // { // sum += Convert.ToDecimal(resultTP); // } // resultGrand = Convert.ToDecimal(sum.ToString()); //} private void btnSave_Click(object sender, EventArgs e) { SaleInvoiceBL objProd = new SaleInvoiceBL(); for (int i = 0; i < dgvProduct.Rows.Count; ++i) { objProd.ProductID = Convert.ToInt32(dgvProduct.Rows[i].Cells[1].Value.ToString()); objProd.Quantity = Convert.ToInt32(dgvProduct.Rows[i].Cells[6].Value.ToString()); objProd.UpdateProd(); } PurchaseReturnBL objCtn = new PurchaseReturnBL(); for (int i = 0; i < dgvProduct.Rows.Count; ++i) { objCtn.ProductID = Convert.ToInt32(dgvProduct.Rows[i].Cells[1].Value.ToString()); objCtn.Ctn = Convert.ToDecimal(dgvProduct.Rows[i].Cells[5].Value.ToString()); objCtn.CtnUpdate(); } SaleInvoiceBL objsale = new SaleInvoiceBL(); decimal Ssum = 0; for (int i = 0; i < dgvProduct.Rows.Count; ++i) { objsale.InvoiceNo = Convert.ToInt32(txtInvoiceID.Text); objsale.ProductID = Convert.ToInt32(dgvProduct.Rows[i].Cells[1].Value.ToString()); objsale.Ctn = Convert.ToDecimal(dgvProduct.Rows[i].Cells[5].Value.ToString()); objsale.Quantity = Convert.ToInt32(dgvProduct.Rows[i].Cells[6].Value.ToString()); objsale.Discount = Convert.ToDecimal(dgvProduct.Rows[i].Cells[7].Value.ToString()); objsale.TotalAmount = Convert.ToDecimal(dgvProduct.Rows[i].Cells[8].Value.ToString()); decimal TP = Convert.ToDecimal(dgvProduct.Rows[i].Cells[3].Value.ToString()); objsale.RP = Convert.ToDecimal(dgvProduct.Rows[i].Cells[4].Value); decimal resultRP = (objsale.RP * objsale.Ctn) - objsale.Discount; decimal resultTP = (TP * objsale.Ctn); decimal detailP = Convert.ToDecimal(resultRP - resultTP); objsale.DetailProfit = detailP; Ssum += resultTP; objsale.SaveDetail(); } decimal grandtotal = Convert.ToDecimal(txtGrandTotal.Text); decimal InvoiceProfit = grandtotal - Ssum; SaleInvoiceBL objmas = new SaleInvoiceBL() { SaleDate = DateTime.Parse(txtInvoiceDate.Text), GrandTotal = Convert.ToDecimal(txtGrandTotal.Text), CustomerID = Convert.ToInt32(txtCusId.Text), Payment = Convert.ToDecimal(txtTotalPay.Text), DuePayment = Convert.ToDecimal(txtDuePay.Text), OrderBy = txtSalesman.Text, MasterProfit = InvoiceProfit }; objmas.SaveMaster(); SaleLedgerBL objLedger = new SaleLedgerBL(); objLedger.Invoiceno = Convert.ToInt32(txtInvoiceID.Text); objLedger.CustomerID = Convert.ToInt32(txtCusId.Text); objLedger.Credit = Convert.ToDecimal(txtDuePay.Text); objLedger.Debit = 0; objLedger.Date = Convert.ToDateTime(txtInvoiceDate.Text); objLedger.Balance = Convert.ToDecimal(txtnewBalance.Text); objLedger.Description = "Credit"; objLedger.Save(); (new SaleLedgerBL()).UpdateBalance(objLedger.Balance, objLedger.CustomerID); saleInvoiceReport objSale = new saleInvoiceReport(); rptViewer objview = new rptViewer(); //objSale.SetDataSource =; objSale.SetParameterValue("@InvoiceNo", txtInvoiceID.Text); SaleInvoiceBL obj = new SaleInvoiceBL() { InvoiceNo = Convert.ToInt32(txtInvoiceID.Text) }; DataTable dt = obj.Search(); if (dt.Rows.Count > 0) { objSale.SetDataSource(dt); } objview.crptViewer.ReportSource = objSale; objview.WindowState = FormWindowState.Normal; objview.ShowDialog(); ClearForm(); dgvProduct.DataSource = null; btnNew.Enabled = true; }
private void btnSave_Click(object sender, EventArgs e) { ReturnSaleBL objMas = new ReturnSaleBL() { Invoiceno = Convert.ToInt32(txtInvoiceID.Text), ReturnAmount = Convert.ToDecimal(txtBalance.Text), ReturnDate = DateTime.Parse(txtReturnDate.Text), TotalBill = Convert.ToDecimal(txtTotalBill.Text), ReturnCash = Convert.ToDecimal(txtReturnCash.Text), CustomerID = Convert.ToInt32(txtCusID.Text) }; ReturnSaleBL objDetail = new ReturnSaleBL(); for (int i = 0; i < dgvReturnItem.Rows.Count; i++) { objDetail.RInvoice = Convert.ToInt32(txtReturnID.Text); objDetail.ProductID = Convert.ToInt32(dgvReturnItem.Rows[i].Cells[2].Value.ToString()); objDetail.RP = Convert.ToDecimal(dgvReturnItem.Rows[i].Cells[4].Value.ToString()); objDetail.Ctn = Convert.ToDecimal(dgvReturnItem.Rows[i].Cells[5].Value.ToString()); objDetail.Quantity = Convert.ToInt32(dgvReturnItem.Rows[i].Cells[6].Value.ToString()); objDetail.Discount = Convert.ToDecimal(dgvReturnItem.Rows[i].Cells[7].Value.ToString()); objDetail.Amount = Convert.ToDecimal(dgvReturnItem.Rows[i].Cells[8].Value.ToString()); objDetail.SaveDetail(); } PurchaseInvoiceBL objPur = new PurchaseInvoiceBL(); for (int i = 0; i < dgvReturnItem.Rows.Count; i++) { objPur.ProductID = Convert.ToInt32(dgvReturnItem.Rows[0].Cells[2].Value.ToString()); objPur.Quantity = Convert.ToInt32(dgvReturnItem.Rows[0].Cells[6].Value.ToString()); objPur.ProdUpdate(); } PurchaseInvoiceBL objCtn = new PurchaseInvoiceBL(); for (int i = 0; i < dgvReturnItem.Rows.Count; i++) { objCtn.ProductID = Convert.ToInt32(dgvReturnItem.Rows[0].Cells[2].Value.ToString()); objCtn.Ctn = Convert.ToInt32(dgvReturnItem.Rows[0].Cells[5].Value.ToString()); objCtn.CtnUpdate(); } SaleLedgerBL objLedger = new SaleLedgerBL(); objLedger.RInvoice = Convert.ToInt32(txtReturnID.Text); objLedger.CustomerID = Convert.ToInt32(txtCusID.Text); objLedger.Debit = Convert.ToDecimal(txtBalance.Text); objLedger.Credit = 0; objLedger.Date = Convert.ToDateTime(txtReturnDate.Text); objLedger.Balance = Convert.ToDecimal(txtnewBalance.Text); objLedger.Description = "Debit"; objLedger.Save(); (new SaleLedgerBL()).UpdateBalance(objLedger.Balance, objLedger.CustomerID); //ReturnSaleBL objDue = new ReturnSaleBL() //{ // CustomerID = Convert.ToInt32(txtCusID.Text), // DuePayment = Convert.ToDecimal(txtBalance.Text) //}; //objDue.UpdateDueSub(); if (txtBalance.Text != "0.00") { SaleRecoveryBL objRec = new SaleRecoveryBL() { CustomerID = Convert.ToInt32(txtCusID.Text), RecoveryDate = Convert.ToDateTime(txtReturnDate.Text), RInvoice = Convert.ToInt32(txtReturnID.Text), ReturnCash = Convert.ToDecimal(txtBalance.Text) }; objRec.Save(); } objMas.SaveMaster(); SaleReturnReport objRep = new SaleReturnReport(); rptViewer objView = new rptViewer(); objRep.SetParameterValue("@RinvoiceNo", txtReturnID.Text); ReturnSaleBL obj = new ReturnSaleBL() { RInvoice = Convert.ToInt32(txtReturnID.Text) }; DataTable dt = obj.Select(); if (dt.Rows.Count > 0) { objRep.SetDataSource(dt); } objView.crptViewer.ReportSource = objRep; objView.WindowState = FormWindowState.Normal; objView.ShowDialog(); ClearForm(); btnNew.Enabled = true; }
private void btnSave_Click(object sender, EventArgs e) { PurchaseInvoiceBL objpur = new PurchaseInvoiceBL(); for (int i = 0; i < dgvProduct.Rows.Count; i++) { objpur.ProductID = Convert.ToInt32(dgvProduct.Rows[i].Cells[1].Value.ToString()); objpur.Quantity = Convert.ToInt32(dgvProduct.Rows[i].Cells[4].Value.ToString()); objpur.ProdUpdate(); } PurchaseInvoiceBL objCtn = new PurchaseInvoiceBL(); for (int i = 0; i < dgvProduct.Rows.Count; i++) { objCtn.ProductID = Convert.ToInt32(dgvProduct.Rows[i].Cells[1].Value.ToString()); objCtn.Ctn = Convert.ToInt32(dgvProduct.Rows[i].Cells[7].Value.ToString()); objCtn.CtnUpdate(); } PurchaseInvoiceBL objmas = new PurchaseInvoiceBL() { PInvoice = Convert.ToInt32(txtInvoiceID.Text), companyID = Convert.ToInt32(txtComID.Text), Discount = Convert.ToDecimal(txtBillDiscount.Text), PurchaseDate = DateTime.Parse(txtPurInvoiceDate.Text), TotalAmount = Convert.ToDecimal(txttotalAmount.Text), Payment = Convert.ToDecimal(txtTotalPay.Text), DuePayment = Convert.ToDecimal(txtPayDue.Text), furDiscount = Convert.ToDecimal(txtfurDiscount.Text), GrandTotal = Convert.ToDecimal(txtGrandTotal.Text) }; PurchaseInvoiceBL objDet = new PurchaseInvoiceBL(); for (int i = 0; i < dgvProduct.Rows.Count; i++) { objDet.PInvoice = Convert.ToInt32(txtInvoiceID.Text); objDet.ProductID = Convert.ToInt32(dgvProduct.Rows[i].Cells[1].Value.ToString()); objDet.TP = Convert.ToDecimal(dgvProduct.Rows[i].Cells[3].Value.ToString()); objDet.Quantity = Convert.ToInt32(dgvProduct.Rows[i].Cells[4].Value.ToString()); objDet.frieght = Convert.ToDecimal(dgvProduct.Rows[i].Cells[6].Value.ToString()); objDet.Ctn = Convert.ToDecimal(dgvProduct.Rows[i].Cells[7].Value.ToString()); objDet.Amount = Convert.ToDecimal(dgvProduct.Rows[i].Cells[8].Value.ToString()); objDet.SaveDetail(); } objmas.SaveMaster(); PurchaseLedgerBL objLedger = new PurchaseLedgerBL(); objLedger.PInvoice = Convert.ToInt32(txtInvoiceID.Text); objLedger.CompanyID = Convert.ToInt32(txtComID.Text); objLedger.Credit = Convert.ToDecimal(txtPayDue.Text); objLedger.Debit = 0; objLedger.Date = Convert.ToDateTime(txtPurInvoiceDate.Text); objLedger.Balance = Convert.ToDecimal(txtnewBalance.Text); objLedger.Description = "Debit"; objLedger.save(); (new PurchaseLedgerBL()).UpdateBalance(objLedger.Balance, objLedger.CompanyID); PurchaseInvoiceReport objretp = new PurchaseInvoiceReport(); rptViewer objView = new rptViewer(); objretp.SetParameterValue("@PInvoice", txtInvoiceID.Text); PurchaseInvoiceBL objBl = new PurchaseInvoiceBL() { PInvoice = Convert.ToInt32(txtInvoiceID.Text) }; var dt = objBl.Search(); if (dt != null) { objretp.SetDataSource(dt); objView.crptViewer.ReportSource = objretp; objView.WindowState = FormWindowState.Maximized; objView.ShowDialog(); } ClearForm(); ChkFrieghtOrder.Checked = false; btnNew.Enabled = true; }