Example #1
0
    /// <summary>
    /// BUTTON [模板設定查詢]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnQUERY_Click(object sender, EventArgs e)
    {
        #region 檢查條件

        BCO.ITMCommon ITMComm = new BCO.ITMCommon();

        ArrayList arl_Check_Condition = Check_Condition("BUTTON [模板設定查詢]鈕");

        #region 如果檢查有誤,則Return

        if (arl_Check_Condition[1].ToString() != string.Empty)
        {
            #region 錯誤訊息

            this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString();

            #endregion

            #region Focus欄位

            if (arl_Check_Condition[0].ToString() != string.Empty)
            {
                string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM111", s_ScriptManager_Script, true);
            }

            #endregion

            return;
        }

        #endregion

        #endregion

        ParameterList.Clear();
        ParameterList.Add(slpCHAN_NO.Text);
        ParameterList.Add(slpT_DATE.Text);
        ParameterList.Add(Session["UID"].ToString());
        DataTable dt_Return = new DataTable();

        BCO.MaintainReturnTemplate bco = new BCO.MaintainReturnTemplate(ConntionDB);
        dt_Return = bco.QueryRegularReturnItem(ParameterList);

        string SessionIDName = "ITM111_StoreCount" + PageTimeStamp.Value;
        txtSTORE_COUNT.Text = Session[SessionIDName].ToString();

        if (dt_Return.Rows.Count == 0)
        {
            txtSTORE_COUNT.Text = Page.Request.Form[txtSTORE_COUNT.UniqueID];
            ErrorMsgLabel.Text = "模板日期 : " + slpT_DATE.Text + " 查無資料";
            return;
        }
        string strLockUID = string.Empty;
        string strLockTime = string.Empty;
        int iChkResult = QueryControlChk(out strLockUID, out strLockTime);
        if (iChkResult == 1)
        {
            string script = "if(confirm('使用者:" + strLockUID + " 從 " + strLockTime.Substring(0, 16) + " 正在使用中,如果確定執行將中斷正在執行的作業?')==true){document.getElementById('" + btnEnter.ClientID + "').click();}";
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EXEC", script, true);
        }
        else
        {
            EnterResult();
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AuthorityControls(this);
        try
        {
            #region 清空Message

            this.ErrorMsgLabel.Text = string.Empty;

            #endregion

            if (!IsPostBack)
            {
                #region 寫入首次載入Page TimeStamp

                PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}",
                                                    DateTime.Now.Year.ToString(),
                                                    DateTime.Now.Month.ToString().PadLeft(2, '0'),
                                                    DateTime.Now.Day.ToString().PadLeft(2, '0'),
                                                    DateTime.Now.Hour.ToString().PadLeft(2, '0'),
                                                    DateTime.Now.Minute.ToString().PadLeft(2, '0'),
                                                    DateTime.Now.Second.ToString().PadLeft(2, '0')
                                                    );

                #endregion

                #region 設定ToolBar預設狀態

                ToolBarInit();

                #endregion

                #region 設定DefaultButton

                Form.DefaultButton = btnQuery.UniqueID;

                #endregion

                #region 設定頁面初始狀態

                this.but_Import.Enabled = false;//確定匯入
                this.but_Error.Enabled = false;//檢視異常

                #endregion

                #region Attributes

                this.but_LoadFile.Attributes["onclick"] += "Lock_Control();";
                this.but_Error.Attributes["onclick"] = "return CALL_POP_ITM07();";

                #endregion
            }
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            #region Focus欄位

            if (!IsPostBack)
            {
                STMModel.ITMCommon ITMComm = new STMModel.ITMCommon();
                string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(this.txtITEM.TextBox_Code.ClientID, false);
                ScriptManager.RegisterStartupScript(this.upError, typeof(UpdatePanel), "ITM071", s_ScriptManager_Script, true);
            }

            #endregion
        }
    }//page_load
Example #3
0
    /// <summary>
    /// BUTTON [查詢]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Query_Click(object sender, EventArgs e)
    {
        try
        {
            #region 檢查條件

            BCO.ITMCommon ITMComm = new BCO.ITMCommon();

            ArrayList arl_Check_Condition = Check_Condition("BUTTON [查詢]鈕");

            #region 如果檢查有誤,則Return

            if (arl_Check_Condition[1].ToString() != string.Empty)
            {
                #region 錯誤訊息

                this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString();

                #endregion

                #region Focus欄位

                if (arl_Check_Condition[0].ToString() != string.Empty)
                {
                    string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                    ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM111", s_ScriptManager_Script, true);
                }

                #endregion

                return;
            }

            #endregion

            #endregion

            #region 傳入參數

            ParameterList.Clear();
            ParameterList.Add(ITMComm.GetValueSetParameter(this.slpCHAN_NO.Text, "string", false)); //[通路]
            ParameterList.Add(ITMComm.GetValueSetParameter(this.slpT_DATE.Text, "date", false)); //[模板日期]
            ParameterList.Add(ITMComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//V_LOG_UPDATEUID

            #endregion

            #region 連結資料庫

            DataTable dt_Return = new DataTable();
            BCO.MaintainReturnTemplate bco = new BCO.MaintainReturnTemplate(ConntionDB);
            dt_Return = bco.QUERYSETTEMPLATEDATA(ParameterList);

            #endregion

            #region 資料與GridView繫結

            //抓取本頁初次登記的時間
            string SessionIDName = "ITM111_" + PageTimeStamp.Value;

            Session["SessionID"] = SessionIDName;
            Session[SessionIDName] = dt_Return;

            this.gv_QueryResult.DataSource = dt_Return;
            this.gv_QueryResult.DataBind();

            #endregion

            #region 檢查回傳資料

            if (dt_Return.Rows.Count == 0)
            { this.ErrorMsgLabel.Text = "查無資料"; }

            #endregion
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
    }
Example #4
0
    /// <summary>
    /// BUTTON [整批修改]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Save_Click(object sender, EventArgs e)
    {
        try
        {
            #region 檢查條件

            BCO.ITMCommon ITMComm = new BCO.ITMCommon();

            ArrayList arl_Check_Condition = Check_Condition();

            #region 如果檢查有誤,則Return

            if (arl_Check_Condition[1].ToString() != string.Empty)
            {
                #region 錯誤訊息

                this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString();

                #endregion

                #region Focus欄位

                if (arl_Check_Condition[0].ToString() != string.Empty)
                {
                    string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                    ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM075", s_ScriptManager_Script, true);
                }

                #endregion

                return;
            }

            #endregion

            #endregion

            #region 傳入參數

            #region 設定TempTable的框架

            DataTable dt_Temp = new DataTable();

            dt_Temp.Columns.Add("ITEM", typeof(string));//[品號]
            dt_Temp.Columns.Add("PERIOD_B", typeof(string));//[期別(起)]
            dt_Temp.Columns.Add("PERIOD_E", typeof(string));//[期別(迄)]
            dt_Temp.Columns.Add("ITEM_NAME", typeof(string));//[品名]
            dt_Temp.Columns.Add("MDC_END_DATE", typeof(DateTime));//[DC結束日]
            dt_Temp.Columns.Add("PERIOD_END_DATE", typeof(DateTime));//[期別結束日]
            dt_Temp.Columns.Add("EFFECTIVE_DATE", typeof(DateTime));//[通路生效日]
            dt_Temp.Columns.Add("CHAN_END_DATE", typeof(DateTime));//[通路結束日]
            dt_Temp.Columns.Add("NOTICE_RETURN_DATE", typeof(DateTime));//[退貨通知日]
            dt_Temp.Columns.Add("PLAN_RETURN_DATE", typeof(DateTime));//[首次預退日]
            dt_Temp.Columns.Add("RTN_DDL", typeof(DateTime));//[退書截止日]
            dt_Temp.Columns.Add("EDIT_REASON", typeof(string));//[異動原因]
            dt_Temp.Columns.Add("UPDATEUID", typeof(string));//[異動人員]
            dt_Temp.Columns.Add("UPDATEDATE", typeof(DateTime));//[異動時間]

            #endregion

            #region 將參數寫入TempTable

            #region 設定變數

            string s_ITEM_FileName = string.Empty;
            string s_PERIOD_B_FileName = string.Empty;
            string s_PERIOD_E_FileName = string.Empty;
            DateTime d_Now = DateTime.Now;

            #endregion

            for (int i = 1; i <= 10; i++)
            {
                s_ITEM_FileName = "slp_ITEM_" + i.ToString();
                s_PERIOD_B_FileName = "slp_PERIOD_B_" + i.ToString();
                s_PERIOD_E_FileName = "slp_PERIOD_E_" + i.ToString();

                if (((ASP.itm_slp_slp_sku_ascx)this.table1.FindControl(s_ITEM_FileName)).Text.Trim() != string.Empty)
                {
                    DataRow dr = dt_Temp.NewRow();
                    dr["ITEM"] = ITMComm.GetValueSetParameter(((ASP.itm_slp_slp_sku_ascx)this.table1.FindControl(s_ITEM_FileName)).Text, "string", false);//[品號]
                    dr["PERIOD_B"] = ITMComm.GetValueSetParameter(((ASP.itm_slp_slp_itemperiod_ascx)this.table1.FindControl(s_PERIOD_B_FileName)).Text, "string", false);//[期別(起)]
                    dr["PERIOD_E"] = ITMComm.GetValueSetParameter(((ASP.itm_slp_slp_itemperiod_ascx)this.table1.FindControl(s_PERIOD_E_FileName)).Text, "string", false);//[期別(迄)]
                    dr["ITEM_NAME"] = ITMComm.GetValueSetParameter(this.txt_ITEM_NAME.Text, "string", false);//[品名]
                    dr["MDC_END_DATE"] = ITMComm.GetValueSetParameter(this.slp_MDC_END_DATE.Text, "date", false);//[DC結束日]
                    dr["PERIOD_END_DATE"] = ITMComm.GetValueSetParameter(this.slp_PERIOD_END_DATE.Text, "date", false);//[期別結束日]
                    dr["EFFECTIVE_DATE"] = ITMComm.GetValueSetParameter(this.slp_EFFECTIVE_DATE.Text, "date", false);//[通路生效日]
                    dr["CHAN_END_DATE"] = ITMComm.GetValueSetParameter(this.slp_CHAN_END_DATE.Text, "date", false);//[通路結束日]
                    dr["NOTICE_RETURN_DATE"] = ITMComm.GetValueSetParameter(this.slp_NOTICE_RETURN_DATE.Text, "date", false);//[退貨通知日]
                    dr["PLAN_RETURN_DATE"] = ITMComm.GetValueSetParameter(this.slp_PLAN_RETURN_DATE.Text, "date", false);//[首次預退日]
                    dr["RTN_DDL"] = ITMComm.GetValueSetParameter(this.slp_RTN_DDL.Text, "date", false);//[退書截止日]
                    dr["EDIT_REASON"] = ITMComm.GetValueSetParameter(this.txt_EDIT_REASON.Text, "string", false);//[異動原因]
                    dr["UPDATEUID"] = ITMComm.GetValueSetParameter(Session["UID"].ToString(), "string", false);//[異動人員]
                    dr["UPDATEDATE"] = ITMComm.GetValueSetParameter(d_Now.ToString(), "datetime", false);//[異動時間]

                    dt_Temp.Rows.Add(dr);
                }
            }

            #endregion

            #endregion

            #region 連結資料庫

            BCO.ITM07_BCO bco = new BCO.ITM07_BCO(ConntionDB);
            bco.UPDATE_ITM075_BULK(null, dt_Temp);

            #endregion

            #region 整批修改成功,將欄位清空

            this.ErrorMsgLabel.Text = "整批修改成功!";

            this.txt_ITEM_NAME.Text = string.Empty;//品名
            this.slp_MDC_END_DATE.Text = string.Empty;//DC結束日
            this.slp_PERIOD_END_DATE.Text = string.Empty;//期別結束日

            this.slp_EFFECTIVE_DATE.Text = string.Empty;//通路生效日
            this.slp_CHAN_END_DATE.Text = string.Empty;//通路結束日
            this.slp_NOTICE_RETURN_DATE.Text = string.Empty;//退貨通知日
            this.slp_PLAN_RETURN_DATE.Text = string.Empty;//首次預退日
            this.slp_RTN_DDL.Text = string.Empty;//退書截止日
            this.txt_EDIT_REASON.Text = string.Empty;//異動原因

            this.slp_ITEM_1.Text = string.Empty;//品號_1
            this.slp_PERIOD_B_1.Text = string.Empty;//期別(起)_1
            this.slp_PERIOD_E_1.Text = string.Empty;//期別(迄)_1
            this.slp_ITEM_2.Text = string.Empty;//品號_2
            this.slp_PERIOD_B_2.Text = string.Empty;//期別(起)_2
            this.slp_PERIOD_E_2.Text = string.Empty;//期別(迄)_2
            this.slp_ITEM_3.Text = string.Empty;//品號_3
            this.slp_PERIOD_B_3.Text = string.Empty;//期別(起)_3
            this.slp_PERIOD_E_3.Text = string.Empty;//期別(迄)_3
            this.slp_ITEM_4.Text = string.Empty;//品號_4
            this.slp_PERIOD_B_4.Text = string.Empty;//期別(起)_4
            this.slp_PERIOD_E_4.Text = string.Empty;//期別(迄)_4
            this.slp_ITEM_5.Text = string.Empty;//品號_5
            this.slp_PERIOD_B_5.Text = string.Empty;//期別(起)_5
            this.slp_PERIOD_E_5.Text = string.Empty;//期別(迄)_5
            this.slp_ITEM_6.Text = string.Empty;//品號_6
            this.slp_PERIOD_B_6.Text = string.Empty;//期別(起)_6
            this.slp_PERIOD_E_6.Text = string.Empty;//期別(迄)_6
            this.slp_ITEM_7.Text = string.Empty;//品號_7
            this.slp_PERIOD_B_7.Text = string.Empty;//期別(起)_7
            this.slp_PERIOD_E_7.Text = string.Empty;//期別(迄)_7
            this.slp_ITEM_8.Text = string.Empty;//品號_8
            this.slp_PERIOD_B_8.Text = string.Empty;//期別(起)_8
            this.slp_PERIOD_E_8.Text = string.Empty;//期別(迄)_8
            this.slp_ITEM_9.Text = string.Empty;//品號_9
            this.slp_PERIOD_B_9.Text = string.Empty;//期別(起)_9
            this.slp_PERIOD_E_9.Text = string.Empty;//期別(迄)_9
            this.slp_ITEM_10.Text = string.Empty;//品號_10
            this.slp_PERIOD_B_10.Text = string.Empty;//期別(起)_10
            this.slp_PERIOD_E_10.Text = string.Empty;//期別(迄)_10

            this.up_All.Update();

            #endregion
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
        finally
        { }
    }
Example #5
0
    /// <summary>
    /// BUTTON [產生異動序號]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Edit_No_Click(object sender, EventArgs e)
    {
        try
        {
            #region 編輯模式

            if (this.hid_PageStatus.Value == "edit")
            {
                #region 宣告變數

                BCO.ITMCommon ITMComm = new BCO.ITMCommon();
                BCO.ITM04_BCO bco = new BCO.ITM04_BCO(ConntionDB);
                DataTable dt_UpdateDB = new DataTable();
                string s_Return_EDIT_NO = string.Empty;

                #endregion

                #region 檢查條件

                ArrayList arl_Check_Condition = Check_Condition("BUTTON [產生異動序號]鈕,編輯狀態_1", null);

                #region 如果檢查有誤,則Return

                if (arl_Check_Condition[1].ToString() != string.Empty)
                {
                    #region 錯誤訊息

                    this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString();

                    #endregion

                    #region Focus欄位

                    if (arl_Check_Condition[0].ToString() != string.Empty)
                    {
                        string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                        ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", s_ScriptManager_Script, true);
                    }

                    #endregion

                    return;
                }

                #endregion

                #endregion

                #region 設定 TempTable 的 SCHEMA

                foreach (DataColumn dc in dt_Original.Columns)
                {
                    dt_UpdateDB.Columns.Add("OLD_" + dc.ColumnName, dc.DataType);
                    dt_UpdateDB.Columns.Add("NEW_" + dc.ColumnName, dc.DataType);
                }

                #endregion

                #region 將資料寫入 TempTable

                DataRow dr_UpdateDB = dt_UpdateDB.NewRow();

                #region 產生異動序號規則

                /* 俊翰寫程式時寫錯,於 20100402 修正
                 * 修正後規則
                 * 異動序號規則現在由 PKG_VDS_CAA_PUBLIC.ORDERDOCUMENTIDANDCODE 產生。
                 * 在編輯畫面按下[產生異動序號]鈕時,會先執行Client端的檢查
                 * 此時檢查是否為[當日第一次異動資料]是以該品號來做檢查
                 * 假設有A、B兩個品號
                 * A品號先執行[產生異動序號],此時B品號再執行[產生異動序號],此時不會跳出 confirm(已非當日第一次異動資料,確定產生異動序號?)
                 * 假設剛剛B品號已執行[產生異動序號],此時再一次執行[產生異動序號],這時才會跳出 confirm(已非當日第一次異動資料,確定產生異動序號?)
                 */

                #endregion

                #region 舊資料

                foreach (DataRow dr in dt_Original.Rows)
                {
                    foreach (DataColumn dc in dt_Original.Columns)
                    { dr_UpdateDB["OLD_" + dc.ColumnName] = dr[dc.ColumnName]; }
                }

                #endregion

                #region 新資料

                //頁籤=商品主檔
                dr_UpdateDB["NEW_ITEM_NAME"] = ITMComm.GetValueSetParameter(this.txt_ITEM_NAME.Text, "string", false);//品名
                dr_UpdateDB["NEW_VICE_ITEM_NAME"] = ITMComm.GetValueSetParameter(this.txt_VICE_ITEM_NAME.Text, "string", false);//副主題
                dr_UpdateDB["NEW_MDC_START_DATE"] = ITMComm.GetValueSetParameter(this.slp_MDC_START_DATE.Text, "date", false);//DC開始日
                dr_UpdateDB["NEW_MDC_END_DATE"] = ITMComm.GetValueSetParameter(this.slp_MDC_END_DATE.Text, "date", false);//DC結束日
                dr_UpdateDB["NEW_MANUFACTURE"] = ITMComm.GetValueSetParameter(this.slp_MANUFACTURE.Text, "string", false);//供應商
                dr_UpdateDB["NEW_EDIT_REASON"] = ITMComm.GetValueSetParameter(this.txt_EDIT_REASON.Text, "string", false);//異動原因
                dr_UpdateDB["NEW_ROOT_NO"] = ITMComm.GetValueSetParameter(this.slp_ROOT_NO.Text, "string", false);//群分類
                dr_UpdateDB["NEW_OUT_OF_PRINT"] = ITMComm.GetValueSetParameter(this.radl_OUT_OF_PRINT.SelectedValue, "int", false);//絕版
                dr_UpdateDB["NEW_PMA"] = ITMComm.GetValueSetParameter(this.slp_PMA.Text, "string", false);//大分類
                dr_UpdateDB["NEW_CATEGORY"] = ITMComm.GetValueSetParameter(this.slp_CATEGORY.Text, "string", false);//中分類
                dr_UpdateDB["NEW_SORT_OUT"] = ITMComm.GetValueSetParameter(this.slp_SORT_OUT.Text, "string", false);//小分類
                dr_UpdateDB["NEW_STATEMENTS"] = ITMComm.GetValueSetParameter(this.txt_STATEMENTS.Text, "string", false);//敘述
                dr_UpdateDB["NEW_ATTRIBUTE"] = ITMComm.GetValueSetParameter(this.radl_ATTRIBUTE.SelectedValue, "int", false);//是否定期
                dr_UpdateDB["NEW_FIRST_PERIOD"] = ITMComm.GetValueSetParameter(this.txt_FIRST_PERIOD.Text, "string", false);//首期期別
                dr_UpdateDB["NEW_NEW_SW"] = ITMComm.GetValueSetParameter(this.radl_NEW_SW.SelectedValue, "string", false);//新商品
                dr_UpdateDB["NEW_PERIOD_STEP"] = ITMComm.GetValueSetParameter(this.slp_PERIOD_STEP.Text, "int", false);//期別累加值
                dr_UpdateDB["NEW_INTERVAL"] = ITMComm.GetValueSetParameter(this.slp_INTERVAL.Text, "int", false);//出刊間隔
                dr_UpdateDB["NEW_PUBLISH_TYPE"] = ITMComm.GetValueSetParameter(this.slp_PUBLISH_TYPE.Text, "string", false);//出刊種類
                dr_UpdateDB["NEW_UNIT"] = ITMComm.GetValueSetParameter(this.slp_UNIT.Text, "int", false);//銷售單位
                dr_UpdateDB["NEW_OPEN_SIZE"] = ITMComm.GetValueSetParameter(this.txt_OPEN_SIZE.Text, "string", false);//開本
                dr_UpdateDB["NEW_PAGE_NUM"] = ITMComm.GetValueSetParameter(this.slp_PAGE_NUM.Text, "int", false);//頁數
                dr_UpdateDB["NEW_WIDTH"] = ITMComm.GetValueSetParameter(this.slp_WIDTH.Text, "double", false);//寬
                dr_UpdateDB["NEW_HIEGHT"] = ITMComm.GetValueSetParameter(this.slp_HIEGHT.Text, "double", false);//高
                dr_UpdateDB["NEW_LENGTH"] = ITMComm.GetValueSetParameter(this.slp_LENGTH.Text, "double", false);//深
                dr_UpdateDB["NEW_AUTHOR"] = ITMComm.GetValueSetParameter(this.txt_AUTHOR.Text, "string", false);//作者
                dr_UpdateDB["NEW_CIP"] = ITMComm.GetValueSetParameter(this.txt_CIP.Text, "string", false);//中央圖書分類碼(CIP)
                dr_UpdateDB["NEW_PUBLISH"] = ITMComm.GetValueSetParameter(this.txt_PUBLISH.Text, "string", false);//VCMS出版社
                dr_UpdateDB["NEW_ITEM_PUBLISHER_NO"] = ITMComm.GetValueSetParameter(this.txt_ITEM_PUBLISHER_NO.Text, "string", false);//商品出版商代號
                dr_UpdateDB["NEW_ITEM_PUBLISHER_NAME"] = ITMComm.GetValueSetParameter(this.txt_ITEM_PUBLISHER_NAME.Text, "string", false);//商品出版商名稱
                dr_UpdateDB["NEW_PUBLISHER_TYPE"] = ITMComm.GetValueSetParameter(this.txt_PUBLISHER_TYPE.Text, "string", false);//出版社書系
                dr_UpdateDB["NEW_PUBLISH_DATE"] = ITMComm.GetValueSetParameter(this.slp_PUBLISH_DATE.Text, "date", false);//出版日期
                //頁籤=商品指定參照
                dr_UpdateDB["NEW_DISTRIBUTE_MODE"] = ITMComm.GetValueSetParameter(this.radl_DISTRIBUTE_MODE.SelectedValue, "string", false);//配量方式
                dr_UpdateDB["NEW_QUANTITY"] = ITMComm.GetValueSetParameter(this.slp_QUANTITY.Text, "int", false);//每店
                dr_UpdateDB["NEW_ACCEPT_TOTAL"] = ITMComm.GetValueSetParameter(this.slp_ACCEPT_TOTAL.Text, "int", false);//總進貨量
                dr_UpdateDB["NEW_RESEMBLE_GOODS"] = ITMComm.GetValueSetParameter(this.txt_RESEMBLE_GOODS.Text, "string", false);//類似商品
                dr_UpdateDB["NEW_GOODS_MATTER"] = ITMComm.GetValueSetParameter(this.txt_GOODS_MATTER.Text, "string", false);//商品說明
                dr_UpdateDB["NEW_COMMEND_CAUSE"] = ITMComm.GetValueSetParameter(this.txt_COMMEND_CAUSE.Text, "string", false);//推薦理由
                //====================================================================================================
                dr_UpdateDB["NEW_UPDATEDATE"] = ITMComm.GetValueSetParameter(DateTime.Now.ToString(), "datetime", false);//[異動日期]
                dr_UpdateDB["NEW_UPDATEUID"] = ITMComm.GetValueSetParameter(Session["UID"].ToString(), "string", false);//[異動人員]

                #endregion

                dt_UpdateDB.Rows.Add(dr_UpdateDB);

                #endregion

                #region 檢查所有欄位否有更新

                arl_Check_Condition.Clear();
                arl_Check_Condition = Check_Condition("BUTTON [產生異動序號]鈕,編輯狀態_2", dt_UpdateDB);

                #region 如果檢查有誤,則Return

                if (arl_Check_Condition[1].ToString() != string.Empty)
                {
                    #region 錯誤訊息

                    this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString();

                    #endregion

                    #region Focus欄位

                    if (arl_Check_Condition[0].ToString() != string.Empty)
                    {
                        string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                        ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", s_ScriptManager_Script, true);
                    }

                    #endregion

                    return;
                }

                #endregion

                #endregion

                #region 連結資料庫

                s_Return_EDIT_NO = bco.UPDATE_ITM042_EDIT_NO(null, dt_UpdateDB);

                #endregion

                #region 跳轉頁面至查詢模式

                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", "alert('異動序號:" + s_Return_EDIT_NO + "');location.replace('ITM041.aspx?Code=ITM04');", true);

                #endregion
            }

            #endregion

            #region 其他模式

            else
            { throw new Exception("BUTTON [產生異動序號]鈕,必須在[編輯模式]下才可以使用,請聯絡系統管理員。"); }

            #endregion
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
    }
Example #6
0
    /// <summary>
    /// BUTTON [儲存]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Save_Click(object sender, EventArgs e)
    {
        try
        {
            #region 新增模式

            if (this.hid_PageStatus.Value == "insert")
            {
                #region 檢查條件

                BCO.ITMCommon ITMComm = new BCO.ITMCommon();
                ArrayList arl_Check_Condition = Check_Condition("BUTTON [儲存]鈕,新增狀態", null);

                #region 如果檢查有誤,則Return

                if (arl_Check_Condition[1].ToString() != string.Empty)
                {
                    #region 錯誤訊息

                    this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString();

                    #endregion

                    #region Focus欄位

                    if (arl_Check_Condition[0].ToString() != string.Empty)
                    {
                        string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                        ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", s_ScriptManager_Script, true);
                    }

                    #endregion

                    return;
                }

                #endregion

                #endregion

                #region 條碼檢查是否重覆
                if (hdfSaveFlag.Value == "0")
                {
                    if (CheckDup_BARCODE(txt_BARCODE.Text, slp_ITEM.Text) == true)
                    {
                        Page currentPage = (Page)HttpContext.Current.Handler;
                        string strScriptName = "ConfirmSave";

                        string strScriptContent = "DupBarcodeSave('" + but_Save.ClientID + "','" + hdfSaveFlag.ClientID + "');";
                        ScriptManager.RegisterClientScriptBlock(currentPage, currentPage.GetType(), strScriptName, strScriptContent, true);
                        return;
                    }
                }
                #endregion

                #region 傳入參數

                ParameterList.Clear();
                //頁籤=商品主檔
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_ITEM.Text, "string", false));//[品號]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_ITEM_NAME.Text, "string", false));//[品名]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_VICE_ITEM_NAME.Text, "string", false));//[副主題]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_MDC_START_DATE.Text, "date", false));//[DC開始日]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_MDC_END_DATE.Text, "date", false));//[DC結束日]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_MANUFACTURE.Text, "string", false));//[供應商]
                ParameterList.Add(ITMComm.GetValueSetParameter("0", "string", false));//[異動序號](新增模式下,畫面上該欄位是空值,但寫入資料庫時固定給值=0)
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_EDIT_REASON.Text, "string", false));//[異動原因]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_ROOT_NO.Text, "string", false));//[群分類]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.radl_OUT_OF_PRINT.SelectedValue, "int", false));//[絕版]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_PMA.Text, "string", false));//[大分類]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_CATEGORY.Text, "string", false));//[中分類]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_SORT_OUT.Text, "string", false));//[小分類]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_STATEMENTS.Text, "string", false));//[敘述]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.radl_ATTRIBUTE.SelectedValue, "int", false));//[是否定期]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_FIRST_PERIOD.Text, "string", false));//[首期期別]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.radl_NEW_SW.SelectedValue, "string", false));//[新商品]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_PERIOD_STEP.Text, "int", false));//[期別累加值]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_INTERVAL.Text, "int", false));//[出刊間隔]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_PUBLISH_TYPE.Text, "string", false));//[出刊種類]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_UNIT.Text, "int", false));//[銷售單位]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_OPEN_SIZE.Text, "string", false));//[開本]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_PAGE_NUM.Text, "int", false));//[頁數]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_WIDTH.Text, "double", false));//[寬]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_HIEGHT.Text, "double", false));//[高]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_LENGTH.Text, "double", false));//[深]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_AUTHOR.Text, "string", false));//[作者]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_CIP.Text, "string", false));//[中央圖書分類碼(CIP)]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_PUBLISH.Text, "string", false));//[VCMS出版社]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_ITEM_PUBLISHER_NO.Text, "string", false));//[商品出版商代號]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_ITEM_PUBLISHER_NAME.Text, "string", false));//[商品出版商名稱]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_PUBLISHER_TYPE.Text, "string", false));//[出版社書系]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_PUBLISH_DATE.Text, "date", false));//[出版日期]
                //頁籤=首期期別
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_PERIOD_END_DATE.Text, "date", false));//[期別結束日]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_BARCODE.Text, "string", false));//[商品條碼]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_PERIOD_BARCODE.Text, "string", false));//[二段條碼]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_PRICE.Text, "int", false));//[零售價]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_COST.Text, "double", false));//[成本價]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_DISCOUNT_RATE.Text, "double", false));//[折扣率]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.radl_PERIOD_PAY_TYPE.SelectedValue, "int", false));//[物流費基準]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_TARGET_RULE.Text, "int", false));//[物流費規則]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_TAX_TYPE.Text, "int", false));//[稅別]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_ACCEPT_RATE.Text, "double", false));//[進貨物流費(%)]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_RETURN_RATE.Text, "double", false));//[退貨物流費(%)]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_ACCEPT_AMT.Text, "double", false));//[進貨物流費(元)]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_RETURN_AMT.Text, "double", false));//[退貨物流費(元)]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_PRINT_CNTY.Text, "string", false));//[印製國家]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_LANGUAGE.Text, "string", false));//[語文]
                //頁籤=商品指定參照
                ParameterList.Add(ITMComm.GetValueSetParameter(this.radl_DISTRIBUTE_MODE.SelectedValue, "string", false));//[配量方式]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_QUANTITY.Text, "int", false));//[每店]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_ACCEPT_TOTAL.Text, "int", false));//[總進貨量]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_RESEMBLE_GOODS.Text, "string", false));//[類似商品]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_GOODS_MATTER.Text, "string", false));//[商品說明]
                ParameterList.Add(ITMComm.GetValueSetParameter(this.txt_COMMEND_CAUSE.Text, "string", false));//[推薦理由]
                //====================================================================================================
                ParameterList.Add(ITMComm.GetValueSetParameter(DateTime.Now.ToString(), "datetime", false));//[建立日期]
                ParameterList.Add(ITMComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//[建立人員]

                #endregion

                #region 連結資料庫

                BCO.ITM04_BCO bco = new BCO.ITM04_BCO(ConntionDB);
                string s_ITEM = bco.ADD_ITM042_ITEM(null, ParameterList);

                #endregion

                #region 清空變數,跳轉頁面至檢視模式

                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", "alert('新增完成');location.replace('ITM042.aspx?Code=ITM04&ITM042_Mode=view&ITM042_ITEM=" + s_ITEM + "');", true);

                #endregion
            }

            #endregion

            #region 編輯模式

            else if (this.hid_PageStatus.Value == "edit")
            {
                #region 宣告變數

                BCO.ITMCommon ITMComm = new BCO.ITMCommon();
                BCO.ITM04_BCO bco = new BCO.ITM04_BCO(ConntionDB);
                DataTable dt_UpdateDB = new DataTable();
                string s_ITEM = string.Empty;

                #endregion

                #region 檢查條件

                ArrayList arl_Check_Condition = Check_Condition("BUTTON [儲存]鈕,編輯狀態", null);

                #region 如果檢查有誤,則Return

                if (arl_Check_Condition[1].ToString() != string.Empty)
                {
                    #region 錯誤訊息

                    this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString();

                    #endregion

                    #region Focus欄位

                    if (arl_Check_Condition[0].ToString() != string.Empty)
                    {
                        string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                        ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", s_ScriptManager_Script, true);
                    }

                    #endregion

                    return;
                }

                #endregion

                #endregion

                #region 設定 TempTable 的 SCHEMA

                foreach (DataColumn dc in dt_Original.Columns)
                {
                    dt_UpdateDB.Columns.Add("OLD_" + dc.ColumnName, dc.DataType);
                    dt_UpdateDB.Columns.Add("NEW_" + dc.ColumnName, dc.DataType);
                }

                #endregion

                #region 將資料寫入 TempTable

                DataRow dr_UpdateDB = dt_UpdateDB.NewRow();

                //舊資料
                foreach (DataRow dr in dt_Original.Rows)
                {
                    foreach (DataColumn dc in dt_Original.Columns)
                    { dr_UpdateDB["OLD_" + dc.ColumnName] = dr[dc.ColumnName]; }
                }

                //新資料
                //頁籤=商品主檔
                dr_UpdateDB["NEW_ITEM_NAME"] = ITMComm.GetValueSetParameter(this.txt_ITEM_NAME.Text, "string", false);//品名
                dr_UpdateDB["NEW_VICE_ITEM_NAME"] = ITMComm.GetValueSetParameter(this.txt_VICE_ITEM_NAME.Text, "string", false);//副主題
                dr_UpdateDB["NEW_MDC_START_DATE"] = ITMComm.GetValueSetParameter(this.slp_MDC_START_DATE.Text, "date", false);//DC開始日
                dr_UpdateDB["NEW_MDC_END_DATE"] = ITMComm.GetValueSetParameter(this.slp_MDC_END_DATE.Text, "date", false);//DC結束日
                dr_UpdateDB["NEW_MANUFACTURE"] = ITMComm.GetValueSetParameter(this.slp_MANUFACTURE.Text, "string", false);//供應商
                dr_UpdateDB["NEW_EDIT_NO"] = ITMComm.GetValueSetParameter(this.txt_EDIT_NO.Text, "string", false);//異動原因
                dr_UpdateDB["NEW_EDIT_REASON"] = ITMComm.GetValueSetParameter(this.txt_EDIT_REASON.Text, "string", false);//異動原因
                dr_UpdateDB["NEW_ROOT_NO"] = ITMComm.GetValueSetParameter(this.slp_ROOT_NO.Text, "string", false);//群分類
                dr_UpdateDB["NEW_OUT_OF_PRINT"] = ITMComm.GetValueSetParameter(this.radl_OUT_OF_PRINT.SelectedValue, "int", false);//絕版
                dr_UpdateDB["NEW_PMA"] = ITMComm.GetValueSetParameter(this.slp_PMA.Text, "string", false);//大分類
                dr_UpdateDB["NEW_CATEGORY"] = ITMComm.GetValueSetParameter(this.slp_CATEGORY.Text, "string", false);//中分類
                dr_UpdateDB["NEW_SORT_OUT"] = ITMComm.GetValueSetParameter(this.slp_SORT_OUT.Text, "string", false);//小分類
                dr_UpdateDB["NEW_STATEMENTS"] = ITMComm.GetValueSetParameter(this.txt_STATEMENTS.Text, "string", false);//敘述
                dr_UpdateDB["NEW_ATTRIBUTE"] = ITMComm.GetValueSetParameter(this.radl_ATTRIBUTE.SelectedValue, "int", false);//是否定期
                dr_UpdateDB["NEW_FIRST_PERIOD"] = ITMComm.GetValueSetParameter(this.txt_FIRST_PERIOD.Text, "string", false);//首期期別
                dr_UpdateDB["NEW_NEW_SW"] = ITMComm.GetValueSetParameter(this.radl_NEW_SW.SelectedValue, "string", false);//新商品
                dr_UpdateDB["NEW_PERIOD_STEP"] = ITMComm.GetValueSetParameter(this.slp_PERIOD_STEP.Text, "int", false);//期別累加值
                dr_UpdateDB["NEW_INTERVAL"] = ITMComm.GetValueSetParameter(this.slp_INTERVAL.Text, "int", false);//出刊間隔
                dr_UpdateDB["NEW_PUBLISH_TYPE"] = ITMComm.GetValueSetParameter(this.slp_PUBLISH_TYPE.Text, "string", false);//出刊種類
                dr_UpdateDB["NEW_UNIT"] = ITMComm.GetValueSetParameter(this.slp_UNIT.Text, "int", false);//銷售單位
                dr_UpdateDB["NEW_OPEN_SIZE"] = ITMComm.GetValueSetParameter(this.txt_OPEN_SIZE.Text, "string", false);//開本
                dr_UpdateDB["NEW_PAGE_NUM"] = ITMComm.GetValueSetParameter(this.slp_PAGE_NUM.Text, "int", false);//頁數
                dr_UpdateDB["NEW_WIDTH"] = ITMComm.GetValueSetParameter(this.slp_WIDTH.Text, "double", false);//寬
                dr_UpdateDB["NEW_HIEGHT"] = ITMComm.GetValueSetParameter(this.slp_HIEGHT.Text, "double", false);//高
                dr_UpdateDB["NEW_LENGTH"] = ITMComm.GetValueSetParameter(this.slp_LENGTH.Text, "double", false);//深
                dr_UpdateDB["NEW_AUTHOR"] = ITMComm.GetValueSetParameter(this.txt_AUTHOR.Text, "string", false);//作者
                dr_UpdateDB["NEW_CIP"] = ITMComm.GetValueSetParameter(this.txt_CIP.Text, "string", false);//中央圖書分類碼(CIP)
                dr_UpdateDB["NEW_PUBLISH"] = ITMComm.GetValueSetParameter(this.txt_PUBLISH.Text, "string", false);//VCMS出版社
                dr_UpdateDB["NEW_ITEM_PUBLISHER_NO"] = ITMComm.GetValueSetParameter(this.txt_ITEM_PUBLISHER_NO.Text, "string", false);//商品出版商代號
                dr_UpdateDB["NEW_ITEM_PUBLISHER_NAME"] = ITMComm.GetValueSetParameter(this.txt_ITEM_PUBLISHER_NAME.Text, "string", false);//商品出版商名稱
                dr_UpdateDB["NEW_PUBLISHER_TYPE"] = ITMComm.GetValueSetParameter(this.txt_PUBLISHER_TYPE.Text, "string", false);//出版社書系
                dr_UpdateDB["NEW_PUBLISH_DATE"] = ITMComm.GetValueSetParameter(this.slp_PUBLISH_DATE.Text, "date", false);//出版日期
                //頁籤=商品指定參照
                dr_UpdateDB["NEW_DISTRIBUTE_MODE"] = ITMComm.GetValueSetParameter(this.radl_DISTRIBUTE_MODE.SelectedValue, "string", false);//配量方式
                dr_UpdateDB["NEW_QUANTITY"] = ITMComm.GetValueSetParameter(this.slp_QUANTITY.Text, "int", false);//每店
                dr_UpdateDB["NEW_ACCEPT_TOTAL"] = ITMComm.GetValueSetParameter(this.slp_ACCEPT_TOTAL.Text, "int", false);//總進貨量
                dr_UpdateDB["NEW_RESEMBLE_GOODS"] = ITMComm.GetValueSetParameter(this.txt_RESEMBLE_GOODS.Text, "string", false);//類似商品
                dr_UpdateDB["NEW_GOODS_MATTER"] = ITMComm.GetValueSetParameter(this.txt_GOODS_MATTER.Text, "string", false);//商品說明
                dr_UpdateDB["NEW_COMMEND_CAUSE"] = ITMComm.GetValueSetParameter(this.txt_COMMEND_CAUSE.Text, "string", false);//推薦理由
                //====================================================================================================
                dr_UpdateDB["NEW_UPDATEDATE"] = ITMComm.GetValueSetParameter(DateTime.Now.ToString(), "datetime", false);//[異動日期]
                dr_UpdateDB["NEW_UPDATEUID"] = ITMComm.GetValueSetParameter(Session["UID"].ToString(), "string", false);//[異動人員]

                dt_UpdateDB.Rows.Add(dr_UpdateDB);

                #endregion

                #region 連結資料庫

                s_ITEM = bco.UPDATE_ITM042_VDS_ITM_ITEM(null, dt_UpdateDB);

                #endregion

                #region 清空變數,跳轉頁面至檢視模式

                if (dt_Original != null)
                { dt_Original.Clear(); }

                #region 組合跳轉頁面字串

                string s_ADDLocation_Replace_String = string.Empty;

                try
                {
                    int i_Count = int.Parse(Request.QueryString["ITM042_COUNT"]);
                    string s_Request_Key = Request.QueryString["ITM042_PageTimeStamp"];

                    s_ADDLocation_Replace_String = "&ITM042_COUNT=" + i_Count.ToString() + "&ITM042_PageTimeStamp=" + s_Request_Key;
                }
                catch { s_ADDLocation_Replace_String = string.Empty; }

                #endregion

                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", "alert('更新成功');location.replace('ITM042.aspx?Code=ITM04&ITM042_Mode=view&ITM042_ITEM=" + s_ITEM + s_ADDLocation_Replace_String + "');", true);

                #endregion
            }

            #endregion

            #region 其他模式

            else
            { throw new Exception("BUTTON [儲存]鈕,必須在[新增模式][編輯模式]下才可以使用,請聯絡系統管理員。"); }

            #endregion
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
    }
Example #7
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                AuthorityControls(this);

                #region 設定TabIndex

                SetTabIndex();

                #endregion

                #region Attributes

                #region 新增模式

                if (this.hid_PageStatus.Value == "insert")
                {
                    //必須在 Page_PreRender 加入 SLP onblur 事件,如果在 Page_Load 加,事件會被覆蓋掉。
                    this.radl_PERIOD_PAY_TYPE.Attributes["onclick"] = "Chg_PERIOD_PAY_TYPE();";
                    this.slp_COST.TextBox_Code.Attributes["onblur"] += "Chg_PRICE_COST();";
                    this.slp_PRICE.TextBox_Code.Attributes["onblur"] += "Chg_PRICE_COST();";
                }

                #endregion

                #endregion

                #region 重新建立[群分類][大分類][中分類][小分類]的階層關係

                this.slp_PMA.RootNo = this.slp_ROOT_NO.Text;
                this.slp_PMA.Text = this.slp_PMA.Text;

                this.slp_CATEGORY.RootNo = this.slp_ROOT_NO.Text;
                this.slp_CATEGORY.PMA = this.slp_PMA.Text;
                this.slp_CATEGORY.Text = this.slp_CATEGORY.Text;

                this.slp_SORT_OUT.RootNo = this.slp_ROOT_NO.Text;
                this.slp_SORT_OUT.PMA = this.slp_PMA.Text;
                this.slp_SORT_OUT.Category = this.slp_CATEGORY.Text;
                this.slp_SORT_OUT.Text = this.slp_SORT_OUT.Text;

                #endregion

                #region Focus欄位

                BCO.ITMCommon ITMComm = new BCO.ITMCommon();
                string s_ScriptManager_Script = string.Empty;

                if (this.hid_PageStatus.Value == "insert")
                { s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(this.slp_ITEM.TextBox_Code.ClientID, false); }

                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", s_ScriptManager_Script, true);

                #endregion
            }
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
    }
Example #8
0
    /// <summary>
    /// Panel 複製新增 BUTTON [確定複製]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_CopyInsert_Insert_Click(object sender, EventArgs e)
    {
        try
        {
            #region 檢視模式

            if (this.hid_PageStatus.Value == "view")
            {
                #region 設定變數

                BCO.ITMCommon ITMComm = new BCO.ITMCommon();
                BCO.ITM04_BCO bco = new BCO.ITM04_BCO(ConntionDB);
                string s_ITEM = string.Empty;
                string s_ScriptManager_MSG = string.Empty;

                #endregion

                #region 檢查條件

                ArrayList arl_Check_Condition = Check_Condition("BUTTON [確定複製]鈕,檢視狀態", null);

                #region 如果檢查有誤,則Return

                if (arl_Check_Condition[1].ToString() != string.Empty)
                {
                    #region 錯誤訊息

                    this.ErrorMsgLabel_CopyInsert.Text = arl_Check_Condition[1].ToString();

                    #endregion

                    #region Focus欄位

                    if (arl_Check_Condition[0].ToString() != string.Empty)
                    {
                        string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                        ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", s_ScriptManager_Script, true);
                    }

                    #endregion

                    return;
                }

                #endregion

                #endregion

                #region 傳入參數

                ParameterList.Clear();
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_ITEM.Text, "string", false));//[舊品號](被複製的品號)
                ParameterList.Add(ITMComm.GetValueSetParameter(this.slp_CopyInsert_ITEM.Text, "string", false));//[新品號](要新增的品號)
                ParameterList.Add(ITMComm.GetValueSetParameter(DateTime.Now.ToString(), "datetime", false));//[建立日期]
                ParameterList.Add(ITMComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//[建立人員]

                #endregion

                #region 連結資料庫

                s_ITEM = bco.ADD_ITM042_ITEM_COPYINSERT(null, ParameterList);

                #endregion

                #region 檢查回傳值

                if (s_ITEM == "99999999999")//如果查無舊品號(被複製的品號)的資料,則回傳商品代號99999999999(11個9)
                { throw new Exception("查無品號:" + this.slp_ITEM.Text + "的相關資料"); }
                else
                { s_ScriptManager_MSG = "alert('複製新增完成');location.replace('ITM042.aspx?Code=ITM04&ITM042_Mode=view&ITM042_ITEM=" + s_ITEM + "');"; }

                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM042", s_ScriptManager_MSG, true);

                #endregion
            }

            #endregion

            #region 其他模式

            else
            { throw new Exception("Panel 複製新增 BUTTON [確定複製]鈕,必須在[檢視模式]下才可以使用,請聯絡系統管理員。"); }

            #endregion
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
            this.ErrorMsgLabel_CopyInsert.Text = ex.Message;
        }
    }