public bool InsertShopData(ShopData objSD) { int res = 0; try { // var sql = @"INSERT INTO [dbo].[Shop_Details] (ShopNo,ShopName,Address1,Address2,City,District,Taluk,State,Country,PostalCode,SavedData,IsDeleted) // VALUES(@ShopNo,@ShopName,@Address1,@Address2,@City,@District,@Taluk,@State,@Country,@PostalCode,Getdate(),@IsDeleted)"; var sql = "[dbo].[InsertShopData]"; DynamicParameters param = new DynamicParameters(); param.Add("ShopName", objSD.ShopName); param.Add("Address1", objSD.Address1); param.Add("Address2", objSD.Address2); param.Add("City", objSD.City); param.Add("District", objSD.District); param.Add("Taluk", objSD.Taluk); param.Add("State", objSD.State); param.Add("Country", objSD.Country); param.Add("PostalCode", objSD.PostalCode); cn.Open(); res = cn.Execute(sql, param, commandType: CommandType.StoredProcedure); cn.Close(); } catch (Exception ex) { } finally { cn.Close(); } return Convert.ToBoolean(res); }
public ActionResult ShopDataNew(ShopData objSD) { bool res = false; //res = shopdatadao.InsertShopData(objSD); return RedirectToAction("ShopDataNew", "Shop"); }