/// <summary> /// 调用存储过程修改一个 /// </summary> /// <param name="info">实体对象</param> /// <returns>更新成功返回ture,否则返回false</returns> public static bool Join_ProjectEditNew(Entity.Join_Project info) { SqlParameter[] prams = { SqlDB.MakeInParam("@ProjectId", SqlDbType.Int, 4, info.ProjectId), SqlDB.MakeInParam("@ProjectName", SqlDbType.NVarChar, 500, info.ProjectName), SqlDB.MakeInParam("@Content", SqlDbType.NText, 0, info.Content), SqlDB.MakeInParam("@TopPCid", SqlDbType.Int, 4, info.TopPCid), SqlDB.MakeInParam("@PCidList", SqlDbType.NVarChar, 100, info.PCidList), SqlDB.MakeInParam("@PCid", SqlDbType.Int, 4, info.PCid), SqlDB.MakeInParam("@ApplicantFile", SqlDbType.NVarChar, 500, info.ApplicantFile), SqlDB.MakeInParam("@IsValid", SqlDbType.Int, 4, info.IsValid), SqlDB.MakeInParam("@IsPause", SqlDbType.Int, 4, info.IsPause), SqlDB.MakeInParam("@AddTime", SqlDbType.DateTime, 8, info.AddTime), SqlDB.MakeInParam("@IsCheck", SqlDbType.Int, 4, info.IsCheck), SqlDB.MakeInParam("@IsHot", SqlDbType.Int, 4, info.IsHot), }; int intReturnValue = 0; intReturnValue = SqlDB.ExecuteNonQuery(strCon, CommandType.StoredProcedure, "Join_ProjectEditNew", prams); if (intReturnValue == 1) { return(true); } return(false); }
/// <summary> /// 暂停该值 /// </summary> /// <param name="ProjectId">自增id的值</param> /// <returns>暂停成功返回ture,否则返回false</returns> public static bool Join_ProjectPause(Entity.Join_Project info) { int intReturnValue = 0; intReturnValue = SqlDB.ExecuteNonQuery(strCon, CommandType.Text, "UPDATE [Join_Project] SET IsPause = " + info.IsPause + " WHERE ProjectId = " + info.ProjectId); if (intReturnValue == 1) { return(true); } return(false); }
/// <summary> /// 调用存储过程增加一个 /// </summary> /// <param name="info">实体对象</param> /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns> public static int Join_ProjectAdd(Entity.Join_Project info) { SqlParameter[] prams = { SqlDB.MakeInParam("@ProjectName", SqlDbType.NVarChar, 1000, info.ProjectName), SqlDB.MakeInParam("@Content", SqlDbType.NText, 0, info.Content), SqlDB.MakeInParam("@PCid", SqlDbType.Int, 4, info.PCid), SqlDB.MakeInParam("@ApplicantFile", SqlDbType.NVarChar, 500, info.ApplicantFile), }; return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(strCon, CommandType.StoredProcedure, "Join_ProjectAdd", prams).ToString(), -1)); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="ProjectId">标识</param> /// <returns>返回Entity</returns> public static Entity.Join_Project Join_ProjectEntityGet(int ProjectId) { Entity.Join_Project info = new Entity.Join_Project(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_Project] WHERE ProjectId = " + ProjectId + ";").Tables[0]; if (dt.Rows.Count > 0) { info.ProjectId = Basic.Utils.StrToInt(dt.Rows[0]["ProjectId"].ToString(), 0); info.ProjectName = dt.Rows[0]["ProjectName"].ToString(); info.Content = dt.Rows[0]["Content"].ToString(); info.TopPCid = Basic.Utils.StrToInt(dt.Rows[0]["TopPCid"].ToString(), 0); info.PCidList = dt.Rows[0]["PCidList"].ToString(); info.PCid = Basic.Utils.StrToInt(dt.Rows[0]["PCid"].ToString(), 0); info.ApplicantFile = dt.Rows[0]["ApplicantFile"].ToString(); info.IsValid = Basic.Utils.StrToInt(dt.Rows[0]["IsValid"].ToString(), 0); info.IsPause = Basic.Utils.StrToInt(dt.Rows[0]["IsPause"].ToString(), 0); info.IsCheck = Basic.Utils.StrToInt(dt.Rows[0]["IsCheck"].ToString(), 0); info.IsHot = Basic.Utils.StrToInt(dt.Rows[0]["IsHot"].ToString(), 0); info.AddTime = Basic.Utils.StrToDateTime(dt.Rows[0]["AddTime"].ToString()); } return(info); }