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

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

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