Ejemplo n.º 1
0
    private void BindGvw()
    {
        this.AspNetPager1.RecordCount = EReport.GetBudGetOutPut(this.prjId, 0, 0).Rows.Count;
        DataTable dataTable = (DataTable)this.ViewState["dtReport"];
        DataView  dataView  = dataTable.AsDataView();

        dataView.Sort = "OrderNumber";
        dataTable     = dataView.ToTable();
        this.ViewState["dtReport"]      = dataTable;
        this.gvwBudGetOutPut.DataSource = dataTable;
        this.gvwBudGetOutPut.DataBind();
    }
Ejemplo n.º 2
0
    private void GetTable(int pageSize, int pageIndex)
    {
        DataTable budGetOutPut = EReport.GetBudGetOutPut(this.prjId, pageSize, pageIndex);

        budGetOutPut.Columns.Add("LossCoefficient", System.Type.GetType("System.Decimal"));
        budGetOutPut.Columns.Add("ResourcePrice", System.Type.GetType("System.Decimal"));
        budGetOutPut.Columns["LossCoefficient"].SetOrdinal(11);
        budGetOutPut.Columns["ResourcePrice"].SetOrdinal(12);
        DataTable dataTable = new DataTable();
        string    text      = string.Empty;

        foreach (DataRow dataRow in budGetOutPut.Rows)
        {
            text = text + "'" + dataRow["TaskId"].ToString() + "',";
        }
        if (text.Length >= 1)
        {
            text      = text.Remove(text.Length - 1);
            dataTable = BudTask.GetTaskRes(text);
            dataTable.Columns.Add(new DataColumn("OrderNumber", System.Type.GetType("System.String")));
            foreach (DataRow dataRow2 in budGetOutPut.Rows)
            {
                int num = 1;
                foreach (DataRow dataRow3 in dataTable.Rows)
                {
                    if (dataRow3["TaskId"].ToString() == dataRow2["TaskId"].ToString())
                    {
                        dataRow3["OrderNumber"] = dataRow2["OrderNumber"].ToString() + num.ToString();
                        num++;
                    }
                }
            }
            System.Collections.IEnumerator enumerator4 = dataTable.Rows.GetEnumerator();
            try
            {
                while (enumerator4.MoveNext())
                {
                    DataRow dataRow4 = (DataRow)enumerator4.Current;
                    DataRow dataRow5 = budGetOutPut.NewRow();
                    dataRow5["TaskCode"]           = string.Empty;
                    dataRow5["OrderNumber"]        = dataRow4["OrderNumber"];
                    dataRow5["TaskName"]           = string.Empty;
                    dataRow5["FeatureDescription"] = dataRow4["ResourceName"].ToString();
                    dataRow5["TypeName"]           = dataRow4["ResourceTypeName"].ToString();
                    dataRow5["Unit"]            = dataRow4["UnitName"].ToString();
                    dataRow5["Quantity"]        = dataRow4["ResourceQuantity"].ToString();
                    dataRow5["ConUnitPrice"]    = System.DBNull.Value;
                    dataRow5["ConTotal"]        = System.DBNull.Value;
                    dataRow5["LossCoefficient"] = dataRow4["LossCoefficient"];
                    dataRow5["ResourcePrice"]   = dataRow4["ResourcePrice"];
                    dataRow5["BudTotal"]        = dataRow4["ResTotal"];
                    dataRow5["BudUnitPrice"]    = System.DBNull.Value;
                    dataRow5["Profit"]          = System.DBNull.Value;
                    dataRow5["ProfitRate"]      = string.Empty;
                    budGetOutPut.Rows.Add(dataRow5);
                }
                goto IL_39C;
            }
            finally
            {
                System.IDisposable disposable4 = enumerator4 as System.IDisposable;
                if (disposable4 != null)
                {
                    disposable4.Dispose();
                }
            }
        }
        dataTable = null;
IL_39C:
        this.ViewState["dtReport"] = budGetOutPut;
    }