public void DataBindToGridview(string IDList) { DataEntityDataContext context = new DataEntityDataContext(); ZWL.BLL.ERPTiKuKaoShi MyLanEmail = new ZWL.BLL.ERPTiKuKaoShi(); var T = context.ERPTiKuKaoShi.Where(p => p.ID>0).OrderByDescending(p => p.ID); EmailList = T.ToList(); }
public void DataBindToGridview(string IDList) { DataEntityDataContext context = new DataEntityDataContext(); ZWL.BLL.ERPTiKuKaoShi MyLanEmail = new ZWL.BLL.ERPTiKuKaoShi(); var T = context.ERPTiKuKaoShi.Where(p => p.UserName == ZWL.Common.PublicMethod.GetSessionValue("UserName")).OrderByDescending(p => p.ID); EmailList = T.ToList(); }
public void DataBindToGridview(string IDList) { ZWL.BLL.ERPTiKuKaoShi MyModel = new ZWL.BLL.ERPTiKuKaoShi(); if (IDList.Trim().Length > 0) { GVData.DataSource = MyModel.GetList(" " + DropDownList2.SelectedItem.Value.ToString() + " like '%" + this.TextBox3.Text.Trim() + "%' and ID in(" + IDList + ") order by ID desc"); } else { GVData.DataSource = MyModel.GetList(" " + DropDownList2.SelectedItem.Value.ToString() + " like '%" + this.TextBox3.Text.Trim() + "%' order by ID desc"); } GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
public void DataBindToGridview(string IDList) { ZWL.BLL.ERPTiKuKaoShi MyModel = new ZWL.BLL.ERPTiKuKaoShi(); if (IDList.Trim().Length > 0) { GVData.DataSource = MyModel.GetList(" " + DropDownList2.SelectedItem.Value.ToString() + " like '%" + this.TextBox3.Text.Trim() + "%' and ID in(" + IDList + ") and UserName='******' order by ID desc"); } else { GVData.DataSource = MyModel.GetList(" " + DropDownList2.SelectedItem.Value.ToString() + " like '%" + this.TextBox3.Text.Trim() + "%' and UserName='******' order by ID desc"); } GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPTiKuKaoShi Modela = new ZWL.BLL.ERPTiKuKaoShi(); Modela.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.lblUserName.Text = Modela.UserName.ToString(); this.lblTimeStr.Text = Modela.TimeStr.ToString(); this.lblShiJuanName.Text = Modela.ShiJuanName.ToString(); //读取试卷信息 ZWL.BLL.ERPTiKuShiJuan Model = new ZWL.BLL.ERPTiKuShiJuan(); Model.GetModel(int.Parse(Modela.ShiJuanID.ToString())); string[] FenLeiSunXu = Model.FenLeiShunXu.Split('|'); for (int j = 0; j < FenLeiSunXu.Length; j++) { string DaBiaoTi = "一"; if (j == 0) { DaBiaoTi = "一"; } else if (j == 1) { DaBiaoTi = "二"; } else if (j == 2) { DaBiaoTi = "三"; } else if (j == 3) { DaBiaoTi = "四"; } else if (j == 4) { DaBiaoTi = "五"; } //绑定当前题目已有的题目 string TiMuIDList = "0"; if (FenLeiSunXu[j].ToString() == "简答题") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='简答题') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); this.Label2.Text = TiMuIDList; if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "、" + FenLeiSunXu[j].ToString() + "(每题" + Model.JianDaFenShu.ToString() + "分,共" + TiMuIDList.Split(',').Length.ToString() + "题,合计" + (Model.JianDaFenShu * TiMuIDList.Split(',').Length).ToString() + "分)<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + ":" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr2(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; this.Label1.Text = this.Label1.Text + "<P>"; } } else { this.Label1.Text = "该试卷无简答题,无需人工阅卷!"; } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPTiKuKaoShi Modela = new ZWL.BLL.ERPTiKuKaoShi(); Modela.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.lblUserName.Text=Modela.UserName.ToString(); this.lblTimeStr.Text=Modela.TimeStr.ToString(); this.lblShiJuanName.Text=Modela.ShiJuanName.ToString(); //��ȡ�Ծ���Ϣ ZWL.BLL.ERPTiKuShiJuan Model = new ZWL.BLL.ERPTiKuShiJuan(); Model.GetModel(int.Parse(Modela.ShiJuanID.ToString())); string[] FenLeiSunXu = Model.FenLeiShunXu.Split('|'); for (int j = 0; j < FenLeiSunXu.Length; j++) { string DaBiaoTi = "һ"; if (j == 0) { DaBiaoTi = "һ"; } else if (j == 1) { DaBiaoTi = "��"; } else if (j == 2) { DaBiaoTi = "��"; } else if (j == 3) { DaBiaoTi = "��"; } else if (j == 4) { DaBiaoTi = "��"; } //��ǰ��Ŀ���е���Ŀ string TiMuIDList = "0"; if (FenLeiSunXu[j].ToString() == "�ж���") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { //һ�� �ж��⣨ÿ��1�֣���20�֣� this.Label1.Text = this.Label1.Text + DaBiaoTi + "��" + FenLeiSunXu[j].ToString() + "��ÿ��" + Model.PanDuanFenShu.ToString() + "�֣���" + TiMuIDList.Split(',').Length.ToString() + "�⣬�ϼ�" + (Model.PanDuanFenShu * TiMuIDList.Split(',').Length).ToString() + "�֣�<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + "��" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; if (MYDT.Tables[0].Rows[i]["ItemsA"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"A\"> A��" + MYDT.Tables[0].Rows[i]["ItemsA"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsB"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"B\"> B��" + MYDT.Tables[0].Rows[i]["ItemsB"].ToString() + "<br>"; } this.Label1.Text = this.Label1.Text + "<P>"; } } } else if (FenLeiSunXu[j].ToString() == "����ѡ����") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "��" + FenLeiSunXu[j].ToString() + "��ÿ��" + Model.DanXuanFenShu.ToString() + "�֣���" + TiMuIDList.Split(',').Length.ToString() + "�⣬�ϼ�" + (Model.DanXuanFenShu * TiMuIDList.Split(',').Length).ToString() + "�֣�<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + "��" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; if (MYDT.Tables[0].Rows[i]["ItemsA"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"A\"> A��" + MYDT.Tables[0].Rows[i]["ItemsA"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsB"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"B\"> B��" + MYDT.Tables[0].Rows[i]["ItemsB"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsC"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"C\"> C��" + MYDT.Tables[0].Rows[i]["ItemsC"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsD"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"D\"> D��" + MYDT.Tables[0].Rows[i]["ItemsD"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsE"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"E\"> E��" + MYDT.Tables[0].Rows[i]["ItemsE"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsF"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"F\"> F��" + MYDT.Tables[0].Rows[i]["ItemsF"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsG"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"G\"> G��" + MYDT.Tables[0].Rows[i]["ItemsG"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsH"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"H\"> H��" + MYDT.Tables[0].Rows[i]["ItemsH"].ToString() + "<br>"; } this.Label1.Text = this.Label1.Text + "<P>"; } } } else if (FenLeiSunXu[j].ToString() == "����ѡ����") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "��" + FenLeiSunXu[j].ToString() + "��ÿ��" + Model.DuoXuanFenShu.ToString() + "�֣���" + TiMuIDList.Split(',').Length.ToString() + "�⣬�ϼ�" + (Model.DuoXuanFenShu * TiMuIDList.Split(',').Length).ToString() + "�֣�<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + "��" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; if (MYDT.Tables[0].Rows[i]["ItemsA"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-A\" value=\"A\"> A��" + MYDT.Tables[0].Rows[i]["ItemsA"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsB"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-B\" value=\"B\"> B��" + MYDT.Tables[0].Rows[i]["ItemsB"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsC"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-C\" value=\"C\"> C��" + MYDT.Tables[0].Rows[i]["ItemsC"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsD"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-D\" value=\"D\"> D��" + MYDT.Tables[0].Rows[i]["ItemsD"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsE"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-E\" value=\"E\"> E��" + MYDT.Tables[0].Rows[i]["ItemsE"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsF"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-F\" value=\"F\"> F��" + MYDT.Tables[0].Rows[i]["ItemsF"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsG"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-G\" value=\"G\"> G��" + MYDT.Tables[0].Rows[i]["ItemsG"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsH"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-H\" value=\"H\"> H��" + MYDT.Tables[0].Rows[i]["ItemsH"].ToString() + "<br>"; } this.Label1.Text = this.Label1.Text + "<P>"; } } } else if (FenLeiSunXu[j].ToString() == "�����") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "��" + FenLeiSunXu[j].ToString() + "��ÿ��" + Model.TianKongFenShu.ToString() + "�֣���" + TiMuIDList.Split(',').Length.ToString() + "�⣬�ϼ�" + (Model.TianKongFenShu * TiMuIDList.Split(',').Length).ToString() + "�֣�<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + "��" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr2(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; this.Label1.Text = this.Label1.Text + "<P>"; } } } else if (FenLeiSunXu[j].ToString() == "�����") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "��" + FenLeiSunXu[j].ToString() + "��ÿ��" + Model.JianDaFenShu.ToString() + "�֣���" + TiMuIDList.Split(',').Length.ToString() + "�⣬�ϼ�" + (Model.JianDaFenShu * TiMuIDList.Split(',').Length).ToString() + "�֣�<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + "��" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr2(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; this.Label1.Text = this.Label1.Text + "<P>"; } } } } //дϵͳ��־ ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "�û��鿴���߿�����Ϣ(" + this.lblUserName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPTiKuKaoShi Modela = new ZWL.BLL.ERPTiKuKaoShi(); Modela.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.lblUserName.Text = Modela.UserName.ToString(); this.lblTimeStr.Text = Modela.TimeStr.ToString(); this.lblShiJuanName.Text = Modela.ShiJuanName.ToString(); //读取试卷信息 ZWL.BLL.ERPTiKuShiJuan Model = new ZWL.BLL.ERPTiKuShiJuan(); Model.GetModel(int.Parse(Modela.ShiJuanID.ToString())); string[] FenLeiSunXu = Model.FenLeiShunXu.Split('|'); for (int j = 0; j < FenLeiSunXu.Length; j++) { string DaBiaoTi = "一"; if (j == 0) { DaBiaoTi = "一"; } else if (j == 1) { DaBiaoTi = "二"; } else if (j == 2) { DaBiaoTi = "三"; } else if (j == 3) { DaBiaoTi = "四"; } else if (j == 4) { DaBiaoTi = "五"; } //绑定当前题目已有的题目 string TiMuIDList = "0"; if (FenLeiSunXu[j].ToString() == "简答题") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='简答题') and KaoShiID="+Request.QueryString["ID"].ToString()).Replace('|',','); this.Label2.Text = TiMuIDList; if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "、" + FenLeiSunXu[j].ToString() + "(每题" + Model.JianDaFenShu.ToString() + "分,共" + TiMuIDList.Split(',').Length.ToString() + "题,合计" + (Model.JianDaFenShu * TiMuIDList.Split(',').Length).ToString() + "分)<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + ":" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr2(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; this.Label1.Text = this.Label1.Text + "<P>"; } } else { this.Label1.Text = "该试卷无简答题,无需人工阅卷!"; } } } } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZWL.BLL.ERPTiKuKaoShi Model0 = new ZWL.BLL.ERPTiKuKaoShi(); Model0.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); Model0.TimeStr = DateTime.Now; Model0.ShiJuanName = this.DropDownList1.SelectedItem.Text; Model0.ShiJuanID = int.Parse(this.DropDownList1.SelectedValue); int MaxID=Model0.Add(); this.Panel1.Visible = false; //��ȡ�Ծ���Ϣ ZWL.BLL.ERPTiKuShiJuan Model = new ZWL.BLL.ERPTiKuShiJuan(); Model.GetModel(int.Parse(this.DropDownList1.SelectedItem.Value.ToString())); MaxTime = int.Parse(Model.KaoShiXianShi.ToString()) * 60;//������ʱ string[] FenLeiSunXu = Model.FenLeiShunXu.Split('|'); for (int j = 0; j < FenLeiSunXu.Length; j++) { //��ǰ��Ŀ���е���Ŀ string TiMuIDList = "0"; if (FenLeiSunXu[j].ToString() == "�ж���") { TiMuIDList = this.Lab1.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID =int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string UserDaAnStr = ""; try { UserDaAnStr= Request.Form["rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString()].ToString(); } catch { } Model1.UserDaAn = UserDaAnStr; if (UserDaAnStr == MYDT.Tables[0].Rows[i]["AnswerStr"].ToString()) { Model1.DeFen = Model.PanDuanFenShu; } else { Model1.DeFen = 0; } Model1.Add(); } } else if (FenLeiSunXu[j].ToString() == "����ѡ����") { TiMuIDList = this.Lab2.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID = int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string UserDaAnStr = ""; try { UserDaAnStr = Request.Form["rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString()].ToString(); } catch { } Model1.UserDaAn = UserDaAnStr; if (UserDaAnStr == MYDT.Tables[0].Rows[i]["AnswerStr"].ToString()) { Model1.DeFen = Model.DanXuanFenShu; } else { Model1.DeFen = 0; } Model1.Add(); } } else if (FenLeiSunXu[j].ToString() == "����ѡ����") { TiMuIDList = this.Lab3.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID = int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string DangQianDaAnStr = ""; try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-A"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-B"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-C"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-D"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-E"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-F"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-G"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-H"].ToString(); } catch { } Model1.UserDaAn = DangQianDaAnStr; if (DangQianDaAnStr == MYDT.Tables[0].Rows[i]["AnswerStr"].ToString()) { Model1.DeFen = Model.DuoXuanFenShu; } else { Model1.DeFen = 0; } Model1.Add(); } } else if (FenLeiSunXu[j].ToString() == "�����") { TiMuIDList = this.Lab4.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID = int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string UserDaAnStr = ""; try { UserDaAnStr = Request.Form["text-" + MYDT.Tables[0].Rows[i]["ID"].ToString()].ToString(); } catch { } Model1.UserDaAn = UserDaAnStr; if (UserDaAnStr == MYDT.Tables[0].Rows[i]["AnswerStr"].ToString()) { Model1.DeFen = Model.TianKongFenShu; } else { Model1.DeFen = 0; } Model1.Add(); } } else if (FenLeiSunXu[j].ToString() == "�����") { TiMuIDList = this.Lab5.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID = int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string UserDaAnStr = ""; try { UserDaAnStr = Request.Form["textarea-" + MYDT.Tables[0].Rows[i]["ID"].ToString()].ToString(); } catch { } Model1.UserDaAn = UserDaAnStr; Model1.DeFen =null; Model1.Add(); } } } //дϵͳ��־ ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "�û�������߿�����Ϣ(" + this.DropDownList1.SelectedItem.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "���߿�����Ϣ��ӳɹ�����ǰ�����ľ�÷֣�" + ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select sum(DeFen) from ERPTiKuKaoShiJieGuo where KaoShiID=" + MaxID.ToString()) + "���˷����������˹��ľ������", "TiKuKaoShi.aspx"); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZWL.BLL.ERPTiKuKaoShi Model0 = new ZWL.BLL.ERPTiKuKaoShi(); Model0.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); Model0.TimeStr = DateTime.Now; Model0.ShiJuanName = this.DropDownList1.SelectedItem.Text; Model0.ShiJuanID = int.Parse(this.DropDownList1.SelectedValue); int MaxID = Model0.Add(); this.Panel1.Visible = false; //读取试卷信息 ZWL.BLL.ERPTiKuShiJuan Model = new ZWL.BLL.ERPTiKuShiJuan(); Model.GetModel(int.Parse(this.DropDownList1.SelectedItem.Value.ToString())); MaxTime = int.Parse(Model.KaoShiXianShi.ToString()) * 60;//考试限时 string[] FenLeiSunXu = Model.FenLeiShunXu.Split('|'); for (int j = 0; j < FenLeiSunXu.Length; j++) { //绑定当前题目已有的题目 string TiMuIDList = "0"; if (FenLeiSunXu[j].ToString() == "判断题") { TiMuIDList = this.Lab1.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID = int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string UserDaAnStr = ""; try { UserDaAnStr = Request.Form["rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString()].ToString(); } catch { } Model1.UserDaAn = UserDaAnStr; if (UserDaAnStr == MYDT.Tables[0].Rows[i]["AnswerStr"].ToString()) { Model1.DeFen = Model.PanDuanFenShu; } else { Model1.DeFen = 0; } Model1.Add(); } } else if (FenLeiSunXu[j].ToString() == "单项选择题") { TiMuIDList = this.Lab2.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID = int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string UserDaAnStr = ""; try { UserDaAnStr = Request.Form["rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString()].ToString(); } catch { } Model1.UserDaAn = UserDaAnStr; if (UserDaAnStr == MYDT.Tables[0].Rows[i]["AnswerStr"].ToString()) { Model1.DeFen = Model.DanXuanFenShu; } else { Model1.DeFen = 0; } Model1.Add(); } } else if (FenLeiSunXu[j].ToString() == "多项选择题") { TiMuIDList = this.Lab3.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID = int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string DangQianDaAnStr = ""; try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-A"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-B"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-C"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-D"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-E"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-F"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-G"].ToString(); } catch { } try { DangQianDaAnStr = DangQianDaAnStr + Request.Form["CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-H"].ToString(); } catch { } Model1.UserDaAn = DangQianDaAnStr; if (DangQianDaAnStr == MYDT.Tables[0].Rows[i]["AnswerStr"].ToString()) { Model1.DeFen = Model.DuoXuanFenShu; } else { Model1.DeFen = 0; } Model1.Add(); } } else if (FenLeiSunXu[j].ToString() == "填空题") { TiMuIDList = this.Lab4.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID = int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string UserDaAnStr = ""; try { UserDaAnStr = Request.Form["text-" + MYDT.Tables[0].Rows[i]["ID"].ToString()].ToString(); } catch { } Model1.UserDaAn = UserDaAnStr; if (UserDaAnStr == MYDT.Tables[0].Rows[i]["AnswerStr"].ToString()) { Model1.DeFen = Model.TianKongFenShu; } else { Model1.DeFen = 0; } Model1.Add(); } } else if (FenLeiSunXu[j].ToString() == "简答题") { TiMuIDList = this.Lab5.Text; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { ZWL.BLL.ERPTiKuKaoShiJieGuo Model1 = new ZWL.BLL.ERPTiKuKaoShiJieGuo(); Model1.KaoShiID = MaxID; Model1.TiMuID = int.Parse(MYDT.Tables[0].Rows[i]["ID"].ToString()); Model1.DaAn = MYDT.Tables[0].Rows[i]["AnswerStr"].ToString(); string UserDaAnStr = ""; try { UserDaAnStr = Request.Form["textarea-" + MYDT.Tables[0].Rows[i]["ID"].ToString()].ToString(); } catch { } Model1.UserDaAn = UserDaAnStr; Model1.DeFen = null; Model1.Add(); } } } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加在线考试信息(" + this.DropDownList1.SelectedItem.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "在线考试信息添加成功!当前电脑阅卷得分:" + ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select sum(DeFen) from ERPTiKuKaoShiJieGuo where KaoShiID=" + MaxID.ToString()) + ",此分数不包含人工阅卷分数!", "TiKuKaoShi.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPTiKuKaoShi Modela = new ZWL.BLL.ERPTiKuKaoShi(); Modela.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.lblUserName.Text = Modela.UserName.ToString(); this.lblTimeStr.Text = Modela.TimeStr.ToString(); this.lblShiJuanName.Text = Modela.ShiJuanName.ToString(); //读取试卷信息 ZWL.BLL.ERPTiKuShiJuan Model = new ZWL.BLL.ERPTiKuShiJuan(); Model.GetModel(int.Parse(Modela.ShiJuanID.ToString())); string[] FenLeiSunXu = Model.FenLeiShunXu.Split('|'); for (int j = 0; j < FenLeiSunXu.Length; j++) { string DaBiaoTi = "一"; if (j == 0) { DaBiaoTi = "一"; } else if (j == 1) { DaBiaoTi = "二"; } else if (j == 2) { DaBiaoTi = "三"; } else if (j == 3) { DaBiaoTi = "四"; } else if (j == 4) { DaBiaoTi = "五"; } //绑定当前题目已有的题目 string TiMuIDList = "0"; if (FenLeiSunXu[j].ToString() == "判断题") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { //一、 判断题(每题1分,共20分) this.Label1.Text = this.Label1.Text + DaBiaoTi + "、" + FenLeiSunXu[j].ToString() + "(每题" + Model.PanDuanFenShu.ToString() + "分,共" + TiMuIDList.Split(',').Length.ToString() + "题,合计" + (Model.PanDuanFenShu * TiMuIDList.Split(',').Length).ToString() + "分)<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + ":" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; if (MYDT.Tables[0].Rows[i]["ItemsA"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"A\"> A:" + MYDT.Tables[0].Rows[i]["ItemsA"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsB"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"B\"> B:" + MYDT.Tables[0].Rows[i]["ItemsB"].ToString() + "<br>"; } this.Label1.Text = this.Label1.Text + "<P>"; } } } else if (FenLeiSunXu[j].ToString() == "单项选择题") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "、" + FenLeiSunXu[j].ToString() + "(每题" + Model.DanXuanFenShu.ToString() + "分,共" + TiMuIDList.Split(',').Length.ToString() + "题,合计" + (Model.DanXuanFenShu * TiMuIDList.Split(',').Length).ToString() + "分)<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + ":" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; if (MYDT.Tables[0].Rows[i]["ItemsA"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"A\"> A:" + MYDT.Tables[0].Rows[i]["ItemsA"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsB"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"B\"> B:" + MYDT.Tables[0].Rows[i]["ItemsB"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsC"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"C\"> C:" + MYDT.Tables[0].Rows[i]["ItemsC"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsD"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"D\"> D:" + MYDT.Tables[0].Rows[i]["ItemsD"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsE"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"E\"> E:" + MYDT.Tables[0].Rows[i]["ItemsE"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsF"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"F\"> F:" + MYDT.Tables[0].Rows[i]["ItemsF"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsG"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"G\"> G:" + MYDT.Tables[0].Rows[i]["ItemsG"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsH"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"radio\" name=\"rad-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "\" value=\"H\"> H:" + MYDT.Tables[0].Rows[i]["ItemsH"].ToString() + "<br>"; } this.Label1.Text = this.Label1.Text + "<P>"; } } } else if (FenLeiSunXu[j].ToString() == "多项选择题") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "、" + FenLeiSunXu[j].ToString() + "(每题" + Model.DuoXuanFenShu.ToString() + "分,共" + TiMuIDList.Split(',').Length.ToString() + "题,合计" + (Model.DuoXuanFenShu * TiMuIDList.Split(',').Length).ToString() + "分)<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + ":" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; if (MYDT.Tables[0].Rows[i]["ItemsA"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-A\" value=\"A\"> A:" + MYDT.Tables[0].Rows[i]["ItemsA"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsB"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-B\" value=\"B\"> B:" + MYDT.Tables[0].Rows[i]["ItemsB"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsC"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-C\" value=\"C\"> C:" + MYDT.Tables[0].Rows[i]["ItemsC"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsD"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-D\" value=\"D\"> D:" + MYDT.Tables[0].Rows[i]["ItemsD"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsE"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-E\" value=\"E\"> E:" + MYDT.Tables[0].Rows[i]["ItemsE"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsF"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-F\" value=\"F\"> F:" + MYDT.Tables[0].Rows[i]["ItemsF"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsG"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-G\" value=\"G\"> G:" + MYDT.Tables[0].Rows[i]["ItemsG"].ToString() + "<br>"; } if (MYDT.Tables[0].Rows[i]["ItemsH"].ToString().Trim().Length > 0) { this.Label1.Text = this.Label1.Text + " <input type=\"checkbox\" name=\"CHK-" + MYDT.Tables[0].Rows[i]["ID"].ToString() + "-H\" value=\"H\"> H:" + MYDT.Tables[0].Rows[i]["ItemsH"].ToString() + "<br>"; } this.Label1.Text = this.Label1.Text + "<P>"; } } } else if (FenLeiSunXu[j].ToString() == "填空题") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "、" + FenLeiSunXu[j].ToString() + "(每题" + Model.TianKongFenShu.ToString() + "分,共" + TiMuIDList.Split(',').Length.ToString() + "题,合计" + (Model.TianKongFenShu * TiMuIDList.Split(',').Length).ToString() + "分)<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + ":" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr2(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; this.Label1.Text = this.Label1.Text + "<P>"; } } } else if (FenLeiSunXu[j].ToString() == "简答题") { TiMuIDList = ZWL.DBUtility.DbHelperSQL.GetStringList("select TiMuID from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='" + FenLeiSunXu[j].ToString() + "') and KaoShiID=" + Request.QueryString["ID"].ToString()).Replace('|', ','); if (TiMuIDList.Trim().Length > 0 && TiMuIDList.Trim() != "0") { this.Label1.Text = this.Label1.Text + DaBiaoTi + "、" + FenLeiSunXu[j].ToString() + "(每题" + Model.JianDaFenShu.ToString() + "分,共" + TiMuIDList.Split(',').Length.ToString() + "题,合计" + (Model.JianDaFenShu * TiMuIDList.Split(',').Length).ToString() + "分)<hr>"; DataSet MYDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPTiKu where ID in('" + TiMuIDList.Replace(",", "','") + "')"); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { int TempNum = i + 1; this.Label1.Text = this.Label1.Text + TempNum.ToString() + ":" + MYDT.Tables[0].Rows[i]["TitleStr"].ToString() + "" + JieDaStr2(MYDT.Tables[0].Rows[i]["ID"].ToString(), Request.QueryString["ID"].ToString()) + "<br>"; this.Label1.Text = this.Label1.Text + "<P>"; } } } } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户查看在线考试信息(" + this.lblUserName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); } }