示例#1
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool Join_AbilityResultsEdit(Entity.Join_AbilityResults info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@AbilityResultsId", SqlDbType.Int,   4, info.AbilityResultsId),
                SqlDB.MakeInParam("@UserId",           SqlDbType.Int,   4, info.UserId),
                SqlDB.MakeInParam("@Language",         SqlDbType.Float, 8, info.Language),
                SqlDB.MakeInParam("@Tissue",           SqlDbType.Float, 8, info.Tissue),
                SqlDB.MakeInParam("@Among",            SqlDbType.Float, 8, info.Among),
                SqlDB.MakeInParam("@Mathematics",      SqlDbType.Float, 8, info.Mathematics),
                SqlDB.MakeInParam("@Motion",           SqlDbType.Float, 8, info.Motion),
                SqlDB.MakeInParam("@Writing",          SqlDbType.Float, 8, info.Writing),
                SqlDB.MakeInParam("@Watch",            SqlDbType.Float, 8, info.Watch),
                SqlDB.MakeInParam("@Space",            SqlDbType.Float, 8, info.Space),
                SqlDB.MakeInParam("@Art",              SqlDbType.Float, 8, info.Art),
            };
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(strCon, CommandType.StoredProcedure, "Join_AbilityResultsEdit", prams);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }
示例#2
0
        public static Entity.Join_AbilityResults Join_AbilityResultsEntityGetByUserId(int UserId)
        {
            Entity.Join_AbilityResults info = new Entity.Join_AbilityResults();
            DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT TOP 1 * FROM [Join_AbilityResults] WHERE UserId = " + UserId + " ORDER BY AbilityResultsId DESC").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.AbilityResultsId = Basic.Utils.StrToInt(dt.Rows[0]["AbilityResultsId"].ToString(), 0);
                info.UserId           = Basic.Utils.StrToInt(dt.Rows[0]["UserId"].ToString(), 0);
                info.Among            = Basic.Utils.StrToFloat(dt.Rows[0]["Among"].ToString(), 0);
                info.Art         = Basic.Utils.StrToFloat(dt.Rows[0]["Among"].ToString(), 0);
                info.Language    = Basic.Utils.StrToFloat(dt.Rows[0]["Among"].ToString(), 0);
                info.Mathematics = Basic.Utils.StrToFloat(dt.Rows[0]["Among"].ToString(), 0);
                info.Motion      = Basic.Utils.StrToFloat(dt.Rows[0]["Among"].ToString(), 0);
                info.Space       = Basic.Utils.StrToFloat(dt.Rows[0]["Among"].ToString(), 0);
                info.Tissue      = Basic.Utils.StrToFloat(dt.Rows[0]["Among"].ToString(), 0);
                info.Watch       = Basic.Utils.StrToFloat(dt.Rows[0]["Among"].ToString(), 0);
                info.Writing     = Basic.Utils.StrToFloat(dt.Rows[0]["Among"].ToString(), 0);
                info.AddTime     = Basic.Utils.StrToDateTime(dt.Rows[0]["AddTime"].ToString());
                return(info);
            }
            else
            {
                return(null);
            }
        }
示例#3
0
        /// <summary>
        /// 获取某一个实体
        /// </summary>
        /// <param name="AbilityResultsId">标识</param>
        /// <returns>返回Entity</returns>
        public static Entity.Join_AbilityResults Join_AbilityResultsEntityGet(int AbilityResultsId)
        {
            Entity.Join_AbilityResults info = new Entity.Join_AbilityResults();
            DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_AbilityResults] WHERE AbilityResultsId = " + AbilityResultsId + ";").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.AbilityResultsId = Basic.Utils.StrToInt(dt.Rows[0]["AbilityResultsId"].ToString(), 0);
                info.UserId           = Basic.Utils.StrToInt(dt.Rows[0]["UserId"].ToString(), 0);
            }
            return(info);
        }
示例#4
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int Join_AbilityResultsAdd(Entity.Join_AbilityResults info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@UserId",      SqlDbType.Int,   4, info.UserId),
         SqlDB.MakeInParam("@Language",    SqlDbType.Float, 8, info.Language),
         SqlDB.MakeInParam("@Tissue",      SqlDbType.Float, 8, info.Tissue),
         SqlDB.MakeInParam("@Among",       SqlDbType.Float, 8, info.Among),
         SqlDB.MakeInParam("@Mathematics", SqlDbType.Float, 8, info.Mathematics),
         SqlDB.MakeInParam("@Motion",      SqlDbType.Float, 8, info.Motion),
         SqlDB.MakeInParam("@Writing",     SqlDbType.Float, 8, info.Writing),
         SqlDB.MakeInParam("@Watch",       SqlDbType.Float, 8, info.Watch),
         SqlDB.MakeInParam("@Space",       SqlDbType.Float, 8, info.Space),
         SqlDB.MakeInParam("@Art",         SqlDbType.Float, 8, info.Art),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(strCon, CommandType.StoredProcedure, "Join_AbilityResultsAdd", prams).ToString(), -1));
 }