Exemple #1
0
    //審核確認
    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        #region
        try
        {

            BCO.MaintainStoreDiscount bco = new BCO.MaintainStoreDiscount(ConnectionDB);
            DataTable dtA = (DataTable)Session["STM193_gvA" + PageTimeStamp.Value];
            DataTable dtB = (DataTable)Session["STM193_gvB" + PageTimeStamp.Value];
            DataTable dtC = (DataTable)Session["STM193_gvC" + PageTimeStamp.Value];

            //for (int i = 0; i < ha.Count; i++)
            //    ha[i] = true;

            foreach (GridViewRow gr in this.GridViewA.Rows)
            {
                DataRow drA = dtA.Select("ID=" + ((Label)gr.FindControl("lblAID")).Text.Trim())[0];
                if (((CheckBox)gr.FindControl("chkConfirmA")).Checked == true)
                {
                    drA["CONFIRM_CODE"] = "1";
                    drA["UPDATEUID"] = Session["UID"].ToString();
                    drA["FUN_TYPE"] = "U";
                }
                else
                {
                    drA["CONFIRM_CODE"] = "0";
                    drA["UPDATEUID"] = Session["UID"].ToString();
                    drA["FUN_TYPE"] = "U";
                }
            }

            foreach (GridViewRow gr in this.GridViewB.Rows)
            {
                DataRow drA = dtB.Select("ID=" + ((Label)gr.FindControl("lblBID")).Text.Trim())[0];
                if (((CheckBox)gr.FindControl("chkConfirmB")).Checked == true)
                {
                    drA["CONFIRM_CODE"] = "1";
                    drA["UPDATEUID"] = Session["UID"].ToString();
                    drA["FUN_TYPE"] = "U";
                }
                else
                {
                    drA["CONFIRM_CODE"] = "0";
                    drA["UPDATEUID"] = Session["UID"].ToString();
                    drA["FUN_TYPE"] = "U";
                }
            }

            foreach (GridViewRow gr in this.GridViewC.Rows)
            {
                DataRow drA = dtC.Select("ID=" + ((Label)gr.FindControl("lblCID")).Text.Trim())[0];
                if (((CheckBox)gr.FindControl("chkConfirmC")).Checked == true)
                {
                    drA["CONFIRM_CODE"] = "1";
                    drA["UPDATEUID"] = Session["UID"].ToString();
                    drA["FUN_TYPE"] = "U";
                }
                else
                {
                    drA["CONFIRM_CODE"] = "0";
                    drA["UPDATEUID"] = Session["UID"].ToString();
                    drA["FUN_TYPE"] = "U";
                }
            }

            bco.UpdateStoreDiscount(dtA, dtB, dtC, Session["UID"].ToString(), null);
            this.btnConfirm.Enabled = false;
            this.btnAdd.Enabled = true;
            databind(this.SLP_Store1.Text.Trim());

            //抓取本頁初次登記的時間
            string SessionIDName = "STM193_gvC" + PageTimeStamp.Value;
            this.TabContainer1.ActiveTabIndex = 0;
            SLP_RootNo_C_DET.Text = "";
            SLP_PMA_C_DET.Text = "";
            SLP_Category_C_DET.Text = "";
            SLP_SKU_C_DET.Text = "";
            SLP_ItemPeriod_C_DET.Text = "";
            TextBoxRowCountLimit.Text = "500";

            this.GridViewC.Visible = false;
            dtC = null;
            Session[SessionIDName] = dtC;
            this.GridViewC.DataSource = dtC;
            this.GridViewC.DataBind();

            ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "ClientScript", string.Format("alert('審核完成');", Session["UID"].ToString().Trim()), true);

        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        #endregion
    }
Exemple #2
0
    //更新
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        #region
        try
        {
            SLP_SKU_C.Text = "";
            SLP_ItemPeriod_C.Text = "";
            txtItemPeriod_END_C.Text = "";
            SLP_SLPNumber_C2.Text = "";
            SLP_SLPNumber_C.Text = "";
            SLP_SLPNumber2.Text = "";
            SLP_SLPNumber3.Text = "";
            SLP_SLPDate3.Text = "";
            SLP_SLPDate4.Text = "";
            this.HidIDC.Value = "";
            this.panC.Visible = false;

            SLP_RootNo_B.Text = "";
            SLP_PMA_B.Text = "";
            SLP_Category_B.Text = "";
            SLP_SLPNumber1.Text = "";
            SLP_SLPDate1.Text = "";
            SLP_SLPDate2.Text = "";
            this.HidIDB.Value = "";
            this.panB.Visible = false;

            SLP_RootNo_A.Text = "";
            SLP_PMA_A.Text = "";
            SLP_SLPNumber_PRICE_DIS_A.Text = "";
            SLP_SLPDate_EFF_S_A.Text = "";
            SLP_SLPDate_EFF_S_B.Text = "";
            this.HidIDA.Value = "";
            this.panA.Visible = false;

            BCO.MaintainStoreDiscount bco = new BCO.MaintainStoreDiscount(ConnectionDB);
            DataTable dtA = (DataTable)Session["STM193_gvA" + PageTimeStamp.Value];
            DataTable dtB = (DataTable)Session["STM193_gvB" + PageTimeStamp.Value];
            DataTable dtC = (DataTable)Session["STM193_gvC" + PageTimeStamp.Value];

            if (dtA == null && dtB == null && dtC == null)
            {
                ErrorMsgLabel.Text = "無設定商品折扣明細資料,請確認";
                return;
            }

            bco.UpdateStoreDiscount(dtA, dtB, dtC, Session["UID"].ToString(), null);
            this.btnConfirm.Enabled = true;

            databind(this.SLP_Store1.Text.Trim());

            //抓取本頁初次登記的時間
            string SessionIDName = "STM193_gvC" + PageTimeStamp.Value;
            this.TabContainer1.ActiveTabIndex = 0;
            SLP_RootNo_C_DET.Text = "";
            SLP_PMA_C_DET.Text = "";
            SLP_Category_C_DET.Text = "";
            SLP_SKU_C_DET.Text = "";
            SLP_ItemPeriod_C_DET.Text = "";
            TextBoxRowCountLimit.Text = "500";

            this.GridViewC.Visible = false;
            dtC=null;
            Session[SessionIDName] = dtC;
            this.GridViewC.DataSource = dtC;
            this.GridViewC.DataBind();

            ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "ClientScript", string.Format("alert('更新完成');", Session["UID"].ToString().Trim()), true);

        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        #endregion
    }