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"); }