Beispiel #1
0
 private void DataPlay()
 {
     if (this.Request.QueryString["op"] != null)
     {
         this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
     }
     if (this.Request.QueryString["id"] != null)
     {
         this.txtdeptid.Text = this.Request.QueryString["id"].ToString();     //部门ID
     }
     if (this.Request.QueryString["lastid"] != null)
     {
         this.txtlastdeptid.Value = this.Request.QueryString["lastid"].ToString();     //上级部门ID
     }
     TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
     //新文档
     if (this.txtop.Value == "add")
     {
         this.txtdeptid.Text = JpDepts.GetMaxDeptid(txtlastdeptid.Value);
     }
     //旧文档
     if (this.txtop.Value == "modify")
     {
         DataTable dt = JpDepts.GetDept(this.txtdeptid.Text);
         if (dt.Rows.Count > 0)
         {
             this.txtdeptname.Text = dt.Rows[0]["deptname"].ToString();
             this.txtdeptsort.Text = dt.Rows[0]["deptsort"].ToString();
         }
     }
 }