Ejemplo n.º 1
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool FenShengYuanXiaoLuQuEdit(Entity.FenShengYuanXiaoLuQu info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@Id",                 SqlDbType.Int,       4, info.Id),
                SqlDB.MakeInParam("@DataYear",           SqlDbType.Int,       4, info.DataYear),
                SqlDB.MakeInParam("@ProvinceId",         SqlDbType.Int,       4, info.ProvinceId),
                SqlDB.MakeInParam("@ShengShi",           SqlDbType.NVarChar, 15, info.ShengShi),
                SqlDB.MakeInParam("@CengCi",             SqlDbType.Int,       4, info.CengCi),
                SqlDB.MakeInParam("@PiCi",               SqlDbType.Int,       4, info.PiCi),
                SqlDB.MakeInParam("@PcLeiBie",           SqlDbType.Int,       4, info.PcLeiBie),
                SqlDB.MakeInParam("@KeLei",              SqlDbType.Int,       4, info.KeLei),
                SqlDB.MakeInParam("@KeLeiMingCheng",     SqlDbType.NVarChar, 50, info.KeLeiMingCheng),
                SqlDB.MakeInParam("@SchoolId",           SqlDbType.Int,       4, info.SchoolId),
                SqlDB.MakeInParam("@SchoolProvinceId",   SqlDbType.Int,       4, info.SchoolProvinceId),
                SqlDB.MakeInParam("@YuanXiaoDaiMa",      SqlDbType.Char,      5, info.YuanXiaoDaiMa),
                SqlDB.MakeInParam("@YuanXiaoMingCheng",  SqlDbType.NVarChar, 64, info.YuanXiaoMingCheng),
                SqlDB.MakeInParam("@ZuiGaoFen",          SqlDbType.Int,       4, info.ZuiGaoFen),
                SqlDB.MakeInParam("@PingJunFen",         SqlDbType.Int,       4, info.PingJunFen),
                SqlDB.MakeInParam("@ZuiDiFen",           SqlDbType.Int,       4, info.ZuiDiFen),
                SqlDB.MakeInParam("@ZuiDaWeiCi",         SqlDbType.Int,       4, info.ZuiDaWeiCi),
                SqlDB.MakeInParam("@PingJunWeiCi",       SqlDbType.Int,       4, info.PingJunWeiCi),
                SqlDB.MakeInParam("@ZuiXiaoWeiCi",       SqlDbType.Int,       4, info.ZuiXiaoWeiCi),
                SqlDB.MakeInParam("@PiCiXian",           SqlDbType.Int,       4, info.PiCiXian),
                SqlDB.MakeInParam("@PingJunXianCha",     SqlDbType.Int,       4, info.PingJunXianCha),
                SqlDB.MakeInParam("@JiHuaShu",           SqlDbType.Int,       4, info.JiHuaShu),
                SqlDB.MakeInParam("@TouDangBiLi",        SqlDbType.Int,       4, info.TouDangBiLi),
                SqlDB.MakeInParam("@TouChuShu",          SqlDbType.Int,       4, info.TouChuShu),
                SqlDB.MakeInParam("@LuQuShu",            SqlDbType.Int,       4, info.LuQuShu),
                SqlDB.MakeInParam("@TouChuZuiDiFen",     SqlDbType.Int,       4, info.TouChuZuiDiFen),
                SqlDB.MakeInParam("@TouChuZuiGaoFen",    SqlDbType.Int,       4, info.TouChuZuiGaoFen),
                SqlDB.MakeInParam("@TouChuZuiXiaoWeiCi", SqlDbType.Int,       4, info.TouChuZuiXiaoWeiCi),
                SqlDB.MakeInParam("@TouChuZuiDaWeiCi",   SqlDbType.Int,       4, info.TouChuZuiDaWeiCi),
                SqlDB.MakeInParam("@IsBuLu",             SqlDbType.Int,       4, info.IsBuLu),
            };
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(CommandType.StoredProcedure, "FenShengYuanXiaoLuQuEdit", prams);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        public static Entity.FenShengYuanXiaoLuQu FenShengYuanXiaoLuQuAllEntityGet(int ProvinceId, int PiCi, int KeLei, int SchoolId, string strDataYear)
        {
            Entity.FenShengYuanXiaoLuQu info = new Entity.FenShengYuanXiaoLuQu();
            DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [" + DAL.Common.GetYearTableName("FenShengYuanXiaoLuQu", "All") + "] WHERE DataYear = " + strDataYear + " AND ProvinceId = " + ProvinceId + " AND PiCi = " + PiCi + " AND KeLei = " + KeLei + " AND SchoolId = " + SchoolId).Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.Id                 = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0);
                info.DataYear           = Basic.Utils.StrToInt(dt.Rows[0]["DataYear"].ToString(), 0);
                info.ProvinceId         = Basic.Utils.StrToInt(dt.Rows[0]["ProvinceId"].ToString(), 0);
                info.ShengShi           = dt.Rows[0]["ShengShi"].ToString();
                info.CengCi             = Basic.Utils.StrToInt(dt.Rows[0]["CengCi"].ToString(), 0);
                info.PiCi               = Basic.Utils.StrToInt(dt.Rows[0]["PiCi"].ToString(), 0);
                info.PcLeiBie           = Basic.Utils.StrToInt(dt.Rows[0]["PcLeiBie"].ToString(), 0);
                info.KeLei              = Basic.Utils.StrToInt(dt.Rows[0]["KeLei"].ToString(), 0);
                info.KeLeiMingCheng     = dt.Rows[0]["KeLeiMingCheng"].ToString();
                info.SchoolId           = Basic.Utils.StrToInt(dt.Rows[0]["SchoolId"].ToString(), 0);
                info.SchoolProvinceId   = Basic.Utils.StrToInt(dt.Rows[0]["SchoolProvinceId"].ToString(), 0);
                info.YuanXiaoDaiMa      = dt.Rows[0]["YuanXiaoDaiMa"].ToString();
                info.YuanXiaoMingCheng  = dt.Rows[0]["YuanXiaoMingCheng"].ToString();
                info.ZuiGaoFen          = Basic.Utils.StrToInt(dt.Rows[0]["ZuiGaoFen"].ToString(), 0);
                info.PingJunFen         = Basic.Utils.StrToInt(dt.Rows[0]["PingJunFen"].ToString(), 0);
                info.ZuiDiFen           = Basic.Utils.StrToInt(dt.Rows[0]["ZuiDiFen"].ToString(), 0);
                info.ZuiDaWeiCi         = Basic.Utils.StrToInt(dt.Rows[0]["ZuiDaWeiCi"].ToString(), 0);
                info.PingJunWeiCi       = Basic.Utils.StrToInt(dt.Rows[0]["PingJunWeiCi"].ToString(), 0);
                info.ZuiXiaoWeiCi       = Basic.Utils.StrToInt(dt.Rows[0]["ZuiXiaoWeiCi"].ToString(), 0);
                info.PiCiXian           = Basic.Utils.StrToInt(dt.Rows[0]["PiCiXian"].ToString(), 0);
                info.PingJunXianCha     = Basic.Utils.StrToInt(dt.Rows[0]["PingJunXianCha"].ToString(), 0);
                info.JiHuaShu           = Basic.Utils.StrToInt(dt.Rows[0]["JiHuaShu"].ToString(), 0);
                info.TouDangBiLi        = Basic.Utils.StrToInt(dt.Rows[0]["TouDangBiLi"].ToString(), 0);
                info.TouChuShu          = Basic.Utils.StrToInt(dt.Rows[0]["TouChuShu"].ToString(), 0);
                info.LuQuShu            = Basic.Utils.StrToInt(dt.Rows[0]["LuQuShu"].ToString(), 0);
                info.TouChuZuiDiFen     = Basic.Utils.StrToInt(dt.Rows[0]["TouChuZuiDiFen"].ToString(), 0);
                info.TouChuZuiGaoFen    = Basic.Utils.StrToInt(dt.Rows[0]["TouChuZuiGaoFen"].ToString(), 0);
                info.TouChuZuiXiaoWeiCi = Basic.Utils.StrToInt(dt.Rows[0]["TouChuZuiXiaoWeiCi"].ToString(), 0);
                info.TouChuZuiDaWeiCi   = Basic.Utils.StrToInt(dt.Rows[0]["TouChuZuiDaWeiCi"].ToString(), 0);
                info.IsBuLu             = Basic.Utils.StrToInt(dt.Rows[0]["IsBuLu"].ToString(), 0);
            }
            return(info);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int FenShengYuanXiaoLuQuAdd(Entity.FenShengYuanXiaoLuQu info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@DataYear",           SqlDbType.Int,       4, info.DataYear),
         SqlDB.MakeInParam("@ProvinceId",         SqlDbType.Int,       4, info.ProvinceId),
         SqlDB.MakeInParam("@ShengShi",           SqlDbType.NVarChar, 15, info.ShengShi),
         SqlDB.MakeInParam("@CengCi",             SqlDbType.Int,       4, info.CengCi),
         SqlDB.MakeInParam("@PiCi",               SqlDbType.Int,       4, info.PiCi),
         SqlDB.MakeInParam("@PcLeiBie",           SqlDbType.Int,       4, info.PcLeiBie),
         SqlDB.MakeInParam("@KeLei",              SqlDbType.Int,       4, info.KeLei),
         SqlDB.MakeInParam("@KeLeiMingCheng",     SqlDbType.NVarChar, 50, info.KeLeiMingCheng),
         SqlDB.MakeInParam("@SchoolId",           SqlDbType.Int,       4, info.SchoolId),
         SqlDB.MakeInParam("@SchoolProvinceId",   SqlDbType.Int,       4, info.SchoolProvinceId),
         SqlDB.MakeInParam("@YuanXiaoDaiMa",      SqlDbType.Char,      5, info.YuanXiaoDaiMa),
         SqlDB.MakeInParam("@YuanXiaoMingCheng",  SqlDbType.NVarChar, 64, info.YuanXiaoMingCheng),
         SqlDB.MakeInParam("@ZuiGaoFen",          SqlDbType.Int,       4, info.ZuiGaoFen),
         SqlDB.MakeInParam("@PingJunFen",         SqlDbType.Int,       4, info.PingJunFen),
         SqlDB.MakeInParam("@ZuiDiFen",           SqlDbType.Int,       4, info.ZuiDiFen),
         SqlDB.MakeInParam("@ZuiDaWeiCi",         SqlDbType.Int,       4, info.ZuiDaWeiCi),
         SqlDB.MakeInParam("@PingJunWeiCi",       SqlDbType.Int,       4, info.PingJunWeiCi),
         SqlDB.MakeInParam("@ZuiXiaoWeiCi",       SqlDbType.Int,       4, info.ZuiXiaoWeiCi),
         SqlDB.MakeInParam("@PiCiXian",           SqlDbType.Int,       4, info.PiCiXian),
         SqlDB.MakeInParam("@PingJunXianCha",     SqlDbType.Int,       4, info.PingJunXianCha),
         SqlDB.MakeInParam("@JiHuaShu",           SqlDbType.Int,       4, info.JiHuaShu),
         SqlDB.MakeInParam("@TouDangBiLi",        SqlDbType.Int,       4, info.TouDangBiLi),
         SqlDB.MakeInParam("@TouChuShu",          SqlDbType.Int,       4, info.TouChuShu),
         SqlDB.MakeInParam("@LuQuShu",            SqlDbType.Int,       4, info.LuQuShu),
         SqlDB.MakeInParam("@TouChuZuiDiFen",     SqlDbType.Int,       4, info.TouChuZuiDiFen),
         SqlDB.MakeInParam("@TouChuZuiGaoFen",    SqlDbType.Int,       4, info.TouChuZuiGaoFen),
         SqlDB.MakeInParam("@TouChuZuiXiaoWeiCi", SqlDbType.Int,       4, info.TouChuZuiXiaoWeiCi),
         SqlDB.MakeInParam("@TouChuZuiDaWeiCi",   SqlDbType.Int,       4, info.TouChuZuiDaWeiCi),
         SqlDB.MakeInParam("@IsBuLu",             SqlDbType.Int,       4, info.IsBuLu),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(CommandType.StoredProcedure, "FenShengYuanXiaoLuQuAdd", prams).ToString(), -1));
 }