public string InsertRetailer(Business.Retailers objRetailer) { string retInsertRet = string.Empty; try { using (SqlConnection conn = Connection.OpenConnection()) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "INSERT_RETAILER"; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Connection = conn; SqlParameter[] sqlParams=new SqlParameter [8]; SqlParameter RetailerCode = new SqlParameter("@RetailerCode", objRetailer.RetailerCode); RetailerCode.Direction = System.Data.ParameterDirection.Input; RetailerCode.DbType = System.Data.DbType.String; sqlParams[0] = RetailerCode; SqlParameter RetailerName = new SqlParameter("@RetailerName", objRetailer.RetailerName); RetailerName.Direction = System.Data.ParameterDirection.Input; RetailerName.DbType = System.Data.DbType.String; sqlParams[1] = RetailerName; SqlParameter EVD_No = new SqlParameter("EVD_No", objRetailer.EVD_No); EVD_No.Direction = System.Data.ParameterDirection.Input; EVD_No.DbType = System.Data.DbType.String; sqlParams[2] = EVD_No; SqlParameter Address = new SqlParameter("@Address", objRetailer.Address); Address.Direction = System.Data.ParameterDirection.Input; Address.DbType = System.Data.DbType.String; sqlParams[3] = Address; SqlParameter OpeningBalance = new SqlParameter("@OpeningBalance", objRetailer.OpeningBalance); OpeningBalance.Direction = System.Data.ParameterDirection.Input; OpeningBalance.DbType = System.Data.DbType.Currency; sqlParams[4] = OpeningBalance; SqlParameter WorkingHours = new SqlParameter("@WorkingHours", objRetailer.WorkingHours); WorkingHours.Direction = System.Data.ParameterDirection.Input; WorkingHours.DbType = System.Data.DbType.Double; sqlParams[5] = WorkingHours; SqlParameter ContactPerson_Name = new SqlParameter("@ContactPerson_Name", objRetailer.ContactPerson_Name); ContactPerson_Name.Direction = System.Data.ParameterDirection.Input; ContactPerson_Name.DbType = System.Data.DbType.String; sqlParams[6] = ContactPerson_Name; SqlParameter ContactPerson_Phone = new SqlParameter("@ContactPerson_Phone", objRetailer.ContactPerson_Phone); ContactPerson_Phone.Direction = System.Data.ParameterDirection.Input; ContactPerson_Phone.DbType = System.Data.DbType.Double; sqlParams[7] = ContactPerson_Phone;
cmd.Parameters.AddRange(sqlParams); cmd.ExecuteNonQuery(); retInsertRet = Msg.Value.ToString();
SqlParameter EVD_No = new SqlParameter("EVD_No", objRetailer.EVD_No);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)