Beispiel #1
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        MaintainPurchaseOrder bcop = new MaintainPurchaseOrder(ConntionDB);
        bool IsAcceptOK = bcop.CheckPurchaseIsACCEPT(this.txtPURCHASE_NO.Text);
        if (IsAcceptOK)
        {

            ErrorMsgLabel.Text = "該筆已有驗收單資料,不可進行刪除!!";
            return;
        }
        else
        {

            //CheckVendorAccountClose BCO_CHECK = new CheckVendorAccountClose(ConntionDB);
            //if (BCO_CHECK.CheckVendorCloseStaus(txtONWAY_DATE.Text.Replace("/", "")) == "1")
            //{
            //    ErrorMsgLabel.Text = "在途日 " + txtONWAY_DATE.Text.Replace("/", "") + " 已日結,不可刪除在途單。";
            //    return;
            //}
            //else
            //{
            try
            {

                DataTable dt1 = (DataTable)Session[PageTimeStamp.Value + GridView1.ID];
                DataTable dt2 = (DataTable)Session[PageTimeStamp.Value + GridView2.ID];

                string strNowDate = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");

                MaintainGoodsInTransit BCO = new MaintainGoodsInTransit(ConntionDB);

                bool bResult = false;

                //0.Item DataTable
                //1.Gift DataTable        
                //2.ONWAY_NO                        
                //3.UPDATEDATE
                //4.UPDATEUID            
                //5.OLD_UPDATEDATE
                //6.OLD_UPDATEUID            
                ParameterList.Clear();
                ParameterList.Add(dt1);                         //0
                ParameterList.Add(dt2);                         //1            
                ParameterList.Add(txtONWAY_NO.Text);            //2
                ParameterList.Add(strNowDate);                  //3
                ParameterList.Add(Session["UID"].ToString());   //4
                ParameterList.Add(hdfOLD_UPDATEDATE.Value);     //5
                ParameterList.Add(SLP_UPDATEUID.Text);          //6

                bResult = BCO.DeleteGoodsInTransit(ParameterList);

                Response.Redirect("PUR051.aspx?Code=PUR05", false);
            }
            catch (Exception ex)
            {
                ErrorMsgLabel.Text = ex.Message;
            }
            finally { }

            //}
        }
    }