protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Jium.BLL.currentalarm bll = new Jium.BLL.currentalarm();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             long id = (Convert.ToInt64(Request.Params["id"]));
             bll.Delete(id);
             Response.Redirect("list.aspx");
         }
     }
 }
Beispiel #2
0
 private void ShowInfo(long id)
 {
     Jium.BLL.currentalarm   bll   = new Jium.BLL.currentalarm();
     Jium.Model.currentalarm model = bll.GetModel(id);
     this.lblid.Text           = model.id.ToString();
     this.lblalarmname.Text    = model.alarmname;
     this.lblalarmdesc.Text    = model.alarmdesc;
     this.lblcreatetime.Text   = model.createtime;
     this.lblupdatetime.Text   = model.updatetime;
     this.lblownerid.Text      = model.ownerid.ToString();
     this.lblhandlerid.Text    = model.handlerid.ToString();
     this.lblalarmtype.Text    = model.alarmtype.ToString();
     this.lbloperateid.Text    = model.operateid.ToString();
     this.lblhandlestatus.Text = model.handlestatus.ToString();
     this.lblconfirmtime.Text  = model.confirmtime;
     this.lblhandledetail.Text = model.handledetail;
 }
Beispiel #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtalarmname.Text.Trim().Length == 0)
            {
                strErr += "alarmname不能为空!\\n";
            }
            if (this.txtalarmdesc.Text.Trim().Length == 0)
            {
                strErr += "alarmdesc不能为空!\\n";
            }
            if (this.txtcreatetime.Text.Trim().Length == 0)
            {
                strErr += "createtime不能为空!\\n";
            }
            if (this.txtupdatetime.Text.Trim().Length == 0)
            {
                strErr += "updatetime不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtownerid.Text))
            {
                strErr += "ownerid格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txthandlerid.Text))
            {
                strErr += "handlerid格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtalarmtype.Text))
            {
                strErr += "alarmtype格式错误!\\n";
            }
            if (this.txtoperateid.Text.Trim().Length == 0)
            {
                strErr += "operateid不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txthandlestatus.Text))
            {
                strErr += "handlestatus格式错误!\\n";
            }
            if (this.txtconfirmtime.Text.Trim().Length == 0)
            {
                strErr += "confirmtime不能为空!\\n";
            }
            if (this.txthandledetail.Text.Trim().Length == 0)
            {
                strErr += "handledetail不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string alarmname    = this.txtalarmname.Text;
            string alarmdesc    = this.txtalarmdesc.Text;
            string createtime   = this.txtcreatetime.Text;
            string updatetime   = this.txtupdatetime.Text;
            int    ownerid      = int.Parse(this.txtownerid.Text);
            int    handlerid    = int.Parse(this.txthandlerid.Text);
            int    alarmtype    = int.Parse(this.txtalarmtype.Text);
            string operateid    = this.txtoperateid.Text;
            int    handlestatus = int.Parse(this.txthandlestatus.Text);
            string confirmtime  = this.txtconfirmtime.Text;
            string handledetail = this.txthandledetail.Text;

            Jium.Model.currentalarm model = new Jium.Model.currentalarm();
            model.alarmname    = alarmname;
            model.alarmdesc    = alarmdesc;
            model.createtime   = createtime;
            model.updatetime   = updatetime;
            model.ownerid      = ownerid;
            model.handlerid    = handlerid;
            model.alarmtype    = alarmtype;
            model.operateid    = long.Parse(operateid);
            model.handlestatus = handlestatus;
            model.confirmtime  = confirmtime;
            model.handledetail = handledetail;

            Jium.BLL.currentalarm bll = new Jium.BLL.currentalarm();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }