コード例 #1
0
        protected bool HasApplyAttach()
        {
            var ml =
                new BLL.CCOM.Examination_arrangement_detail().GetModelList(" Ea_id=" + this.apply_id);

            return(ml != null && ml.Count > 0);
        }
コード例 #2
0
        /// <summary>
        /// Myxls导出Excel,保存在客户端
        /// </summary>
        private void DataTableExportToExcel(long applyId, string xlsName, string sheetName)
        {
            //表头
            //决定Datatable显示哪些内容
            DataSet    ds = new DataSet();
            DataTable  dt = ds.Tables.Add("Sheet1");
            DataRow    dr;
            DataColumn column;

            //1---序号
            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "序号";
            ds.Tables["Sheet1"].Columns.Add(column);

            //2---准考证号
            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "准考证号";
            ds.Tables["Sheet1"].Columns.Add(column);
            //3---姓名
            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "姓名";
            ds.Tables["Sheet1"].Columns.Add(column);
            //4---专业
            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "专业";
            ds.Tables["Sheet1"].Columns.Add(column);

            var ml = new BLL.CCOM.Examination_arrangement_detail().GetModelList(" Ea_id='" + applyId + "' order by newid()");

            for (int row = 0; row < ml.Count; row++)
            {
                var m = ml[row];

                //申请人基本信息
                //学生用户
                try
                {
                    Model.CCOM.View_UserAgency model = new BLL.CCOM.View_UserAgency().GetModel(" User_id='" + m.User_id + "'");
                    dr    = ds.Tables["Sheet1"].NewRow();
                    dr[0] = row + 1;
                    dr[1] = model.UP_CCOM_number;
                    dr[2] = model.User_realname;
                    dr[3] = model.Agency_name;

                    ds.Tables["Sheet1"].Rows.Add(dr);
                }
                catch
                {
                    continue;
                }
            }

            //导出EXCEL,速度有点慢
            DataToExcel.ExportToExcel(ds, Server.MapPath("/upload/excel/"), xlsName + ".xlsx", this.Page);
        }
コード例 #3
0
        protected void showStudentInfo()
        {
            BLL.CCOM.User_information ubll = new BLL.CCOM.User_information();
            BLL.CCOM.User_property    pbll = new BLL.CCOM.User_property();
            List <Model.CCOM.Examination_arrangement_detail> EadList = new BLL.CCOM.Examination_arrangement_detail().GetModelList(" Ea_id=" + examId);
            int      num        = 0;
            TableRow studentRow = new TableRow();

            foreach (Model.CCOM.Examination_arrangement_detail EadModel in EadList)
            {
                num++;
                var       umodel      = ubll.GetModel(EadModel.User_id);
                var       pmodel      = pbll.GetModel("User_id=" + EadModel.User_id);
                TableCell studentCell = new TableCell();
                studentCell.HorizontalAlign = HorizontalAlign.Center;
                studentRow.Cells.Add(studentCell);
                Image upPicture = new Image();
                upPicture.ImageUrl = "../../.." + pmodel.UP_picture;
                upPicture.Width    = 60;
                studentCell.Controls.Add(upPicture);
                Panel panel1 = new Panel();
                studentCell.Controls.Add(panel1);
                Label upCcomNum = new Label();
                upCcomNum.Text = pmodel.UP_CCOM_number;
                panel1.Controls.Add(upCcomNum);
                Panel panel2 = new Panel();
                studentCell.Controls.Add(panel2);
                Label name = new Label();
                name.Text = umodel.User_realname;
                panel2.Controls.Add(name);

                if (num % 6 == 0)
                {
                    studentTable.Rows.Add(studentRow);
                    studentRow = new TableRow();
                }
            }
            if (num % 6 != 0)
            {
                studentTable.Rows.Add(studentRow);
            }
        }
コード例 #4
0
        protected void showStudentInfo()
        {
            BLL.CCOM.User_information ubll = new BLL.CCOM.User_information();
            BLL.CCOM.User_property    pbll = new BLL.CCOM.User_property();
            List <Model.CCOM.Examination_arrangement_detail> EadList = new BLL.CCOM.Examination_arrangement_detail().GetModelList(" Ea_id=" + examId);
            int num = 0;

            foreach (Model.CCOM.Examination_arrangement_detail EadModel in EadList)
            {
                TableRow studentRow = new TableRow();
                studentTable.Rows.Add(studentRow);
                var       umodel  = ubll.GetModel(EadModel.User_id);
                var       pmodel  = pbll.GetModel("User_id=" + EadModel.User_id);
                TableCell numCell = new TableCell();
                numCell.HorizontalAlign = HorizontalAlign.Center;
                studentRow.Cells.Add(numCell);
                TableCell idCell = new TableCell();
                idCell.HorizontalAlign = HorizontalAlign.Center;
                studentRow.Cells.Add(idCell);
                TableCell nameCell = new TableCell();
                nameCell.HorizontalAlign = HorizontalAlign.Center;
                studentRow.Cells.Add(nameCell);
                TableCell scoreCell = new TableCell();
                scoreCell.HorizontalAlign = HorizontalAlign.Center;
                studentRow.Cells.Add(scoreCell);
                TableCell chapterCell = new TableCell();
                studentRow.Cells.Add(chapterCell);
                Label numLabel = new Label();
                numLabel.Text = (++num).ToString();
                numCell.Controls.Add(numLabel);
                Label upCcomNum = new Label();
                upCcomNum.Text = pmodel.UP_CCOM_number;
                idCell.Controls.Add(upCcomNum);
                Label name = new Label();
                name.Text = umodel.User_realname;
                nameCell.Controls.Add(name);
                Label chapter = newChapterLabel(umodel.User_id);
                chapterCell.Controls.Add(chapter);
            }
        }
コード例 #5
0
        //绑定导出数据的表
        private DataTable RptBindExport(string _strWhere)
        {
            var bll = new BLL.CCOM.Examination_arrangement_detail();

            return(bll.GetList(_strWhere).Tables["ds"]);
        }
コード例 #6
0
        protected void bindUserInfo()
        {
            //int[] margin = {1,1,2,2,2,3,3,4};
            long _id = GetAdminInfo_CCOM().User_id;
            var user_model = new BLL.CCOM.User_infomation().GetModel(_id);
            if ((int)user_model.User_type != 1)
            {
                JscriptMsg("只有考生才有打印准考证功能", "/AdminMetro/index.aspx", "Error");
                return;
            }
            var property_model = new BLL.CCOM.User_property().GetModel(" User_id=" + _id);
            if (property_model != null)
            {
                if (property_model.UP_picture != null && property_model.UP_picture != "")
                {
                    if (!property_model.UP_picture.StartsWith("http"))
                    {
                        this.stu_pic.Src = DataDic.FILE_URL + property_model.UP_picture;
                    }
                    else
                    {
                        this.stu_pic.Src = property_model.UP_picture;
                    }
                }
                else
                {
                    this.stu_pic.Src = "/admin/images/default_user_avatar.gif";
                }
                try
                {
                    int period = int.Parse(new BLL.CCOM.Period().GetModel(property_model.Period_id).Period_year);
                    this.tit.Text = "中央音乐学院本科招生" + period + "年专业考试准考证";
                }
                catch
                {
                    JscriptMsg("考生信息出错", "/AdminMetro/index.aspx", "Error");
                    //Response.Redirect("");
                }
                
                this.print_time.Text = "打印时间:" + DateTime.Now.ToString("yyyy年MM月dd日");
                //var user_model = new BLL.CCOM.User_infomation().GetModel(_id);
                this.stu_name.Text = user_model.User_realname;
                this.addmission_number.Text = property_model.UP_CCOM_number;
                this.ID_number.Text = user_model.User_ID_number;
                //this.qrcode.Src = "QrCode.ashx?data=" + DESEncrypt.Encrypt(property_model.UP_CCOM_number);
                if (property_model.Agency_id >0)
                {
                    var angency_model = new BLL.CCOM.Agency().GetModel(property_model.Agency_id);
                    if (angency_model != null)
                    {
                        this.major.Text = angency_model.Agency_name;
                    }

                    //获取报考科目
                    int majorId = property_model.Agency_id;
                    //科目字典
                    BLL.CCOM.Subject sub_bll = new BLL.CCOM.Subject();
                    try
                    {
                        List<Model.CCOM.Subject> subjectList = sub_bll.GetModelList("Major_Agency_id=" + majorId);
                        foreach (Model.CCOM.Subject subject in subjectList)
                        {
                            subjectDic.Add(subject.Subject_id, subject);
                        }
                    }
                    catch (Exception e)
                    {
                        return;
                    }
                    root = sub_bll.GetModel("Major_Agency_id=" + majorId + "and Subject_level=0");
                    foreach (Model.CCOM.Subject Cmodel in subjectDic.Values)
                    {
                        if (Cmodel.Fs_id == root.Subject_id)
                        {
                            BindSubject(Cmodel,0, true);
                        }
                    }


                    //获取已排考科目
                    //var exam_list = new BLL.CCOM.Examination_arrangement_detail().GetModelList(" User_id=" + GetAdminInfo_CCOM().User_id);
                    //if (exam_list != null && exam_list.Count>0)
                    //{
                    //    var bll = new BLL.CCOM.Examination_subject();
                    //    Model.CCOM.Examination_subject model = null;
                    //    for(int i=0;i<exam_list.Count;i++)
                    //    {
                    //        model = bll.GetModel(" Ea_id="+exam_list[i].Ea_id);

                    //    }
                    //}
                    //else//未有排考信息
                    //{
                    //    JscriptMsg("尚未排考完成,请等候排考结束再行打印!", "/AdminMetro/index.aspx", "Error");
                    //    return;
                    //}



                    long user_id = GetAdminInfo_CCOM().User_id;
                    int flag = 0;//记录该场考试是否已排该考生
                    StringBuilder sb = new StringBuilder();
                    BLL.CCOM.Examination_subject exam_sub_bll = new BLL.CCOM.Examination_subject();
                    BLL.CCOM.Examination_arrangement_detail exam_detail_bll = new BLL.CCOM.Examination_arrangement_detail();

                    int single = 0; //单选只输出一次
                    for (int i = 0; i < sub.Count; i++)
                    {
                        var exam_sub_model_list = exam_sub_bll.GetModelList(" Esn_id=" + sub[i]);
                        if (exam_sub_model_list != null)
                        {
                            for (int j = 0; j < exam_sub_model_list.Count; j++)
                            {
                                if (single == 1)
                                {
                                    single = 0;
                                    continue;
                                }
                                if (new BLL.CCOM.Subject().GetModel(sub[i]).Value_type == 1 && single == 0)
                                {
                                    single = 1;
                                }

                                flag = 0;
                                var detail_model_list = exam_detail_bll.GetModelList(" Ea_id=" + exam_sub_model_list[j].Ea_id);
                                for (int k = 0; k < detail_model_list.Count; k++)
                                {
                                    if (detail_model_list[k].User_id == user_id)
                                    {
                                        
                                        flag = 1;
                                        var model = new BLL.CCOM.Examination_arrangement().GetModel(" Ea_id=" + detail_model_list[k].Ea_id);
                                        string st_time = model.Ea_starttime.ToString("MM月dd日hh:mm");
                                        //st_time = st_time.Substring(0, st_time.Length - 6);
                                        string end_time = ((DateTime)model.Ea_endtime).ToString("hh:mm");
                                        var room = new BLL.CCOM.Examination_room().GetModel(model.Ea_room);
                                        
                                        sb.Append("<div class=\"exam_line\">");
                                        sb.Append("<div class=\"course\">");
                                        sb.Append("<span>");
                                        sb.Append(model.Ea_name);
                                        sb.Append("</span>");
                                        sb.Append("</div>");
                                        sb.Append("<div class=\"arrange\">");
                                        sb.Append("<span>");
                                        sb.Append(st_time+"-"+end_time);
                                        sb.Append("</span>");
                                        sb.Append("<br />");
                                        sb.Append("<span >");
                                        sb.Append("考场:"+room.Er_building+room.Er_room);
                                        if (model.Ea_restroom != null)
                                        {
                                            var rest_room = new BLL.CCOM.Examination_room().GetModel((int)model.Ea_restroom);
                                            sb.Append(" 候考场:" + room.Er_building +    room.Er_room);
                                        }
                                        sb.Append("</span>");
                                        sb.Append(" </div>");
                                        sb.Append(" </div>");

                                        break;
                                    }
                                }
                                if (flag == 0)//该科目尚未排考
                                {

                                }
                            }
                        }
                    }
                    this.exam_info.InnerHtml=sb.ToString();
                }
                if (user_model.User_gender != null)
                {
                    if ((bool)user_model.User_gender)
                    {
                        this.gender.Text = "女";
                    }
                    else
                    {
                        this.gender.Text = "男";
                    }
                }
            }
            else
            {
                JscriptMsg("考生不存在", "", "Error");
                return;
            }
        }