예제 #1
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool JiuYeLvEdit(Entity.GKJiuYeLv info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@Id",                     SqlDbType.Int,        4, info.Id),
                SqlDB.MakeInParam("@Year",                   SqlDbType.Int,        4, info.Year),
                SqlDB.MakeInParam("@IsBen",                  SqlDbType.Int,        4, info.IsBen),
                SqlDB.MakeInParam("@ZhuanYeId",              SqlDbType.Int,        4, info.ZhuanYeId),
                SqlDB.MakeInParam("@ZhuanYeName",            SqlDbType.NVarChar, 200, info.ZhuanYeName),
                SqlDB.MakeInParam("@JiuYeLv",                SqlDbType.Int,        4, info.JiuYeLv),
                SqlDB.MakeInParam("@JiuYeLvA",               SqlDbType.NVarChar,  20, info.JiuYeLvA),
                SqlDB.MakeInParam("@JiuYeLv211",             SqlDbType.Int,        4, info.JiuYeLv211),
                SqlDB.MakeInParam("@JiuYeLvA211",            SqlDbType.NVarChar,  20, info.JiuYeLvA211),
                SqlDB.MakeInParam("@CentralCollegeJiuYeLv",  SqlDbType.Int,        4, info.CentralCollegeJiuYeLv),
                SqlDB.MakeInParam("@CentralCollegeJiuYeLvA", SqlDbType.NVarChar,  20, info.CentralCollegeJiuYeLvA),
                SqlDB.MakeInParam("@LocalCollegeJiuYeLv",    SqlDbType.Int,        4, info.LocalCollegeJiuYeLv),
                SqlDB.MakeInParam("@LocalCollegeJiuYeLvA",   SqlDbType.NVarChar,  20, info.LocalCollegeJiuYeLvA),
                SqlDB.MakeInParam("@BiYeShengGuiMo",         SqlDbType.NVarChar, 200, info.BiYeShengGuiMo),
                SqlDB.MakeInParam("@XueKeMenLei",            SqlDbType.Int,        4, info.XueKeMenLei),
                SqlDB.MakeInParam("@XueKeMenLeiName",        SqlDbType.NVarChar,  50, info.XueKeMenLeiName),
                SqlDB.MakeInParam("@ZhuanYeLei",             SqlDbType.Int,        4, info.ZhuanYeLei),
                SqlDB.MakeInParam("@ZhuanYeLeiName",         SqlDbType.NVarChar,  50, info.ZhuanYeLeiName),
            };
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(CommandType.StoredProcedure, "JiuYeLvEdit", prams);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }
예제 #2
0
        /// <summary>
        /// 获取某一个实体
        /// </summary>
        /// <param name="Id">标识</param>
        /// <returns>返回Entity</returns>
        public static Entity.GKJiuYeLv JiuYeLvEntityGet(int Id)
        {
            Entity.GKJiuYeLv info = new Entity.GKJiuYeLv();
            DataTable        dt   = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [JiuYeLv] WHERE Id = " + Id + ";").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.Id                     = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0);
                info.Year                   = Basic.Utils.StrToInt(dt.Rows[0]["Year"].ToString(), 0);
                info.IsBen                  = Basic.Utils.StrToInt(dt.Rows[0]["IsBen"].ToString(), 0);
                info.ZhuanYeId              = Basic.Utils.StrToInt(dt.Rows[0]["ZhuanYeId"].ToString(), 0);
                info.ZhuanYeName            = dt.Rows[0]["ZhuanYeName"].ToString();
                info.JiuYeLv                = Basic.Utils.StrToInt(dt.Rows[0]["JiuYeLv"].ToString(), 0);
                info.JiuYeLvA               = dt.Rows[0]["JiuYeLvA"].ToString();
                info.JiuYeLv211             = Basic.Utils.StrToInt(dt.Rows[0]["JiuYeLv211"].ToString(), 0);
                info.JiuYeLvA211            = dt.Rows[0]["JiuYeLvA211"].ToString();
                info.CentralCollegeJiuYeLv  = Basic.Utils.StrToInt(dt.Rows[0]["CentralCollegeJiuYeLv"].ToString(), 0);
                info.CentralCollegeJiuYeLvA = dt.Rows[0]["CentralCollegeJiuYeLvA"].ToString();
                info.LocalCollegeJiuYeLv    = Basic.Utils.StrToInt(dt.Rows[0]["LocalCollegeJiuYeLv"].ToString(), 0);
                info.LocalCollegeJiuYeLvA   = dt.Rows[0]["LocalCollegeJiuYeLvA"].ToString();
                info.BiYeShengGuiMo         = dt.Rows[0]["BiYeShengGuiMo"].ToString();
                info.XueKeMenLei            = Basic.Utils.StrToInt(dt.Rows[0]["XueKeMenLei"].ToString(), 0);
                info.XueKeMenLeiName        = dt.Rows[0]["XueKeMenLeiName"].ToString();
                info.ZhuanYeLei             = Basic.Utils.StrToInt(dt.Rows[0]["ZhuanYeLei"].ToString(), 0);
                info.ZhuanYeLeiName         = dt.Rows[0]["ZhuanYeLeiName"].ToString();
            }
            return(info);
        }
예제 #3
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int JiuYeLvAdd(Entity.GKJiuYeLv info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@Year",                   SqlDbType.Int,        4, info.Year),
         SqlDB.MakeInParam("@IsBen",                  SqlDbType.Int,        4, info.IsBen),
         SqlDB.MakeInParam("@ZhuanYeId",              SqlDbType.Int,        4, info.ZhuanYeId),
         SqlDB.MakeInParam("@ZhuanYeName",            SqlDbType.NVarChar, 200, info.ZhuanYeName),
         SqlDB.MakeInParam("@JiuYeLv",                SqlDbType.Int,        4, info.JiuYeLv),
         SqlDB.MakeInParam("@JiuYeLvA",               SqlDbType.NVarChar,  20, info.JiuYeLvA),
         SqlDB.MakeInParam("@JiuYeLv211",             SqlDbType.Int,        4, info.JiuYeLv211),
         SqlDB.MakeInParam("@JiuYeLvA211",            SqlDbType.NVarChar,  20, info.JiuYeLvA211),
         SqlDB.MakeInParam("@CentralCollegeJiuYeLv",  SqlDbType.Int,        4, info.CentralCollegeJiuYeLv),
         SqlDB.MakeInParam("@CentralCollegeJiuYeLvA", SqlDbType.NVarChar,  20, info.CentralCollegeJiuYeLvA),
         SqlDB.MakeInParam("@LocalCollegeJiuYeLv",    SqlDbType.Int,        4, info.LocalCollegeJiuYeLv),
         SqlDB.MakeInParam("@LocalCollegeJiuYeLvA",   SqlDbType.NVarChar,  20, info.LocalCollegeJiuYeLvA),
         SqlDB.MakeInParam("@BiYeShengGuiMo",         SqlDbType.NVarChar, 200, info.BiYeShengGuiMo),
         SqlDB.MakeInParam("@XueKeMenLei",            SqlDbType.Int,        4, info.XueKeMenLei),
         SqlDB.MakeInParam("@XueKeMenLeiName",        SqlDbType.NVarChar,  50, info.XueKeMenLeiName),
         SqlDB.MakeInParam("@ZhuanYeLei",             SqlDbType.Int,        4, info.ZhuanYeLei),
         SqlDB.MakeInParam("@ZhuanYeLeiName",         SqlDbType.NVarChar,  50, info.ZhuanYeLeiName),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(CommandType.StoredProcedure, "JiuYeLvAdd", prams).ToString(), -1));
 }