protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //检查是否是考生 try { Model.CCOM.User_information user_model = GetAdminInfo_CCOM(); if (user_model.User_type == 6) { JscriptMsg("只有考生用户可以报考!", "back", "Error"); return; } } catch { Response.Redirect("/adminmetro/center.aspx"); } //检查前面步骤是否完成 checkBefore(); } period = new BLL.CCOM.Period().GetModel("Period_state=1"); BindAllSubject(); MakeClickableErrorMessage(); if (!IsPostBack) { BindData(); } }
////设置分页数量 //protected void txtPageNum_TextChanged(object sender, EventArgs e) //{ // int _pagesize; // if (int.TryParse(txtPageNum.Text.Trim(), out _pagesize)) // { // if (_pagesize > 0) // { // Utils.WriteCookie("Period_page_size", _pagesize.ToString(), 43200); // } // } // Response.Redirect(Utils.CombUrlTxt("SetTime.aspx", "fun_id={0}&keywords={1}", DESEncrypt.Encrypt(this.fun_id), this.keywordTab0)); //} protected String GetEditLink(String enc_Id) { BLL.CCOM.Period bll = new BLL.CCOM.Period(); Model.CCOM.Period model = bll.GetModel(" Period_id=" + DESEncrypt.Decrypt(enc_Id)); String link = ""; if (model.Period_state) { link = "<asp:LinkButton ID=\"lbt\" OnClientClick=\"return confirm('确定要关闭该周期吗?');void(0);\" OnClick=\"lbtClose_Click\" runat=\"server\" ToolTip='<%# DESEncrypt.Encrypt(Eval(\"Period_id\").ToString())%>' Text=\"关闭\"></asp:LinkButton>"; } else { link = "<asp:LinkButton ID=\"lbt1\" OnClientClick=\"return confirm('确定要开启该周期吗?');void(0);\" OnClick=\"lbtOpen_Click\" runat=\"server\" ToolTip='<%# DESEncrypt.Encrypt(Eval(\"Period_id\").ToString())%>' Text=\"开启\"></asp:LinkButton>"; } return(link); }
//开启本年度 protected void lbtOpenLastYear_Click(object sender, EventArgs e) { BLL.CCOM.Period bll = new BLL.CCOM.Period(); var lbtn = sender as LinkButton; if (lbtn != null) { Model.CCOM.Period model = new Model.CCOM.Period(); model.Period_year = (DateTime.Now.Year + 1).ToString(); model.Period_state = false; if (bll.Add(model) > 0) { JscriptMsg("创建成功!", Utils.CombUrlTxt("SetTime.aspx", "fun_id={0}&keywords={1}", DESEncrypt.Encrypt(this.fun_id), keywordTab0), "Success"); } else { JscriptMsg("创建失败!", Utils.CombUrlTxt("SetTime.aspx", "fun_id={0}&keywords={1}", DESEncrypt.Encrypt(this.fun_id), keywordTab0), "Error"); } } }
//关闭 protected void lbtClose_Click(object sender, EventArgs e) { BLL.CCOM.Period bll = new BLL.CCOM.Period(); var lbtn = sender as LinkButton; if (lbtn != null) { var id = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); Model.CCOM.Period model = bll.GetModel(id); model.Period_state = false; if (bll.Update(model)) { JscriptMsg("关闭成功!", Utils.CombUrlTxt("SetTime.aspx", "fun_id={0}&keywords={1}", DESEncrypt.Encrypt(this.fun_id), keywordTab0), "Success"); } else { JscriptMsg("关闭失败!", Utils.CombUrlTxt("SetTime.aspx", "fun_id={0}&keywords={1}", DESEncrypt.Encrypt(this.fun_id), keywordTab0), "Error"); } } }
//开启 protected void lbtOpen_Click(object sender, EventArgs e) { BLL.CCOM.Period bll = new BLL.CCOM.Period(); var lbtn = sender as LinkButton; if (lbtn != null) { var id = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); Model.CCOM.Period model = bll.GetModel(id); var models = bll.GetModelList(""); int number = 0; foreach (Model.CCOM.Period m in models) { if (m.Period_state) { number++; } } if (number != 0) { JscriptMsg("请先关闭已开启的周期,再开启本周期!", Utils.CombUrlTxt("SetTime.aspx", "fun_id={0}&keywords={1}", DESEncrypt.Encrypt(this.fun_id), keywordTab0), "Error"); } else { model.Period_state = true; if (bll.Update(model)) { JscriptMsg("开启成功!", Utils.CombUrlTxt("SetTime.aspx", "fun_id={0}&keywords={1}", DESEncrypt.Encrypt(this.fun_id), keywordTab0), "Success"); } else { JscriptMsg("开启失败!", Utils.CombUrlTxt("SetTime.aspx", "fun_id={0}&keywords={1}", DESEncrypt.Encrypt(this.fun_id), keywordTab0), "Error"); } } } }
protected void showUserInfo() { BLL.CCOM.User_property user_bll = new BLL.CCOM.User_property(); Model.CCOM.User_property user_model = user_bll.GetModel(_id); BLL.CCOM.Period user_bll_period = new BLL.CCOM.Period(); Model.CCOM.Period user_model_period = user_bll_period.GetModel(user_model.Period_id); if (user_model == null) { InnerRedirect(MyEnums.RediirectErrorEnum.ParameterError); } //国籍 this.ddl_UP_nation.Text = user_model.UP_nation.ToString(); //民族 this.ddl_UP_nationality.Text = user_model.UP_nationality.ToString(); //政治面貌 this.ddl_UP_politics.Text = user_model.UP_politics.ToString(); //文化程度 this.ddl_UP_degree.Text = user_model.UP_degree.ToString(); //高中毕业院校 this.txt_UP_high_school.Text = user_model.UP_high_school; //高考报名号 this.txt_UP_CEE_number.Text = user_model.UP_CEE_number; //省艺术联考考生号 this.txt_UP_AEE_number.Text = user_model.UP_AEE_number; //专业考试期间移动电话 this.txt_UP_PE_Iphone.Text = user_model.UP_PE_Iphone; //常规移动电话 this.txt_UP_PE_Aphone.Text = user_model.UP_PE_Aphone; //高考所在地 this.ddl_UP_province.Text = user_model.UP_province.ToString(); //录取通知书地址 this.txt_UP_address.Text = user_model.UP_address; //收件人 this.txt_UP_receiver.Text = user_model.UP_receiver; //收件人电话 this.txt_UP_receiver_phone.Text = user_model.UP_receiver_phone; //邮编 this.txt_UP_postal_code.Text = user_model.UP_postal_code; //证件复印图片 string UP_ID_picture_path = user_model.UP_ID_picture.ToString(); if (UP_ID_picture_path != "") { this.img_UP_ID_picture.Src = UP_ID_picture_path; this.txt_UP_ID_picture.Text = UP_ID_picture_path; } else { this.img_UP_ID_picture.Src = ""; this.txt_UP_ID_picture.Text = ""; } //近期免冠照片 string UP_picture_path = user_model.UP_picture.ToString(); if (UP_picture_path != "") { this.img_UP_picture.Src = UP_picture_path; this.txt_UP_picture.Text = UP_picture_path; } else { this.img_UP_picture.Src = ""; this.txt_UP_picture.Text = ""; } //省联考合格证 string UP_AEE_picture_path = user_model.UP_AEE_picture.ToString(); if (UP_AEE_picture_path != "") { this.img_UP_AEE_picture.Src = UP_AEE_picture_path; this.txt_UP_AEE_picture.Text = UP_AEE_picture_path; } else { this.img_UP_AEE_picture.Src = ""; this.txt_UP_AEE_picture.Text = ""; } //所属周期 this.txt_Period_id.Text = user_model_period.Period_year.ToString(); }