コード例 #1
0
        private void OpenPageMuti(StuGLSearch stuGLSearch, string action, string fileName, string windowName, string LocalIP, string LocalBrowserType)
        {
            Session["action"] = action;
            //Session["action"] = action;
            Session["UrlFileName"] = fileName;
            //stuGLSearch = new CglSearch().InitSearch(stuGLSearch);
            if (stuGLSearch.InTestPeriods > 1)
            {
                DataTable dtProcess = new CglFreqProcess().GetFreqProcAlls(stuGLSearch, CglDBFreq.TableName.QryFreqProcess01, SortOrder.Descending, stuGLSearch.InTestPeriods - 1);

                foreach (DataRow drRow in dtProcess.Rows)
                {
                    StuGLSearch stuSearchTemp = stuGLSearch;
                    stuSearchTemp.LngTotalSN    = long.Parse(drRow["lngTotalSN"].ToString(), InvariantCulture);
                    stuSearchTemp.InTestPeriods = 1;
                    Session["id"] = SetRequestId(stuSearchTemp);
                    Session[action + SetRequestId(stuSearchTemp)] = stuSearchTemp;
                    if (stuGLSearch.SearchOrder)
                    {
                        SetSearchOrder(stuSearchTemp, action, SetRequestId(stuSearchTemp), fileName, LocalIP, LocalBrowserType);
                    }
                    else
                    {
                        OpenPage(stuSearchTemp, Request.Url.Authority, action, fileName, windowName);
                    }
                }
            }
        }
コード例 #2
0
        private void ShowFreqProcess(StuGLSearch stuSearchTemp)
        {
            dtlProcess.Visible = true;
            DataTable DtFreqProcess = new CglFreqProcess().GetFreqProcs(stuSearchTemp, CglDBFreq.TableName.QryFreqProcess, SortOrder.Descending);

            if (DtFreqProcess.Columns.Contains("lngFreqProcessSN"))
            {
                DtFreqProcess.Columns.Remove("lngFreqProcessSN");
            }
            if (DtFreqProcess.Columns.Contains("lngFreqSN"))
            {
                DtFreqProcess.Columns.Remove("lngFreqSN");
            }
            gvFreqProcess.DataSource = new CglFunc().CTableShow(DtFreqProcess).DefaultView;
            if (gvFreqProcess.Columns.Count == 0)
            {
                for (int ColumnIndex = 0; ColumnIndex < DtFreqProcess.Columns.Count; ColumnIndex++)
                {
                    BoundField bfCell = new BoundField()
                    {
                        DataField      = DtFreqProcess.Columns[ColumnIndex].ColumnName,
                        HeaderText     = new CglFunc().ConvertFieldNameId(DtFreqProcess.Columns[ColumnIndex].ColumnName, 1),
                        SortExpression = DtFreqProcess.Columns[ColumnIndex].ColumnName,
                    };
                    gvFreqProcess.Columns.Add(bfCell);
                }
            }
            #region Set Columns of DataGrid gvProcess
            foreach (BoundField dcColumn in gvFreqProcess.Columns)
            {
                string strColumnName = dcColumn.SortExpression;
                if ((strColumnName.Substring(0, 4) != "lngL" && strColumnName.Substring(0, 4) != "lngM") || strColumnName == "lngMethodSN")
                {
                    dcColumn.HeaderStyle.CssClass = strColumnName;
                    dcColumn.ItemStyle.CssClass   = strColumnName;
                }

                if (strColumnName.Substring(0, 4) == "lngL" || strColumnName.Substring(0, 4) == "lngS")
                {
                    dcColumn.HeaderStyle.CssClass = strColumnName;
                    dcColumn.DataFormatString     = "{0:d2}";
                }
            }
            #endregion
            gvFreqProcess.RowDataBound += GvFreqProcess_RowDataBound;
            gvFreqProcess.DataBind();
        }