//删除 protected void lbtRoomDelete_Click(object sender, EventArgs e) { BLL.CCOM.Examination_room bll = new BLL.CCOM.Examination_room(); var lbtn = sender as LinkButton; if (lbtn != null) { var id = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); bool result = true; try { result = bll.Delete(id); } catch { result = false; } string keywords = this.keywordTab0; int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg("删除成功!", Utils.CombUrlTxt("ConfResource.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Success"); } else { JscriptMsg("删除失败!", Utils.CombUrlTxt("ConfResource.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Error"); } } }
//tab1=================== #region 数据绑定================================= private void RoomBind(string _strWhere, string _order) { int pageSize = RoomGetPageSize(15); //每页数量 int page = MyRequest.GetQueryInt("page", 1); //string keywords = MyRequest.GetQueryString("keywords"); string keywords = this.keywordTab0; int start_index = pageSize * (page - 1) + 1; int end_index = pageSize * page; this.txtKeywords.Text = keywords; var bll = new BLL.CCOM.Examination_room(); //计算数量 int totalCount = bll.GetRecordCount(_strWhere); //绑定当页 this.roomList.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index); this.roomList.DataBind(); //绑定页码 txtRoomPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("ConfResource.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, "__id__"); this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); }
public string GetRestRoom(int id) { try { Model.CCOM.Examination_arrangement exam_model = new BLL.CCOM.Examination_arrangement().GetModel(id); Model.CCOM.Examination_room model = new BLL.CCOM.Examination_room().GetModel((int)exam_model.Ea_restroom); return(model.Er_building + "/" + model.Er_floor + "层/" + model.Er_room + "/" + model.Er_capacity + "人"); } catch { return(""); } }
protected void Page_Load(object sender, EventArgs e) { BLL.CCOM.Period pbll = new BLL.CCOM.Period(); var pmodel = pbll.GetModel("Period_state=1"); periodYear = pmodel.Period_year; examId = Convert.ToInt32(DESEncrypt.Decrypt(MyRequest.GetQueryString("examId"))); BLL.CCOM.Examination_arrangement bll = new BLL.CCOM.Examination_arrangement(); var model = bll.GetModel(examId); var roomModel = new BLL.CCOM.Examination_room().GetModel(model.Ea_room); examInfo += model.Ea_name + " " + model.Ea_starttime.ToString("M月d日 hh:mm") + " " + roomModel.Er_building + roomModel.Er_room; showStudentInfo(); }
public string getRoomName(int Ea_id) { try { var exam = new BLL.CCOM.Examination_arrangement().GetModel(Ea_id); int room_id = exam.Ea_room; var room = new BLL.CCOM.Examination_room().GetModel(room_id); return(" -" + room.Er_building + room.Er_floor + "楼" + room.Er_room + " -考试开始时间: " + exam.Ea_starttime); } catch { JscriptMsg("获取考试出错", "", "Error"); } return(""); }
protected void BindSignInfo(long signId) { Model.CCOM.Examination_room model = new BLL.CCOM.Examination_room().GetModel(" Er_id=" + signId); if (model != null) { this.buildingText.Text = model.Er_building; this.floorText.Text = Utils.ObjectToStr(model.Er_floor); this.roomText.Text = model.Er_room; this.capacityText.Text = Utils.ObjectToStr(model.Er_capacity); this.remarkText.Text = model.Er_remark; } else { JscriptMsg("传输参数不正确!", "back", "Error"); } }
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; } }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { String building = this.buildingText.Text; String floor = this.floorText.Text; String room = this.roomText.Text; String capacity = this.capacityText.Text; String remark = this.remarkText.Text; int floorInt; int capacityInt; if (building == "") { JscriptMsg("考场所在楼不能为空!", "", "Error"); return; } if (floor == "") { JscriptMsg("楼层不能为空!", "", "Error"); return; } if (room == "") { JscriptMsg("房间号不能为空!", "", "Error"); return; } if (capacity == "") { JscriptMsg("容量不能为空!", "", "Error"); return; } if (Tools.CheckParams(building)) { JscriptMsg("考场所在楼名不合法!", "", "Error"); return; } if (Tools.CheckParams(floor)) { JscriptMsg("考场所在楼层不合法!", "", "Error"); return; } if (Tools.CheckParams(room)) { JscriptMsg("考场所在房间号不合法!", "", "Error"); return; } if (Tools.CheckParams(capacity)) { JscriptMsg("考场容量不合法!", "", "Error"); return; } if (Tools.CheckParams(remark)) { JscriptMsg("备注不合法!", "", "Error"); return; } try { floorInt = int.Parse(floor); capacityInt = int.Parse(capacity); }catch { JscriptMsg("输入不合法!", "", "Error"); return; } if (action == MyEnums.ActionEnum.Edit.ToString()) //修改 { if (signId != 0) { Model.CCOM.Examination_room model = new BLL.CCOM.Examination_room().GetModel(" Er_id=" + signId); if (model != null) { model.Er_building = building; model.Er_floor = floorInt; model.Er_room = room; model.Er_capacity = capacityInt; model.Er_remark = remark; if (new BLL.CCOM.Examination_room().Update(model)) { string pageUrl = Utils.CombUrlTxt("RoomList.aspx", "fun_id={0}", DESEncrypt.Encrypt(this.fun_id)); JscriptMsg("考场编辑成功!^_^", pageUrl, "Success"); } else { JscriptMsg("出现异常,考场编辑失败!", "", "Error"); } } } } else { //add Model.CCOM.Examination_room model = new Model.CCOM.Examination_room(); model.Er_building = building; model.Er_floor = floorInt; model.Er_room = room; model.Er_capacity = capacityInt; model.Er_remark = remark; model.Er_id = new BLL.CCOM.Examination_room().Add(model); if (model.Er_id > 0) { string pageUrl = Utils.CombUrlTxt("RoomList.aspx", "fun_id={0}", DESEncrypt.Encrypt(this.fun_id)); JscriptMsg("考场添加成功!^_^", pageUrl, "Success"); } else { JscriptMsg("出现异常,考场添加失败!", "", "Error"); } } }
protected string ImportDataItem(DataSet ds, ref int success, ref int error)//基础数据 { string result = ""; BLL.CCOM.Examination_room bll = new BLL.CCOM.Examination_room(); Model.CCOM.Examination_room model = new Model.CCOM.Examination_room(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string checkmsg = null; string building = ds.Tables[0].Rows[i]["所在楼"].ToString().Trim(); if (!ValidDFValue(building, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,所在楼名" + checkmsg + "<br/>"; error++; continue; } else if (building != "") { model.Er_building = building; } string floor = ds.Tables[0].Rows[i]["楼层"].ToString().Trim(); int floorInt; try { floorInt = int.Parse(floor); } catch { result += "×第" + (i + 1).ToString() + "行数据更新失败,所在楼层填写需要为整数<br/>"; error++; continue; } if (!ValidDFValue(floor, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,所在楼层" + checkmsg + "<br/>"; error++; continue; } else if (floor != "") { model.Er_floor = floorInt; } string room = ds.Tables[0].Rows[i]["房间号"].ToString().Trim(); if (!ValidDFValue(room, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,所在房间号" + checkmsg + "<br/>"; error++; continue; } else if (room != "") { model.Er_room = room; } string cap = ds.Tables[0].Rows[i]["容量"].ToString().Trim(); int capInt; try { capInt = int.Parse(cap); } catch { result += "×第" + (i + 1).ToString() + "行数据更新失败,考场容量填写需要为整数<br/>"; error++; continue; } if (!ValidDFValue(cap, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,考场容量" + checkmsg + "<br/>"; error++; continue; } else if (cap != "") { model.Er_capacity = capInt; } string remark = ds.Tables[0].Rows[i]["备注"].ToString().Trim(); if (!ValidDFValue(remark, false, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,备注" + checkmsg + "<br/>"; error++; continue; } else if (remark != "") { model.Er_remark = remark; } if (bll.Add(model) == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { success++; } } return(result); }