public static string SaveEditedAmount(NameValueCollection querystring) { decimal ddecimal; int dint; var ltoAmounts = new LTOEditAmount { intIDLtoLiquidationDetail = int.TryParse(querystring.Get("intIDLtoLiquidationDetail"), out dint) ? dint : 0, AccountCode = querystring.Get("AccountCode"), LtoORAmount = decimal.TryParse(querystring.Get("LtoORAmount"), out ddecimal) ? ddecimal : 0, LtoProcessingFee = decimal.TryParse(querystring.Get("LtoProcessingFee"), out ddecimal) ? ddecimal : 0, LtoSOP = decimal.TryParse(querystring.Get("LtoSOP"), out ddecimal) ? ddecimal : 0, LtoSalesReport = decimal.TryParse(querystring.Get("LtoSalesReport"), out ddecimal) ? ddecimal : 0, LtoTotalCA = decimal.TryParse(querystring.Get("LtoTotalCA"), out ddecimal) ? ddecimal : 0, OverOrShort = decimal.TryParse(querystring.Get("OverOrShort"), out ddecimal) ? ddecimal : 0, Company = querystring.Get("Company") }; UserProfile userprofile = WebCommon.GetUserProfile(); int intIDSecUser = int.Parse(userprofile.UserId.ToString()); return(LTOLiquidationDAL.SaveEditedAmount(ltoAmounts, intIDSecUser)); }
public static string SaveEditedAmount(LTOEditAmount amounts, int intIDSecUser) { try { string result; var dbUtil = new DatabaseManager(); using (var conn = new SqlConnection(dbUtil.getSQLConnectionString("MainDB"))) { conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "spLtoLiq_SaveEditedAmount"; cmd.CommandTimeout = 180; cmd.Parameters.AddWithValue("@intIDLtoLiquidationDetail", amounts.intIDLtoLiquidationDetail); cmd.Parameters.AddWithValue("@AccountCode", amounts.AccountCode); cmd.Parameters.AddWithValue("@LtoORAmount", amounts.LtoORAmount); cmd.Parameters.AddWithValue("@LtoProcessingFee", amounts.LtoProcessingFee); cmd.Parameters.AddWithValue("@LtoSOP", amounts.LtoSOP); cmd.Parameters.AddWithValue("@LtoSalesReport", amounts.LtoSalesReport); cmd.Parameters.AddWithValue("@LtoTotalCA", amounts.LtoTotalCA); cmd.Parameters.AddWithValue("@OverOrShort", amounts.OverOrShort); cmd.Parameters.AddWithValue("@intIDSecUser", intIDSecUser); cmd.Parameters.AddWithValue("@Company", amounts.Company); //"SNDC"); result = (string)cmd.ExecuteScalar(); } } return(result); } catch (Exception ex) { return(ex.ToString()); } }