Beispiel #1
0
    private bool SaveData()
    {
        bool bResult = false;
        try
        {
            ErrorMsgLabel.Text = "";

            //把GridView的資料寫入Session中
            WriteToInfo();
            WriteToITEM();

            string strAlertMsg = string.Empty;
            string strErrMsg = string.Empty;
            CheckData(out strAlertMsg, out strErrMsg); //檢查編輯期間,已經有人編輯或新增的狀況.
            if (strAlertMsg != "")
            {
                ErrorMsgLabel.Text = strErrMsg;
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "MSG", "window.setTimeout(function(){alert('" + strAlertMsg + "');}, 500);", true);
                return bResult;
            }

            DataTable dtINFO = (DataTable)Session["CGD39_INFO_" + PageTimeStamp.Value];
            DataTable dtITEM = (DataTable)Session["CGD39_ITEM_" + PageTimeStamp.Value];

            CGDModel.VDS_CGD39_BCO BCO = new CGDModel.VDS_CGD39_BCO(ConntionDB);
            ParameterList.Clear();
            ParameterList.Add(DBPara(hdfID.Value, ParaType.Number));                 //0.PID
            ParameterList.Add(DBPara(slpPickDate.Text, ParaType.Date));              //1.PICK_DATE
            ParameterList.Add(DBPara(txtPICK_BATCH.Text, ParaType.Varchar2));        //2.PICK_BATCH
            ParameterList.Add(DBPara(Session["UID"].ToString(), ParaType.Varchar2)); //3.UID
            ParameterList.Add(DateTime.Now);                                         //4.UPDATE_TIME
            ParameterList.Add(DBPara(SLP_CREATEUID.Text, ParaType.Varchar2));        //5.CREATEUID
            ParameterList.Add(DBPara(txtCreateDate.Text, ParaType.Date));            //6.CreateDate                          
            ParameterList.Add(DBPara(slpGET_TIME.Text, ParaType.Varchar2));          //7.V_GET_TIME (更新RPT用的)
            ParameterList.Add(DBPara(slpSPEC_ITEMNUM.Text, ParaType.Number));        //8.N_SPEC_ITEMNUM (更新RPT用的)
            ParameterList.Add(DBPara(slpCTRL_ITEMNUM.Text, ParaType.Number));        //9.N_CTRL_ITEMNUM (更新RPT用的)
            ParameterList.Add(DBPara(slpPICK_ITEMNUM.Text, ParaType.Number));        //10.N_PICK_ITEMNUM (更新RPT用的)
            ParameterList.Add(DBPara(slpAmt.Text, ParaType.Number));                 //11.N_AMT (更新RPT用的)       
            ParameterList.Add(DBPara(hdfRPT_UPDATEUID.Value, ParaType.Varchar2));          //12.OLD_RPT_UPDATEUID (更新RPT用的)   
            ParameterList.Add(DBPara(hdfRPT_UPDATEDATE.Value, ParaType.Date));             //13.OLD_RPT_UPDATE_TIME (更新RPT用的)

            ArrayList ParameterSPEC = new ArrayList();
            ParameterSPEC.Add(DBPara(txtSPEC_STORENUM_ALL.Text, ParaType.Number));  //0.N_SPEC_STORENUM_ALL  in number,
            ParameterSPEC.Add(DBPara(txtSPEC_STORENUM.Text, ParaType.Number));      //1.N_SPEC_STORENUM      in number,
            ParameterSPEC.Add(DBPara(txtSPEC_PERIODNUM_ALL.Text, ParaType.Number)); //2.N_SPEC_PERIODNUM_ALL in number,
            ParameterSPEC.Add(DBPara(txtSPEC_PERIODNUM.Text, ParaType.Number));     //3.N_SPEC_PERIODNUM     in number,
            ParameterSPEC.Add(DBPara(txtSPEC_ITEMNUM.Text, ParaType.Number));       //4.N_SPEC_ITEMNUM       in number,
            ParameterSPEC.Add(DBPara(txtSPEC_STAFFNUM.Text, ParaType.Number));      //5.N_SPEC_STAFFNUM      in number,
            ParameterSPEC.Add(DBPara(txtSEPC_HR.Text, ParaType.Number));            //6.N_SEPC_HR            in number,
            ParameterSPEC.Add(DBPara(txtVDS_TRANSNUM.Text, ParaType.Number));       //7.N_VDS_TRANSNUM       in number,
            ParameterSPEC.Add(DBPara(txtDPS_TRANSNUM.Text, ParaType.Number));       //8.N_DPS_TRANSNUM       in number,
            ParameterSPEC.Add(DBPara(txtNOTES.Text, ParaType.Varchar2));            //9.V_NOTES              in varchar

            BCO.SaveData(ParameterList, dtINFO, ParameterSPEC, dtITEM);
            bResult = true;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        finally
        {

        }
        return bResult;
    }