Пример #1
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool Join_ProfessionResultsEdit(Entity.Join_ProfessionResults info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@ProfessionResultsId", SqlDbType.Int, 4, info.ProfessionResultsId),
                SqlDB.MakeInParam("@UserId",              SqlDbType.Int, 4, info.UserId),
                SqlDB.MakeInParam("@Group1",              SqlDbType.Int, 4, info.Group1),
                SqlDB.MakeInParam("@Group2",              SqlDbType.Int, 4, info.Group2),
                SqlDB.MakeInParam("@Group3",              SqlDbType.Int, 4, info.Group3),
                SqlDB.MakeInParam("@Group4",              SqlDbType.Int, 4, info.Group4),
                SqlDB.MakeInParam("@Group5",              SqlDbType.Int, 4, info.Group5),
                SqlDB.MakeInParam("@Group6",              SqlDbType.Int, 4, info.Group6),
                SqlDB.MakeInParam("@Group7",              SqlDbType.Int, 4, info.Group7),
                SqlDB.MakeInParam("@Group8",              SqlDbType.Int, 4, info.Group8),
                SqlDB.MakeInParam("@Group9",              SqlDbType.Int, 4, info.Group9),
                SqlDB.MakeInParam("@Group10",             SqlDbType.Int, 4, info.Group10),
                SqlDB.MakeInParam("@Group11",             SqlDbType.Int, 4, info.Group11),
                SqlDB.MakeInParam("@Group12",             SqlDbType.Int, 4, info.Group12),
                SqlDB.MakeInParam("@Group13",             SqlDbType.Int, 4, info.Group13),
            };
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(strCon, CommandType.StoredProcedure, "Join_ProfessionResultsEdit", prams);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }
Пример #2
0
        public static Entity.Join_ProfessionResults Join_ProfessionResultsEntityGetByUserId(int UserId)
        {
            Entity.Join_ProfessionResults info = new Entity.Join_ProfessionResults();
            DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT top 1 * FROM [Join_ProfessionResults] WHERE UserId = " + UserId + " ORDER BY ProfessionResultsId DESC").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.ProfessionResultsId = Basic.Utils.StrToInt(dt.Rows[0]["ProfessionResultsId"].ToString(), 0);
                info.UserId  = Basic.Utils.StrToInt(dt.Rows[0]["UserId"].ToString(), 0);
                info.Group1  = Basic.Utils.StrToInt(dt.Rows[0]["Group1"].ToString(), 0);
                info.Group2  = Basic.Utils.StrToInt(dt.Rows[0]["Group2"].ToString(), 0);
                info.Group3  = Basic.Utils.StrToInt(dt.Rows[0]["Group3"].ToString(), 0);
                info.Group4  = Basic.Utils.StrToInt(dt.Rows[0]["Group4"].ToString(), 0);
                info.Group5  = Basic.Utils.StrToInt(dt.Rows[0]["Group5"].ToString(), 0);
                info.Group6  = Basic.Utils.StrToInt(dt.Rows[0]["Group6"].ToString(), 0);
                info.Group7  = Basic.Utils.StrToInt(dt.Rows[0]["Group7"].ToString(), 0);
                info.Group8  = Basic.Utils.StrToInt(dt.Rows[0]["Group8"].ToString(), 0);
                info.Group9  = Basic.Utils.StrToInt(dt.Rows[0]["Group9"].ToString(), 0);
                info.Group10 = Basic.Utils.StrToInt(dt.Rows[0]["Group10"].ToString(), 0);
                info.Group11 = Basic.Utils.StrToInt(dt.Rows[0]["Group11"].ToString(), 0);
                info.Group12 = Basic.Utils.StrToInt(dt.Rows[0]["Group12"].ToString(), 0);
                info.Group13 = Basic.Utils.StrToInt(dt.Rows[0]["Group13"].ToString(), 0);
            }
            return(info);
        }
Пример #3
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int Join_ProfessionResultsAdd(Entity.Join_ProfessionResults info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@UserId",  SqlDbType.Int, 4, info.UserId),
         SqlDB.MakeInParam("@Group1",  SqlDbType.Int, 4, info.Group1),
         SqlDB.MakeInParam("@Group2",  SqlDbType.Int, 4, info.Group2),
         SqlDB.MakeInParam("@Group3",  SqlDbType.Int, 4, info.Group3),
         SqlDB.MakeInParam("@Group4",  SqlDbType.Int, 4, info.Group4),
         SqlDB.MakeInParam("@Group5",  SqlDbType.Int, 4, info.Group5),
         SqlDB.MakeInParam("@Group6",  SqlDbType.Int, 4, info.Group6),
         SqlDB.MakeInParam("@Group7",  SqlDbType.Int, 4, info.Group7),
         SqlDB.MakeInParam("@Group8",  SqlDbType.Int, 4, info.Group8),
         SqlDB.MakeInParam("@Group9",  SqlDbType.Int, 4, info.Group9),
         SqlDB.MakeInParam("@Group10", SqlDbType.Int, 4, info.Group10),
         SqlDB.MakeInParam("@Group11", SqlDbType.Int, 4, info.Group11),
         SqlDB.MakeInParam("@Group12", SqlDbType.Int, 4, info.Group12),
         SqlDB.MakeInParam("@Group13", SqlDbType.Int, 4, info.Group13),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(strCon, CommandType.StoredProcedure, "Join_ProfessionResultsAdd", prams).ToString(), -1));
 }