/// <summary> /// 年级绑定 /// </summary> protected void BindDDl() { ExtendBLL.SysSetting ES = new ExtendBLL.SysSetting(); int Year = ES.GetCurrentSetting().CurrentYear; int S = int.Parse(ES.GetCurrentSetting().CurrentSemester.Value.ToString()); ddlClass.DataSource = Common.GradeHelper.GetCurrentGrade(Year, S, false); ddlClass.DataBind(); }
protected void InitDDl() { //性别 ExtendBLL.Dictionary BD = new ExtendBLL.Dictionary(); ddlSex.DataSource = BD.GetItemListByDClass("201"); ddlSex.DataValueField = "Code"; ddlSex.DataTextField = "Name"; ddlSex.DataBind(); //年级 ExtendBLL.SysSetting ES = new ExtendBLL.SysSetting(); int Year = ES.GetCurrentSetting().CurrentYear; int S = int.Parse(ES.GetCurrentSetting().CurrentSemester.Value.ToString()); ddlLJ.DataSource = Common.GradeHelper.GetCurrentGrade(Year, S, false); ddlLJ.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("SYKFRCCX");//必须写在ispostback外 strPageUserType.Add("mana"); if (!Page.IsPostBack) { LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting(); ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting(); try { msys = extendsys.GetCurrentSetting(); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } bindddl(); ddlSemester.SelectedValue = msys.CurrentSemester.Value.ToString(); ddlYear.SelectedValue = msys.CurrentYear.ToString(); IniPage(ddlYear.SelectedValue, ddlSemester.SelectedValue); } }
public void bindDDL(LabMS.Model.OpentProject mopproject) { LabMS.BLL.Lab blab = new LabMS.BLL.Lab(); List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>(); mLab = blab.GetModelList(" Lab_ParentID is null "); ddlLabName.DataSource = mLab; ddlLabName.DataTextField = "Lab_Name"; ddlLabName.DataValueField = "Lab_Code"; ddlLabName.DataBind(); ddlLabName.SelectedValue = mopproject.Project_Lab; ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary(); List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>(); listCClass = eDictionary.GetItemListByDClass("shiyanleibie"); ddlProjectCategory.DataSource = listCClass; ddlProjectCategory.DataTextField = "Name"; ddlProjectCategory.DataValueField = "Code"; ddlProjectCategory.DataBind(); ddlProjectCategory.SelectedValue = mopproject.Project_Category; listCClass = eDictionary.GetItemListByDClass("shiyanleixing"); ddlProjectType.DataSource = listCClass; ddlProjectType.DataTextField = "Name"; ddlProjectType.DataValueField = "Code"; ddlProjectType.DataBind(); ddlProjectType.SelectedValue = mopproject.Project_Type; listCClass = eDictionary.GetItemListByDClass("shiyanyaoqiu"); ddlProjectRequire.DataSource = listCClass; ddlProjectRequire.DataTextField = "Name"; ddlProjectRequire.DataValueField = "Code"; ddlProjectRequire.DataBind(); ddlProjectRequire.SelectedValue = mopproject.Project_Require; listCClass = eDictionary.GetItemListByDClass("shiyanzheleibie"); ddlProjectPartnerType.DataSource = listCClass; ddlProjectPartnerType.DataTextField = "Name"; ddlProjectPartnerType.DataValueField = "Code"; ddlProjectPartnerType.DataBind(); ddlProjectPartnerType.SelectedValue = mopproject.Project_PartnerType; listCClass = eDictionary.GetItemListByDClass("shiyanxiangmulaiyuan"); ddlProjectComFrom.DataSource = listCClass; ddlProjectComFrom.DataTextField = "Name"; ddlProjectComFrom.DataValueField = "Code"; ddlProjectComFrom.DataBind(); ddlProjectComFrom.SelectedValue = mopproject.OP_ProSource; LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting(); ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting(); msys = extendsys.GetCurrentSetting(); List<string> listYear = Common.GradeHelper.GetCurrentGrade((int)msys.CurrentYear, (int)msys.CurrentSemester, false); ddlOPGrade.DataSource = listYear; ddlOPGrade.DataBind(); ddlOPGrade.Items.Insert(0, new ListItem("", "0")); ddlOPGrade.SelectedValue = mopproject.OP_Grade; ddlOPFunds.SelectedValue = mopproject.OP_Funds; }
protected void btnRest_Click(object sender, EventArgs e) { LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting(); ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting(); try { msys = extendsys.GetCurrentSetting(); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } ddlSemester.SelectedValue = msys.CurrentSemester.Value.ToString(); ddlYear.SelectedValue = msys.CurrentYear.ToString(); if (UserType == "mana") { tbTeacherCode.Value = ""; tbTeacherName.Value = ""; } lbSituation.Text = ""; }
void bind(string strwhere) { LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting(); ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting(); msys = extendsys.GetCurrentSetting(); List<LabMS.Model.OpentProject> listmopproject = new List<LabMS.Model.OpentProject>(); LabMS.BLL.OpentProject bopproject = new LabMS.BLL.OpentProject(); if (strwhere.Equals("")) { strwhere += " 1=1 "; } strwhere += " and SYear = " + msys.CurrentYear + " and Semester = " + msys.CurrentSemester; if (UserType == "teacher") { strwhere += " and OP_Teacher = '" + UserCode + "'"; } listmopproject = bopproject.GetModelList(strwhere + " order by ID desc "); foreach (LabMS.Model.OpentProject op in listmopproject) { List<LabMS.Model.Teacher> listmteacher = new List<LabMS.Model.Teacher>(); LabMS.BLL.Teacher bteacher = new LabMS.BLL.Teacher(); listmteacher = bteacher.GetModelList(" Teacher_Code= '" + op.OP_Teacher + "'"); if (listmteacher.Count > 0) { op.OP_Teacher = listmteacher[0].Teacher_Name; } LabMS.BLL.Lab blab = new LabMS.BLL.Lab(); List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>(); mLab = blab.GetModelList(" Lab_Code='"+ op.Project_Lab +"'"); if (mLab.Count > 0) { op.Project_Lab = mLab[0].Lab_Name; } ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary(); List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>(); listCClass = eDictionary.GetModelList("DClass = 'shiyanyaoqiu' and Code = '"+op.Project_Require+"'"); if (listCClass.Count > 0) { op.Project_Require = listCClass[0].Name; } op.OP_Phone = op.Project_StartWeek.ToString()+"--"+op.Project_EndWeek.ToString(); List<LabMS.Model.ProjectAppointment>listprojectapp = new List<LabMS.Model.ProjectAppointment>(); ExtendBLL.ProjectAppointment bprojectapp = new ExtendBLL.ProjectAppointment(); listprojectapp = bprojectapp.GetModelList(" OP_ProjectCode ='"+op.OP_ProjectCode+"'"); op.OP_OpenType = listprojectapp.Count.ToString(); listCClass = eDictionary.GetModelList("DClass = 'shiyanleixing' and Code = '" + op.Project_Type + "'"); if (listCClass.Count > 0) { op.Project_Type = listCClass[0].Name; } if (op.OP_Audit == "0") { } op.OP_Audit = LabMS.Common.Status.GetOpenProjectStatus(op.OP_Audit); } gv_OpenProjectList.DataSource = listmopproject; gv_OpenProjectList.DataBind(); }
//保存 protected void btnSave_Click(object sender, EventArgs e) { #region 验证 if (string.IsNullOrEmpty(ProjectName.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "项目名称不能为空!"); return; } if (string.IsNullOrEmpty(PlanHours.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "计划学时不能为空!"); return; } int hour = 0; if (!int.TryParse(PlanHours.Text.Trim(), out hour)) { LabMS.Common.JShelper.JSAlert(Page, "err", "计划学时只能输入数字!"); return; } if (ddlApplyLab.SelectedValue.ToString().Equals("0")) { LabMS.Common.JShelper.JSAlert(Page, "err", "申请实验室不能为空!"); return; } if (string.IsNullOrEmpty(ApplyTimeMin.Text.Trim()) || string.IsNullOrEmpty(ApplyTimeMax.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "申请时间不能为空!"); return; } else { if (Convert.ToDateTime(ApplyTimeMin.Text.Trim()) > Convert.ToDateTime(ApplyTimeMax.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "申请开始时间大于结束时间!"); return; } } if (string.IsNullOrEmpty(tb_StudentIDs.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "申请人不能为空!"); return; } if (string.IsNullOrEmpty(Contactor.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "联系人不能为空!"); return; } if (string.IsNullOrEmpty(ContactPhone.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "联系人的联系电话不能为空!"); return; } string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"; Regex re = new Regex(strRegex); if (!string.IsNullOrEmpty(ContactEmail.Text.Trim())) { if (!re.IsMatch(ContactEmail.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "联系人的EMail地址格式不正确!"); return; } } if (!string.IsNullOrEmpty(TeacherEmail.Text.Trim())) { if (!re.IsMatch(TeacherEmail.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "指导老师的EMail地址格式不正确!"); return; } } int temp = 0; int Index = int.Parse(tb_EIndex.Value); for (int i = 0; i < Index; i++) { if (!string.IsNullOrEmpty(Request.Form["name" + i + ""])) { if (string.IsNullOrEmpty(Request.Form["num" + i + ""])) { LabMS.Common.JShelper.JSAlert(Page, "err", "所需仪器数量不能为空!"); return; } else { if (!int.TryParse(Request.Form["num" + i + ""], out temp)) { LabMS.Common.JShelper.JSAlert(Page, "err", "所需仪器数量必须为数字!"); return; } } } else { if (!string.IsNullOrEmpty(Request.Form["num" + i + ""])) { LabMS.Common.JShelper.JSAlert(Page, "err", "所需仪器名称不能为空!"); return; } else { if (!string.IsNullOrEmpty(Request.Form["intro" + i + ""])) { LabMS.Common.JShelper.JSAlert(Page, "err", "所需仪器名称不能为空!"); return; } } } } Index = int.Parse(tb_ConsumpIndex.Value); for (int i = 0; i < Index; i++) { if (!string.IsNullOrEmpty(Request.Form["consumpname" + i + ""])) { if (string.IsNullOrEmpty(Request.Form["consumpnum" + i + ""])) { LabMS.Common.JShelper.JSAlert(Page, "err", "所需低耗品数量不能为空!"); return; } else { if (!int.TryParse(Request.Form["consumpnum" + i + ""], out temp)) { LabMS.Common.JShelper.JSAlert(Page, "err", "所需低耗品数量必须为数字!"); return; } } } else { if (!string.IsNullOrEmpty(Request.Form["consumpnum" + i + ""])) { LabMS.Common.JShelper.JSAlert(Page, "err", "所需低耗品名称不能为空!"); return; } else { if (!string.IsNullOrEmpty(Request.Form["consumpintro" + i + ""])) { LabMS.Common.JShelper.JSAlert(Page, "err", "所需低耗品名称不能为空!"); return; } } } } #endregion LabMS.BLL.PersonalProject projectinfo = new LabMS.BLL.PersonalProject(); LabMS.Model.PersonalProject project = new LabMS.Model.PersonalProject(); int ProjectID = int.Parse(Request.QueryString["ProjectID"]); project.ProjectID = ProjectID; project.ProjectName = ProjectName.Text.Trim(); project.PlanHours = int.Parse(PlanHours.Text.Trim()); project.AppcationLabID = int.Parse(ddlApplyLab.SelectedValue.Trim()); DateTime tempTime = new DateTime(); if (DateTime.TryParse(ApplyTimeMin.Text.Trim(), out tempTime)) { project.ApplicationStartTime = tempTime; } if (DateTime.TryParse(ApplyTimeMax.Text.Trim(), out tempTime)) { project.ApplicationEndTime = tempTime; } LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting(); ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting(); msys = extendsys.GetCurrentSetting(); project.SYear = msys.CurrentYear; project.Semester = msys.CurrentSemester; project.Contactor = Contactor.Text.Trim(); project.ContactorClass = ContactorClass.Text.Trim(); project.ContactorEmail = ContactEmail.Text.Trim(); project.ContactorPhone = ContactPhone.Text.Trim(); project.Teacher = Teacher.Text.Trim(); project.TeacherTitle = TeacherTitle.Text.Trim(); project.TeacherEmail = TeacherEmail.Text.Trim(); project.TeacherPhone = TeacherPhone.Text.Trim(); project.ApplicationReason = ApplyReason.Text.Trim(); project.ProjectStatus = "1";//状态为未申请(status=1) string strAlertContent = "保存成功!"; if (((Button)sender).ID == "btnApply") { strAlertContent = "申请成功!"; project.ProjectStatus = "2"; } //添加申请人 string[] array = tb_StudentIDs.Text.Split(','); List<string> lsIDs = new List<string>(); lsIDs.Add(array[0]); foreach (string item in array) { int Count = 0; foreach (string Pr in lsIDs) { if (item != Pr) { Count++; } } if (Count == lsIDs.Count) { lsIDs.Add(item); } } try { projectinfo.Update(project); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } if (!array[0].Equals("")) { LabMS.BLL.PersonalProjApp applicantinfo = new LabMS.BLL.PersonalProjApp(); LabMS.Model.PersonalProjApp applicant = new LabMS.Model.PersonalProjApp(); List<LabMS.Model.PersonalProjApp> applicantList = new List<LabMS.Model.PersonalProjApp>(); string str = " PersonalProjID=" + ProjectID; applicantList = applicantinfo.GetModelList(str); try { foreach (LabMS.Model.PersonalProjApp a in applicantList) { applicantinfo.Delete(a.ID); } for (int i = 0; i < lsIDs.Count; i++) { applicant.ApplicantID = int.Parse(lsIDs[i]); applicant.PersonalProjID = ProjectID; applicantinfo.Add(applicant); } } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } } //删除对应的仪器和低耗品 LabMS.BLL.PersonalProjConsume consumeinfo = new PersonalProjConsume(); LabMS.Model.PersonalProjConsume consume = new LabMS.Model.PersonalProjConsume(); List<LabMS.Model.PersonalProjConsume> consumeList = new List<LabMS.Model.PersonalProjConsume>(); string strSql = " PersonalProjID=" + ProjectID; consumeList = consumeinfo.GetModelList(strSql); try { foreach (LabMS.Model.PersonalProjConsume c in consumeList) { consumeinfo.Delete(c.ID); } } catch(Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } //添加仪器 int EquipIndex = int.Parse(tb_EIndex.Value); for (int i = 0; i < EquipIndex; i++) { string EquipName = ""; int EquipNum = 0; string Introduction = ""; try { EquipName = Request.Form["name" + i + ""]; EquipNum = int.Parse(Request.Form["num" + i + ""]); Introduction = Request.Form["intro" + i + ""]; consume.EquipName = EquipName; consume.EquipNum = EquipNum; consume.EquipType = 1; consume.Introduction = Introduction; consume.PersonalProjID = ProjectID; consumeinfo.Add(consume); } catch { } } //添加低耗品 int ConsumpIndex = int.Parse(tb_ConsumpIndex.Value); for (int i = 0; i < ConsumpIndex; i++) { string ConsumpName = ""; int ConsumpNum = 0; string ConsumpIntro = ""; try { ConsumpName = Request.Form["consumpname" + i + ""]; ConsumpNum = int.Parse(Request.Form["consumpnum" + i + ""]); ConsumpIntro = Request.Form["consumpintro" + i + ""]; consume.EquipName = ConsumpName; consume.EquipNum = ConsumpNum; consume.EquipType = 2; consume.Introduction = ConsumpIntro; consume.PersonalProjID = ProjectID; consumeinfo.Add(consume); } catch { } } LabMS.Common.JShelper.JSAlertAndRedirect(Page, "AddSuccess", strAlertContent, "ListPersonalProject.aspx"); }
protected void bnSave_Click(object sender, EventArgs e) { LabMS.BLL.OpentProject bopproject = new LabMS.BLL.OpentProject(); string strWhere = "ID =" + lbCID.Text; List<LabMS.Model.OpentProject> listmopproject = bopproject.GetModelList(strWhere); if (listmopproject.Count == 0) { Common.JShelper.JSAlert(Page, "err2", "开放实验项目不存在!"); } LabMS.Model.OpentProject moproject = listmopproject[0]; #region 验证 if (string.IsNullOrEmpty(tbProjectStartWeek.Text.Trim()) || string.IsNullOrEmpty(tbProjectEndWeek.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "实验周次不能为空!"); return; } int iStartWeek = 0; int iEndWeek = 0; if (!(int.TryParse(tbProjectStartWeek.Text.Trim(), out iStartWeek) && int.TryParse(tbProjectEndWeek.Text.Trim(), out iEndWeek))) { LabMS.Common.JShelper.JSAlert(Page, "err", "实验周次只能输入数字!"); return; } if (iStartWeek > iEndWeek) { LabMS.Common.JShelper.JSAlert(Page, "err", "实验周次开始时间大于结束时间!"); return; } if (iStartWeek > 20 || iEndWeek > 20) { LabMS.Common.JShelper.JSAlert(Page, "err", "实验周次过大!"); return; } if (string.IsNullOrEmpty(tbTeacherCode.Value.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "指导老师不能为空!"); return; } if (string.IsNullOrEmpty(tb_StudentIDs.Value.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "实验学生不能为空!"); return; } #endregion moproject.OP_ProjectName = tbProjectName.Text.Trim(); moproject.OP_ProjectCode = tbProjectCode.Text.Trim(); moproject.Project_Category = ddlProjectCategory.SelectedValue; moproject.Project_EndWeek = iEndWeek; moproject.Project_Lab = ddlLabName.SelectedValue; moproject.Project_PartnerType = ddlProjectPartnerType.SelectedValue; moproject.Project_Require = ddlProjectRequire.SelectedValue; moproject.Project_StartWeek = iStartWeek; moproject.Project_Subject = tbProjectSubjectCode.Value; moproject.Project_Type = ddlProjectType.SelectedValue; moproject.OP_AppIntro = tbOPReason.Text.Trim(); moproject.OP_ProSource = ddlProjectComFrom.SelectedValue; moproject.OP_Professioanl = tbOPProfessioanl.Text.Trim(); moproject.OP_PlanningCourseTime = tbOPPlanningCourseTime.Text.Trim(); moproject.OP_Phone = tbOPPhone.Text.Trim(); moproject.OP_InCharge = tbOPInCharge.Text.Trim(); moproject.OP_Grade = ddlOPGrade.SelectedValue; moproject.OP_AppIntro = tbOPContent.Text.Trim(); moproject.OP_Teacher = tbTeacherCode.Value.Trim(); moproject.OP_OpenType = tbOPContent.Text.Trim();//实验内容 LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting(); ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting(); msys = extendsys.GetCurrentSetting(); moproject.SYear = msys.CurrentYear; moproject.Semester = msys.CurrentSemester; string strAlertContent = "保存成功!"; moproject.OP_Audit = "0"; if (((Button)sender).ID == "btnApp") { strAlertContent = "申请成功!"; moproject.OP_Audit = "1"; } moproject.OP_AppTime = DateTime.Now; moproject.OP_Applicant = lbAppPerson.Text; int iOpenProjectID = 0; try { bopproject.Update(moproject); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } String[] listsID = tb_StudentIDs.Value.Split(','); LabMS.Model.ProjectAppointment projectapp = new LabMS.Model.ProjectAppointment(); ExtendBLL.ProjectAppointment bprojectapp = new ExtendBLL.ProjectAppointment(); bprojectapp.Del(" where OP_ProjectCode ='" + moproject.OP_ProjectCode + "'"); for (int i = 0; i < listsID.Length; ++i) { projectapp.Appoint_ClassID = "0"; projectapp.Appoint_ProID = 0; projectapp.OP_Appoint_ID = listsID[i].ToString(); projectapp.OP_ProjectCode = moproject.OP_ProjectCode; projectapp.OP_Score = ""; try { bprojectapp.Add(projectapp); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; bprojectapp.Del(" where OP_ProjectCode ='" + moproject.OP_ProjectCode + "'"); return; } } AttachmentItemSave(moproject); Common.JShelper.JSAlertAndRedirect(Page, "success", strAlertContent, "currentopenprojectlist.aspx"); }
void binddll() { LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting(); ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting(); msys = extendsys.GetCurrentSetting(); List<string> listYear = Common.GradeHelper.GetCurrentGrade((int)msys.CurrentYear, (int)msys.CurrentSemester, false); ddlYear.DataSource = listYear; ddlYear.DataBind(); ddlYear.Items.Insert(0, new ListItem("", "0")); List<LabMS.Model.Professional> listPro = new List<LabMS.Model.Professional>(); LabMS.BLL.Professional bPro = new LabMS.BLL.Professional(); listPro = bPro.GetModelList(""); ddlPro.DataSource = listPro; ddlPro.DataValueField = "ID"; ddlPro.DataTextField = "Pro_Name"; ddlPro.DataBind(); ddlPro.Items.Insert(0, new ListItem("", "0")); bindClass(ddlYear.SelectedValue, ddlPro.SelectedValue); }
void bindddl() { LabMS.BLL.Lab Lab = new LabMS.BLL.Lab(); List<LabMS.Model.Lab> ParentLab = new List<LabMS.Model.Lab>(); ParentLab = Lab.GetModelList("Lab_ParentID is null"); List<LabMS.Model.Lab> SonLab = new List<LabMS.Model.Lab>(); SonLab = Lab.GetModelList("Lab_ParentID is not null"); for (int i = 0; i < ParentLab.Count; i++) { ddlLabName.Items.Add(new ListItem(ParentLab[i].Lab_Name, ParentLab[i].Lab_Code.ToString())); for (int j = 0; j < SonLab.Count; j++) { if (SonLab[j].Lab_ParentID == ParentLab[i].ID) { ddlLabName.Items.Add(new ListItem("--|" + SonLab[j].Lab_Name, SonLab[j].Lab_Code.ToString())); } } } ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary(); List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>(); listCClass = eDictionary.GetItemListByDClass("shiyanleibie"); ddlProjectCategory.DataSource = listCClass; ddlProjectCategory.DataTextField = "Name"; ddlProjectCategory.DataValueField = "Code"; ddlProjectCategory.DataBind(); listCClass = eDictionary.GetItemListByDClass("shiyanleixing"); ddlProjectType.DataSource = listCClass; ddlProjectType.DataTextField = "Name"; ddlProjectType.DataValueField = "Code"; ddlProjectType.DataBind(); listCClass = eDictionary.GetItemListByDClass("shiyanyaoqiu"); ddlProjectRequire.DataSource = listCClass; ddlProjectRequire.DataTextField = "Name"; ddlProjectRequire.DataValueField = "Code"; ddlProjectRequire.DataBind(); listCClass = eDictionary.GetItemListByDClass("shiyanzheleibie"); ddlProjectPartnerType.DataSource = listCClass; ddlProjectPartnerType.DataTextField = "Name"; ddlProjectPartnerType.DataValueField = "Code"; ddlProjectPartnerType.DataBind(); listCClass = eDictionary.GetItemListByDClass("shiyanxiangmulaiyuan"); ddlProjectComFrom.DataSource = listCClass; ddlProjectComFrom.DataTextField = "Name"; ddlProjectComFrom.DataValueField = "Code"; ddlProjectComFrom.DataBind(); LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting(); ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting(); msys = extendsys.GetCurrentSetting(); List<string> listYear = Common.GradeHelper.GetCurrentGrade((int)msys.CurrentYear, (int)msys.CurrentSemester, false); ddlOPGrade.DataSource = listYear; ddlOPGrade.DataBind(); ddlOPGrade.Items.Insert(0, new ListItem("", "0")); }