private void GetM2Data(LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM12Report flM2Report, string unitType) { if (ddlClient.SelectedValue == "-1") { if (cbxSectionId.Checked) { ArrayList sectionsId = new ArrayList(); foreach (ListItem lst in cbxlSectionId.Items) { if (lst.Selected) { sectionsId.Add(lst.Value); } } flM2Report.LoadBySectionId(int.Parse(hdfCompanyId.Value), sectionsId, unitType); } else { if (cbxDate.Checked) { DateTime m1Date = DateTime.Parse(tkrdpDate.SelectedDate.Value.ToShortDateString()); flM2Report.LoadByDate(int.Parse(hdfCompanyId.Value), m1Date.ToShortDateString(), unitType); } else { if (cbxStreet.Checked) { flM2Report.LoadByStreet(int.Parse(hdfCompanyId.Value), tbxStreet.Text.Trim(), unitType); } else { if (cbxSubArea.Checked) { flM2Report.LoadBySubArea(int.Parse(hdfCompanyId.Value), tbxSubArea.Text.Trim(), unitType); } else { flM2Report.Load(int.Parse(hdfCompanyId.Value), unitType); } } } } } else { if (ddlProject.SelectedValue == "-1") { if (cbxSectionId.Checked) { ArrayList sectionsId = new ArrayList(); foreach (ListItem lst in cbxlSectionId.Items) { if (lst.Selected) { sectionsId.Add(lst.Value); } } flM2Report.LoadByCompaniesIdSectionId(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), unitType, sectionsId); } else { if (cbxDate.Checked) { DateTime m1Date = DateTime.Parse(tkrdpDate.SelectedDate.Value.ToShortDateString()); flM2Report.LoadByCompaniesIdDate(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), unitType, m1Date.ToShortDateString()); } else { if (cbxStreet.Checked) { flM2Report.LoadByCompaniesIdStreet(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), unitType, tbxStreet.Text.Trim()); } else { if (cbxSubArea.Checked) { flM2Report.LoadByCompaniesIdSubArea(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), unitType, tbxSubArea.Text.Trim()); } else { flM2Report.LoadByCompaniesId(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), unitType); } } } } } else { if (cbxSectionId.Checked) { ArrayList sectionsId = new ArrayList(); foreach (ListItem lst in cbxlSectionId.Items) { if (lst.Selected) { sectionsId.Add(lst.Value); } } flM2Report.LoadByCompaniesIdProjectIdSectionId(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType, sectionsId); } else { if (cbxDate.Checked) { DateTime m1Date = DateTime.Parse(tkrdpDate.SelectedDate.Value.ToShortDateString()); flM2Report.LoadByCompaniesIdProjectIdDate(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType, m1Date.ToShortDateString()); } else { if (cbxStreet.Checked) { flM2Report.LoadByCompaniesIdProjectIdStreet(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType, tbxStreet.Text.Trim()); } else { if (cbxSubArea.Checked) { flM2Report.LoadByCompaniesIdProjectIdSubArea(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType, tbxSubArea.Text.Trim()); } else { flM2Report.LoadByCompaniesIdProjectId(int.Parse(hdfCompanyId.Value), int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType); } } } } } } }
private void GetM1Data(LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM1Report flM1Report, string unitType, int companyId) { // Get Data // For all clients if (ddlClient.SelectedValue == "-1") { // validate checkboxes if (cbxSectionId.Checked) { ArrayList sectionsId = new ArrayList(); foreach (ListItem lst in cbxlSectionId.Items) { if (lst.Selected) { sectionsId.Add(lst.Value); } } flM1Report.LoadBySectionId(companyId, sectionsId, unitType); } else { if (cbxDate.Checked) { DateTime m1Date = DateTime.Parse(tkrdpDate.SelectedDate.Value.ToShortDateString()); flM1Report.LoadByDate(companyId, m1Date.ToShortDateString(), unitType); } else { if (cbxStreet.Checked) { flM1Report.LoadByStreet(companyId, "%" + tbxStreet.Text.Trim() + "%", unitType); } else { if (cbxSubArea.Checked) { flM1Report.LoadBySubArea(companyId, "%" + tbxSubArea.Text.Trim() + "%", unitType); } else { flM1Report.Load(companyId, unitType); } } } } } // For specific client else { // For all projects if (ddlProject.SelectedValue == "-1") { if (cbxSectionId.Checked) { ArrayList sectionsId = new ArrayList(); foreach (ListItem lst in cbxlSectionId.Items) { if (lst.Selected) { sectionsId.Add(lst.Value); } } flM1Report.LoadByCompaniesIdSectionId(companyId, int.Parse(ddlClient.SelectedValue), unitType, sectionsId); } else { if (cbxDate.Checked) { DateTime m1Date = DateTime.Parse(tkrdpDate.SelectedDate.Value.ToShortDateString()); flM1Report.LoadByCompaniesIdDate(companyId, int.Parse(ddlClient.SelectedValue), unitType, m1Date.ToShortDateString()); } else { if (cbxStreet.Checked) { flM1Report.LoadByCompaniesIdStreet(companyId, int.Parse(ddlClient.SelectedValue), unitType, "%" + tbxStreet.Text.Trim() + "%"); } else { if (cbxSubArea.Checked) { flM1Report.LoadByCompaniesIdSubArea(companyId, int.Parse(ddlClient.SelectedValue), unitType, "%" + tbxSubArea.Text.Trim() + "%"); } else { flM1Report.LoadByCompaniesId(companyId, int.Parse(ddlClient.SelectedValue), unitType); } } } } } // For specific project else { if (cbxSectionId.Checked) { ArrayList sectionsId = new ArrayList(); foreach (ListItem lst in cbxlSectionId.Items) { if (lst.Selected) { sectionsId.Add(lst.Value); } } flM1Report.LoadByCompaniesIdProjectIdSectionId(companyId, int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType, sectionsId); } else { if (cbxDate.Checked) { DateTime m1Date = DateTime.Parse(tkrdpDate.SelectedDate.Value.ToShortDateString()); flM1Report.LoadByCompaniesIdProjectIdDate(companyId, int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType, m1Date.ToShortDateString()); } else { if (cbxStreet.Checked) { flM1Report.LoadByCompaniesIdProjectIdStreet(companyId, int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType, "%" + tbxStreet.Text.Trim() + "%"); } else { if (cbxSubArea.Checked) { flM1Report.LoadByCompaniesIdProjectIdSubArea(companyId, int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType, "%" + tbxSubArea.Text.Trim() + "%"); } else { flM1Report.LoadByCompaniesIdProjectId(companyId, int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), unitType); } } } } } } }