private void btnDelete_Click(object sender, EventArgs e) { //ItemMasterModel objmodel = objItemMasterBl.GetItemNameByTaxCategoryname(tbxName.Text.Trim()); //if (objmodel.Name != null) //{ // MessageBox.Show("Can Not Delete Tax Name Under Tag With Item Name.." + objmodel.Name); // tbxName.Focus(); //} //if (objmodel.Name == null) //{ bool isDelete = objtaxbl.DeleteGSTCategorById(GST_Id); if (isDelete) { MessageBox.Show("Delete Successfully!"); ClearFormValues(); GST_Id = 0; Administration.List.GSTcategoryList frmList = new Administration.List.GSTcategoryList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillGSTCategoryInfo(); } //} }
private void ListTaxcategory_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Administration.List.GSTcategoryList frmList = new Administration.List.GSTcategoryList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillGSTCategoryInfo(); }
private void btnUpdate_Click(object sender, EventArgs e) { eSunSpeedDomain.TaxCategoryModel objGsttax = new TaxCategoryModel(); objGsttax.GSTName = tbxName.Text.Trim(); objGsttax.TaxCat_Type = cbxType.SelectedItem.ToString() == "" ? string.Empty : cbxType.SelectedItem.ToString(); //if (cbxType.SelectedIndex == 0) //{ objGsttax.TaxonMRP = Convert.ToBoolean(cbxTaxonmrp.SelectedItem.ToString() == "Y" ? true : false); objGsttax.TaxonMRPMode = cbxTaxonmrpmode.SelectedItem.ToString() == "" ? string.Empty : cbxTaxonmrpmode.SelectedItem.ToString(); //} objGsttax.SGST_Tax = Convert.ToDecimal(tbxSgstTax.Text.ToString() == string.Empty ? "0.00" : tbxSgstTax.Text.ToString()); objGsttax.IGST_Tax = Convert.ToDecimal(tbxIgstTax.Text.ToString() == string.Empty ? "0.00" : tbxIgstTax.Text.ToString()); objGsttax.CGST_Tax = Convert.ToDecimal(tbxCgstTax.Text.Trim() == string.Empty ? "0.00" : tbxCgstTax.Text.Trim()); objGsttax.CalculatedTaxon = Convert.ToDecimal(tbxCalculatedtaxon.Text.ToString() == string.Empty ? "0.00" : tbxCalculatedtaxon.Text.ToString()); //GST Tax Rates Grid TaxRatesModel objGSTTaxRates; List <TaxRatesModel> lstTaxRates = new List <TaxRatesModel>(); for (int i = 0; i < dvgGSTTaxrateDetails.DataRowCount; i++) { DataRow row = dvgGSTTaxrateDetails.GetDataRow(i); objGSTTaxRates = new TaxRatesModel(); objGSTTaxRates.wef = Convert.ToDateTime(row["wef"].ToString()); objGSTTaxRates.CGST_Tax = Convert.ToDecimal(row["CGST_Tax"].ToString() == string.Empty ? "0.00" : row["CGST_Tax"].ToString()); objGSTTaxRates.SGST_Tax = Convert.ToDecimal(row["SGST_Tax"].ToString() == string.Empty ? "0.00" : row["SGST_Tax"].ToString()); objGSTTaxRates.Tax_Type = row["Tax_Type"].ToString(); objGSTTaxRates.IGST_Tax = Convert.ToDecimal(row["IGST_Tax"].ToString() == string.Empty ? "0.00" : row["IGST_Tax"].ToString()); objGSTTaxRates.Cess = Convert.ToDecimal(row["Cess"].ToString() == string.Empty ? "0.00" : row["Cess"].ToString()); objGSTTaxRates.TaxRate_Id = Convert.ToInt32(row["TaxRate_Id"].ToString() == string.Empty ? "0" : row["TaxRate_Id"].ToString()); objGSTTaxRates.GSTID = Convert.ToInt32(row["GSTID"].ToString() == string.Empty ? "0" : row["GSTID"].ToString()); lstTaxRates.Add(objGSTTaxRates); } objGsttax.GSTTaxRates = lstTaxRates; objGsttax.GST_ID = Convert.ToInt32(GST_Id); bool isSuccess = objtaxbl.UpdateGSTDetails(objGsttax); if (isSuccess) { MessageBox.Show("Update Successfully!"); ClearFormValues(); GST_Id = 0; Administration.List.GSTcategoryList frmList = new Administration.List.GSTcategoryList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillGSTCategoryInfo(); } }