public virtual int Fill(CloudAccountDA.ReportEstimatedBillingTeamDataTable dataTable, int?CompanyID, string EntryFor, int?ProjectID, bool?Billed, DateTime?FromDate, DateTime?ToDate)
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if (CompanyID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (EntryFor == null)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = EntryFor;
     }
     if (ProjectID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[3].Value = ProjectID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[3].Value = DBNull.Value;
     }
     if (Billed.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[4].Value = Billed.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[4].Value = DBNull.Value;
     }
     if (FromDate.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[5].Value = FromDate.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[5].Value = DBNull.Value;
     }
     if (ToDate.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[6].Value = ToDate.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[6].Value = DBNull.Value;
     }
     if (this.ClearBeforeFill)
     {
         dataTable.Clear();
     }
     return(this.Adapter.Fill(dataTable));
 }
        private void BindGrid()
        {
            DateTime?dtFromDate = new DateTime?();
            DateTime?dtToDate   = new DateTime?();
            bool?    bBilled    = new bool?();

            if (this.txtDateFrom.Text.Trim().Length > 0)
            {
                dtFromDate = new DateTime?(DateTime.Parse(this.txtDateFrom.Text.Trim()));
            }
            if (this.txtDateTo.Text.Trim().Length > 0)
            {
                dtToDate = new DateTime?(DateTime.Parse(this.txtDateTo.Text.Trim()));
            }
            if (this.ddlBilled.SelectedIndex > 0)
            {
                bBilled = new bool?(bool.Parse(this.ddlBilled.SelectedItem.Value));
            }
            if (this.ddlGroupBy.SelectedItem.Text == "Team")
            {
                int?iProjectID = new int?();
                if (this.ddlProject.SelectedIndex > 0)
                {
                    iProjectID = new int?(int.Parse(this.ddlProject.SelectedItem.Value));
                }
                if (this.ddlTeam.SelectedIndex > 0)
                {
                    this.objReportEstimatedBillingTeamDT = this.objReportEstimatedBillingTeamBll.GetData(int.Parse(this.hfCompanyID.Value), this.ddlTeam.SelectedItem.Text, iProjectID, bBilled, dtFromDate, dtToDate);
                    Label label = new Label()
                    {
                        Text = this.ddlTeam.SelectedItem.Text
                    };
                    label.Font.Bold = true;
                    this.divGrids.Controls.Add((Control)label);
                    this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                    GridView gridView1 = new GridView();
                    gridView1.DataSource    = (object)this.objReportEstimatedBillingTeamDT;
                    gridView1.CssClass      = "reportTable table table-responsive";
                    gridView1.Width         = Unit.Percentage(100.0);
                    gridView1.GridLines     = GridLines.None;
                    gridView1.EmptyDataText = "No Timesheet entry found";
                    GridView gridView2 = gridView1;
                    gridView2.HeaderStyle.BackColor = ColorTranslator.FromHtml("#0083E0");
                    gridView2.HeaderStyle.ForeColor = Color.White;
                    gridView2.DataBind();
                    this.divGrids.Controls.Add((Control)gridView2);
                    this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                }
                else
                {
                    this.ddlTeam.DataBind();
                    foreach (ListItem listItem in this.ddlTeam.Items)
                    {
                        if (!string.IsNullOrEmpty(listItem.Value))
                        {
                            this.objReportEstimatedBillingTeamDT = this.objReportEstimatedBillingTeamBll.GetData(int.Parse(this.hfCompanyID.Value), listItem.Value, iProjectID, bBilled, dtFromDate, dtToDate);
                            Label label = new Label()
                            {
                                Text = listItem.Text
                            };
                            label.Font.Bold = true;
                            this.divGrids.Controls.Add((Control)label);
                            this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                            GridView gridView1 = new GridView();
                            gridView1.DataSource    = (object)this.objReportEstimatedBillingTeamDT;
                            gridView1.CssClass      = "reportTable table table-responsive";
                            gridView1.Width         = Unit.Percentage(100.0);
                            gridView1.GridLines     = GridLines.None;
                            gridView1.EmptyDataText = "No Timesheet entry found";
                            GridView gridView2 = gridView1;
                            gridView2.HeaderStyle.BackColor = ColorTranslator.FromHtml("#0083E0");
                            gridView2.HeaderStyle.ForeColor = Color.White;
                            gridView2.DataBind();
                            this.divGrids.Controls.Add((Control)gridView2);
                            this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                        }
                    }
                }
            }
            else if (this.ddlGroupBy.SelectedItem.Text == "Client")
            {
                int?iProjectID = new int?();
                if (this.ddlProject.SelectedIndex > 0)
                {
                    iProjectID = new int?(int.Parse(this.ddlProject.SelectedItem.Value));
                }
                this.ddlClient.DataBind();
                foreach (ListItem listItem in this.ddlClient.Items)
                {
                    if (!string.IsNullOrEmpty(listItem.Value))
                    {
                        this.objReportEstimatedBillingClientDT = this.objReportEstimatedBillingClientBll.GetData(int.Parse(this.hfCompanyID.Value), new int?(int.Parse(listItem.Value)), iProjectID, bBilled, dtFromDate, dtToDate);
                        Label label = new Label()
                        {
                            Text = listItem.Text
                        };
                        label.Font.Bold = true;
                        this.divGrids.Controls.Add((Control)label);
                        this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                        GridView gridView1 = new GridView();
                        gridView1.DataSource    = (object)this.objReportEstimatedBillingClientDT;
                        gridView1.CssClass      = "reportTable table table-responsive";
                        gridView1.Width         = Unit.Percentage(100.0);
                        gridView1.GridLines     = GridLines.None;
                        gridView1.EmptyDataText = "No Timesheet entry found";
                        GridView gridView2 = gridView1;
                        gridView2.HeaderStyle.BackColor = ColorTranslator.FromHtml("#0083E0");
                        gridView2.HeaderStyle.ForeColor = Color.White;
                        gridView2.DataBind();
                        this.divGrids.Controls.Add((Control)gridView2);
                        this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                    }
                }
            }
            else if (this.ddlGroupBy.SelectedItem.Text == "Project")
            {
                if (this.ddlProject.SelectedIndex > 0)
                {
                    int?iProjectID = new int?();
                    if (this.ddlProject.SelectedIndex > 0)
                    {
                        iProjectID = new int?(int.Parse(this.ddlProject.SelectedItem.Value));
                    }
                    this.objReportEstimatedBillingProjectDT = this.objReportEstimatedBillingProjectBll.GetData(int.Parse(this.hfCompanyID.Value), iProjectID, bBilled, dtFromDate, dtToDate);
                    Label label = new Label()
                    {
                        Text = this.ddlProject.SelectedItem.Text
                    };
                    label.Font.Bold = true;
                    this.divGrids.Controls.Add((Control)label);
                    this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                    GridView gridView1 = new GridView();
                    gridView1.DataSource    = (object)this.objReportEstimatedBillingProjectDT;
                    gridView1.CssClass      = "reportTable table table-responsive";
                    gridView1.Width         = Unit.Percentage(100.0);
                    gridView1.GridLines     = GridLines.None;
                    gridView1.EmptyDataText = "No Timesheet entry found";
                    GridView gridView2 = gridView1;
                    gridView2.HeaderStyle.BackColor = ColorTranslator.FromHtml("#0083E0");
                    gridView2.HeaderStyle.ForeColor = Color.White;
                    gridView2.DataBind();
                    this.divGrids.Controls.Add((Control)gridView2);
                    this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                }
                else
                {
                    this.ddlProject.DataBind();
                    foreach (ListItem listItem in this.ddlProject.Items)
                    {
                        if (!string.IsNullOrEmpty(listItem.Value))
                        {
                            this.objReportEstimatedBillingProjectDT = this.objReportEstimatedBillingProjectBll.GetData(int.Parse(this.hfCompanyID.Value), new int?(int.Parse(listItem.Value)), bBilled, dtFromDate, dtToDate);
                            Label label = new Label()
                            {
                                Text = listItem.Text
                            };
                            label.Font.Bold = true;
                            this.divGrids.Controls.Add((Control)label);
                            this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                            GridView gridView1 = new GridView();
                            gridView1.DataSource    = (object)this.objReportEstimatedBillingProjectDT;
                            gridView1.CssClass      = "reportTable table table-responsive";
                            gridView1.Width         = Unit.Percentage(100.0);
                            gridView1.GridLines     = GridLines.None;
                            gridView1.EmptyDataText = "No Timesheet entry found";
                            GridView gridView2 = gridView1;
                            gridView2.HeaderStyle.BackColor = ColorTranslator.FromHtml("#0083E0");
                            gridView2.HeaderStyle.ForeColor = Color.White;
                            gridView2.DataBind();
                            this.divGrids.Controls.Add((Control)gridView2);
                            this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                        }
                    }
                }
            }
            else
            {
                if (!(this.ddlGroupBy.SelectedItem.Text == "Task"))
                {
                    return;
                }
                this.ddlTask.DataBind();
                foreach (ListItem listItem in this.ddlTask.Items)
                {
                    if (!string.IsNullOrEmpty(listItem.Value))
                    {
                        this.objReportEstimatedBillingTaskDT = this.objReportEstimatedBillingTaskBll.GetData(int.Parse(this.hfCompanyID.Value), int.Parse(listItem.Value), bBilled, dtFromDate, dtToDate);
                        Label label = new Label()
                        {
                            Text = listItem.Text
                        };
                        label.Font.Bold = true;
                        this.divGrids.Controls.Add((Control)label);
                        this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                        GridView gridView1 = new GridView();
                        gridView1.DataSource    = (object)this.objReportEstimatedBillingTaskDT;
                        gridView1.CssClass      = "reportTable table table-responsive";
                        gridView1.Width         = Unit.Percentage(100.0);
                        gridView1.GridLines     = GridLines.None;
                        gridView1.EmptyDataText = "No Timesheet entry found";
                        GridView gridView2 = gridView1;
                        gridView2.HeaderStyle.BackColor = ColorTranslator.FromHtml("#0083E0");
                        gridView2.HeaderStyle.ForeColor = Color.White;
                        gridView2.DataBind();
                        this.divGrids.Controls.Add((Control)gridView2);
                        this.divGrids.Controls.Add((Control) new LiteralControl("<br />"));
                    }
                }
            }
        }