Esempio n. 1
0
        /// <summary>
        /// IVM144_1報表(列印鈕)
        /// </summary>
        /// <param name="ParameterList">變數清單</param>        
        /// <returns>回傳查詢結果</returns>
        public DataTable IVM144_1(ArrayList ParameterList)
        {

            #region

            IVMModel.MaintainDataTrans BCO = new IVMModel.MaintainDataTrans(ConntionDB);
            DataTable Dt = BCO.QueryTransInErr(ParameterList);


            if (Dt.Rows.Count == 0)
            {
                throw new Exception("查無資料");
            }
            else
            {
                return Dt;
            }

            #endregion
        }
Esempio n. 2
0
    /// <summary>
    /// BUTTON [查詢]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Query_Click(object sender, EventArgs e)
    {
        try
        {
            #region 設定變數

            DataTable dt_Return_UP = new DataTable();

            #endregion

            #region 檢查條件

            BCO_CAA.CAACommon CAAComm = new BCO_CAA.CAACommon();
            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 = CAAComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                    ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "CGD261", s_ScriptManager_Script, true);
                }

                #endregion

                return;
            }

            #endregion

            #endregion

            #region 取得欄位[條碼][二段條碼][品名][品號][期別]

            #region 傳入參數

            ParameterList.Clear();
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_FULL_BARCODE.Text, "string", false));//[商品條碼]

            #endregion

            #region 連接資料庫

            BCO_IVM.MaintainDataTrans bco_IVM = new BCO_IVM.MaintainDataTrans(ConntionDB);
            dt_Return_UP = bco_IVM.GetItemByBarCode(ParameterList);

            #endregion

            #region 檢查回傳資料

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

                dt_Result = null;

                this.Repeater1.DataSource = dt_Result;
                this.Repeater1.DataBind();

                this.txt_BARCODE.Text = string.Empty;//條碼
                this.txt_PERIOD_BARCODE.Text = string.Empty;//二段條碼
                this.txt_ITEM_NAME.Text = string.Empty;//品名
                this.txt_ITEM.Text = string.Empty;//品號
                this.txt_PERIOD.Text = string.Empty;//期別           

                return;
            }

            #endregion

            #region 將資料寫入欄位

            this.txt_BARCODE.Text = dt_Return_UP.Rows[0]["BARCODE"].ToString();
            this.txt_PERIOD_BARCODE.Text = dt_Return_UP.Rows[0]["PERIOD_BARCODE"].ToString();
            this.txt_ITEM_NAME.Text = dt_Return_UP.Rows[0]["ITEM_NAME"].ToString();
            this.txt_ITEM.Text = dt_Return_UP.Rows[0]["ITEM"].ToString();
            this.txt_PERIOD.Text = dt_Return_UP.Rows[0]["PERIOD"].ToString();

            #endregion

            #endregion

            #region 傳入參數

            ParameterList.Clear();
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "date", false));//[門市進貨日]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_PICK_BATCH.Text, "string", false));//[理貨批次]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.ddl_LINE_B.SelectedValue, "string", false));//[理貨線]起
            ParameterList.Add(CAAComm.GetValueSetParameter(this.ddl_LINE_E.SelectedValue, "string", false));//[理貨線]迄
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_ITEM.Text, "string", false));//[品號]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_PERIOD.Text, "string", false));//[期別]
            ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//[登入人員]

            #endregion

            #region 連接資料庫

            BCO_CGD.CGD26_BCO bco_CGD = new BCO_CGD.CGD26_BCO(ConntionDB);
            dt_Result = bco_CGD.QUERY_CGD26_DATA(ParameterList);

            #endregion

            #region 資料載入畫面

            this.Repeater1.DataSource = dt_Result;
            this.Repeater1.DataBind();

            #endregion

            #region 檢查回傳資料

            if (dt_Result.Rows.Count == 0)
            {
                this.ErrorMsgLabel.Text = "查無資料";
                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "CGD261_FOCUS", "setTimeout(function(){document.getElementById('" + txt_FULL_BARCODE.ClientID + "').focus();},10);", true);
            }
            else
            {
                string s_Filter_Expression = string.Empty;//篩選資料SQL

                s_Filter_Expression = "ROW_TYPE = 'ITEM'";
                DataRow[] dr_IMG = dt_Result.Select(s_Filter_Expression);

                if (dr_IMG.Length == 1)
                {

                }
                else
                {
                    this.ErrorMsgLabel.Text = "該筆資料查無商品的資料。";
                }

                txt_FULL_BARCODE.Text = "";
                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "CGD261_FOCUS", "setTimeout(function(){document.getElementById('" + but_Out.ClientID + "').focus();},10);", true);
            }

            #endregion

        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
    }
Esempio n. 3
0
 private void GetExceptionVendor()
 {
     IVMModel.MaintainDataTrans BCO = new IVMModel.MaintainDataTrans(ConntionDB);
     string Chan = "";
     string Store = "";
     string Supplier = "";
     BCO.GetExceptionData(out Chan, out Store, out Supplier);
     this.hidVendorException.Value = Supplier;
 }
Esempio n. 4
0
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        PIC.VDS2G.VSM.IVM.MaintainDataTrans BCO = new PIC.VDS2G.VSM.IVM.MaintainDataTrans(ConntionDB);

        ParameterList.Clear();

        ParameterList.Add(TextBoxRowCountLimit.Text);
        ParameterList.Add(txtTrans_No.Text);
        ParameterList.Add(txtChan_Source_No.Text);
        ParameterList.Add(SLP_Trans_Date.Text);
        ParameterList.Add(SLP_Locate_No.Text);
        ParameterList.Add("");
        ParameterList.Add(txtChan_Trans_No.Text);

        DataTable Dt = BCO.QueryTransInByFind(ParameterList);

        if (Dt.Rows.Count != 0)
        {
            BindGrid(Dt);
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "QueryNoData", "alert(' 查無資料 ');", true);
        }

    }
Esempio n. 5
0
    private DataTable GetSourceData()
    {
        DataTable Dt = new DataTable();
        int intTotal_Cnt = 0;
        int intNomal_Cnt = 0;
        int intErr_Cnt = 0;
        int intTotal_Trans_Qty = 0;

        PIC.VDS2G.VSM.IVM.MaintainDataTrans BCO = new PIC.VDS2G.VSM.IVM.MaintainDataTrans(ConntionDB);

        ParameterList.Clear();

        ParameterList.Add(H_Supplier.Value);
        ParameterList.Add(H_Chan_No.Value);
        ParameterList.Add(H_Store.Value);
        ParameterList.Add(txtChan_Trans_No.Text);
        ParameterList.Add(Session["UID"].ToString() + PageTimeStamp.Value);

        Dt = BCO.GetSourceData(ParameterList, out intTotal_Cnt, out intNomal_Cnt, out intErr_Cnt, out intTotal_Trans_Qty);

        return Dt;
    }
Esempio n. 6
0
    //取得 CHAN_NO, STORE, SUPPLIER 備用
    private void GetValueForAdd()
    {
        string strChanNo = string.Empty;
        string strStore = string.Empty;
        string strSupplier = string.Empty;

        PIC.VDS2G.VSM.IVM.MaintainDataTrans BCO = new PIC.VDS2G.VSM.IVM.MaintainDataTrans(ConntionDB);

        BCO.GetExceptionData(out strChanNo, out strStore, out strSupplier);

        H_Chan_No.Value = strChanNo;
        H_Store.Value = strStore;
        H_Supplier.Value = strSupplier;

    }
Esempio n. 7
0
    private void LoadData(string strID)
    {
        PIC.VDS2G.VSM.IVM.MaintainDataTrans BCO = new PIC.VDS2G.VSM.IVM.MaintainDataTrans(ConntionDB);
        ParameterList.Clear();

        ParameterList.Add(int.Parse(strID));

        DataTable Dt = BCO.QueryTransDetl(ParameterList);

        if (Dt.Rows.Count != 0)
        {
            //gvIn 賦值
            BindGrid(Dt);

            int intSum = 0;
            for (int i = 0; i < Dt.Rows.Count; i++)
            {
                intSum += int.Parse(Dt.Rows[i]["TRANS_QTY"].ToString());
            }

            PanelGrid.Visible = true;

            //畫面上控制項賦值
            BindControl(strID, intSum);
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "QueryNoData", "alert(' 查無資料 ');", true);
        }
    }
Esempio n. 8
0
    private void SetNoRangeValue(string strTransNo)
    {
        PIC.VDS2G.VSM.IVM.MaintainDataTrans BCO = new PIC.VDS2G.VSM.IVM.MaintainDataTrans(ConntionDB);

        ParameterList.Clear();

        ParameterList.Add(1);
        ParameterList.Add(strTransNo);
        ParameterList.Add("");
        ParameterList.Add("");
        ParameterList.Add("");
        ParameterList.Add("");
        ParameterList.Add("");

        DataTable Dt = BCO.QueryTransInByFind(ParameterList);

        DataRow dr = Dt.Select("TRANS_NO ='" + strTransNo + "'")[0];

        if (dr["REMOVE_NO_RANGE"].ToString().IndexOf('~') != -1)
        {
            string[] strREMOVE_NO_RANGE = dr["REMOVE_NO_RANGE"].ToString().Split(new char[] { '~' });
            lblRemove_No_Range.Text = strREMOVE_NO_RANGE[0] + "~<br>" + strREMOVE_NO_RANGE[1];
        }
        else
        {
            lblRemove_No_Range.Text = "";
        }

        if (dr["BACKWARD_NO_RANGE"].ToString().IndexOf('~') != -1)
        {
            string[] strRETURN_NO_RANGE = dr["BACKWARD_NO_RANGE"].ToString().Split(new char[] { '~' });
            lblReturn_No_Range.Text = strRETURN_NO_RANGE[0] + "~<br>" + strRETURN_NO_RANGE[1];
        }
        else
        {
            lblReturn_No_Range.Text = "";
        }

        if (dr["ACCEPT_NO_RAGNE"].ToString().IndexOf('~') != -1)
        {
            string[] strST_ACCEPT_NO_RANGE = dr["ACCEPT_NO_RAGNE"].ToString().Split(new char[] { '~' });
            lblST_Accept_No_Range.Text = strST_ACCEPT_NO_RANGE[0] + "~<br>" + strST_ACCEPT_NO_RANGE[1];
        }
        else
        {
            lblST_Accept_No_Range.Text = "";
        }

        if (dr["INOUT_NO_RANGE"].ToString().IndexOf('~') != -1)
        {
            string[] strINOUT_NO_RANGE = dr["INOUT_NO_RANGE"].ToString().Split(new char[] { '~' });
            lblInOut_No_Range.Text = strINOUT_NO_RANGE[0] + "~<br>" + strINOUT_NO_RANGE[1];
        }
        else
        {
            lblInOut_No_Range.Text = "";
        }

        PanelList.Visible = true;

        //this.MID.Value = dr["ID"].ToString();
        Session["MID"] = dr["ID"].ToString();
    }
Esempio n. 9
0
    //執行轉入
    protected void btnTransIn_Click(object sender, EventArgs e)
    {
        ErrorMsgLabel.Text = "";
        try
        {
            int intID = 0;
            string strTransNo = string.Empty;
            string strMsg = string.Empty;
            string strResult = string.Empty;

            PIC.VDS2G.VSM.IVM.MaintainDataTrans BCO = new PIC.VDS2G.VSM.IVM.MaintainDataTrans(ConntionDB);

            ParameterList.Clear();

            ParameterList.Add(H_Supplier.Value);          //0
            ParameterList.Add(H_Store.Value);             //1
            ParameterList.Add(H_Chan_No.Value);           //2
            ParameterList.Add(Session["H_ChanSourceNo"].ToString());      //3
            ParameterList.Add(Session["UID"].ToString()); //4
            ParameterList.Add(SLP_Locate_No.Text);        //5
            ParameterList.Add(H_InTmpSec.Value);          //6
            ParameterList.Add(Session["UID"].ToString() + PageTimeStamp.Value); //7

            BCO.CreateTransIn(ParameterList, DBT, out intID, out strTransNo, out strMsg, out strResult);
            

            if (strResult == "1")
            {
                txtTrans_No.Text = strTransNo;
                Session["ForChanTransNo"] = strTransNo;
                //MID.Value = intID.ToString();
                Session["MID"] = intID.ToString();

                SetDefaultStatus("1");

                SetNoRangeValue(strTransNo);

                hdPageMode.Value = "view";
                Session["PageMode" + PageTimeStamp.Value] = "view";

                DataTable dtTemp = GetSourceData();
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }
Esempio n. 10
0
    //匯入
    protected void btnImport_Click(object sender, EventArgs e)
    {
        ErrorMsgLabel.Text = "";

        if (CheckImport())
        {
            H_InTmpSec.Value = QueryLocateImport(SLP_Locate_No.Text);

            DataTable Dt = new DataTable();
            int intTotal_Cnt = 0;
            int intNomal_Cnt = 0;
            int intErr_Cnt = 0;
            int intTotal_Trans_Qty = 0;

            PIC.VDS2G.VSM.IVM.MaintainDataTrans BCO = new PIC.VDS2G.VSM.IVM.MaintainDataTrans(ConntionDB);

            ParameterList.Clear();

            ParameterList.Add(H_Supplier.Value);
            ParameterList.Add(H_Chan_No.Value);
            ParameterList.Add(H_Store.Value);
            ParameterList.Add(txtChan_Trans_No.Text);
            ParameterList.Add(Session["UID"].ToString() + PageTimeStamp.Value);

            Dt = BCO.GetSourceData(ParameterList, out intTotal_Cnt, out intNomal_Cnt, out intErr_Cnt, out intTotal_Trans_Qty);

            string SessionIDName = "IVM144_" + PageTimeStamp.Value;
            Session[SessionIDName] = Dt;

            Session["H_ChanSourceNo"] = txtChan_Trans_No.Text;
            H_ChanSourceNo.Value = txtChan_Trans_No.Text;

            if (Dt.Rows.Count != 0)
            {
                //gvIn.PageSize = (TextBoxPagesize.Text == "") ? 10 : (int.Parse(TextBoxPagesize.Text) < 0) ? 10 : int.Parse(TextBoxPagesize.Text);
                gvIn.PageIndex = 0;

                gvIn.DataSource = Dt;
                gvIn.DataBind();

                PanelGrid.Visible = true;

                lblTrans_Cnt.Text = intTotal_Cnt.ToString();
                lblNormal.Text = intNomal_Cnt.ToString();
                lblErr_Cnt.Text = intErr_Cnt.ToString();
                lblNormalTotal.Text = intTotal_Trans_Qty.ToString();

                PanelResult.Visible = true;

                btnImport.Enabled = false;

                SLP_Locate_No.ReadOnly = true;
                txtChan_Trans_No.ReadOnly = true;
                txtChan_Trans_No.CssClass = "readtxtbox";
            }
            else
            {
                PanelGrid.Visible = false;
                PanelResult.Visible = false;
                SLP_Locate_No.ReadOnly = false;
                txtChan_Trans_No.ReadOnly = false;
                txtChan_Trans_No.CssClass = "";
                //ScriptManager.RegisterStartupScript(Page, this.GetType(), "NoTransInData", "alert(' 查無待轉入資料 ');", true);
                ErrorMsgLabel.Text = "無正常待轉入資料";
            }

            if (intErr_Cnt > 0)
            {
                btnViewErrorData.Enabled = true;
            }
            else
            {
                btnViewErrorData.Enabled = false;
            }

            if (intNomal_Cnt > 0)
            {
                btnTransIn.Enabled = true;
            }
            else
            {
                btnTransIn.Enabled = false;
            }

            if (Request.QueryString["PageMode"] == "3")
            {
                hdPageMode.Value = "new";
                Session["PageMode" + PageTimeStamp.Value] = "new";
            }
            else
            {
                hdPageMode.Value = "view";
                Session["PageMode" + PageTimeStamp.Value] = "view";
            }

        }
        else
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "DataFilledError", "alert(' 條件輸入不完整 ');", true);
        }
    }
Esempio n. 11
0
    protected void btnDelTransData_Click(object sender, EventArgs e)
    {
        ErrorMsgLabel.Text = "";
        string strMsg = string.Empty;

        if (CheckImport())
        {
            try
            {
                PIC.VDS2G.VSM.IVM.MaintainDataTrans BCO = new PIC.VDS2G.VSM.IVM.MaintainDataTrans(ConntionDB);

                ParameterList.Clear();
                ParameterList.Add(txtChan_Trans_No.Text);

                BCO.DeleteTransData(ParameterList, DBT, out strMsg);

                if (strMsg == "")
                {
                    ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "Success", "alert(' 刪除成功 ');location.href='IVM144.aspx?Code=IVM14&PageMode=3'", true);

                    //Response.Redirect("IVM144.aspx?Code=IVM14&PageMode=3", false);

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

        }
        else
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "DataFilledError", "alert(' 條件輸入不完整 ');", true);
        }

    }