Example #1
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {


        BCO.VDS_IVM38_BCO bco = new BCO.VDS_IVM38_BCO(ConntionDB);

        GridViewRow grdRow = (GridViewRow)((LinkButton)sender).Parent.Parent;

        string ITEM = ((Label)grdRow.FindControl("lblITEM")).Text;
        string PERIOD = ((Label)grdRow.FindControl("lblPERIOD")).Text;

            try
            {
                ParameterList.Clear();
                ParameterList.Add(ITEM);
                ParameterList.Add(PERIOD);
                ParameterList.Add(Session["UID"].ToString());

                bco.doDelete(ParameterList);

                ErrorMsgLabel.Text = "刪除成功!";

                DataTable Dt = new DataTable();

                Dt = this.searchData();

                if (Dt == null || (Dt != null && Dt.Rows.Count <= 0))
                {
                    ErrorMsgLabel.Text = "查無資料";
                }
                else
                {

                    #region 將查詢結果放至SESSION
                    Session["IVM381_" + PageTimeStamp.Value] = Dt;
                    #endregion

                }


                #region 設定查詢結果

                this.setGV(0, Dt, false);

                #endregion

            }
            catch (Exception ex)
            {
                ErrorMsgLabel.Text = ex.Message;
            }
    }