コード例 #1
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool ProvincePiCiEdit(Entity.ProvincePiCi info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@Id",         SqlDbType.Int,        4, info.Id),
                SqlDB.MakeInParam("@ProvinceId", SqlDbType.Int,        4, info.ProvinceId),
                SqlDB.MakeInParam("@LeiBie",     SqlDbType.Int,        4, info.LeiBie),
                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("@PcName",     SqlDbType.NVarChar,  50, info.PcName),
                SqlDB.MakeInParam("@PcIntro",    SqlDbType.NVarChar, 500, info.PcIntro),
                SqlDB.MakeInParam("@CkFsx",      SqlDbType.Int,        4, info.CkFsx),
                SqlDB.MakeInParam("@MajorCount", SqlDbType.Int,        4, info.MajorCount),
                SqlDB.MakeInParam("@IsPause",    SqlDbType.Int,        4, info.IsPause),
                SqlDB.MakeInParam("@ShowOrder",  SqlDbType.Int,        4, info.ShowOrder),
            };
            int intReturnValue = 0;

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

            if (dt.Rows.Count > 0)
            {
                info.Id         = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0);
                info.ProvinceId = Basic.Utils.StrToInt(dt.Rows[0]["ProvinceId"].ToString(), 0);
                info.LeiBie     = Basic.Utils.StrToInt(dt.Rows[0]["LeiBie"].ToString(), 0);
                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.PcName     = dt.Rows[0]["PcName"].ToString();
                info.PcIntro    = dt.Rows[0]["PcIntro"].ToString();
                info.CkFsx      = Basic.Utils.StrToInt(dt.Rows[0]["CkFsx"].ToString(), 0);
                info.MajorCount = Basic.Utils.StrToInt(dt.Rows[0]["MajorCount"].ToString(), 0);
                info.IsPause    = Basic.Utils.StrToInt(dt.Rows[0]["IsPause"].ToString(), 0);
                info.ShowOrder  = Basic.Utils.StrToInt(dt.Rows[0]["ShowOrder"].ToString(), 0);
                return(info);
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
        /// <summary>
        /// 暂停该值
        /// </summary>
        /// <param name="Id">自增id的值</param>
        /// <returns>暂停成功返回ture,否则返回false</returns>
        public static bool ProvincePiCiPause(Entity.ProvincePiCi info)
        {
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(CommandType.Text, "UPDATE [ProvincePiCi] SET IsPause = " + info.IsPause + "  WHERE Id =  " + info.Id);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }
コード例 #4
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int ProvincePiCiAdd(Entity.ProvincePiCi info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@ProvinceId", SqlDbType.Int,        4, info.ProvinceId),
         SqlDB.MakeInParam("@LeiBie",     SqlDbType.Int,        4, info.LeiBie),
         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("@PcName",     SqlDbType.NVarChar,  50, info.PcName),
         SqlDB.MakeInParam("@PcIntro",    SqlDbType.NVarChar, 500, info.PcIntro),
         SqlDB.MakeInParam("@CkFsx",      SqlDbType.Int,        4, info.CkFsx),
         SqlDB.MakeInParam("@MajorCount", SqlDbType.Int,        4, info.MajorCount),
         SqlDB.MakeInParam("@IsPause",    SqlDbType.Int,        4, info.IsPause),
         SqlDB.MakeInParam("@ShowOrder",  SqlDbType.Int,        4, info.ShowOrder),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(CommandType.StoredProcedure, "ProvincePiCiAdd", prams).ToString(), -1));
 }
コード例 #5
0
        public static string ShowStudentZhiYuanList(int PcId, int StudentId, bool ZhuanYeIsEmpty)
        {
            StringBuilder sb = new StringBuilder();

            Entity.ProvincePiCi obj = DAL.ProvincePiCi.ProvincePiCiEntityGet(PcId);
            sb.Append("<tr>");
            if (ZhuanYeIsEmpty == true)
            {
                sb.Append("<th width=\"30%\">志愿名</th>");
                sb.Append("<th width=\"50%\">院校名称</th>");
                sb.Append("<th width=\"20%\">专业调剂</th>");
            }
            else
            {
                sb.Append("<th width=\"8%\">志愿名</th>");
                sb.Append("<th width=\"24%\">院校名称</th>");
                for (int i = 1; i <= obj.MajorCount; i++)
                {
                    if (obj.MajorCount == 5)
                    {
                        sb.Append("<th width=\"12%\">专业" + i + "</th>");
                    }
                    else if (obj.MajorCount == 6)
                    {
                        sb.Append("<th width=\"10%\">专业" + i + "</th>");
                    }
                    else
                    {
                        sb.Append("<th>专业" + i + "</th>");
                    }
                }
                sb.Append("<th width=\"8%\">专业调剂</th>");
            }
            sb.Append("</tr>\r\n");

            DataTable dtStudentZhiYuanList = DAL.StudentZhiYuan.StudentZhiYuanList(" StudentId = " + StudentId + " AND ProvincePcId = " + PcId);
            DataTable dt = DAL.ProvinceZhiYuan.ProvinceZhiYuanList(PcId);

            for (int j = 0; j < dt.Rows.Count; j++)
            {
                Entity.StudentZhiYuan studentZhiYuan = DAL.StudentZhiYuan.StudentZhiYuanEntityGet(Basic.Utils.StrToInt(dt.Rows[j]["Id"].ToString(), 0), StudentId);
                if (studentZhiYuan == null)
                {
                    sb.Append("<tr><td>");
                    sb.Append(dt.Rows[j]["ZhiYuanMing"].ToString());
                    sb.Append("</td><td>");
                    sb.Append("</td>");
                    sb.Append(ShowZhuanYe("", obj.MajorCount, -1, ZhuanYeIsEmpty));
                    sb.Append("</tr>\r\n");
                }
                else
                {
                    sb.Append("<tr><td>");
                    sb.Append(dt.Rows[j]["ZhiYuanMing"].ToString());
                    sb.Append("</td><td>");
                    sb.Append(studentZhiYuan.SchoolName);
                    sb.Append("</td>");
                    sb.Append(ShowZhuanYe(studentZhiYuan.MajorList, obj.MajorCount, studentZhiYuan.IsTiaoJi, ZhuanYeIsEmpty));
                    sb.Append("</tr>\r\n");
                }
            }

            return(sb.ToString());
        }