private void ListSaleType_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Administration.List.SalestypeList frmSaleList = new Administration.List.SalestypeList(); frmSaleList.StartPosition = FormStartPosition.CenterParent; frmSaleList.ShowDialog(); FillSalesTypeInfo(); }
private void btnDelete_Click(object sender, EventArgs e) { bool isDelete = objSaleBL.DeleteSaleType(SalesId); if (isDelete) { MessageBox.Show("Delete Successfully!"); SalesId = 0; Administration.List.SalestypeList frmSaleList = new Administration.List.SalestypeList(); frmSaleList.StartPosition = FormStartPosition.CenterParent; frmSaleList.ShowDialog(); FillSalesTypeInfo(); } }
private void btnUpdate_Click(object sender, EventArgs e) { objSaleModel = new SaleTypeModel(); objSaleModel.SalesType = tbxSaleType.Text.Trim(); //this GroupBox for sales Account Information of RadioButton objSaleModel.typeSpecifyHereSingleAccount = rbngrpSalesAcInf.SelectedIndex == 0 ? true : false; if (objSaleModel.typeSpecifyHereSingleAccount) { objSaleModel.LedgerAccountBox = cbxLedgerAccount.Text.Trim() == null ? string.Empty : cbxLedgerAccount.Text.Trim(); } objSaleModel.typeDifferentTaxRate = rbngrpSalesAcInf.SelectedIndex == 1 ? true : false; objSaleModel.typeSpecifyINVoucher = rbngrpSalesAcInf.SelectedIndex == 2 ? true : false; //TaxationType: RadioButton Group if (rbngrpTaxation.SelectedIndex == 0) { objSaleModel.typeTaxable = true; } if (rbngrpTaxation.SelectedIndex == 1) { objSaleModel.typeAgainstSTFrom = true; } if (rbngrpTaxation.SelectedIndex == 2) { objSaleModel.typeExempt = true; } if (rbngrpTaxation.SelectedIndex == 3) { objSaleModel.typeLUMSumDealer = true; } if (rbngrpTaxation.SelectedIndex == 4) { objSaleModel.typeMultiTax = true; } if (rbngrpTaxation.SelectedIndex == 5) { objSaleModel.typeTaxpaid = true; } if (rbngrpTaxation.SelectedIndex == 6) { objSaleModel.typeTaxFree = true; } if (rbngrpTaxation.SelectedIndex == 7) { objSaleModel.typeUnRegDealer = true; } //Region Radio Button GroupBox if (rbngrpRegion.SelectedIndex == 0) { objSaleModel.TypeLocal = true; } if (rbngrpRegion.SelectedIndex == 1) { objSaleModel.TypeCentral = true; } //other Information Group if (objSaleModel.typeTaxable) { if (objSaleModel.TypeLocal) { objSaleModel.TaxInvoice = cbxTaxInvoiceyesno.SelectedItem.ToString().Equals("Y") ? true : false; } objSaleModel.VatReturnCategory = cbxVatreturnCategory.SelectedItem.ToString(); objSaleModel.SkipVatorSaleTaxReport = cbxVatorSalesTaxReports.SelectedItem.ToString().Equals("Y") ? true : false; } if (objSaleModel.typeMultiTax) { if (objSaleModel.TypeLocal) { objSaleModel.TaxInvoice = cbxTaxInvoiceyesno.SelectedItem.ToString().Equals("Y") ? true : false; } objSaleModel.CalculateTaxonItemMRP = cbxTaxonItemmrp.SelectedItem.ToString().Equals("Y") ? true : false; objSaleModel.TaxInclusiveItemPrice = cbxTaxInclItemPrice.SelectedItem.ToString().Equals("Y") ? true : false; objSaleModel.CalculatedTax = Convert.ToDecimal(tbxCalculatedtax.Text.Trim() == string.Empty ? "0.00" : tbxCalculatedtax.Text.Trim()); objSaleModel.VatReturnCategory = cbxVatreturnCategory.SelectedItem.ToString(); objSaleModel.SkipVatorSaleTaxReport = cbxVatorSalesTaxReports.SelectedItem.ToString().Equals("Y") ? true : false; objSaleModel.AdjustTaxinSaleAccount = cbxAdTaxinSaleAmt.SelectedItem.ToString().Equals("Y") ? true : false; if (objSaleModel.typeDifferentTaxRate == false) { objSaleModel.TaxAccount = cbxTaxAccount.SelectedItem.ToString(); } } if (objSaleModel.typeAgainstSTFrom) { if (objSaleModel.TypeLocal) { objSaleModel.TaxInvoice = cbxTaxInvoiceyesno.SelectedItem.ToString().Equals("Y") ? true : false; } objSaleModel.VatReturnCategory = cbxVatreturnCategory.SelectedItem.ToString(); objSaleModel.SkipVatorSaleTaxReport = cbxVatorSalesTaxReports.SelectedItem.ToString().Equals("Y") ? true : false; if (objSaleModel.typeAgainstSTFrom) { objSaleModel.IssueSTFrom = cbxIssueSTform.SelectedItem.ToString().Equals("Y") ? true : false; if (objSaleModel.IssueSTFrom) { objSaleModel.FromIssuable = cbxFormIssuable.SelectedItem.ToString(); } objSaleModel.ReceiveSTForm = cbxIssueSTform.SelectedItem.ToString().Equals("Y") ? true : false; if (objSaleModel.IssueSTFrom) { objSaleModel.FromReceivable = cbxFormIssuable.SelectedItem.ToString(); } } objSaleModel.TaxinPercentage = Convert.ToDecimal(tbxTaxPer.Text.Trim() == string.Empty ? "0.00" : tbxTaxPer.Text.Trim()); objSaleModel.SurchargeInPercentage = Convert.ToDecimal(tbxSurchargePer.Text.Trim() == string.Empty ? "0.00" : tbxSurchargePer.Text.Trim()); objSaleModel.freezeTaxinSales = cbxFreezeTaxinsale.SelectedItem.ToString().Equals("Y") ? true : false; objSaleModel.freezeTaxinSalesReturn = cbxFreezeTaxinSaleReturn.SelectedItem.ToString().Equals("Y") ? true : false; } if (objSaleModel.typeTaxpaid || objSaleModel.typeExempt || objSaleModel.typeTaxFree) { objSaleModel.VatReturnCategory = cbxVatreturnCategory.SelectedItem.ToString(); objSaleModel.SkipVatorSaleTaxReport = cbxVatorSalesTaxReports.SelectedItem.ToString().Equals("Y") ? true : false; } //if Enable MultiTax Will Show on other Information Group //Tax Calculation objSaleModel.SingleTaxRate = rbngrpTaxcalculation.SelectedIndex == 0 ? true : false; objSaleModel.MultiTaxRate = rbngrpTaxcalculation.SelectedIndex == 1 ? true : false; if (objSaleModel.SingleTaxRate) { objSaleModel.TaxinPercentage = Convert.ToDecimal(tbxTaxPer.Text.Trim() == string.Empty ? "0.00" : tbxTaxPer.Text.Trim()); objSaleModel.SurchargeInPercentage = Convert.ToDecimal(tbxSurchargePer.Text.Trim() == string.Empty ? "0.00" : tbxSurchargePer.Text.Trim()); objSaleModel.freezeTaxinSales = cbxFreezeTaxinsale.SelectedItem.ToString().Equals("Y") ? true : false; objSaleModel.freezeTaxinSalesReturn = cbxFreezeTaxinSaleReturn.SelectedItem.ToString().Equals("Y") ? true : false; } if (objSaleModel.MultiTaxRate) { if (objSaleModel.typeSpecifyHereSingleAccount) { objSaleModel.servicesLedgerBox = cbxServicesAccLedger.SelectedItem.ToString(); } } //Type of Transaction on Region GrupBox Sub objSaleModel.TypeStockTransfer = rbngrpTranction.SelectedIndex == 0 ? true : false; objSaleModel.ExportNormal = rbngrpTranction.SelectedIndex == 1 ? true : false; objSaleModel.SaleinTransit = rbngrpTranction.SelectedIndex == 2 ? true : false; objSaleModel.TypeOther = rbngrpTranction.SelectedIndex == 3 ? true : false; objSaleModel.ExportHighsea = rbngrpTranction.SelectedIndex == 4 ? true : false; objSaleModel.InvoiceHeading = tbxInvoiceHeading.Text.Trim() == null ? string.Empty : tbxInvoiceHeading.Text.Trim(); objSaleModel.InvoiceDescription = tbxInvoiceDescription.Text.Trim() == null ? string.Empty : tbxInvoiceDescription.Text.Trim(); objSaleModel.Sale_Id = SalesId; bool isSuccess = objSaleBL.UpdateSalestype(objSaleModel); if (isSuccess) { MessageBox.Show("Update Successfully!"); SalesId = 0; Administration.List.SalestypeList frmSaleList = new Administration.List.SalestypeList(); frmSaleList.StartPosition = FormStartPosition.CenterParent; frmSaleList.ShowDialog(); FillSalesTypeInfo(); } }