//取得grade约束 public List <CheckGrade> examSubjectNoToGetCheckGrade(ExamSubject examSubject) { //取要限制的科目编号 string sql = "select * from check_grade where examSubjectNo=@examSubjectNo"; SqlParameter[] pars = { new SqlParameter("@examSubjectNo", SqlDbType.Int) }; pars[0].Value = examSubject.id; DataTable da = SqlHelper.GetTable(sql, CommandType.Text, pars); List <CheckGrade> list = new List <CheckGrade>(); if (da.Rows.Count > 0) { CheckGrade check = null; list = new List <CheckGrade>(); foreach (DataRow datarow in da.Rows) { check = new CheckGrade(); LoadGrade(datarow, check); list.Add(check); } } return(list); }
void CheckPointSet_Click(object sender, RoutedEventArgs e) { CheckGrade form = new CheckGrade(FormTypes.Browse, "", "0"); EntityBrowser browser = new EntityBrowser(form); browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); }
private void Button_Click(object sender, RoutedEventArgs e) { if (DtGrid.SelectedItem != null) { T_HR_EMPLOYEECHECK ent = DtGrid.SelectedItem as T_HR_EMPLOYEECHECK; CheckGrade form = new CheckGrade(ent.BEREGULARID, ent.T_HR_EMPLOYEE.EMPLOYEEID, "0"); EntityBrowser browser = new EntityBrowser(form); browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); } }
void btnEdit_Click(object sender, RoutedEventArgs e) { if (DtGrid.SelectedItems.Count > 0) { T_HR_ASSESSMENTFORMMASTER ent = DtGrid.SelectedItems[0] as T_HR_ASSESSMENTFORMMASTER; CheckGrade form = new CheckGrade(ent.ASSESSMENTFORMMASTERID, ent.EMPLOYEEID, ent.EMPLOYEELEVEL); EntityBrowser browser = new EntityBrowser(form); //browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => {}); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Response.Write(" 1 IsPostBack:" + IsPostBack + "</br>"); examSubject.id = Convert.ToInt32(Request.QueryString["id"]); Sub = examSubjectDalServer.GetSubject(examSubject); // Response.Write("</br>+Sub.detail" + Sub.detail + "==" + Sub.examPlace); TextBox3.Text = Sub.examPlace; TextBox1.Text = Sub.detail; //CheckBoxList1.Items[0].Selected = true; //取得grade约束 List <CheckGrade> clist = examSubjectDalServer.examSubjectNoToGetCheckGrade(examSubject); Boolean f1 = false; for (int i = 0; i < CheckBoxList1.Items.Count; i++) { foreach (var cl in clist) { if (CheckBoxList1.Items[i].Text == cl.grade) { CheckBoxList1.Items[i].Selected = true; f1 = true; } } } //分类 下拉框待选中 if (f1) { RadioButton2.Checked = true; } else { RadioButton1.Checked = true; // CheckBoxList1.Visible = false; Response.Write("<script>visableF();</script>"); } } else { // Response.Write("2 IsPostBack-true:" + IsPostBack + "</br>"); examSubject.id = Convert.ToInt32(Request.QueryString["id"]); examSubject.name = Request.Form["name"]; examSubject.ApplyStar = Convert.ToDateTime(Request.Form["ApplyStar"]); examSubject.ApplyEnd = Convert.ToDateTime(Request.Form["ApplyEnd"]); examSubject.ExamStar = Convert.ToDateTime(Request.Form["ExamStar"]); examSubject.ExamEnd = Convert.ToDateTime(Request.Form["ExamEnd"]); examSubject.examPlace = TextBox3.Text; examSubject.detail = TextBox1.Text; examSubject.classifyName = DropDownList1.SelectedValue; Major major = null; List <Major> cm = new List <Major>(); for (int i = 0; i < CheckBoxList2.Items.Count; i++) { if (CheckBoxList2.Items[i].Selected) { major = new Major(); major.name = CheckBoxList2.Items[i].Text; cm.Add(major); } } List <CheckGrade> cl = new List <CheckGrade>(); CheckGrade cg = null; for (int i = 0; i < CheckBoxList1.Items.Count; i++) { if (CheckBoxList1.Items[i].Selected) { cg = new CheckGrade(); cg.grade = CheckBoxList1.Items[i].Text; cl.Add(cg); } } examSubjectDalServer.updateCheck(cm, cl, examSubject, RadioButton1.Checked, RadioButton3.Checked); if (examSubjectDalServer.UpdateExamSubject(examSubject) > 0) { Response.Redirect("SubjectManage.aspx"); } else { Response.Write("修改失败"); } } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { ExamSubject examSubject = new ExamSubject(); examSubject.name = Request.Form["mz"].Trim(); examSubject.ApplyStar = Convert.ToDateTime(Request.Form["as"]); examSubject.ApplyEnd = Convert.ToDateTime(Request.Form["ae"]); examSubject.ExamEnd = Convert.ToDateTime(Request.Form["ee"]); examSubject.ExamStar = Convert.ToDateTime(Request.Form["es"]); examSubject.examPlace = TextBox3.Text; examSubject.detail = TextBox1.Text; examSubject.classifyName = DropDownList1.SelectedValue; Major major = null; List <Major> mlist = new List <Major>(); for (int i = 0; i < CheckBoxList2.Items.Count; i++) { if (CheckBoxList2.Items[i].Selected) { major = new Major(); major.name = CheckBoxList2.Items[i].Text; mlist.Add(major); } } List <CheckGrade> clist = new List <CheckGrade>(); CheckGrade cg = null; for (int i = 0; i < CheckBoxList1.Items.Count; i++) { if (CheckBoxList1.Items[i].Selected) { cg = new CheckGrade(); cg.grade = CheckBoxList1.Items[i].Text; clist.Add(cg); } } ExamSubjectDalServer examSubjectDalServer = new ExamSubjectDalServer(); if (Request.Form["r1"] == "无限制") { clist.Clear(); } if (Request.Form["r2"] == "无限制") { mlist.Clear(); } //string // DropDownList1.SelectedValue //classifyName examSubjectDalServer.AddSubject(examSubject); examSubjectDalServer.AddMajors(mlist, clist, examSubject); Response.Redirect("SubjectManage.aspx"); } }
public void LoadGrade(DataRow rows, CheckGrade check) { check.examsubjecSubject = Convert.ToInt32(rows["examSubjectNo"]); check.grade = rows["checkGrade"] != null ? rows["checkGrade"].ToString().Trim() : string.Empty; }