private void loadGridData()
    {
        _dtUser = UserManagement.LoadUserList(organizationId: 0, excludeDeveloper: false, loadArchived: false, userNameSearch: "");
        Page.ClientScript.RegisterArrayDeclaration("_userList", JsonConvert.SerializeObject(_dtUser, Newtonsoft.Json.Formatting.None));
        _dtAllocation_Unused = MasterData.Allocation_Get_All_Unused();
        Page.ClientScript.RegisterArrayDeclaration("_Allocation_Unused", JsonConvert.SerializeObject(_dtAllocation_Unused, Newtonsoft.Json.Formatting.None));
        DataTable dt = null;

        if (_refreshData || Session["AllocationGroup_Assignment"] == null)
        {
            dt = MasterData.AllocationGroup_Assignment_Get(this._qfWorkAreaID);
            HttpContext.Current.Session["AllocationGroup_Assignment"] = dt;
        }
        else
        {
            dt = (DataTable)HttpContext.Current.Session["AllocationGroup_Assignment"];
        }

        if (dt != null)
        {
            this.DCC = dt.Columns;
            Page.ClientScript.RegisterArrayDeclaration("_dcc", JsonConvert.SerializeObject(DCC, Newtonsoft.Json.Formatting.None));
            spanRowCount.InnerText = dt.Rows.Count.ToString();


            InitializeColumnData(ref dt);
            dt.AcceptChanges();
            iti_Tools_Sharp.DynamicHeader head = WTSUtility.CreateGridMultiHeader(dt);
            if (head != null)
            {
                grdMD.DynamicHeader = head;
            }

            int count = dt.Rows.Count;
            count = count > 0 ? count - 1 : count;
            spanRowCount.InnerText = count.ToString();
        }

        grdMD.DataSource = dt;
        grdMD.DataBind();
    }
예제 #2
0
    private void printChildRows(DataRow parentRow, Worksheet ws, ref int rowCount, ref DataTable childRaw)
    {
        DataTable child = null;
        int       ID    = parentRow.Field <int>("ALLOCATIONGROUPID");

        child = MasterData.AllocationGroup_Assignment_Get(parentID: ID);
        int i = 0, j = 1;

        formatChild(child);
        printChildHeader(ws, ref rowCount, child.Columns);
        foreach (DataRow row in child.Rows)
        {
            WTSUtility.importDataRow(ref childRaw, row);
            j = 2;
            foreach (object value in row.ItemArray)
            {
                ws.Cells[rowCount + i, j].PutValue(value);
                j++;
            }
            i++;
        }
        rowCount += child.Rows.Count;
    }