Ejemplo n.º 1
0
    private void ForToolBarShow(string strID)
    {
        string SessionMain = "CGR0321_M_" + PageTimeStamp.Value;
        string SessionDetail = "CGR0321_D_" + PageTimeStamp.Value;
        DataTable Dt_Main = MakeMainTable();
        DataTable Dt_Detail = MakeDetailTable();

        ArrayList AL_Temp = new ArrayList();

        CGRModel.MaintainSorterExceptoin BCO = new PIC.VDS2G.LGT.CGR.MaintainSorterExceptoin(ConntionDB);

        ParameterList.Clear();

        ParameterList.Add(strID);

        //main data
        Dt_Main = BCO.QueryMainByID(ParameterList);
        //detail data
        Dt_Detail = BCO.QueryDetailByID(ParameterList);

        SetControlValue(Dt_Main, Dt_Detail, AL_Temp);

        Session[SessionMain] = Dt_Main;
        Session[SessionDetail] = Dt_Detail;
    }
Ejemplo n.º 2
0
    //查詢資料,並將查詢回來的資料和控制項繫結
    private void ShowEditData(string strID)
    {
        try
        {
            //抓取本頁初次登記的時間
            string SessionMain = "CGR0321_M_" + PageTimeStamp.Value;
            string SessionDetail = "CGR0321_D_" + PageTimeStamp.Value;

            DataTable Dt_Main = MakeMainTable();
            DataTable Dt_Detail = MakeDetailTable();
            ArrayList AL_Temp = new ArrayList();

            if (Session["PageMode" + PageTimeStamp.Value].ToString() == "1" || Session["PageMode" + PageTimeStamp.Value].ToString() == "2")
            {
                //string strID = Request.QueryString["CGR03"];

                CGRModel.MaintainSorterExceptoin BCO = new PIC.VDS2G.LGT.CGR.MaintainSorterExceptoin(ConntionDB);

                ParameterList.Clear();

                ParameterList.Add(strID);

                //main data
                Dt_Main = BCO.QueryMainByID(ParameterList);
                //detail data
                Dt_Detail = BCO.QueryDetailByID(ParameterList);
            }
            else //Session["PageMode"+PageTimeStamp.Value].ToString() == "3"
            {
                //Dt_Main = (DataTable)Session["CGR0321_M_" + Request.QueryString["PageTimeStamp"]];
                //Dt_Detail = (DataTable)Session["CGR0321_D_" + Request.QueryString["PageTimeStamp"]];
                //AL_Temp = (ArrayList)Session["CGR0321_T_" + Request.QueryString["PageTimeStamp"]];
                Dt_Main = (DataTable)Session[SessionMain];
                Dt_Detail = (DataTable)Session[SessionDetail];
            }

            SetControlValue(Dt_Main, Dt_Detail, AL_Temp);

            Session[SessionMain] = Dt_Main;
            Session[SessionDetail] = Dt_Detail;

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