public ActionResult Edit(ColorWarehouse request) { var result = _colorWarehouseDa.Edit(request); if (result > 0) { return(Json(new { Status = true, Message = "Sửa kho màu thành công" })); } return(Json(new { Status = false, Message = "Sửa kho màu thất bại" })); }
public decimal Edit(ColorWarehouse model) { try { var spParameter = new SqlParameter[6]; #region Set param var parameter = new SqlParameter("@P_Id", SqlDbType.Int) { Direction = ParameterDirection.Input, Value = model.Id }; spParameter[0] = parameter; parameter = new SqlParameter("@P_Name", SqlDbType.NVarChar) { Direction = ParameterDirection.Input, Value = model.Name }; spParameter[1] = parameter; parameter = new SqlParameter("@P_Avatar", SqlDbType.NVarChar) { Direction = ParameterDirection.Input, Value = model.Avatar }; spParameter[2] = parameter; parameter = new SqlParameter("@P_Description", SqlDbType.NVarChar) { Direction = ParameterDirection.Input, Value = model.Description }; spParameter[3] = parameter; parameter = new SqlParameter("@P_Lstord", SqlDbType.Int) { Direction = ParameterDirection.Input, Value = model.Lstord }; spParameter[4] = parameter; parameter = new SqlParameter("@P_Return", SqlDbType.Int) { Direction = ParameterDirection.Output, Value = -1 }; spParameter[5] = parameter; #endregion SqlHelper.ExecuteNonQuery(ConfigInfo.ConnectString, CommandType.StoredProcedure, "PROC_COLOR_EDIT", spParameter); return(Convert.ToDecimal(spParameter[5].Value)); } catch (Exception ex) { Logger.Log.Error(ex.ToString()); return(-1); } }