Exemple #1
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool StudentZhiYuanEdit(Entity.StudentZhiYuan info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@id",                SqlDbType.Int,         4, info.Id),
                SqlDB.MakeInParam("@ProvincePcId",      SqlDbType.Int,         4, info.ProvincePcId),
                SqlDB.MakeInParam("@ProvinceZhiYuanId", SqlDbType.Int,         4, info.ProvinceZhiYuanId),
                SqlDB.MakeInParam("@SchoolId",          SqlDbType.Int,         4, info.SchoolId),
                SqlDB.MakeInParam("@SchoolName",        SqlDbType.NVarChar,  100, info.SchoolName),
                SqlDB.MakeInParam("@MajorList",         SqlDbType.NVarChar, 1000, info.MajorList),
                SqlDB.MakeInParam("@MajorCount",        SqlDbType.Int,         4, info.MajorCount),
                SqlDB.MakeInParam("@IsTiaoJi",          SqlDbType.Int,         4, info.IsTiaoJi),
                SqlDB.MakeInParam("@IsAllMajor",        SqlDbType.Int,         4, info.IsAllMajor),
                SqlDB.MakeInParam("@StudentId",         SqlDbType.Int,         4, info.StudentId),
                SqlDB.MakeInParam("@AddTime",           SqlDbType.DateTime,    8, info.AddTime),
                SqlDB.MakeInParam("@Memo",              SqlDbType.NVarChar,  500, info.Memo),
            };
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(CommandType.StoredProcedure, "StudentZhiYuanEdit", prams);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }
Exemple #2
0
        /// <summary>
        /// 获取某一个实体
        /// </summary>
        /// <param name="id">标识</param>
        /// <returns>返回Entity</returns>
        public static Entity.StudentZhiYuan StudentZhiYuanEntityGet(int ProvinceZhiYuanId, int StudentId)
        {
            Entity.StudentZhiYuan info = new Entity.StudentZhiYuan();
            DataTable             dt   = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [StudentZhiYuan] WHERE StudentId = " + StudentId + " AND ProvinceZhiYuanId = " + ProvinceZhiYuanId + ";").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.Id                = Basic.Utils.StrToInt(dt.Rows[0]["id"].ToString(), 0);
                info.ProvincePcId      = Basic.Utils.StrToInt(dt.Rows[0]["ProvincePcId"].ToString(), 0);
                info.ProvinceZhiYuanId = Basic.Utils.StrToInt(dt.Rows[0]["ProvinceZhiYuanId"].ToString(), 0);
                info.SchoolId          = Basic.Utils.StrToInt(dt.Rows[0]["SchoolId"].ToString(), 0);
                info.SchoolName        = dt.Rows[0]["SchoolName"].ToString();
                info.MajorList         = dt.Rows[0]["MajorList"].ToString();
                info.MajorCount        = Basic.Utils.StrToInt(dt.Rows[0]["MajorCount"].ToString(), 0);
                info.IsTiaoJi          = Basic.Utils.StrToInt(dt.Rows[0]["IsTiaoJi"].ToString(), 0);
                info.IsAllMajor        = Basic.Utils.StrToInt(dt.Rows[0]["IsAllMajor"].ToString(), 0);
                info.StudentId         = Basic.Utils.StrToInt(dt.Rows[0]["StudentId"].ToString(), 0);
                info.Memo              = dt.Rows[0]["Memo"].ToString();
                info.AddTime           = Basic.Utils.StrToDateTime(dt.Rows[0]["AddTime"].ToString());
                return(info);
            }
            else
            {
                return(null);
            }
        }
Exemple #3
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int StudentZhiYuanAdd(Entity.StudentZhiYuan info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@ProvincePcId",      SqlDbType.Int,         4, info.ProvincePcId),
         SqlDB.MakeInParam("@ProvinceZhiYuanId", SqlDbType.Int,         4, info.ProvinceZhiYuanId),
         SqlDB.MakeInParam("@SchoolId",          SqlDbType.Int,         4, info.SchoolId),
         SqlDB.MakeInParam("@SchoolName",        SqlDbType.NVarChar,  100, info.SchoolName),
         SqlDB.MakeInParam("@MajorList",         SqlDbType.NVarChar, 1000, info.MajorList),
         SqlDB.MakeInParam("@MajorCount",        SqlDbType.Int,         4, info.MajorCount),
         SqlDB.MakeInParam("@IsTiaoJi",          SqlDbType.Int,         4, info.IsTiaoJi),
         SqlDB.MakeInParam("@IsAllMajor",        SqlDbType.Int,         4, info.IsAllMajor),
         SqlDB.MakeInParam("@StudentId",         SqlDbType.Int,         4, info.StudentId),
         //SqlDB.MakeInParam("@AddTime", SqlDbType.DateTime, 8, info.AddTime),
         SqlDB.MakeInParam("@Memo",              SqlDbType.NVarChar,  500, info.Memo),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(CommandType.StoredProcedure, "StudentZhiYuanAdd", prams).ToString(), -1));
 }
Exemple #4
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());
        }