コード例 #1
0
ファイル: CGD382.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    private bool SaveData()
    {
        bool bResult = false;
        try
        {
            ErrorMsgLabel.Text = "";
            string strErrMsg = CheckData(hdfID.Value); //檢查編輯期間,已經有人編輯或新增的狀況.
            if (strErrMsg != "")
            {
                ErrorMsgLabel.Text = strErrMsg;
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "MSG", "window.setTimeout(function(){alert('" + strErrMsg + "');}, 500);", true);
                return bResult;
            }

            lblLast_Route.Visible = false;
            if (txtLast_Route.Text.Trim() == "")
            {
                lblLast_Route.Visible = true;
                ErrorMsgLabel.Text = "請檢查資料是否全部輸入完成";
                return bResult;
            }

            WriteToCATEGORY01();
            WriteToCATEGORY02();
            DataTable dtBASE = (DataTable)Session["CGD38_CATEGORY01_" + PageTimeStamp.Value];
            DataTable dtAREA = (DataTable)Session["CGD38_CATEGORY02_" + PageTimeStamp.Value];
            if (this.hdfID.Value == "") //Insert
            {
                CGDModel.VDS_CGD38_BCO BCO = new CGDModel.VDS_CGD38_BCO(ConntionDB);

                #region 主檔資料

                string D_PICK_DATE = slpPickDate.Text;
                string V_PICK_BATCH = txtPICK_BATCH.Text;
                string V_GET_TIME = slpGET_TIME.Text;
                string N_SPEC_ITEMNUM = slpSPEC_ITEMNUM.Text;
                string N_CTRL_ITEMNUM = slpCTRL_ITEMNUM.Text;
                string N_PICK_ITEMNUM = slpPICK_ITEMNUM.Text;
                string N_AMT = slpAmt.Text;
                string N_DE_PAPERBOXNUM = slpDE_PAPERBOXNUM.Text;
                string V_LAST_ROUTE = txtLast_Route.Text;
                string N_CHK_ROUTENUM = slpCHK_ROUTENUM.Text;
                string N_CHK_STORENUM = slpCHK_STORENUM.Text;
                string N_ERR_STORENUM = slpERR_STORENUM.Text;
                string V_RTN_TIME = slpRTN_TIME.Text;
                string V_ALO_TIME = slpALO_TIME.Text;
                string V_CGD_TRANSTIME = slpCGD_TRANSTIME.Text;
                string V_CGD_DATATIME = slpCGD_DATATIME.Text;
                string V_CGD_LISTTIME = slpCGD_LISTTIME.Text;
                string D_CREATEDATE = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                string V_CREATEUID = Session["UID"].ToString();
                string D_UPDATEDATE = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                string V_UPDATEUID = Session["UID"].ToString();
                string strID = string.Empty;

                ParameterList.Clear();

                ParameterList.Add(DBPara(D_PICK_DATE, ParaType.Date));
                ParameterList.Add(DBPara(V_PICK_BATCH, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_GET_TIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(N_SPEC_ITEMNUM, ParaType.Number));
                ParameterList.Add(DBPara(N_CTRL_ITEMNUM, ParaType.Number));
                ParameterList.Add(DBPara(N_PICK_ITEMNUM, ParaType.Number));
                ParameterList.Add(DBPara(N_AMT, ParaType.Number));
                ParameterList.Add(DBPara(N_DE_PAPERBOXNUM, ParaType.Number));
                ParameterList.Add(DBPara(V_LAST_ROUTE, ParaType.Varchar2));
                ParameterList.Add(DBPara(N_CHK_ROUTENUM, ParaType.Number));
                ParameterList.Add(DBPara(N_CHK_STORENUM, ParaType.Number));
                ParameterList.Add(DBPara(N_ERR_STORENUM, ParaType.Number));
                ParameterList.Add(DBPara(V_RTN_TIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_ALO_TIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_CGD_TRANSTIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_CGD_DATATIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_CGD_LISTTIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(D_CREATEDATE, ParaType.Date));
                ParameterList.Add(DBPara(V_CREATEUID, ParaType.Varchar2));
                ParameterList.Add(DBPara(D_UPDATEDATE, ParaType.Date));
                ParameterList.Add(DBPara(V_UPDATEUID, ParaType.Varchar2));

                #endregion 主檔資料

                BCO.InertData(ParameterList, dtBASE, dtAREA, out strID);

                hdfID.Value = strID;

                bResult = true;


            }
            else //Update
            {

                CGDModel.VDS_CGD38_BCO BCO = new CGDModel.VDS_CGD38_BCO(ConntionDB);

                #region 主檔資料
                string D_PICK_DATE = slpPickDate.Text;
                string V_PICK_BATCH = txtPICK_BATCH.Text;
                string V_GET_TIME = slpGET_TIME.Text;
                string N_SPEC_ITEMNUM = slpSPEC_ITEMNUM.Text;
                string N_CTRL_ITEMNUM = slpCTRL_ITEMNUM.Text;
                string N_PICK_ITEMNUM = slpPICK_ITEMNUM.Text;
                string N_AMT = slpAmt.Text;
                string N_DE_PAPERBOXNUM = slpDE_PAPERBOXNUM.Text;
                string V_LAST_ROUTE = txtLast_Route.Text;
                string N_CHK_ROUTENUM = slpCHK_ROUTENUM.Text;
                string N_CHK_STORENUM = slpCHK_STORENUM.Text;
                string N_ERR_STORENUM = slpERR_STORENUM.Text;
                string V_RTN_TIME = slpRTN_TIME.Text;
                string V_ALO_TIME = slpALO_TIME.Text;
                string V_CGD_TRANSTIME = slpCGD_TRANSTIME.Text;
                string V_CGD_DATATIME = slpCGD_DATATIME.Text;
                string V_CGD_LISTTIME = slpCGD_LISTTIME.Text;
                string D_CREATEDATE = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                string V_CREATEUID = Session["UID"].ToString();
                string D_UPDATEDATE = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                string V_UPDATEUID = Session["UID"].ToString();
                string strID = this.hdfID.Value;
                string D_OLD_UPDATEDATE = txtUpdateDate.Text;
                string V_OLD_UPDATEUID = SLP_UPDATEUID.Text;

                ParameterList.Clear();

                ParameterList.Add(DBPara(D_PICK_DATE, ParaType.Date));
                ParameterList.Add(DBPara(V_PICK_BATCH, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_GET_TIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(N_SPEC_ITEMNUM, ParaType.Number));
                ParameterList.Add(DBPara(N_CTRL_ITEMNUM, ParaType.Number));
                ParameterList.Add(DBPara(N_PICK_ITEMNUM, ParaType.Number));
                ParameterList.Add(DBPara(N_AMT, ParaType.Number));
                ParameterList.Add(DBPara(N_DE_PAPERBOXNUM, ParaType.Number));
                ParameterList.Add(DBPara(V_LAST_ROUTE, ParaType.Varchar2));
                ParameterList.Add(DBPara(N_CHK_ROUTENUM, ParaType.Number));
                ParameterList.Add(DBPara(N_CHK_STORENUM, ParaType.Number));
                ParameterList.Add(DBPara(N_ERR_STORENUM, ParaType.Number));
                ParameterList.Add(DBPara(V_RTN_TIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_ALO_TIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_CGD_TRANSTIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_CGD_DATATIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(V_CGD_LISTTIME, ParaType.Varchar2));
                ParameterList.Add(DBPara(D_UPDATEDATE, ParaType.Date));
                ParameterList.Add(DBPara(V_UPDATEUID, ParaType.Varchar2));
                ParameterList.Add(DBPara(strID, ParaType.Number));
                ParameterList.Add(DBPara("1", ParaType.Number));
                ParameterList.Add(DBPara(D_OLD_UPDATEDATE, ParaType.Date));
                ParameterList.Add(DBPara(V_OLD_UPDATEUID, ParaType.Varchar2));

                #endregion 主檔資料

                BCO.UpdateData(ParameterList, dtBASE, dtAREA);

                bResult = true;
            }

        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        finally
        {

        }
        return bResult;
    }
コード例 #2
0
ファイル: CGD382.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    private void BindMaster(string strPICK_DATE, string strPICK_BATCH)
    {

        CGDModel.VDS_CGD38_BCO BCO = new CGDModel.VDS_CGD38_BCO(ConntionDB);
        ParameterList.Clear();
        ParameterList.Add(DBNull.Value);//ID
        ParameterList.Add(DBPara(strPICK_DATE, ParaType.Varchar2));
        ParameterList.Add(DBPara(strPICK_BATCH, ParaType.Varchar2));
        DataTable dtRPT = BCO.QueryVDS_CGD_DAILY_RPT(ParameterList);
        Session["CGD38_RPT_" + PageTimeStamp.Value] = dtRPT;

        hdfID.Value = "";

        if (dtRPT.Rows.Count > 0)
            hdfID.Value = dtRPT.Rows[0]["ID"].ToString();

        ParameterList.Clear();
        ParameterList.Add(DBPara(hdfID.Value, ParaType.Number));//ID
        ParameterList.Add(DBPara(strPICK_DATE, ParaType.Varchar2));
        ParameterList.Add(DBPara(strPICK_BATCH, ParaType.Varchar2));
        DataTable dtSUM = BCO.GetSummaryData(ParameterList);
        Session["CGD38_SUM_" + PageTimeStamp.Value] = dtSUM;

        //載入第一個區塊的資料(含建立&修改人資料)
        BindFirstBlock();

        //中間區塊計算用的隱藏TEXTBOX
        txtTEMP_TIME07.Text = ShowTime(GetDef("PickTimeS"));
        txtTEMP_TIME08.Text = ShowTime(GetDef("PickTimeE"));

        //載入最後區塊(理貨各項數據區塊)
        BindLastBlock();       
    }
コード例 #3
0
ファイル: CGD382.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
 //檢查此筆資料是否在編輯期間有異動過
 private string CheckData(string strID)
 {
     string strMsg = string.Empty;
     CGDModel.VDS_CGD38_BCO BCO = new CGDModel.VDS_CGD38_BCO(ConntionDB);
     ParameterList.Clear();
     ParameterList.Add(DBNull.Value);//ID
     ParameterList.Add(DBPara(slpPickDate.Text, ParaType.Varchar2));
     ParameterList.Add(DBPara(txtPICK_BATCH.Text, ParaType.Varchar2));
     DataTable dt = BCO.QueryVDS_CGD_DAILY_RPT(ParameterList);
     if (strID == "")
     {
         if (dt.Rows.Count > 0)
             strMsg = "此筆資料在編輯期間有被異動過了,請重新查詢後編輯.";
     }
     else
     {
         if (dt.Rows.Count == 0)
         {
             strMsg = "此筆資料在編輯期間有被異動過了,請重新查詢後編輯.";
         }
         else
         {
             if ((dt.Rows[0]["UpdateDate"].ToString().Trim() != txtUpdateDate.Text.Trim()) || (dt.Rows[0]["UPDATEUID"].ToString().Trim() != SLP_UPDATEUID.Text.Trim()))
             {
                 strMsg = "此筆資料在編輯期間有被異動過了,請重新查詢後編輯.";
             }
         }
     }
     return strMsg;
 }
コード例 #4
0
ファイル: CGD382.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    //建立各區物流箱產出完成時間區塊
    private void BindCATEGORY02()
    {
        CGDModel.VDS_CGD38_BCO BCO = new CGDModel.VDS_CGD38_BCO(ConntionDB);
        ParameterList.Clear();
        ParameterList.Add("02");
        DataTable dt = BCO.QueryVDS_CGD_CODE_DETL(ParameterList);

        DataTable TempTable = new DataTable();
        TempTable.Columns.Add(new DataColumn("TITLE"));
        TempTable.Columns.Add(new DataColumn("SCODE"));
        TempTable.Columns.Add(new DataColumn("EXPLAIN"));
        TempTable.Columns.Add(new DataColumn("FINISH_TIME"));

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataRow dr = TempTable.NewRow();
            int iNo = i + 1;
            dr["TITLE"] = iNo.ToString() + "、" + dt.Rows[i]["EXPLAIN"].ToString();
            dr["SCODE"] = dt.Rows[i]["SCODE"].ToString();
            dr["EXPLAIN"] = dt.Rows[i]["EXPLAIN"].ToString();
            string strFINISH_TIME = "";
            if (hdfID.Value != "")
            {
                ParameterList.Clear();
                ParameterList.Add(hdfID.Value);
                ParameterList.Add(DBNull.Value);
                DataTable dtData = BCO.QueryVDS_CGD_DAILY_AREA(ParameterList);
                DataRow[] drFind = dtData.Select("SCODE='" + dr["SCODE"].ToString() + "'");
                if (drFind.Length > 0)
                {
                    strFINISH_TIME = drFind[0]["FINISH_TIME"].ToString();
                }
            }
            dr["FINISH_TIME"] = strFINISH_TIME;

            TempTable.Rows.Add(dr);
        }
        DataList2.DataSource = TempTable;
        DataList2.DataBind();
        Session["CGD38_CATEGORY02_" + PageTimeStamp.Value] = TempTable;
    }
コード例 #5
0
ファイル: CGD382.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    //建立日報表初始數據設定區塊
    private void BindCATEGORY01()
    {

        CGDModel.VDS_CGD38_BCO BCO = new CGDModel.VDS_CGD38_BCO(ConntionDB);
        ParameterList.Clear();
        ParameterList.Add("01");
        DataTable dt = BCO.QueryVDS_CGD_CODE_DETL(ParameterList);


        DataTable TempTable = new DataTable();
        TempTable.Columns.Add(new DataColumn("TITLE"));
        TempTable.Columns.Add(new DataColumn("SCODE"));
        TempTable.Columns.Add(new DataColumn("EXPLAIN"));
        TempTable.Columns.Add(new DataColumn("COLUMN_TYPE"));
        TempTable.Columns.Add(new DataColumn("X"));   //數字or百分比型態
        TempTable.Columns.Add(new DataColumn("Y"));   //數字or百分比型態
        TempTable.Columns.Add(new DataColumn("Z"));   //數字or百分比型態
        TempTable.Columns.Add(new DataColumn("X_T")); //時間型態
        TempTable.Columns.Add(new DataColumn("Y_T")); //時間型態
        TempTable.Columns.Add(new DataColumn("Z_T")); //時間型態
        TempTable.Columns.Add(new DataColumn("X_Value")); //不分型態
        TempTable.Columns.Add(new DataColumn("Y_Value")); //不分型態
        TempTable.Columns.Add(new DataColumn("Z_Value")); //不分型態
        TempTable.Columns.Add(new DataColumn("TOTAL"));
        TempTable.Columns.Add(new DataColumn("TEMP_TIME")); //紀錄理貨起始的最小時間或理貨結束的最大時間

        string strX, strY, strZ;        //儲存數值or百分比
        string strX_T, strY_T, strZ_T;  //儲存時間
        string strX_Value, strY_Value, strZ_Value; //不分型態的都會存
        string strTEMP_TIME;
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataRow dr = TempTable.NewRow();
            dr["TITLE"] = dt.Rows[i]["EXPLAIN"].ToString();
            dr["SCODE"] = dt.Rows[i]["SCODE"].ToString();
            dr["EXPLAIN"] = dt.Rows[i]["EXPLAIN"].ToString();
            dr["COLUMN_TYPE"] = dt.Rows[i]["COLUMN_TYPE"].ToString();
            strX = "";
            strY = "";
            strZ = "";
            strX_T = "";
            strY_T = "";
            strZ_T = "";
            strX_Value = "";
            strY_Value = "";
            strZ_Value = "";
            strTEMP_TIME = "";
            //假如是第一次新增要讀入預設值
            if (hdfID.Value == "")
            {
                //B2&B4
                if ((dr["SCODE"].ToString() == "01") || (dr["SCODE"].ToString() == "03"))
                {
                    //V_PICK_DATE     IN  VARCHAR2,
                    //V_PICK_BATCH    IN  VARCHAR2,       
                    ParameterList.Clear();
                    ParameterList.Add(slpPickDate.Text);
                    ParameterList.Add(txtPICK_BATCH.Text);
                    DataTable dtTemp = BCO.GetLineBoxData(ParameterList);
                    if (dtTemp.Rows.Count > 0)
                    {
                        //B2 理貨路線 SCODE='01'
                        if (dr["SCODE"].ToString() == "01")
                        {
                            strX_Value = GetXYZ(dtTemp, "LineCount", "X");
                            strY_Value = GetXYZ(dtTemp, "LineCount", "Y");
                            strZ_Value = GetXYZ(dtTemp, "LineCount", "Z");
                        }

                        //B4 理貨箱數 SCODE='03'
                        if (dr["SCODE"].ToString() == "03")
                        {
                            strX_Value = GetXYZ(dtTemp, "BoxCount", "X");
                            strY_Value = GetXYZ(dtTemp, "BoxCount", "Y");
                            strZ_Value = GetXYZ(dtTemp, "BoxCount", "Z");
                        }
                    }
                }

                //B3 理貨店數 SCODE='02'
                if (dr["SCODE"].ToString() == "02")
                {
                    //V_PICK_DATE      IN  VARCHAR2,
                    //V_PICK_BATCH     IN  VARCHAR2,
                    ParameterList.Clear();
                    ParameterList.Add(slpPickDate.Text);
                    ParameterList.Add(txtPICK_BATCH.Text);
                    DataTable dtTemp = BCO.GetStoreCount(ParameterList);
                    if (dtTemp.Rows.Count > 0)
                    {
                        strX_Value = GetXYZ(dtTemp, "StoreCount", "X");
                        strY_Value = GetXYZ(dtTemp, "StoreCount", "Y");
                        strZ_Value = GetXYZ(dtTemp, "StoreCount", "Z");
                    }
                }

                //B5 工作站數 SCODE='04'
                if (dr["SCODE"].ToString() == "04")
                {
                    //V_DPS_CODE         varchar2,
                    //V_PICK_DATE        varchar2,
                    //V_PICK_BATCH       varchar2,
                    ParameterList.Clear();
                    ParameterList.Add("A");
                    ParameterList.Add(slpPickDate.Text);
                    ParameterList.Add(txtPICK_BATCH.Text);
                    DataTable dtTemp = BCO.GetStationCount(ParameterList);
                    if (dtTemp.Rows.Count > 0)
                    {
                        strX_Value = dtTemp.Rows[0]["StationCount"].ToString();
                        strY_Value = dtTemp.Rows[0]["StationCount"].ToString();
                        strZ_Value = dtTemp.Rows[0]["StationCount"].ToString();
                    }
                }

                //B6 第一箱理貨所需時間(秒) SCODE='09'
                if (dr["SCODE"].ToString() == "09")
                {
                    strX_Value = "3";
                    strY_Value = "3";
                    strZ_Value = "3";
                }

                //B7 品保秤重容許率 SCODE='10'
                if (dr["SCODE"].ToString() == "10")
                {
                    strX_Value = "0.50";
                    strY_Value = "0.50";
                    strZ_Value = "0.50";
                }

            }
            else
            {
                //編輯時,讀取儲存資料
                //N_PID         IN  NUMBER,   
                //V_SCODE       IN varchar2,  
                ParameterList.Clear();
                ParameterList.Add(hdfID.Value);
                ParameterList.Add(DBNull.Value);
                DataTable dtData = BCO.QueryVDS_CGD_DAILY_BASE(ParameterList);
                DataRow[] drFind = dtData.Select("SCODE='" + dr["SCODE"].ToString() + "'");
                if (drFind.Length > 0)
                {
                    strX_Value = drFind[0]["X"].ToString();
                    strY_Value = drFind[0]["Y"].ToString();
                    strZ_Value = drFind[0]["Z"].ToString();
                }
            }

            //如果是數字類型的話 要計算合計欄位
            if (dr["COLUMN_TYPE"].ToString() == "1")
            {
                strX_Value = (strX_Value == "") ? "0" : strX_Value;
                strY_Value = (strY_Value == "") ? "0" : strY_Value;
                strZ_Value = (strZ_Value == "") ? "0" : strZ_Value;
                dr["TOTAL"] = int.Parse(strX_Value) + int.Parse(strY_Value) + int.Parse(strZ_Value);
            }

            //如果是時間類別
            if (dr["COLUMN_TYPE"].ToString() == "2")
            {
                strX_T = strX_Value;
                strY_T = strY_Value;
                strZ_T = strZ_Value;
            }
            else
            {
                strX = strX_Value;
                strY = strY_Value;
                strZ = strZ_Value;
            }

            dr["X"] = strX;
            dr["Y"] = strY;
            dr["Z"] = strZ;
            dr["X_T"] = strX_T;
            dr["Y_T"] = strY_T;
            dr["Z_T"] = strZ_T;
            dr["X_VALUE"] = strX_Value;
            dr["Y_VALUE"] = strY_Value;
            dr["Z_VALUE"] = strZ_Value;
            dr["TEMP_TIME"] = strTEMP_TIME;

            TempTable.Rows.Add(dr);
        }
        DataList1.DataSource = TempTable;
        DataList1.DataBind();
        Session["CGD38_CATEGORY01_" + PageTimeStamp.Value] = TempTable;
    }
コード例 #6
0
ファイル: CGD392.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    //檢查此筆資料是否在編輯期間有異動過
    private void CheckData(out string strAlertMsg, out string strErrMsg)
    {
        strAlertMsg = "";
        strErrMsg = "";
        CGDModel.VDS_CGD38_BCO BCO38 = new CGDModel.VDS_CGD38_BCO(ConntionDB);
        ParameterList.Clear();
        ParameterList.Add(DBNull.Value);//ID
        ParameterList.Add(DBPara(slpPickDate.Text, ParaType.Varchar2));
        ParameterList.Add(DBPara(txtPICK_BATCH.Text, ParaType.Varchar2));
        DataTable dt = BCO38.QueryVDS_CGD_DAILY_RPT(ParameterList);

        if (dt.Rows.Count == 0)
        {
            strAlertMsg = "此筆資料在編輯期間有被異動過了,請重新查詢後編輯.";
            strErrMsg = strAlertMsg;
            return;
        }
        else
        {
            if ((dt.Rows[0]["UpdateDate"].ToString().Trim() != hdfRPT_UPDATEDATE.Value.Trim()) || (dt.Rows[0]["UPDATEUID"].ToString().Trim() != hdfRPT_UPDATEUID.Value.Trim()))
            {
                strAlertMsg = "此筆資料在編輯期間有被異動過了,請重新查詢後編輯.";
                strErrMsg = strAlertMsg;
                return;
            }
        }

        //檢查理貨品項短溢明細是否有輸入
        DataTable dtITEM = (DataTable)Session["CGD39_ITEM_" + PageTimeStamp.Value];
        if (dtITEM.Rows.Count == 0)
        {
            strAlertMsg = "理貨品項短溢明細未輸入";
            strErrMsg = "理貨品項短溢明細未輸入";
            return;
        }

        for (int i = 0; i < dtITEM.Rows.Count; i++)
        {
            string strSingleMsg = string.Empty;
            string strITEM = dtITEM.Rows[i]["ITEM"].ToString().Trim();
            string strPERIOD = dtITEM.Rows[i]["PERIOD"].ToString().Trim();
            string strSHORT_NUM = dtITEM.Rows[i]["SHORT_NUM"].ToString().Trim();
            string strOVER_NUM = dtITEM.Rows[i]["OVER_NUM"].ToString().Trim();

            if (strITEM == "")
            {
                strSingleMsg = "[品號]欄位未輸入";
            }
            else if (strPERIOD == "")
            {
                strSingleMsg = "[期別]欄位未輸入";
            }
            else if (CheckItemExists(strITEM) == false)
            {
                strSingleMsg = "查無此品號";
            }
            else if (CheckPeriodExists(strITEM, strPERIOD) == false)
            {
                strSingleMsg = "查無此期別";
            }
            else if (strSHORT_NUM == "")
            {
                strSingleMsg = "[短少數量]未輸入";
            }
            else if (strOVER_NUM == "")
            {
                strSingleMsg = "[溢多數量]未輸入";
            }
            else if ((strSHORT_NUM == "0") && (strOVER_NUM == "0"))
            {
                strSingleMsg = "短少和溢多數量不同時為零";
            }
            else if ((strSHORT_NUM != "0") && (strOVER_NUM != "0"))
            {
                strSingleMsg = "短少和溢多數量只允許一方有數量";
            }
            else
            {
                //檢查理貨品項短溢明細是否有重複品號期別
                for (int j = 0; j < dtITEM.Rows.Count; j++)
                {
                    if (j != i)
                    {
                        string strOtherITEM = dtITEM.Rows[j]["ITEM"].ToString().Trim();
                        string strOtherPERIOD = dtITEM.Rows[j]["PERIOD"].ToString().Trim();
                        if ((strOtherITEM == strITEM) && (strOtherPERIOD == strPERIOD))
                        {
                            int iRow = i + 1;
                            strSingleMsg = "與第 " + iRow.ToString() + " 行品號期別資料重複";
                            break;
                        }
                    }
                }
            }
            if (strSingleMsg != "")
            {
                int iRow = i + 1;
                strErrMsg += "第 " + iRow.ToString() + " 行 " + strSingleMsg + "<BR/>";
            }
        }

        DataTable dtINFO = (DataTable)Session["CGD39_INFO_" + PageTimeStamp.Value];
        for (int i = 0; i < dtINFO.Rows.Count; i++)
        {
            string strVENDOR_NAME = dtINFO.Rows[i]["VENDOR_NAME"].ToString().Trim();
            string strSHORTNUM = dtINFO.Rows[i]["SHORTNUM"].ToString().Trim();
            string strOVERNUM = dtINFO.Rows[i]["OVERNUM"].ToString().Trim();
            if ((strSHORTNUM != "0") && (strOVERNUM != "0"))
            {
                strErrMsg += "廠商[" + strVENDOR_NAME + "]:短少和溢多欄位只允許一方有數量<BR/>";
            }
        }

        if (strErrMsg != "")
        {
            strAlertMsg = "理貨品項短溢明細區資料有誤,請檢視網頁最下方的錯誤訊息!";
            strErrMsg = "理貨品項短溢明細區資料錯誤<BR/>" + strErrMsg;
            return;
        }


    }
コード例 #7
0
ファイル: CGD392.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    private void BindMaster(string strPICK_DATE, string strPICK_BATCH)
    {

        CGDModel.VDS_CGD38_BCO BCO = new CGDModel.VDS_CGD38_BCO(ConntionDB);
        ParameterList.Clear();
        ParameterList.Add(DBNull.Value);//ID
        ParameterList.Add(DBPara(strPICK_DATE, ParaType.Varchar2));
        ParameterList.Add(DBPara(strPICK_BATCH, ParaType.Varchar2));
        DataTable dtRPT = BCO.QueryVDS_CGD_DAILY_RPT(ParameterList);
        Session["CGD38_RPT_" + PageTimeStamp.Value] = dtRPT;

        hdfID.Value = "";
        hdfRPT_UPDATEUID.Value = "";
        hdfRPT_UPDATEDATE.Value = "";
        if (dtRPT.Rows.Count > 0)
        {
            hdfID.Value = dtRPT.Rows[0]["ID"].ToString();
            hdfRPT_UPDATEUID.Value = dtRPT.Rows[0]["UPDATEUID"].ToString();
            hdfRPT_UPDATEDATE.Value = dtRPT.Rows[0]["UPDATEDATE"].ToString();
        }
        ParameterList.Clear();
        ParameterList.Add(DBPara(hdfID.Value, ParaType.Number));//ID
        ParameterList.Add(DBPara(strPICK_DATE, ParaType.Varchar2));
        ParameterList.Add(DBPara(strPICK_BATCH, ParaType.Varchar2));
        DataTable dtSUM = BCO.GetSummaryData(ParameterList);
        Session["CGD38_SUM_" + PageTimeStamp.Value] = dtSUM;

        //載入第一個區塊的資料
        BindFirstBlock();
    }
コード例 #8
0
ファイル: CGD391.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    protected void btnEdit_Click(object sender, EventArgs e)
    {

        try
        {
            #region 檢查條件
            ErrorMsgLabel.Text = "";
            if (slpPickDate.Text.Trim() == "")
            {
                ErrorMsgLabel.Text = "[理貨日期]欄位必填";
                return;
            }

            if (txtPICK_BATCH.Text.Trim() == "")
            {
                ErrorMsgLabel.Text = "[理貨批次]欄位必填";
                return;
            }


            CGDModel.VDS_CGD38_BCO BCO = new CGDModel.VDS_CGD38_BCO(ConntionDB);
            ParameterList.Clear();
            ParameterList.Add(DBNull.Value);//ID
            ParameterList.Add(DBPara(slpPickDate.Text, ParaType.Varchar2));
            ParameterList.Add(DBPara(txtPICK_BATCH.Text, ParaType.Varchar2));
            DataTable dtRPT = BCO.QueryVDS_CGD_DAILY_RPT(ParameterList);
            if (dtRPT.Rows.Count != 0)
                Response.Redirect("CGD392.aspx?Code=CGD39&pickdate=" + slpPickDate.Text.Trim() + "&PICK_BATCH=" + txtPICK_BATCH.Text.Trim());
            else
                ErrorMsgLabel.Text = "請先於CGD38進行日報表基本數據維護";
            #endregion




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