/// <summary> /// 更新一条数据 /// </summary> public void Update(string GUID, string UID, TB_ShoppingCartEntity UEntity) { //更新数据 int result = dal.Update(UEntity); CheckResult(result, ""); }
private void Update(Dictionary <string, object> dicPar) { //要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID", "CCode", "BusCode", "CCname", "TStatus", "PKCode", "AutoDelTime", "IsAutoDelete", "MaxNum" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } //获取参数信息 string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); string CCode = dicPar["CCode"].ToString(); string BusCode = dicPar["BusCode"].ToString(); string CCname = dicPar["CCname"].ToString(); string TStatus = dicPar["TStatus"].ToString(); string PKCode = dicPar["PKCode"].ToString(); string AutoDelTime = "1900-01-01 " + dicPar["AutoDelTime"].ToString(); string IsAutoDelete = dicPar["IsAutoDelete"].ToString(); string MaxNum = dicPar["MaxNum"].ToString(); //调用逻辑 TB_ShoppingCartEntity UEntity = bll.GetEntitySigInfo(" where pkcode='" + PKCode + "'"); UEntity.AutoDelTime = StringHelper.StringToDateTime(AutoDelTime); UEntity.IsAutoDelete = IsAutoDelete; UEntity.MaxNum = StringHelper.StringToInt(MaxNum); bll.Update(GUID, USER_ID, UEntity); ReturnResultJson(bll.oResult.Code, bll.oResult.Msg); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(TB_ShoppingCartEntity Entity) { SqlParameter[] sqlParameters = { new SqlParameter("@BusCode", Entity.BusCode), new SqlParameter("@CCode", Entity.CCode), new SqlParameter("@CCname", Entity.CCname), new SqlParameter("@TStatus", Entity.TStatus), new SqlParameter("@PKCode", Entity.PKCode), new SqlParameter("@AutoDelTime", Entity.AutoDelTime), new SqlParameter("@IsAutoDelete", Entity.IsAutoDelete), new SqlParameter("@MaxNum", Entity.MaxNum), }; return(DBHelper.ExecuteNonQuery("dbo.p_TB_ShoppingCart_Update", CommandType.StoredProcedure, sqlParameters)); }
/// <summary> /// 单行数据转实体对象 /// </summary> /// <param name="dr"></param> /// <returns></returns> private TB_ShoppingCartEntity SetEntityInfo(DataRow dr) { TB_ShoppingCartEntity Entity = new TB_ShoppingCartEntity(); Entity.Id = StringHelper.StringToLong(dr["Id"].ToString()); Entity.BusCode = dr["BusCode"].ToString(); Entity.CCode = dr["CCode"].ToString(); Entity.CCname = dr["CCname"].ToString(); Entity.TStatus = dr["TStatus"].ToString(); Entity.PKCode = dr["PKCode"].ToString(); Entity.AutoDelTime = StringHelper.StringToDateTime(dr["AutoDelTime"].ToString()); Entity.IsAutoDelete = dr["IsAutoDelete"].ToString(); Entity.MaxNum = StringHelper.StringToInt(dr["MaxNum"].ToString()); return(Entity); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ref TB_ShoppingCartEntity Entity) { intReturn = 0; SqlParameter[] sqlParameters = { new SqlParameter("@BusCode", Entity.BusCode), new SqlParameter("@CCode", Entity.CCode), new SqlParameter("@CCname", Entity.CCname), new SqlParameter("@TStatus", Entity.TStatus), new SqlParameter("@PKCode", Entity.PKCode), new SqlParameter("@AutoDelTime", Entity.AutoDelTime), new SqlParameter("@IsAutoDelete", Entity.IsAutoDelete), new SqlParameter("@MaxNum", Entity.MaxNum), }; sqlParameters[4].Direction = ParameterDirection.Output; intReturn = DBHelper.ExecuteNonQuery("dbo.p_TB_ShoppingCart_Add", CommandType.StoredProcedure, sqlParameters); if (intReturn == 0) { Entity.PKCode = sqlParameters[4].Value.ToString(); } return(intReturn); }
/// <summary> /// 检验表单数据 /// </summary> /// <returns></returns> public bool CheckPageInfo(string type, string BusCode, string CCname, string TStatus, string PKCode, string AutoDelTime, string IsAutoDelete, string MaxNum, string CCode) { bool rel = false; try { Entity = new TB_ShoppingCartEntity(); Entity.Id = 0; Entity.BusCode = BusCode; Entity.CCode = CCode; Entity.CCname = CCname; Entity.TStatus = TStatus; Entity.PKCode = PKCode; Entity.AutoDelTime = StringHelper.StringToDateTime(AutoDelTime); Entity.IsAutoDelete = IsAutoDelete; Entity.MaxNum = StringHelper.StringToInt(MaxNum); rel = true; } catch (System.Exception) { } return(rel); }