tijian_tieying/web/Web/Moa/DocFile/TiKuAdd.aspx.cs

72 lines
2.8 KiB
C#
Raw Normal View History

2025-02-20 12:14:39 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Moa_DocFile_TiKuAdd : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
ZWL.Common.PublicMethod.CheckSession();
//设置上传的附件为空
ZWL.Common.PublicMethod.SetSessionValue("WenJianList", "");
//判断题目类型然后设置Panel的显示与否
if (Request.QueryString["FenLeiStr"].ToString() == "判断题")
{
this.Panel2.Visible = false;
this.Panel1.Visible = true;
this.txtItemsA.Text = "正确";
this.txtItemsB.Text = "错误";
}
else if (Request.QueryString["FenLeiStr"].ToString() == "填空题")
{
this.Panel1.Visible = false;
this.Panel2.Visible = false;
}
else if (Request.QueryString["FenLeiStr"].ToString() == "简答题")
{
this.Panel1.Visible = false;
this.Panel2.Visible = false;
this.txtAnswerStr.Height = Unit.Parse("60");
this.txtAnswerStr.TextMode = TextBoxMode.MultiLine;
}
}
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
ZWL.BLL.ERPTiKu Model = new ZWL.BLL.ERPTiKu();
Model.TitleStr = this.txtTitleStr.Text.ToString();
Model.ItemsA = this.txtItemsA.Text.ToString();
Model.ItemsB = this.txtItemsB.Text.ToString();
Model.ItemsC = this.txtItemsC.Text.ToString();
Model.ItemsD = this.txtItemsD.Text.ToString();
Model.ItemsE = this.txtItemsE.Text.ToString();
Model.ItemsF = this.txtItemsF.Text.ToString();
Model.ItemsG = this.txtItemsG.Text.ToString();
Model.ItemsH = this.txtItemsH.Text.ToString();
Model.AnswerStr = this.txtAnswerStr.Text.ToString();
Model.TiKuID = int.Parse(Request.QueryString["TiKuID"].ToString());
Model.FenLeiStr = Request.QueryString["FenLeiStr"].ToString();
Model.Add();
//写系统日志
ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
MyRiZhi.DoSomething = "用户添加题库管理信息(" + this.txtTitleStr.Text + ")";
MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
MyRiZhi.Add();
ZWL.Common.MessageBox.ShowAndRedirect(this, "题库管理信息添加成功!", "TiKu.aspx?TiKuID=" + Request.QueryString["TiKuID"].ToString() + "&FenLeiStr=" + Request.QueryString["FenLeiStr"].ToString());
}
}