Exemplo n.º 1
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int Join_TestWLResultsAdd(Entity.Join_TestWLResults info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@UserId", SqlDbType.Int, 4, info.UserId),
         SqlDB.MakeInParam("@WK",     SqlDbType.Int, 4, info.WK),
         SqlDB.MakeInParam("@LK",     SqlDbType.Int, 4, info.LK)
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(strCon, CommandType.StoredProcedure, "Join_TestWLResultsAdd", prams).ToString(), -1));
 }
Exemplo n.º 2
0
        public static Entity.Join_TestWLResults Join_TestWLResultsEntityGetByUserId(int UserId)
        {
            Entity.Join_TestWLResults info = new Entity.Join_TestWLResults();
            DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_TestWLResults] WHERE UserId = " + UserId + " ORDER BY WlId DESC").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.WlId   = Basic.Utils.StrToInt(dt.Rows[0]["WlId"].ToString(), 0);
                info.UserId = Basic.Utils.StrToInt(dt.Rows[0]["UserId"].ToString(), 0);
                info.WK     = Basic.Utils.StrToInt(dt.Rows[0]["WK"].ToString(), 0);
                info.LK     = Basic.Utils.StrToInt(dt.Rows[0]["LK"].ToString(), 0);
            }
            return(info);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool Join_TestWLResultsEdit(Entity.Join_TestWLResults info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@WlId",   SqlDbType.Int, 4, info.WlId),
                SqlDB.MakeInParam("@UserId", SqlDbType.Int, 4, info.UserId),
                SqlDB.MakeInParam("@WK",     SqlDbType.Int, 4, info.WK),
                SqlDB.MakeInParam("@LK",     SqlDbType.Int, 4, info.LK)
            };
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(strCon, CommandType.StoredProcedure, "Join_TestWLResultsEdit", prams);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }