Beispiel #1
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int Join_AbilityTestAdd(Entity.Join_AbilityTest info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@AbilityNumber", SqlDbType.Int,        4, info.AbilityNumber),
         SqlDB.MakeInParam("@AbilityTitle",  SqlDbType.NVarChar, 500, info.AbilityTitle),
         SqlDB.MakeInParam("@GroupNumber",   SqlDbType.Int,        4, info.GroupNumber),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(strCon, CommandType.StoredProcedure, "Join_AbilityTestAdd", prams).ToString(), -1));
 }
Beispiel #2
0
        /// <summary>
        /// 获取某一个实体
        /// </summary>
        /// <param name="AbilityId">标识</param>
        /// <returns>返回Entity</returns>
        public static Entity.Join_AbilityTest Join_AbilityTestEntityGet(int AbilityId)
        {
            Entity.Join_AbilityTest info = new Entity.Join_AbilityTest();
            DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_AbilityTest] WHERE AbilityId = " + AbilityId + ";").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.AbilityId     = Basic.Utils.StrToInt(dt.Rows[0]["AbilityId"].ToString(), 0);
                info.AbilityNumber = Basic.Utils.StrToInt(dt.Rows[0]["AbilityNumber"].ToString(), 0);
                info.AbilityTitle  = dt.Rows[0]["AbilityTitle"].ToString();
                info.GroupNumber   = Basic.Utils.StrToInt(dt.Rows[0]["GroupNumber"].ToString(), 0);
            }
            return(info);
        }
Beispiel #3
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool Join_AbilityTestEdit(Entity.Join_AbilityTest info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@AbilityId",     SqlDbType.Int,        4, info.AbilityId),
                SqlDB.MakeInParam("@AbilityNumber", SqlDbType.Int,        4, info.AbilityNumber),
                SqlDB.MakeInParam("@AbilityTitle",  SqlDbType.NVarChar, 500, info.AbilityTitle),
                SqlDB.MakeInParam("@GroupNumber",   SqlDbType.Int,        4, info.GroupNumber),
            };
            int intReturnValue = 0;

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