public virtual int Fill(CloudAccountDA.TeamSummaryDataTable dataTable, int?CompanyID, string EntryFor) { 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 (this.ClearBeforeFill) { dataTable.Clear(); } return(this.Adapter.Fill(dataTable)); }
public virtual CloudAccountDA.TeamSummaryDataTable GetDataByWeek(int?CompanyID, string EntryFor) { this.Adapter.SelectCommand = this.CommandCollection[1]; 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; } CloudAccountDA.TeamSummaryDataTable dataTable = new CloudAccountDA.TeamSummaryDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
private void SetPageData() { this.gvCurrentWeek.DataBind(); if (this.gvCurrentWeek.Rows.Count > 0) { this.lblCurrentWeek.Text = DateTime.Parse(this.gvCurrentWeek.Rows[0].Cells[0].Text).ToString("MMM dd/yy") + " - " + DateTime.Parse(this.gvCurrentWeek.Rows[0].Cells[1].Text).ToString("MMM dd/yy"); } this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); string str1 = this.objCompanyMasterDT.Rows[0]["CompanyContactPerson"].ToString(); StringBuilder stringBuilder1 = new StringBuilder(); stringBuilder1.Insert(0, str1); if (stringBuilder1.Length > 12) { str1 = stringBuilder1.ToString().Substring(0, 10) + "..."; } string sEntryFor1 = this.objCompanyMasterDT.Rows[0]["CompanyUserName"].ToString(); this.objTeamSummaryDT = this.objTeamSummaryBll.GetDataByMonth(int.Parse(this.hfCompanyID.Value), sEntryFor1); string str2 = "0.00"; if (this.objTeamSummaryDT.Rows.Count > 0) { str2 = this.objTeamSummaryDT.Rows[0]["Hours"].ToString(); } this.objTeamSummaryDT = this.objTeamSummaryBll.GetDataByWeek(int.Parse(this.hfCompanyID.Value), sEntryFor1); string str3 = "0.00"; if (this.objTeamSummaryDT.Rows.Count > 0) { str3 = this.objTeamSummaryDT.Rows[0]["Hours"].ToString(); } Label label1 = new Label(); label1.ID = "lblNameCmp" + str1; label1.Text = str1; Label label2 = label1; Label label3 = new Label(); label3.ID = "lblHoursMonthCmp" + str1; label3.Text = str2; Label label4 = label3; Label label5 = new Label(); label5.ID = "lblHoursWeekCmp" + str1; label5.Text = str3; Label label6 = label5; this.divName.Controls.Add((Control)label2); this.divHoursMonth.Controls.Add((Control)label4); this.divHoursWeek.Controls.Add((Control)label6); this.divName.Controls.Add((Control) new LiteralControl("<BR>")); this.divHoursMonth.Controls.Add((Control) new LiteralControl("<BR>")); this.divHoursWeek.Controls.Add((Control) new LiteralControl("<BR>")); this.objStaffMasterDT = this.objStaffMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objStaffMasterDT.Rows.Count <= 0) { return; } for (int index = 0; index < this.objStaffMasterDT.Rows.Count; ++index) { string sEntryFor2 = this.objStaffMasterDT.Rows[index]["UserName"].ToString(); string str4 = (string)this.objStaffMasterDT.Rows[index]["FirstName"] + (object)" " + (string)this.objStaffMasterDT.Rows[index]["LastName"]; StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.Insert(0, str4); if (stringBuilder2.Length > 12) { str4 = stringBuilder2.ToString().Substring(0, 10) + "..."; } this.objTeamSummaryDT = this.objTeamSummaryBll.GetDataByMonth(int.Parse(this.hfCompanyID.Value), sEntryFor2); string str5 = "0.00"; if (this.objTeamSummaryDT.Rows.Count > 0) { str5 = this.objTeamSummaryDT.Rows[0]["Hours"].ToString(); } this.objTeamSummaryDT = this.objTeamSummaryBll.GetDataByWeek(int.Parse(this.hfCompanyID.Value), sEntryFor2); string str6 = "0.00"; if (this.objTeamSummaryDT.Rows.Count > 0) { str6 = this.objTeamSummaryDT.Rows[0]["Hours"].ToString(); } Label label7 = new Label(); label7.ID = "lblNameStaff" + str4; label7.Text = str4; Label label8 = label7; Label label9 = new Label(); label9.ID = "lblHoursMonthStaff" + str4; label9.Text = str5; Label label10 = label9; Label label11 = new Label(); label11.ID = "lblHoursWeekStaff" + str4; label11.Text = str6; Label label12 = label11; this.divName.Controls.Add((Control)label8); this.divHoursMonth.Controls.Add((Control)label10); this.divHoursWeek.Controls.Add((Control)label12); this.divName.Controls.Add((Control) new LiteralControl("<BR>")); this.divHoursMonth.Controls.Add((Control) new LiteralControl("<BR>")); this.divHoursWeek.Controls.Add((Control) new LiteralControl("<BR>")); } }