private void btnSave_Click(object sender, EventArgs e) { Tax tax = new Tax(); tax.TaxId = TaxId; tax.TaxName = txtTaxName.Text.Trim(); tax.TaxPercentage = Convert.ToDecimal(txtTaxPercentage.Text); masterService.UpdateTax(tax); CustomMessageBox.Show(string.Format(Constants.SUCCESSFULL_TAX_SAVE_MESSAGE, txtTaxName.Text), Constants.CONSTANT_INFORMATION, Sleek_Bill.Controls.CustomMessageBox.eDialogButtons.OK, CustomImages.GetDialogImage(Sleek_Bill.Controls.CustomImages.eCustomDialogImages.Success)); this.Close(); }
public void UpdateTax(Tax tax) { using (TransactionScope scope = new TransactionScope()) { Db.ExecuteNonQuery("usp_Tax_UpdateTax", CommandType.StoredProcedure, new DbParameter[] { Db.CreateParameter("TaxId", tax.TaxId), Db.CreateParameter("TaxName", tax.TaxName), Db.CreateParameter("TaxPercentage", tax.TaxPercentage) }); scope.Complete(); } }
public int AddTax(Tax tax) { using (TransactionScope scope = new TransactionScope()) { DbParameter parameter = null; parameter = Db.CreateParameter("TaxId", DbType.Int32, 8); parameter.Direction = ParameterDirection.Output; Db.ExecuteNonQuery("usp_Tax_InsertTaxDetails", CommandType.StoredProcedure, new DbParameter[] { parameter, Db.CreateParameter("TaxName", tax.TaxName), Db.CreateParameter("TaxPercentage", tax.TaxPercentage), Db.CreateParameter("Status", tax.Status), }); scope.Complete(); return (int)parameter.Value; } }
public void UpdateTax(Tax tax) { this.masterDBObj.UpdateTax(tax); }
public int AddTax(Tax tax) { return this.masterDBObj.AddTax(tax); }
private void btnAddTax_Click(object sender, EventArgs e) { Tax tax = new Tax(); tax.TaxName = txtTaxName.Text.Trim(); tax.TaxPercentage = Math.Round(Convert.ToDecimal(txtTaxPercentage.Text),2); tax.IsDefault = false; tax.Status = true; int taxId = masterService.AddTax(tax); CustomMessageBox.Show(Constants.SUCCESSFULL_TAX_ADD_MESSAGE, Constants.CONSTANT_INFORMATION, Sleek_Bill.Controls.CustomMessageBox.eDialogButtons.OK, CustomImages.GetDialogImage(Sleek_Bill.Controls.CustomImages.eCustomDialogImages.Success)); BindTaxDetailsDataGrid(); }