예제 #1
0
    private void loadRequests()
    {
        DataTable dt = null;

        if (_refreshData || Session["dtWorkItemRequest"] == null)
        {
            dt = WorkRequest.WorkRequestList_Get(typeID: 0, showArchived: _showArchived, requestGroupID: 0, myData: _myData);
            HttpContext.Current.Session["dtWorkItemRequest"] = dt;
        }
        else
        {
            dt = (DataTable)HttpContext.Current.Session["dtWorkItemRequest"];
        }

        if (dt != null)
        {
            this.DCC = dt.Columns;
            spanRowCount.InnerText = dt.Rows.Count.ToString();

            InitializeColumnData(ref dt);
            dt.AcceptChanges();
        }

        if (_export)
        {
            ExportExcel(dt);
        }
        else
        {
            grdRequest.DataSource = dt;
            grdRequest.DataBind();
        }
    }
예제 #2
0
    protected static DataTable GetMasterDataValues(string idField, string columnName, string textField, bool includeArchive = false)
    {
        DataSet   ds = null;
        DataTable dt = null;

        try
        {
            switch (columnName.ToUpper())
            {
            case "ALLOCATION":
                ds = MasterData.AllocationList_Get(includeArchive: includeArchive);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null)
                {
                    dt = ds.Tables[0];
                    dt.Columns["ALLOCATIONID"].ColumnName = "valueField";
                    dt.Columns["ALLOCATION"].ColumnName   = "textField";
                }

                break;

            case "ARCHIVE":
                dt = new DataTable();
                dt.Columns.Add("valueField");
                dt.Columns.Add("textField");
                dt.AcceptChanges();

                dt.Rows.Add(new object[] { "0", "No" });
                dt.Rows.Add(new object[] { "1", "Yes" });

                break;

            case "ASSIGNED":
                dt = UserManagement.LoadUserList(organizationId: 0, excludeDeveloper: false, loadArchived: includeArchive, userNameSearch: "");
                if (dt != null)
                {
                    dt.Columns["WTS_RESOURCEID"].ColumnName = "valueField";
                    dt.Columns["UserName"].ColumnName       = "textField";
                }

                break;

            case "PRIMARY_DEVELOPER":
                dt = UserManagement.LoadUserList(organizationId: 0, excludeDeveloper: false, loadArchived: includeArchive, userNameSearch: "");
                if (dt != null)
                {
                    dt.Columns["WTS_RESOURCEID"].ColumnName = "valueField";
                    dt.Columns["UserName"].ColumnName       = "textField";
                }

                break;

            case "WORKITEMTYPE":
                dt = MasterData.WorkItemTypeList_Get(includeArchive: includeArchive);
                if (dt != null)
                {
                    dt.Columns["WORKITEMTYPEID"].ColumnName = "valueField";
                    dt.Columns["WORKITEMTYPE"].ColumnName   = "textField";
                }

                break;

            case "PRIORITY":
                dt = MasterData.PriorityList_Get(includeArchive: includeArchive);
                if (dt != null)
                {
                    dt.DefaultView.RowFilter = "PriorityType = 'Work Item'";
                    dt = dt.DefaultView.ToTable();
                    dt.Columns["PriorityID"].ColumnName = "valueField";
                    dt.Columns["Priority"].ColumnName   = "textField";
                }

                break;

            case "PRODUCTION":
                dt = new DataTable();
                dt.Columns.Add("valueField");
                dt.Columns.Add("textField");
                dt.AcceptChanges();

                dt.Rows.Add(new object[] { "0", "No" });
                dt.Rows.Add(new object[] { "1", "Yes" });

                break;

            case "VERSION":
                dt = MasterData.ProductVersionList_Get(includeArchive: includeArchive);
                if (dt != null)
                {
                    dt = dt.DefaultView.ToTable();
                    dt.Columns["ProductVersionID"].ColumnName = "valueField";
                    dt.Columns["ProductVersion"].ColumnName   = "textField";
                }

                break;

            case "WEBSYSTEM":
                dt = MasterData.SystemList_Get(includeArchive: includeArchive);
                if (dt != null)
                {
                    dt = dt.DefaultView.ToTable();
                    dt.Columns["WTS_SYSTEMID"].ColumnName = "valueField";
                    dt.Columns["WTS_SYSTEM"].ColumnName   = "textField";
                }

                break;

            case "WORKAREA":
                dt = MasterData.WorkAreaList_Get(includeArchive: includeArchive);
                if (dt != null)
                {
                    dt = dt.DefaultView.ToTable();
                    dt.Columns["WorkAreaID"].ColumnName = "valueField";
                    dt.Columns["WorkArea"].ColumnName   = "textField";
                }

                break;

            case "WORKREQUEST":
                dt = WorkRequest.WorkRequestList_Get(typeID: 0, requestGroupID: 0, myData: false);
                if (dt != null)
                {
                    dt = dt.DefaultView.ToTable();
                    dt.Columns["WORKREQUESTID"].ColumnName = "valueField";
                    dt.Columns["TITLE"].ColumnName         = "textField";
                }

                break;

            case "WORKTYPE":
                dt = MasterData.WorkTypeList_Get(includeArchive: includeArchive);
                if (dt != null)
                {
                    dt.Columns["WORKTYPEID"].ColumnName = "valueField";
                    dt.Columns["WORKTYPE"].ColumnName   = "textField";
                }

                break;

            case "WORKLOADGROUP":
                dt = MasterData.WorkloadGroupList_Get(includeArchive: includeArchive);
                if (dt != null)
                {
                    dt = dt.DefaultView.ToTable();
                    dt.Columns["WorkloadGroupID"].ColumnName = "valueField";
                    dt.Columns["WorkloadGroup"].ColumnName   = "textField";
                }

                break;

            default:
                dt = null;
                break;
            }
        }
        catch (Exception ex)
        {
            LogUtility.LogException(ex);
            dt = null;
        }

        return(dt);
    }