private List <SqlParameter> SetValuesInTaxFormula(TaxFormulaInfo taxformula) { List <SqlParameter> sqlParams = new List <SqlParameter>(); if (taxformula.TaxFormulaId != 0) { sqlParams.Add(new SqlParameter("@TaxFormulaId", taxformula.TaxFormulaId)); } else { sqlParams.Add(new SqlParameter("CreatedDate", taxformula.CreatedDate)); sqlParams.Add(new SqlParameter("CreatedBy", taxformula.CreatedBy)); } sqlParams.Add(new SqlParameter("@TaxFormulaName", taxformula.TaxFormulaName)); Logger.Debug("TaxFormula Controller TaxFormulaName:" + taxformula.TaxFormulaName); sqlParams.Add(new SqlParameter("@IsActive", taxformula.IsActive)); Logger.Debug("TaxFormula Controller IsActive:" + taxformula.IsActive); sqlParams.Add(new SqlParameter("@UpdatedDate", taxformula.UpdatedDate)); sqlParams.Add(new SqlParameter("@UpdatedBy", taxformula.UpdatedBy)); return(sqlParams); }
public void UpdateTaxFormula(TaxFormulaInfo taxformula) { _sqlHelper.ExecuteNonQuery(SetValuesInTaxFormula(taxformula), Storeprocedures.spUpdateTaxFormula.ToString(), CommandType.StoredProcedure); foreach (var item in taxformula.TaxFormulaCharges) { InsertTaxFormulaCharge(item, taxformula.TaxFormulaId); } }
public TaxFormulaInfo GetTaxFormulaDDLValues(DataRow dr) { TaxFormulaInfo retVal = new TaxFormulaInfo(); retVal.TaxFormulaId = Convert.ToInt32(dr["TaxFormulaId"]); retVal.TaxFormulaName = Convert.ToString(dr["TaxFormulaName"]); return(retVal); }
public int InsertTaxFormula(TaxFormulaInfo taxformula) { int taxFormulaId = 0; taxFormulaId = Convert.ToInt32(_sqlHelper.ExecuteScalerObj(SetValuesInTaxFormula(taxformula), Storeprocedures.spInsertTaxFormula.ToString(), CommandType.StoredProcedure)); foreach (var item in taxformula.TaxFormulaCharges) { InsertTaxFormulaCharge(item, taxFormulaId); } return(taxFormulaId); }
public TaxFormulaViewModel() { TaxFormula = new TaxFormulaInfo(); TaxFormulas = new List <TaxFormulaInfo>(); Filter = new TaxFormulaFilter(); Pager = new PaginationInfo(); FriendlyMessage = new List <FriendlyMessage>(); Charges = new List <ChargesInfo>(); TaxFormulaCharges = new List <TaxFormulaChargesInfo>(); }
private TaxFormulaInfo GetTaxFormulaValues(DataRow dr) { TaxFormulaInfo taxFormula = new TaxFormulaInfo(); taxFormula.TaxFormulaId = Convert.ToInt32(dr["TaxFormulaId"]); if (!dr.IsNull("TaxFormulaName")) { taxFormula.TaxFormulaName = Convert.ToString(dr["TaxFormulaName"]); } if (!dr.IsNull("IsActive")) { taxFormula.IsActive = Convert.ToBoolean(dr["IsActive"]); } return(taxFormula); }
public TaxFormulaInfo GetTaxFormulaById(int taxFormulaId) { List <SqlParameter> sqlParam = new List <SqlParameter>(); TaxFormulaInfo taxFormula = new TaxFormulaInfo(); sqlParam.Add(new SqlParameter("@TaxFormulaId", taxFormulaId)); DataTable dt = _sqlHelper.ExecuteDataTable(sqlParam, Storeprocedures.spGetTaxFormulaById.ToString(), CommandType.StoredProcedure); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { taxFormula = GetTaxFormulaValues(dr); } } return(taxFormula); }