/// <summary> /// 调用存储过程修改一个 /// </summary> /// <param name="info">实体对象</param> /// <returns>更新成功返回ture,否则返回false</returns> public static bool Join_ZhongKeResultsEdit(Entity.Join_ZhongKeResults info) { SqlParameter[] prams = { SqlDB.MakeInParam("@Id", SqlDbType.Int, 4, info.Id), SqlDB.MakeInParam("@UserId", SqlDbType.Int, 4, info.UserId), SqlDB.MakeInParam("@BeiDong", SqlDbType.Int, 4, info.BeiDong), SqlDB.MakeInParam("@YanXue", SqlDbType.Int, 4, info.YanXue), SqlDB.MakeInParam("@XinXiCaiJi", SqlDbType.Int, 4, info.XinXiCaiJi), SqlDB.MakeInParam("@FangFa", SqlDbType.Int, 4, info.FangFa), SqlDB.MakeInParam("@BiJiao", SqlDbType.Int, 4, info.BiJiao), SqlDB.MakeInParam("@ZiJian", SqlDbType.Int, 4, info.ZiJian), SqlDB.MakeInParam("@QuDao", SqlDbType.Int, 4, info.QuDao), SqlDB.MakeInParam("@FenXi", SqlDbType.Int, 4, info.FenXi), SqlDB.MakeInParam("@ZiKong", SqlDbType.Int, 4, info.ZiKong), SqlDB.MakeInParam("@GouTong", SqlDbType.Int, 4, info.GouTong), SqlDB.MakeInParam("@SiWei", SqlDbType.Int, 4, info.SiWei), SqlDB.MakeInParam("@ChengDan", SqlDbType.Int, 4, info.ChengDan), SqlDB.MakeInParam("@AddTime", SqlDbType.DateTime, 8, info.AddTime), }; int intReturnValue = 0; intReturnValue = SqlDB.ExecuteNonQuery(strCon, CommandType.StoredProcedure, "Join_ZhongKeResultsEdit", prams); if (intReturnValue == 1) { return(true); } return(false); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.Join_ZhongKeResults Join_ZhongKeResultsEntityGet(int Id) { Entity.Join_ZhongKeResults info = new Entity.Join_ZhongKeResults(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_ZhongKeResults] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.UserId = Basic.Utils.StrToInt(dt.Rows[0]["UserId"].ToString(), 0); info.BeiDong = Basic.Utils.StrToInt(dt.Rows[0]["BeiDong"].ToString(), 0); info.YanXue = Basic.Utils.StrToInt(dt.Rows[0]["YanXue"].ToString(), 0); info.XinXiCaiJi = Basic.Utils.StrToInt(dt.Rows[0]["XinXiCaiJi"].ToString(), 0); info.FangFa = Basic.Utils.StrToInt(dt.Rows[0]["FangFa"].ToString(), 0); info.BiJiao = Basic.Utils.StrToInt(dt.Rows[0]["BiJiao"].ToString(), 0); info.ZiJian = Basic.Utils.StrToInt(dt.Rows[0]["ZiJian"].ToString(), 0); info.QuDao = Basic.Utils.StrToInt(dt.Rows[0]["QuDao"].ToString(), 0); info.FenXi = Basic.Utils.StrToInt(dt.Rows[0]["FenXi"].ToString(), 0); info.ZiKong = Basic.Utils.StrToInt(dt.Rows[0]["ZiKong"].ToString(), 0); info.GouTong = Basic.Utils.StrToInt(dt.Rows[0]["GouTong"].ToString(), 0); info.SiWei = Basic.Utils.StrToInt(dt.Rows[0]["SiWei"].ToString(), 0); info.ChengDan = Basic.Utils.StrToInt(dt.Rows[0]["ChengDan"].ToString(), 0); info.AddTime = DateTime.Parse(dt.Rows[0]["AddTime"].ToString()); } return(info); }
/// <summary> /// 调用存储过程增加一个 /// </summary> /// <param name="info">实体对象</param> /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns> public static int Join_ZhongKeResultsAdd(Entity.Join_ZhongKeResults info) { SqlParameter[] prams = { SqlDB.MakeInParam("@UserId", SqlDbType.Int, 4, info.UserId), SqlDB.MakeInParam("@BeiDong", SqlDbType.Int, 4, info.BeiDong), SqlDB.MakeInParam("@YanXue", SqlDbType.Int, 4, info.YanXue), SqlDB.MakeInParam("@XinXiCaiJi", SqlDbType.Int, 4, info.XinXiCaiJi), SqlDB.MakeInParam("@FangFa", SqlDbType.Int, 4, info.FangFa), SqlDB.MakeInParam("@BiJiao", SqlDbType.Int, 4, info.BiJiao), SqlDB.MakeInParam("@ZiJian", SqlDbType.Int, 4, info.ZiJian), SqlDB.MakeInParam("@QuDao", SqlDbType.Int, 4, info.QuDao), SqlDB.MakeInParam("@FenXi", SqlDbType.Int, 4, info.FenXi), SqlDB.MakeInParam("@ZiKong", SqlDbType.Int, 4, info.ZiKong), SqlDB.MakeInParam("@GouTong", SqlDbType.Int, 4, info.GouTong), SqlDB.MakeInParam("@SiWei", SqlDbType.Int, 4, info.SiWei), SqlDB.MakeInParam("@ChengDan", SqlDbType.Int, 4, info.ChengDan), SqlDB.MakeInParam("@AddTime", SqlDbType.DateTime, 8, info.AddTime), }; return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(strCon, CommandType.StoredProcedure, "Join_ZhongKeResultsAdd", prams).ToString(), -1)); }