Exemple #1
0
    /// <summary>
    /// 繫結資料到畫面控制項
    /// </summary>
    private bool databind(string strROCESS_NO)
    {
        bool bResult = false; //false:無資料 true:有資料
        CGDModel.CGD30_BCO BCO = new CGDModel.CGD30_BCO(ConnectionDB);

        ParameterList.Clear();
        for (int i = 0; i < 47; i++)
            ParameterList.Add(DBNull.Value);
        ParameterList.Add(strROCESS_NO);
        DataTable dtData = BCO.DoQuery(ParameterList);
        if (dtData.Rows.Count == 0)
        {
            txtPROCESS_NO.Text = strROCESS_NO;
            hiddenID.Value = strROCESS_NO;
            slpItem.Text = "";
            slpPeriod.Text = "";
            txtTAKEOVER_UNIT.Text = "";
            slpTAKEOVER_DATE.Text = "";
            txtENTRUST_VENDOR.Text = "";
            txtENTRUST_CODE.Text = "";
            slpACCEPT_DATE.Text = "";
            slpRETURN_DATE.Text = "";
            slpDECIDE_DONE_DATE.Text = "";

            chkTASKWAY_1.Checked = false;
            chkTASKWAY_2.Checked = false;
            chkTASKWAY_3.Checked = false;
            chkTASKWAY_4.Checked = false;
            chkTASKWAY_5.Checked = false;
            chkTASKWAY_6.Checked = false;
            txtTASKWAY_DESC_5.Text = "";
            txtTASKWAY_DESC_6.Text = "";

            chkCHAN_1.Checked = false;
            chkCHAN_2.Checked = false;
            chkCHAN_3.Checked = false;
            chkCHAN_4.Checked = false;
            txtCHAN_DESC_4.Text = "";

            SLP_ESTIMATE_NUM.Text = "";

            chkPROCESS_UNIT_1.Checked = false;
            chkPROCESS_UNIT_2.Checked = false;
            chkPROCESS_UNIT_3.Checked = false;
            chkPROCESS_UNIT_4.Checked = false;
            txtPROCESS_UNIT_DESC_4.Text = "";

            chkCHARGE_WAY_1.Checked = false;
            chkCHARGE_WAY_2.Checked = false;
            chkCHARGE_WAY_3.Checked = false;
            txtCHARGE_WAY_DESC_3.Text = "";

            txtINV_VENDOR_NAME.Text = "";
            txtINV_VENDOR_CODE.Text = "";
            txtINV_VENDOR_ADDR.Text = "";
            txtINV_CONTACT.Text = "";
            txtINV_PHONE_CODE.Text = "";
            txtINV_PHONE_NO.Text = "";
            SLP_CHARGE_FEE.Text = "";
            txtOPERATE_DESC.Text = "";
            txtOTHER_DESC.Text = "";
            txtCreateDate.Text = "";
            SLP_CreateUID.Text = "";
            txtUpdateDate.Text = "";
            SLP_UpdateUID.Text = "";

            bResult = false;

            ErrorMsgLabel.Text = "此筆資料已被其他使用者刪除,請點選上一筆/下一筆鈕或回查詢頁重新查詢!";
        }
        else
        {
            txtPROCESS_NO.Text = dtData.Rows[0]["PROCESS_NO"].ToString();
            hiddenID.Value = dtData.Rows[0]["PROCESS_NO"].ToString();
            slpItem.Text = dtData.Rows[0]["ITEM"].ToString();
            slpPeriod.Text = dtData.Rows[0]["PERIOD"].ToString();
            txtTAKEOVER_UNIT.Text = dtData.Rows[0]["TAKEOVER_UNIT"].ToString();
            slpTAKEOVER_DATE.Text = dtData.Rows[0]["TAKEOVER_DATE"].ToString();
            txtENTRUST_VENDOR.Text = dtData.Rows[0]["ENTRUST_VENDOR"].ToString();
            txtENTRUST_CODE.Text = dtData.Rows[0]["ENTRUST_CODE"].ToString();
            slpACCEPT_DATE.Text = dtData.Rows[0]["ACCEPT_DATE"].ToString();
            slpRETURN_DATE.Text = dtData.Rows[0]["RETURN_DATE"].ToString();
            slpDECIDE_DONE_DATE.Text = dtData.Rows[0]["DECIDE_DONE_DATE"].ToString();

            chkTASKWAY_1.Checked = ChangeBool(dtData.Rows[0]["TASKWAY_1"].ToString());
            chkTASKWAY_2.Checked = ChangeBool(dtData.Rows[0]["TASKWAY_2"].ToString());
            chkTASKWAY_3.Checked = ChangeBool(dtData.Rows[0]["TASKWAY_3"].ToString());
            chkTASKWAY_4.Checked = ChangeBool(dtData.Rows[0]["TASKWAY_4"].ToString());
            chkTASKWAY_5.Checked = ChangeBool(dtData.Rows[0]["TASKWAY_5"].ToString());
            chkTASKWAY_6.Checked = ChangeBool(dtData.Rows[0]["TASKWAY_6"].ToString());
            txtTASKWAY_DESC_5.Text = dtData.Rows[0]["TASKWAY_DESC_5"].ToString();
            txtTASKWAY_DESC_6.Text = dtData.Rows[0]["TASKWAY_DESC_6"].ToString();

            chkCHAN_1.Checked = ChangeBool(dtData.Rows[0]["CHAN_1"].ToString());
            chkCHAN_2.Checked = ChangeBool(dtData.Rows[0]["CHAN_2"].ToString());
            chkCHAN_3.Checked = ChangeBool(dtData.Rows[0]["CHAN_3"].ToString());
            chkCHAN_4.Checked = ChangeBool(dtData.Rows[0]["CHAN_4"].ToString());
            txtCHAN_DESC_4.Text = dtData.Rows[0]["CHAN_DESC_4"].ToString();

            SLP_ESTIMATE_NUM.Text = dtData.Rows[0]["ESTIMATE_NUM"].ToString();

            chkPROCESS_UNIT_1.Checked = ChangeBool(dtData.Rows[0]["PROCESS_UNIT_1"].ToString());
            chkPROCESS_UNIT_2.Checked = ChangeBool(dtData.Rows[0]["PROCESS_UNIT_2"].ToString());
            chkPROCESS_UNIT_3.Checked = ChangeBool(dtData.Rows[0]["PROCESS_UNIT_3"].ToString());
            chkPROCESS_UNIT_4.Checked = ChangeBool(dtData.Rows[0]["PROCESS_UNIT_4"].ToString());
            txtPROCESS_UNIT_DESC_4.Text = dtData.Rows[0]["PROCESS_UNIT_DESC_4"].ToString();

            chkCHARGE_WAY_1.Checked = ChangeBool(dtData.Rows[0]["CHARGE_WAY_1"].ToString());
            chkCHARGE_WAY_2.Checked = ChangeBool(dtData.Rows[0]["CHARGE_WAY_2"].ToString());
            chkCHARGE_WAY_3.Checked = ChangeBool(dtData.Rows[0]["CHARGE_WAY_3"].ToString());
            txtCHARGE_WAY_DESC_3.Text = dtData.Rows[0]["CHARGE_WAY_DESC_3"].ToString();

            txtINV_VENDOR_NAME.Text = dtData.Rows[0]["INV_VENDOR_NAME"].ToString();
            txtINV_VENDOR_CODE.Text = dtData.Rows[0]["INV_VENDOR_CODE"].ToString();
            txtINV_VENDOR_ADDR.Text = dtData.Rows[0]["INV_VENDOR_ADDR"].ToString();
            txtINV_CONTACT.Text = dtData.Rows[0]["INV_CONTACT"].ToString();
            txtINV_PHONE_CODE.Text = dtData.Rows[0]["INV_PHONE_CODE"].ToString();
            txtINV_PHONE_NO.Text = dtData.Rows[0]["INV_PHONE_NO"].ToString();
            SLP_CHARGE_FEE.Text = dtData.Rows[0]["CHARGE_FEE"].ToString();
            txtOPERATE_DESC.Text = dtData.Rows[0]["OPERATE_DESC"].ToString();
            txtOTHER_DESC.Text = dtData.Rows[0]["OTHER_DESC"].ToString();
            txtCreateDate.Text = dtData.Rows[0]["CREATEDATE"].ToString();
            SLP_CreateUID.Text = dtData.Rows[0]["CREATEUID"].ToString();
            txtUpdateDate.Text = dtData.Rows[0]["UPDATEDATE"].ToString();
            SLP_UpdateUID.Text = dtData.Rows[0]["UPDATEUID"].ToString();

            bResult = true;
        }
        Session["CGD302_DT" + PageTimeStamp.Value] = dtData;
        return bResult;
    }//databind
Exemple #2
0
    /// <summary>
    /// 查詢資料庫取得資料
    /// </summary> 
    private void databind()
    {
        //抓取本頁初次登記的時間
        string SessionIDName = "CGD301_" + PageTimeStamp.Value;

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

        string V_ITEM = slpItem.Text.Trim();
        string V_PERIOD = slpPeriod.Text.Trim();
        string V_TAKEOVER_UNIT = txtTAKEOVER_UNIT.Text.Trim();
        string D_TAKEOVER_DATE = slpTAKEOVER_DATE.Text.Trim();
        string V_ENTRUST_VENDOR = txtENTRUST_VENDOR.Text.Trim();
        string V_ENTRUST_CODE = txtENTRUST_CODE.Text.Trim();
        string D_ACCEPT_DATE = slpACCEPT_DATE.Text.Trim();
        string D_RETURN_DATE = slpRETURN_DATE.Text.Trim();
        string D_DECIDE_DONE_DATE = slpDECIDE_DONE_DATE.Text.Trim();
        string N_TASKWAY_1 = GetChkBoxValue(chkTASKWAY_1);
        string N_TASKWAY_2 = GetChkBoxValue(chkTASKWAY_2);
        string N_TASKWAY_3 = GetChkBoxValue(chkTASKWAY_3);
        string N_TASKWAY_4 = GetChkBoxValue(chkTASKWAY_4);
        string N_TASKWAY_5 = GetChkBoxValue(chkTASKWAY_5);
        string N_TASKWAY_6 = GetChkBoxValue(chkTASKWAY_6);
        string V_TASKWAY_DESC_5 = txtTASKWAY_DESC_5.Text.Trim();
        string V_TASKWAY_DESC_6 = txtTASKWAY_DESC_6.Text.Trim();
        string N_CHAN_1 = GetChkBoxValue(chkCHAN_1);
        string N_CHAN_2 = GetChkBoxValue(chkCHAN_2);
        string N_CHAN_3 = GetChkBoxValue(chkCHAN_3);
        string N_CHAN_4 = GetChkBoxValue(chkCHAN_4);
        string V_CHAN_DESC_4 = txtCHAN_DESC_4.Text.Trim();
        string V_ESTIMATE_NUM_OP = ConvertSign(SLP_ESTIMATE_NUM.Operator);
        string N_ESTIMATE_NUM = SLP_ESTIMATE_NUM.Text.Trim();
        string N_PROCESS_UNIT_1 = GetChkBoxValue(chkPROCESS_UNIT_1);
        string N_PROCESS_UNIT_2 = GetChkBoxValue(chkPROCESS_UNIT_2);
        string N_PROCESS_UNIT_3 = GetChkBoxValue(chkPROCESS_UNIT_3);
        string N_PROCESS_UNIT_4 = GetChkBoxValue(chkPROCESS_UNIT_4);
        string V_PROCESS_UNIT_DESC_4 = txtPROCESS_UNIT_DESC_4.Text.Trim();
        string N_CHARGE_WAY_1 = GetChkBoxValue(chkCHARGE_WAY_1);
        string N_CHARGE_WAY_2 = GetChkBoxValue(chkCHARGE_WAY_2);
        string N_CHARGE_WAY_3 = GetChkBoxValue(chkCHARGE_WAY_3);
        string V_CHARGE_WAY_DESC_3 = txtCHARGE_WAY_DESC_3.Text.Trim();
        string V_INV_VENDOR_NAME = txtINV_VENDOR_NAME.Text.Trim();
        string V_INV_VENDOR_CODE = txtINV_VENDOR_CODE.Text.Trim();
        string V_INV_VENDOR_ADDR = txtINV_VENDOR_ADDR.Text.Trim();
        string V_INV_CONTACT = txtINV_CONTACT.Text.Trim();
        string V_INV_PHONE_CODE = txtINV_PHONE_CODE.Text.Trim();
        string V_INV_PHONE_NO = txtINV_PHONE_NO.Text.Trim();
        string V_CHARGE_FEE_OP = ConvertSign(SLP_CHARGE_FEE.Operator);
        string N_CHARGE_FEE = SLP_CHARGE_FEE.Text.Trim();
        string D_CREATEDATE_S = SLP_CreateDate.StartDate;
        string D_CREATEDATE_E = SLP_CreateDate.EndDate;
        string V_CREATEUID = SLP_CreateUID.Text.Trim();
        string D_UPDATEDATE_S = SLP_UpdateDate.StartDate;
        string D_UPDATEDATE_E = SLP_UpdateDate.EndDate;
        string V_UPDATEUID = SLP_UpdateUID.Text.Trim();
        string N_PROCESS_NO = txtPROCESS_NO.Text;

        if (D_CREATEDATE_E == "")
            D_CREATEDATE_E = D_CREATEDATE_S;
        if (D_CREATEDATE_S == "")
            D_CREATEDATE_S = D_CREATEDATE_E;

        if (D_UPDATEDATE_E == "")
            D_UPDATEDATE_E = D_UPDATEDATE_S;
        if (D_UPDATEDATE_S == "")
            D_UPDATEDATE_S = D_UPDATEDATE_E;

        ParaSQL PSQL = ParaSQL.Equal;
        if (CheckBoxLikeSearch.Checked == true)
            PSQL = ParaSQL.Like;
        ParameterList.Clear();
        ParameterList.Add(DBPara(V_ITEM, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_PERIOD, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_TAKEOVER_UNIT, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(D_TAKEOVER_DATE, ParaType.Date, PSQL));
        ParameterList.Add(DBPara(V_ENTRUST_VENDOR, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_ENTRUST_CODE, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(D_ACCEPT_DATE, ParaType.Date, PSQL));
        ParameterList.Add(DBPara(D_RETURN_DATE, ParaType.Date, PSQL));
        ParameterList.Add(DBPara(D_DECIDE_DONE_DATE, ParaType.Date, PSQL));
        ParameterList.Add(DBPara(N_TASKWAY_1, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_TASKWAY_2, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_TASKWAY_3, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_TASKWAY_4, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_TASKWAY_5, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_TASKWAY_6, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(V_TASKWAY_DESC_5, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_TASKWAY_DESC_6, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(N_CHAN_1, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_CHAN_2, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_CHAN_3, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_CHAN_4, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(V_CHAN_DESC_4, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_ESTIMATE_NUM_OP, ParaType.Varchar2, ParaSQL.Equal));
        ParameterList.Add(DBPara(N_ESTIMATE_NUM, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_PROCESS_UNIT_1, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_PROCESS_UNIT_2, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_PROCESS_UNIT_3, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_PROCESS_UNIT_4, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(V_PROCESS_UNIT_DESC_4, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(N_CHARGE_WAY_1, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_CHARGE_WAY_2, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(N_CHARGE_WAY_3, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(V_CHARGE_WAY_DESC_3, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_INV_VENDOR_NAME, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_INV_VENDOR_CODE, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_INV_VENDOR_ADDR, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_INV_CONTACT, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_INV_PHONE_CODE, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_INV_PHONE_NO, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(V_CHARGE_FEE_OP, ParaType.Varchar2, ParaSQL.Equal));
        ParameterList.Add(DBPara(N_CHARGE_FEE, ParaType.Number, PSQL));
        ParameterList.Add(DBPara(D_CREATEDATE_S, ParaType.Date, PSQL));
        ParameterList.Add(DBPara(D_CREATEDATE_E, ParaType.Date, PSQL));
        ParameterList.Add(DBPara(V_CREATEUID, ParaType.Varchar2, ParaSQL.Equal));
        ParameterList.Add(DBPara(D_UPDATEDATE_S, ParaType.Date, PSQL));
        ParameterList.Add(DBPara(D_UPDATEDATE_E, ParaType.Date, PSQL));
        ParameterList.Add(DBPara(V_UPDATEUID, ParaType.Varchar2, ParaSQL.Equal));
        ParameterList.Add(DBPara(N_PROCESS_NO, ParaType.Number, PSQL));

        DataTable Dt = BCO.DoQuery(ParameterList);

        Session[SessionIDName] = Dt;
        GridView1.DataSource = Dt;
        //設定分頁大小
        if (TextBoxPagesize.Text == "0")
        {
            GridView1.PageSize = 1;
        }
        else
        {
            GridView1.PageSize = (TextBoxPagesize.Text == "") ? 10 : (int.Parse(TextBoxPagesize.Text) < 0) ? 10 : int.Parse(TextBoxPagesize.Text);
        }
        GridView1.PageIndex = 0;
        GridView1.DataBind();

        #region 將Key值存到Session中

        ArrayList arl_Key = new ArrayList();

        foreach (DataRow drRow in Dt.Rows)
        { arl_Key.Add(drRow["PROCESS_NO"].ToString()); }

        Session["CGD30_SortKey" + this.PageTimeStamp.Value] = arl_Key;

        #endregion

        #region 檢查回傳資料

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

        #endregion
    }
Exemple #3
0
    private string CheckPK(string strITEM, string strPERIOD, string strENTRUST_CODE)
    {
        string strPROCESS_NO = string.Empty;

        CGDModel.CGD30_BCO BCO = new CGDModel.CGD30_BCO(ConnectionDB);


        ParaSQL PSQL = ParaSQL.Equal;

        ParameterList.Clear();
        ParameterList.Add(DBPara(strITEM, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(strPERIOD, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Date, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara(strENTRUST_CODE, ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Date, PSQL));
        ParameterList.Add(DBPara("", ParaType.Date, PSQL));
        ParameterList.Add(DBPara("", ParaType.Date, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("=", ParaType.Varchar2, ParaSQL.Equal));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, PSQL));
        ParameterList.Add(DBPara("=", ParaType.Varchar2, ParaSQL.Equal));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));
        ParameterList.Add(DBPara("", ParaType.Date, PSQL));
        ParameterList.Add(DBPara("", ParaType.Date, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, ParaSQL.Equal));
        ParameterList.Add(DBPara("", ParaType.Date, PSQL));
        ParameterList.Add(DBPara("", ParaType.Date, PSQL));
        ParameterList.Add(DBPara("", ParaType.Varchar2, ParaSQL.Equal));
        ParameterList.Add(DBPara("", ParaType.Number, PSQL));

        DataTable Dt = BCO.DoQuery(ParameterList);
        if (Dt.Rows.Count == 0)
            strPROCESS_NO = "";
        else
            strPROCESS_NO = Dt.Rows[0]["PROCESS_NO"].ToString().Trim();

        return strPROCESS_NO;

    }