public string GetNationality(string UserID) { BLL.CCOM.User_property bll = new BLL.CCOM.User_property(); string str = string.Empty; try { Model.CCOM.User_property model = bll.GetModel(" User_id='" + UserID + "'"); str = new BLL.CCOM.Nationality().GetModel((int)model.UP_nationality).Nationality_name; } catch { str = "未设置"; } return(str); }
protected String GetName(int id) { switch (this.selectid) { case "1": bll_province = new BLL.CCOM.Province(); return(bll_province.GetModel(" " + selectIndex + "=" + id).Province_name); case "2": bll_politics = new BLL.CCOM.Politics(); return(bll_politics.GetModel(" " + selectIndex + "=" + id).Politics_name); case "3": bll_nationality = new BLL.CCOM.Nationality(); return(bll_nationality.GetModel(" " + selectIndex + "=" + id).Nationality_name); case "4": bll_nation = new BLL.CCOM.Nation(); return(bll_nation.GetModel(" " + selectIndex + "=" + id).Nation_name); case "5": bll_musical_instrument = new BLL.CCOM.Musical_instrument(); return(bll_musical_instrument.GetModel(" " + selectIndex + "=" + id).Mi_name); case "6": bll_degree = new BLL.CCOM.Degree(); return(bll_degree.GetModel(" " + selectIndex + "=" + id).Degree_name); case "7": bll_certivicate_type = new BLL.CCOM.Certificate_type(); return(bll_certivicate_type.GetModel(" " + selectIndex + "=" + id).Ct_name); default: return(""); } }
//tab1=================== #region 数据绑定================================= private void RptBind(string _strWhere, string _order) { int pageSize = GetPageSize(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; int totalCount = 0; switch (this.ddlResourceType.SelectedValue) { case "1": bll_province = new BLL.CCOM.Province(); totalCount = bll_province.GetRecordCount(_strWhere); this.rptList.DataSource = bll_province.GetListByPage(_strWhere, _order, start_index, end_index); break; case "2": bll_politics = new BLL.CCOM.Politics(); totalCount = bll_politics.GetRecordCount(_strWhere); this.rptList.DataSource = bll_politics.GetListByPage(_strWhere, _order, start_index, end_index); break; case "3": bll_nationality = new BLL.CCOM.Nationality(); totalCount = bll_nationality.GetRecordCount(_strWhere); this.rptList.DataSource = bll_nationality.GetListByPage(_strWhere, _order, start_index, end_index); break; case "4": bll_nation = new BLL.CCOM.Nation(); totalCount = bll_nation.GetRecordCount(_strWhere); this.rptList.DataSource = bll_nation.GetListByPage(_strWhere, _order, start_index, end_index); break; case "5": bll_musical_instrument = new BLL.CCOM.Musical_instrument(); totalCount = bll_musical_instrument.GetRecordCount(_strWhere); this.rptList.DataSource = bll_musical_instrument.GetListByPage(_strWhere, _order, start_index, end_index); break; case "6": bll_degree = new BLL.CCOM.Degree(); totalCount = bll_degree.GetRecordCount(_strWhere); this.rptList.DataSource = bll_degree.GetListByPage(_strWhere, _order, start_index, end_index); break; case "7": bll_certivicate_type = new BLL.CCOM.Certificate_type(); totalCount = bll_certivicate_type.GetRecordCount(_strWhere); this.rptList.DataSource = bll_certivicate_type.GetListByPage(_strWhere, _order, start_index, end_index); break; default: break; } this.rptList.DataBind(); //绑定页码 txtPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("ResourceList.aspx", "fun_id={0}&keywords={1}&page={2}&selectid={3}", DESEncrypt.Encrypt(this.fun_id), keywords, "__id__", this.ddlResourceType.SelectedValue); this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); }
public String GetResourseName(String signId) { switch (this.ddlResourceType.SelectedValue) { case "1": Model.CCOM.Province model_province = new BLL.CCOM.Province().GetModel(" Province_id=" + signId); if (model_province != null) { return(model_province.Province_name); } return(""); case "2": Model.CCOM.Politics model_politics = new BLL.CCOM.Politics().GetModel(" Politics_id=" + signId); if (model_politics != null) { return(model_politics.Politics_name); } return(""); case "3": Model.CCOM.Nationality model_nationality = new BLL.CCOM.Nationality().GetModel(" Nationality_id=" + signId); if (model_nationality != null) { return(model_nationality.Nationality_name); } return(""); case "4": Model.CCOM.Nation model_nation = new BLL.CCOM.Nation().GetModel(" Nation_id=" + signId); if (model_nation != null) { return(model_nation.Nation_name); } return(""); case "5": Model.CCOM.Musical_instrument model_musical_instrument = new BLL.CCOM.Musical_instrument().GetModel(" Mi_id=" + signId); if (model_musical_instrument != null) { return(model_musical_instrument.Mi_name); } return(""); case "6": Model.CCOM.Degree model_degree = new BLL.CCOM.Degree().GetModel(" Degree_id=" + signId); if (model_degree != null) { return(model_degree.Degree_name); } return(""); case "7": Model.CCOM.Certificate_type model_certificate_type = new BLL.CCOM.Certificate_type().GetModel(" Ct_id=" + signId); if (model_certificate_type != null) { return(model_certificate_type.Ct_name); } return(""); default: return(""); } }
//删除 protected void lbtSingleDelete_Click(object sender, EventArgs e) { var lbtn = sender as LinkButton; if (lbtn != null) { var id = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); bool result = true; try { switch (this.ddlResourceType.SelectedValue) { case "1": bll_province = new BLL.CCOM.Province(); result = bll_province.Delete(id); break; case "2": bll_politics = new BLL.CCOM.Politics(); result = bll_politics.Delete(id); break; case "3": bll_nationality = new BLL.CCOM.Nationality(); result = bll_nationality.Delete(id); break; case "4": bll_nation = new BLL.CCOM.Nation(); result = bll_nation.Delete(id); break; case "5": bll_musical_instrument = new BLL.CCOM.Musical_instrument(); result = bll_musical_instrument.Delete(id); break; case "6": bll_degree = new BLL.CCOM.Degree(); result = bll_degree.Delete(id); break; case "7": bll_certivicate_type = new BLL.CCOM.Certificate_type(); result = bll_certivicate_type.Delete(id); break; default: break; } } catch { result = false; } string keywords = this.keywordTab0; int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg("删除成功!", Utils.CombUrlTxt("ResourceList.aspx", "fun_id={0}&keywords={1}&page={2}&selectid={3}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString(), this.ddlResourceType.SelectedValue), "Success"); } else { JscriptMsg("删除失败!", Utils.CombUrlTxt("ResourceList.aspx", "fun_id={0}&keywords={1}&page={2}&selectid={3}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString(), this.ddlResourceType.SelectedValue), "Error"); } } }
private void bindData() { long _id = GetAdminInfo_CCOM().User_id; if (_id > 0) { Model.CCOM.User_infomation user_model = new BLL.CCOM.User_infomation().GetModel(_id); if ((int)user_model.User_type != 1) { JscriptMsg("只有考生才有打印报名表功能", "/AdminMetro/index.aspx", "Error"); return; } Model.CCOM.User_property property_model = new BLL.CCOM.User_property().GetModel(" User_id=" + _id); try { int period = int.Parse(new BLL.CCOM.Period().GetModel(property_model.Period_id).Period_year); this.title.Text = "中央音乐学院" + period + "年本科招生专业考试报名表"; } catch { JscriptMsg("考生信息出错", "/AdminMetro/index.aspx", "Error"); //Response.Redirect(""); } if (user_model != null && property_model != null) { this.name.Text = user_model.User_realname; this.id_number.Text = user_model.User_ID_number; if (user_model.User_gender != null && (bool)user_model.User_gender) { this.gender.Text = "女"; } else { this.gender.Text = "男"; } if (user_model.User_birthday != null) { this.birthday.Text = ((DateTime)user_model.User_birthday).ToString("yyyyMMdd"); } else { JscriptMsg("出生日期信息不全,请先完善信息再行打印", "/AdminMetro/index.aspx", "Error"); return; } var nation_model = new BLL.CCOM.Nationality().GetModel(property_model.UP_nationality); if (nation_model != null) { this.nation.Text = nation_model.Nationality_name; } else { JscriptMsg("民族不存在", "/AdminMetro/index.aspx", "Error"); return; } var province_model = new BLL.CCOM.Province().GetModel(property_model.UP_province); if (province_model != null) { this.birth_place.Text = province_model.Province_name; this.stu_province.Text = province_model.Province_name; } else { JscriptMsg("省份不存在,请先完善信息再行打印", "/AdminMetro/index.aspx", "Error"); return; } if (property_model.UP_high_school != null) { this.file_address.Text = property_model.UP_high_school; } else { JscriptMsg("高中院校信息不全,请先完善信息再行打印", "/AdminMetro/index.aspx", "Error"); return; } var politics_model = new BLL.CCOM.Politics().GetModel(property_model.UP_politics); if (politics_model != null) { this.politics.Text = politics_model.Politics_name; } else { JscriptMsg("政治面貌不存在,请先完善信息再行打印", "/AdminMetro/index.aspx", "Error"); return; } if (property_model.UP_picture != null) { this.head_pic.Src = property_model.UP_picture; } else { JscriptMsg("证件照信息不全,请先完善信息再行打印", "/AdminMetro/index.aspx", "Error"); return; } var agency_model = new BLL.CCOM.Agency().GetModel(property_model.Agency_id); if (agency_model != null) { this.major.Text = agency_model.Agency_name; } else { JscriptMsg("专业不存在,请先完善信息再行打印", "/AdminMetro/index.aspx", "Error"); return; } this.entrance_exam_number.Text = property_model.UP_CCOM_number; this.stu_entrance_number.Text = property_model.UP_CCOM_number; if (property_model.UP_receiver_phone != null) { this.exam_phone.Text = property_model.UP_receiver_phone; this.reciever_phone.Text = property_model.UP_receiver_phone; } else { JscriptMsg("联系电话信息不全,请先完善信息再行打印", "/AdminMetro/index.aspx", "Error"); return; } if (property_model.UP_address != null) { this.admit_address.Text = property_model.UP_address; } else { JscriptMsg("录取通知书邮寄地址信息不全,请先完善信息再行打印", "/AdminMetro/index.aspx", "Error"); return; } if (property_model.UP_postal_code != null) { this.city_id.Text = property_model.UP_postal_code; } else { JscriptMsg("邮编信息不全,请先完善信息再行打印", "/AdminMetro/index.aspx", "Error"); return; } this.reciever.Text = user_model.User_realname; this.stu_name.Text = user_model.User_realname; } else { JscriptMsg("考生不存在", "/AdminMetro/index.aspx", "Error"); return; } //获取报考科目 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); } } StringBuilder sb = new StringBuilder(); Model.CCOM.Subject sub_model = null; int flag = 0; for (int i = 0; i < sub.Count; i++) { sub_model = sub_bll.GetModel(sub[i]); if (sub_model != null) { if (flag == 1) { flag = 0; continue; } if (sub_model.Value_type == 1 && flag == 0) { flag = 1; } sb.Append("<div class=\"control-group\" style=\"margin-top:5px;\"><div class=\"line\">"); sb.Append("<div class=\"course_name\">"); sb.Append("<span>"); sb.Append(sub_model.Subject_title); sb.Append("</span>"); sb.Append("</div>"); sb.Append("<div class=\"exam_form\">"); sb.Append("<span>"); if (sub_model.Subject_type != null && (bool)sub_model.Subject_type) { sb.Append("面试"); } else { sb.Append("笔试"); } sb.Append("</span>"); sb.Append("</div>"); Label chapter = newChapterLabel(_id, sub[i]); sb.Append("<div class=\"exam_song\">"); sb.Append(chapter.Text.ToString()); sb.Append("</div>"); sb.Append("</div></div><br>"); //sb.Append("<div class=\"line_decration\"></div>"); } } this.examination_course.InnerHtml = sb.ToString(); } }
protected string ImportDataItem(DataSet ds, ref int success, ref int error)//基础数据 { string result = ""; BLL.CCOM.Province bll_Province = new BLL.CCOM.Province(); Model.CCOM.Province model_Province = new Model.CCOM.Province(); BLL.CCOM.Politics bll_Politics = new BLL.CCOM.Politics(); Model.CCOM.Politics model_Politics = new Model.CCOM.Politics(); BLL.CCOM.Nationality bll_Nationality = new BLL.CCOM.Nationality(); Model.CCOM.Nationality model_Nationality = new Model.CCOM.Nationality(); BLL.CCOM.Nation bll_Nation = new BLL.CCOM.Nation(); Model.CCOM.Nation model_Nation = new Model.CCOM.Nation(); BLL.CCOM.Musical_instrument bll_Musical_instrument = new BLL.CCOM.Musical_instrument(); Model.CCOM.Musical_instrument model_Musical_instrument = new Model.CCOM.Musical_instrument(); BLL.CCOM.Degree bll_Degree = new BLL.CCOM.Degree(); Model.CCOM.Degree model_Degree = new Model.CCOM.Degree(); BLL.CCOM.Certificate_type bll_Certificate_type = new BLL.CCOM.Certificate_type(); Model.CCOM.Certificate_type model_Certificate_type = new Model.CCOM.Certificate_type(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string checkmsg = null; string name = ds.Tables[0].Rows[i]["名称"].ToString().Trim(); if (!ValidDFValue(name, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,名称" + checkmsg + "<br/>"; error++; continue; } switch (this.ddlResourceType.SelectedValue) { case "1": if (name != "") { model_Province.Province_name = name; } if (bll_Province.GetModel(" Province_name='" + name + "'") != null) { result += "×第" + (i + 1).ToString() + "行,系统已存在该数据<br/>"; error++; continue; } else if (bll_Province.Add(model_Province) == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { success++; } break; case "2": if (name != "") { model_Politics.Politics_name = name; } if (bll_Politics.GetModel(" Politics_name='" + name + "'") != null) { result += "×第" + (i + 1).ToString() + "行,系统已存在该数据<br/>"; error++; continue; } else if (bll_Politics.Add(model_Politics) == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { success++; } break; case "3": if (name != "") { model_Nationality.Nationality_name = name; } if (bll_Nationality.GetModel(" Nationality_name='" + name + "'") != null) { result += "×第" + (i + 1).ToString() + "行,系统已存在该数据<br/>"; error++; continue; } else if (bll_Nationality.Add(model_Nationality) == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { success++; } break; case "4": if (name != "") { model_Nation.Nation_name = name; } if (bll_Nation.GetModel(" Nation_name='" + name + "'") != null) { result += "×第" + (i + 1).ToString() + "行,系统已存在该数据<br/>"; error++; continue; } else if (bll_Nation.Add(model_Nation) == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { success++; } break; case "5": if (name != "") { model_Musical_instrument.Mi_name = name; } if (bll_Musical_instrument.GetModel(" Mi_name='" + name + "'") != null) { result += "×第" + (i + 1).ToString() + "行,系统已存在该数据<br/>"; error++; continue; } else if (bll_Musical_instrument.Add(model_Musical_instrument) == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { success++; } break; case "6": if (name != "") { model_Degree.Degree_name = name; } if (bll_Degree.GetModel(" Degree_name='" + name + "'") != null) { result += "×第" + (i + 1).ToString() + "行,系统已存在该数据<br/>"; error++; continue; } else if (bll_Degree.Add(model_Degree) == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { success++; } break; case "7": if (name != "") { model_Certificate_type.Ct_name = name; } if (bll_Certificate_type.GetModel(" Ct_name='" + name + "'") != null) { result += "×第" + (i + 1).ToString() + "行,系统已存在该数据<br/>"; error++; continue; } else if (bll_Certificate_type.Add(model_Certificate_type) == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { success++; } break; default: break; } } return(result); }
protected void BindSignInfo(long signId) { this.ddlResourceType.SelectedValue = selectid; switch (this.selectid) { case "1": Model.CCOM.Province model_province = new BLL.CCOM.Province().GetModel(" Province_id=" + signId); if (model_province != null) { this.nameText.Text = model_province.Province_name; } else { JscriptMsg("传输参数不正确!", "back", "Error"); } break; case "2": Model.CCOM.Politics model_politics = new BLL.CCOM.Politics().GetModel(" Politics_id=" + signId); if (model_politics != null) { this.nameText.Text = model_politics.Politics_name; } else { JscriptMsg("传输参数不正确!", "back", "Error"); } break; case "3": Model.CCOM.Nationality model_nationality = new BLL.CCOM.Nationality().GetModel(" Nationality_id=" + signId); if (model_nationality != null) { this.nameText.Text = model_nationality.Nationality_name; } else { JscriptMsg("传输参数不正确!", "back", "Error"); } break; case "4": Model.CCOM.Nation model_nation = new BLL.CCOM.Nation().GetModel(" Nation_id=" + signId); if (model_nation != null) { this.nameText.Text = model_nation.Nation_name; } else { JscriptMsg("传输参数不正确!", "back", "Error"); } break; case "5": Model.CCOM.Musical_instrument model_musical_instrument = new BLL.CCOM.Musical_instrument().GetModel(" Mi_id=" + signId); if (model_musical_instrument != null) { this.nameText.Text = model_musical_instrument.Mi_name; } else { JscriptMsg("传输参数不正确!", "back", "Error"); } break; case "6": Model.CCOM.Degree model_degree = new BLL.CCOM.Degree().GetModel(" Degree_id=" + signId); if (model_degree != null) { this.nameText.Text = model_degree.Degree_name; } else { JscriptMsg("传输参数不正确!", "back", "Error"); } break; case "7": Model.CCOM.Certificate_type model_certificate_type = new BLL.CCOM.Certificate_type().GetModel(" Ct_id=" + signId); if (model_certificate_type != null) { this.nameText.Text = model_certificate_type.Ct_name; } else { JscriptMsg("传输参数不正确!", "back", "Error"); } break; default: break; } }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { String select = this.ddlResourceType.SelectedValue; String name = this.nameText.Text; if (name == "") { JscriptMsg("资源名称不能为空!", "", "Error"); return; } if (select == "") { JscriptMsg("资源类型不能为空!", "", "Error"); return; } if (Tools.CheckParams(name + select)) { JscriptMsg("输入参数不合法!", "", "Error"); return; } if (action == MyEnums.ActionEnum.Edit.ToString()) //修改 { if (signId != 0) { string pageUrl = Utils.CombUrlTxt("ResourceList.aspx", "fun_id={0}&selectid={1}", DESEncrypt.Encrypt(this.fun_id), selectid); switch (select) { case "1": Model.CCOM.Province model_province = new BLL.CCOM.Province().GetModel(" Province_id=" + signId); if (model_province != null) { model_province.Province_name = name; if (new BLL.CCOM.Province().GetModel(" Province_name='" + name + "'") != null) { JscriptMsg("系统中已有该资源!", "", "Error"); } else if (new BLL.CCOM.Province().Update(model_province)) { JscriptMsg("生源地编辑成功!^_^", pageUrl, "Success"); } else { JscriptMsg("出现异常,生源地编辑失败!", "", "Error"); } } break; case "2": Model.CCOM.Politics model_politics = new BLL.CCOM.Politics().GetModel(" Politics_id=" + signId); if (model_politics != null) { model_politics.Politics_name = name; if (new BLL.CCOM.Politics().GetModel(" Politics_name='" + name + "'") != null) { JscriptMsg("系统中已有该资源!", "", "Error"); } else if (new BLL.CCOM.Politics().Update(model_politics)) { JscriptMsg("政治面貌编辑成功!^_^", pageUrl, "Success"); } else { JscriptMsg("出现异常,政治面貌编辑失败!", "", "Error"); } } break; case "3": Model.CCOM.Nationality model_nationality = new BLL.CCOM.Nationality().GetModel(" Nationality_id=" + signId); if (model_nationality != null) { model_nationality.Nationality_name = name; if (new BLL.CCOM.Nationality().GetModel(" Nationality_name='" + name + "'") != null) { JscriptMsg("系统中已有该资源!", "", "Error"); } else if (new BLL.CCOM.Nationality().Update(model_nationality)) { JscriptMsg("民族编辑成功!^_^", pageUrl, "Success"); } else { JscriptMsg("出现异常,民族编辑失败!", "", "Error"); } } break; case "4": Model.CCOM.Nation model_nation = new BLL.CCOM.Nation().GetModel(" Nation_id=" + signId); if (model_nation != null) { model_nation.Nation_name = name; if (new BLL.CCOM.Nation().GetModel(" Nation_name='" + name + "'") != null) { JscriptMsg("系统中已有该资源!", "", "Error"); } else if (new BLL.CCOM.Nation().Update(model_nation)) { JscriptMsg("国籍编辑成功!^_^", pageUrl, "Success"); } else { JscriptMsg("出现异常,国籍编辑失败!", "", "Error"); } } break; case "5": Model.CCOM.Musical_instrument model_musical_instrument = new BLL.CCOM.Musical_instrument().GetModel(" Mi_id=" + signId); if (model_musical_instrument != null) { model_musical_instrument.Mi_name = name; if (new BLL.CCOM.Musical_instrument().GetModel(" Mi_name='" + name + "'") != null) { JscriptMsg("系统中已有该资源!", "", "Error"); } else if (new BLL.CCOM.Musical_instrument().Update(model_musical_instrument)) { JscriptMsg("乐器编辑成功!^_^", pageUrl, "Success"); } else { JscriptMsg("出现异常,乐器编辑失败!", "", "Error"); } } break; case "6": Model.CCOM.Degree model_degree = new BLL.CCOM.Degree().GetModel(" Degree_id=" + signId); if (model_degree != null) { model_degree.Degree_name = name; if (new BLL.CCOM.Degree().GetModel(" Degree_name='" + name + "'") != null) { JscriptMsg("系统中已有该资源!", "", "Error"); } else if (new BLL.CCOM.Degree().Update(model_degree)) { JscriptMsg("教育程度编辑成功!^_^", pageUrl, "Success"); } else { JscriptMsg("出现异常,教育程度编辑失败!", "", "Error"); } } break; case "7": Model.CCOM.Certificate_type model_certificate_type = new BLL.CCOM.Certificate_type().GetModel(" Ct_id=" + signId); if (model_certificate_type != null) { model_certificate_type.Ct_name = name; if (new BLL.CCOM.Certificate_type().GetModel(" Ct_name='" + name + "'") != null) { JscriptMsg("系统中已有该资源!", "", "Error"); } else if (new BLL.CCOM.Certificate_type().Update(model_certificate_type)) { JscriptMsg("证件类型编辑成功!^_^", pageUrl, "Success"); } else { JscriptMsg("出现异常,证件类型编辑失败!", "", "Error"); } } break; default: break; } } } else { //add string pageUrl = Utils.CombUrlTxt("ResourceList.aspx", "fun_id={0}&selectid={1}", DESEncrypt.Encrypt(this.fun_id), select); int id = 0; switch (select) { case "1": Model.CCOM.Province model_province = new Model.CCOM.Province(); model_province.Province_name = name; if (new BLL.CCOM.Province().GetModel(" Province_name='" + name + "'") != null) { id = -100; } else { id = new BLL.CCOM.Province().Add(model_province); } break; case "2": Model.CCOM.Politics model_politics = new Model.CCOM.Politics(); model_politics.Politics_name = name; if (new BLL.CCOM.Politics().GetModel(" Politics_name='" + name + "'") != null) { id = -100; } else { id = new BLL.CCOM.Politics().Add(model_politics); } break; case "3": Model.CCOM.Nationality model_nationality = new Model.CCOM.Nationality(); model_nationality.Nationality_name = name; if (new BLL.CCOM.Nationality().GetModel(" Nationality_name='" + name + "'") != null) { id = -100; } else { id = new BLL.CCOM.Nationality().Add(model_nationality); } break; case "4": Model.CCOM.Nation model_nation = new Model.CCOM.Nation(); model_nation.Nation_name = name; if (new BLL.CCOM.Nation().GetModel(" Nation_name='" + name + "'") != null) { id = -100; } else { id = new BLL.CCOM.Nation().Add(model_nation); } break; case "5": Model.CCOM.Musical_instrument model_musical_instrument = new Model.CCOM.Musical_instrument(); model_musical_instrument.Mi_name = name; if (new BLL.CCOM.Musical_instrument().GetModel(" Mi_name='" + name + "'") != null) { id = -100; } else { id = new BLL.CCOM.Musical_instrument().Add(model_musical_instrument); } break; case "6": Model.CCOM.Degree model_degree = new Model.CCOM.Degree(); model_degree.Degree_name = name; if (new BLL.CCOM.Degree().GetModel(" Degree_name='" + name + "'") != null) { id = -100; } else { id = new BLL.CCOM.Degree().Add(model_degree); } break; case "7": Model.CCOM.Certificate_type model_certificate_type = new Model.CCOM.Certificate_type(); model_certificate_type.Ct_name = name; if (new BLL.CCOM.Certificate_type().GetModel(" Ct_name='" + name + "'") != null) { id = -100; } else { id = new BLL.CCOM.Certificate_type().Add(model_certificate_type); } break; default: break; } if (id > 0) { JscriptMsg("添加资源成功!^_^", pageUrl, "Success"); } else if (id == -100) { JscriptMsg("系统中已有该资源!", "", "Error"); } else { JscriptMsg("出现异常,添加资源失败!", "", "Error"); } } }