예제 #1
0
 protected void ImgModifybtn_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string CKDH = this.txtCKDH.Text.Trim();
         string CK   = this.drpFHCK.SelectedValue;
         if (string.IsNullOrEmpty(CKDH))
         {
             this.PrintfError("请选择要修改的单据");
             return;
         }
         int status = QTCKQuery.GetStatus(CKDH);
         if (status > 0)
         {
             this.PrintfError("该单据已经执行,不能修改");
             return;
         }
         this.hidZT.Value = "Modify";
         ChangeStatus();
         DataSet ds = QTCKQuery.GetItem(CKDH);
         Session["QTCKITEM"] = null;
         Session["QTCKITEM"] = ds;
         this.frameItem.Attributes["src"] = "QTCKD_item.aspx?FHCK=" + CK;
     }
     catch
     {
         this.PrintfError("数据访问错误");
         return;
     }
 }
예제 #2
0
 /// <summary>
 /// 根据出库单号查询其它出库单概要及明细并赋值给Session,并给各个文本框赋值,并向子页面发送当前状态是浏览状态的信息,子页面会获得Session并绑定明细Grid
 /// </summary>
 private void InitAllByCKDH(string CKDH)
 {
     try
     {
         this.txtCKDH.Text = CKDH;
         DataSet ds = QTCKQuery.GetItem(CKDH);
         Session["QTCKITEM"] = ds;
         this.frameItem.Attributes["src"] = "QTCKD_item.aspx?ZT=Browse";
         if (ds != null && ds.Tables[1].Rows.Count > 0)
         {
             this.drpFHCK.SelectedValue = ds.Tables[1].Rows[0]["CK"].ToString();
             if (ds.Tables[1].Rows[0]["CPH"] != null)
             {
                 this.txtCPH.Text = ds.Tables[1].Rows[0]["CPH"].ToString();
             }
             if (ds.Tables[1].Rows[0]["AimAdress"] != null)
             {
                 this.txtMDD.Text = ds.Tables[1].Rows[0]["AimAdress"].ToString();
             }
             if (ds.Tables[1].Rows[0]["ZDR"] != null)
             {
                 this.txtZDR.Text = ds.Tables[1].Rows[0]["ZDR"].ToString();
             }
             if (ds.Tables[1].Rows[0]["ZDRQ"] != null)
             {
                 this.txtZDRQ.Text = ds.Tables[1].Rows[0]["ZDRQ"].ToString();
             }
             if (ds.Tables[1].Rows[0]["statusName"] != null)
             {
                 this.txtStatus.Text = ds.Tables[1].Rows[0]["statusName"].ToString();
             }
             if (ds.Tables[1].Rows[0]["CKLX"] != null)
             {
                 this.drpCKLX.Text = ds.Tables[1].Rows[0]["CKLX"].ToString();
             }
             if (ds.Tables[1].Rows[0]["NCDJ"] != null)
             {
                 this.txtNCDJ.Text = ds.Tables[1].Rows[0]["NCDJ"].ToString();
             }
             if (ds.Tables[1].Rows[0]["CYS"] != null)
             {
                 this.drpCYS.SelectedValue = ds.Tables[1].Rows[0]["CYS"].ToString();
             }
             if (ds.Tables[1].Rows[0]["FYSJ"] != null)
             {
                 this.txtFYRQ.Text = ds.Tables[1].Rows[0]["FYSJ"].ToString();
             }
             if (ds.Tables[1].Rows[0]["SHDW"] != null)
             {
                 this.drpSHDW.Text = ds.Tables[1].Rows[0]["SHDW"].ToString();
             }
         }
     }
     catch
     {
         this.PrintfError("查询后给父窗体赋值时出现错误,请重试");
         return;
     }
 }