private void PopulateIndustries() { bizMessage bizM = new bizMessage(); bizIndustry biz = new bizIndustry(); IQueryable <Industry> inds = biz.ListIndustriesByKeyword(this.txtFindIndustry.Text); this.ucMessanger1.ProcessMessages(biz.MSGS, true); this.lstIndustry.Items.Clear(); if (this.txtFindIndustry.Text != "") { foreach (Industry ind in inds) { this.lstIndustry.Items.Add(new ListItem(ind.IndustryName + " (" + ind.AnzsicCode + ")", ind.AnzsicCode)); } this.lstIndustry.Visible = true; this.lblFoundIndustries.Text = this.lstIndustry.Items.Count.ToString() + " industries found"; } else { this.lstIndustry.Visible = false; this.lblFoundIndustries.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { try { if (!this.IsPostBack) { // ((Main)Master).AuthenticateUser(); if (Session["USER"] == null) { bizMessage bizM = new bizMessage(); this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } bizUser.enGageUser user = (bizUser.enGageUser)Session["USER"]; if (user.Role == (int)Enums.enUserRole.Executive) { Response.Redirect("~/Dashboard.aspx", false); return; } ((Main)Master).HeaderTitle = "Dashboard Totals"; ((HtmlGenericControl)((Main)Master).FindControl("divWrapper")).Attributes["class"] = "wrapper-report"; } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
protected void btnLookup_Click(object sender, EventArgs e) { try { bizMessage bizM = new bizMessage(); this.lblFindMessage.Visible = false; this.lstExecutives.Visible = false; if (this.txtFind.Text == "") { this.lblFindMessage.Visible = true; return; } bizSetting biz = new bizSetting(); NameValueCollection execs = bizActiveDirectory.FindAccountExecutive(this.txtFind.Text); if (execs.Count > 0) { this.lstExecutives.Items.Clear(); foreach (String exec in execs) { this.lstExecutives.Items.Add(new ListItem(exec, execs[exec])); } this.lstExecutives.Visible = true; } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
private void PopulateOpportunitySummary() { bizMessage bizM = new bizMessage(); bizOpportunity biz = new bizOpportunity(); Opportunity o; o = biz.GetOpportunity(int.Parse(Request.QueryString["oid"])); this.ucMessanger1.ProcessMessages(biz.MSGS, true); if (o == null) { return; } switch (o.BusinessType.BusinessTypeName) { case Enums.enBusinessType.NewBusiness: this.imgBusinessType.ImageUrl = "~/images/OpportunityNewBusiness.gif"; break; case Enums.enBusinessType.ReclaimedBusiness: this.imgBusinessType.ImageUrl = "~/images/OpportunityReclaimedBusiness.gif"; break; case Enums.enBusinessType.ExistingClients: this.imgBusinessType.ImageUrl = "~/images/OpportunityExistingClients.gif"; break; case Enums.enBusinessType.QuickQuote: this.imgBusinessType.ImageUrl = "~/images/OpportunityQuickQuote.gif"; break; case Enums.enBusinessType.QuickWin: this.imgBusinessType.ImageUrl = "~/images/OpportunityQuickWin.gif"; break; case Enums.enBusinessType.QuickCall: this.imgBusinessType.ImageUrl = "~/images/OpportunityQuickCall.gif"; break; } this.imgFlagged.Visible = o.Flagged; this.lblOpportunityName.Text = o.OpportunityName; this.lblOpportunityDue.Text = string.Format("{0:dd-MMM-yy}", o.OpportunityDue); List <sp_web_GetCurrentOpportunityStatusResult> s = biz.GetCurrentOpportunityStatus(o.OpportunityID); this.ucMessanger1.ProcessMessages(biz.MSGS, false); if (s != null) { this.lblStatus.Text = s.First().StatusName; } if (o.ContactID.HasValue == true) { this.ddlContact.SelectedValue = o.ContactID.ToString(); } }
private void PopulateClientDetails() { bizMessage bizM = new bizMessage(); bizClient biz = new bizClient(); Client c; c = biz.GetClient(int.Parse(Request.QueryString["cid"])); this.ucMessanger1.ProcessMessages(biz.MSGS, true); if (c == null) { return; } //client details this.lblClientName.Text = c.ClientName; this.lblOfficePhone.Text = c.OfficePhone; if (c.Address == null) { this.lblAddress.Text = "no address"; this.lblAddress.CssClass = "page-text-nodata"; } else { this.lblAddress.Text = c.Address + ", " + c.Location + " " + c.StateCode + " " + c.PostCode; } if (c.Industry != null) { this.lblAssociation.Text = c.Industry.IndustryName + " (" + c.Industry.AnzsicCode + ")"; } if (c.AssociationCode != null) { this.lblAssociation.Text = c.Association.AssociationName; } //executive var u = bizUser.GetSMIAccountExecutiveIdBOAMPSUserName(c.AccountExecutiveID); bizUser.enGageUser exec = bizUser.GetAccountExecutive(u); this.ucMessanger1.ProcessMessages(biz.MSGS, false); this.lblAccountExecutive.Text = "<b>" + exec.DisplayName + "</b>" + ", " + exec.Branch + " (" + exec.Region + ")"; if (c.Inactive == true) { this.lblClientName.Enabled = false; this.lblOfficePhone.Enabled = false; this.lblAddress.Enabled = false; this.lblAssociation.Enabled = false; this.lblAccountExecutive.Enabled = false; } else { this.lblClientName.Enabled = true; this.lblOfficePhone.Enabled = true; this.lblAddress.Enabled = true; this.lblAssociation.Enabled = true; this.lblAccountExecutive.Enabled = true; } }
protected void Page_Load(object sender, EventArgs e) { try { if (!this.IsPostBack) { //((Main)Master).AuthenticateUser(); bizMessage bizM = new bizMessage(); if (Session["USER"] == null) { this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } ((Main)Master).HeaderTitle = "Report"; ((HtmlGenericControl)((Main)Master).FindControl("divWrapper")).Attributes["class"] = "wrapper-report"; bizUser.enGageUser user = (bizUser.enGageUser)Session["USER"]; bizSetting bizS = new bizSetting(); PopulateTeams(); PopulateDefaults(); LoadNorthSydneyReport(); } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!this.IsPostBack) { //((Main)Master).AuthenticateUser(); if (Session["USER"] == null) { bizMessage bizM = new bizMessage(); this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } ((Main)Master).HeaderTitle = "List client search results"; this.txtSearchCriteria.Focus(); PopulateControls(); } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!this.IsPostBack) { if (Session["USER"] == null) { bizMessage bizM = new bizMessage(); this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } var master = (Main)Master; if (master != null) { master.HeaderTitle = "Edit client"; } PopulateClientDetails(); SetAddressControls(); } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
private void PopulateOpportunities() { var bizM = new bizMessage(); var biz = new bizClient(); var ss = biz.FindOpportunities(txtFindOpportunity.Text); lstOpportunity.Items.Clear(); if (txtFindOpportunity.Text != "") { foreach (var s in ss) { lstOpportunity.Items.Add(new ListItem(s, s)); } lstOpportunity.Visible = true; divOpportunities.Visible = true; lblFoundOpportunities.Text = lstOpportunity.Items.Count + " opportunities found"; } else { lstOpportunity.Visible = false; divSource.Visible = false; lblFoundOpportunities.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { try { if (!this.IsPostBack) { //((Main)Master).AuthenticateUser(); if (Session["USER"] == null) { bizMessage bizM = new bizMessage(); this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } using (Timeline.Capture("Dashboard.aspx", "ASP.NET")) { ((Main)Master).HeaderTitle = "Dashboard"; ((HtmlGenericControl)((Main)Master).FindControl("divWrapper")).Attributes["class"] = "wrapper-report"; Security(); } } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!this.IsPostBack) { //((Main)Master).AuthenticateUser(); if (Session["USER"] == null) { bizMessage bizM = new bizMessage(); this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } ((Main)Master).HeaderTitle = "Assign Oportunities "; bizUser.enGageUser user = (bizUser.enGageUser)Session["USER"]; PopulateFilters(); FilterGridsUtilities.PopulateRegionsBranchesAndExecutives(user, ddlFilterRegion, ddlFilterBranch, ddlFilterExcutives, (user.Role == (int)Enums.enUserRole.Executive || user.Role == (int)Enums.enUserRole.Branch) ? false : true, true); FilterGridsUtilities.PopulateRegionsBranchesAndExecutives(user, ddlRegion, ddlBranch, ddlExecutive, (user.Role == (int)Enums.enUserRole.Executive || user.Role == (int)Enums.enUserRole.Branch) ? false : true, false); ddlFilterRegion_SelectedIndexChanged(ddlRegion, new EventArgs()); ddlFilterBranch_SelectedIndexChanged(ddlRegion, new EventArgs()); PopulateFollowUps(); } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
private void PopulateAdditionalControls() { bizMessage bizM = new bizMessage(); bizOpportunity biz = new bizOpportunity(); Opportunity o = biz.GetOpportunity(int.Parse(Request.QueryString["oid"])); if (o == null) { return; } this.lblIncumbentBroker.Text = o.IncumbentBroker; this.lblIncumbentInsurer.Text = o.IncumbentInsurer; this.lblOpportunityDue2.Text = String.Format("{0:dd-MMM-yy}", o.OpportunityDue); if (o.ClassificationID.HasValue == true) { this.lblClassification.Text = o.Classification.ClassificationName; } this.lblNetBrokerageQuoted.Text = string.Format("{0:C}", o.NetBrokerageQuoted); this.lblNetBrokerageActual.Text = string.Format("{0:C}", o.NetBrokerageActual); this.lblDateCompleted.Text = String.Format("{0:dd-MMM-yy}", o.DateCompleted); this.lblMemoNumber.Text = o.MemoNumber; this.lblClientCode.Text = o.Client.ClientCode; }
protected void btnSave_Click(object sender, EventArgs e) { try { this.ucMessanger1.ClearMessages(); this.ucMessanger1.UnmarkControls(); bizMessage bizM = new bizMessage(); if (this.lstExecutives.SelectedValue == "") { this.ucMessanger1.ProcessMessage("Account Executive: " + bizM.GetMessageText("ValueNotSelected"), Enums.enMsgType.Err, "", null, true); return; } bizClient biz = new bizClient(); if (biz.TransferClient(int.Parse(Request.QueryString["cid"]), this.lstExecutives.SelectedValue) == true) { Response.Redirect("FindClient.aspx", false); } this.ucMessanger1.ProcessMessages(biz.MSGS, true); } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!this.IsPostBack) { if (Session["USER"] == null) { bizMessage bizM = new bizMessage(); this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } SetControls(); PopulateClassification(); PopulateBusinessType(); if (Request.QueryString["cc"] != null) { PopulateClientFromBA(); } SetBusinessTypeControls(); } SetAddressControls(); } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
private void PopulateIndustries() { var bizM = new bizMessage(); var biz = new bizIndustry(); var inds = biz.ListIndustriesByKeyword(txtFindIndustry.Text); lstIndustry.Items.Clear(); if (txtFindIndustry.Text != "") { foreach (var ind in inds) { lstIndustry.Items.Add(new ListItem(ind.IndustryName + " (" + ind.AnzsicCode + ")", ind.AnzsicCode)); } lstIndustry.Visible = true; divIndustry.Visible = true; lblFoundIndustries.Text = lstIndustry.Items.Count + " industries found"; } else { lstIndustry.Visible = false; divIndustry.Visible = false; lblFoundIndustries.Text = ""; } }
private void PopulateClientFromBA() { bizMessage bizM = new bizMessage(); bizClient biz = new bizClient(); List <sp_engage_get_clientResult> client; client = biz.GetClientFromBA(Request.QueryString["cc"].ToString()); this.ucMessanger1.ProcessMessages(biz.MSGS, true); if (client.Count == 1) { this.txtClientCode.Text = client[0].ClientCode; this.txtClientName.Text = client[0].ClientName; this.txtAddress.Text = client[0].Address_Line_1 + "\n" + client[0].Address_Line_2 + "\n" + client[0].Address_Line_3; this.txtOfficePhone.Text = client[0].Phone; this.txtOfficeFacsimilie.Text = client[0].Fax; this.txtABNACN.Text = client[0].ABN; int result; if (int.TryParse(client[0].Postcode, out result) == true && client[0].Postcode.Length == 4) { this.ucAUPSS1.PostCode = client[0].Postcode; } //if (this.ucAUPSS1.SuburbControl.Items.FindByValue(client[0].Suburb) != null) //{ // this.ucAUPSS1.Suburb = client[0].Suburb; //} this.txtSource.Text = "iBAIS"; if (client[0].Anzsic_Code != "") { this.txtFindIndustry.Text = client[0].Anzsic_Code; } PopulateIndustries(); if (this.lstIndustry.Items.Count == 1) { this.lstIndustry.SelectedIndex = 0; } if (client[0].ActiveClientInd.ToString() == "N") { if (this.ddlBusinessType.Items.Count > 0) { this.ddlBusinessType.SelectedValue = this.ddlBusinessType.Items.FindByText("Reclaimed business").Value; } } else { if (this.ddlBusinessType.Items.Count > 0) { this.ddlBusinessType.SelectedValue = this.ddlBusinessType.Items.FindByText("New business (Existing clients)").Value; } } } }
private void PopulateClientDetails() { bizMessage bizM = new bizMessage(); bizSetting bizS = new bizSetting(); bizClient biz = new bizClient(); Client c; c = biz.GetClient(Convert.ToInt32(Request.QueryString["cid"])); this.ucMessanger1.ProcessMessages(biz.MSGS, true); if (c == null) { return; } //general this.lblClientName.Text = c.ClientName; this.lblOfficeFacsimilie.Text = c.OfficeFacsimilie; this.lblOfficePhone.Text = c.OfficePhone; //address this.lblAddress.Text = c.Address + ", " + c.Location + " " + c.StateCode + " " + c.PostCode; //executive var u = bizUser.GetSMIAccountExecutiveIdBOAMPSUserName(c.AccountExecutiveID); bizUser.enGageUser exec = bizUser.GetAccountExecutive(u); this.ucMessanger1.ProcessMessages(biz.MSGS, false); this.lblAccountExecutive.Text = "<b>" + exec.DisplayName + "</b>" + ", " + exec.Branch + " (" + exec.Region + ")"; //active contacts bizContact bizA = new bizContact(); List <Contact> acons = c.Contacts.Where(co => co.Inactive == false).ToList(); this.grvActiveContacts.DataSource = acons; this.ucMessanger1.ProcessMessages(bizA.MSGS, false); this.grvActiveContacts.DataBind(); this.lblActiveContacts.Text = acons.Count.ToString(); //inactive contacts bizContact bizI = new bizContact(); List <Contact> icons = c.Contacts.Where(co => co.Inactive == true).ToList(); this.grvInactiveContacts.DataSource = icons; this.ucMessanger1.ProcessMessages(bizI.MSGS, false); this.grvInactiveContacts.DataBind(); this.lblInactiveContacts.Text = icons.Count.ToString(); //buttons this.btnBack.PostBackUrl = "ViewClient.aspx?cid=" + c.ClientID.ToString(); }
private void PopulateClientDetails() { bizMessage bizM = new bizMessage(); bizSetting bizS = new bizSetting(); bizClient biz = new bizClient(); Client c; c = biz.GetClient(Convert.ToInt32(Request.QueryString["cid"])); this.ucMessanger1.ProcessMessages(biz.MSGS, true); if (c == null) { return; } //general this.lblClientName.Text = c.ClientName; this.lblOfficeFacsimilie.Text = c.OfficeFacsimilie; this.lblOfficePhone.Text = c.OfficePhone; //address this.lblAddress.Text = c.Address + ", " + c.Location + " " + c.StateCode + " " + c.PostCode; //executive var u = bizUser.GetSMIAccountExecutiveIdBOAMPSUserName(c.AccountExecutiveID); bizUser.enGageUser exec = bizUser.GetAccountExecutive(u); this.ucMessanger1.ProcessMessages(biz.MSGS, false); this.lblAccountExecutive.Text = "<b>" + exec.DisplayName + "</b>" + ", " + exec.Branch + " (" + exec.Region + ")"; //open opportunities List <sp_web_ListClientOpenOpportunitiesResult> ooppos = biz.ListClientOpenOpportunities(c.ClientID); this.ucMessanger1.ProcessMessages(biz.MSGS, false); this.grvOpenOpportunities.DataSource = ooppos; this.grvOpenOpportunities.DataBind(); this.lblOpenOpportunities.Text = ooppos.Count.ToString(); //open opportunities List <sp_web_ListClientClosedOpportunitiesResult> coppos = biz.ListClientClosedOpportunities(c.ClientID); this.ucMessanger1.ProcessMessages(biz.MSGS, false); this.grvClosedOpportunities.DataSource = coppos; this.grvClosedOpportunities.DataBind(); this.lblClosedOpportunities.Text = coppos.Count.ToString(); //buttons this.btnBack.PostBackUrl = "ViewClient.aspx?cid=" + c.ClientID.ToString(); }
private void PopulateAssociations() { bizMessage bizM = new bizMessage(); bizClient biz = new bizClient(); IQueryable <Association> asss = biz.ListAssociationsByIndustry(this.lstIndustry.SelectedValue); this.ucMessanger1.ProcessMessages(biz.MSGS, true); this.ddlAssociation.Items.Clear(); this.ddlAssociation.Items.Add(new ListItem("-- Please Select --", "")); foreach (Association ass in asss) { this.ddlAssociation.Items.Add(new ListItem(ass.AssociationName, ass.AssociationCode)); } }
private void LoadTallyboardReport() { this.ucMessanger1.ClearMessages(); this.ucMessanger1.UnmarkControls(); SearchOptions so = this.ucSearchOptions1.GetSearchOptions(); if (so == null) { this.pnlResults_CollapsiblePanelExtender.ClientState = "true"; this.pnlResults_CollapsiblePanelExtender.Collapsed = true; return; } bizMessage bizM = new bizMessage(); if (Session["USER"] == null) { this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); this.pnlResults_CollapsiblePanelExtender.ClientState = "true"; this.pnlResults_CollapsiblePanelExtender.Collapsed = true; return; } bizUser.enGageUser user = (bizUser.enGageUser)Session["USER"]; bizReport biz = new bizReport(); List <proc_rpt_TallyboardResult> rs = biz.GetTallyBoardData( so.DateFrom, so.DateTo, so.Region, so.Branch, so.Executive, so.BusinessType, so.Classification, so.Sources, so.Industries, so.Opportunities); CalculateTotal(rs); rptTallyboard.DataSource = rs; rptTallyboard.DataBind(); this.pnlResults_CollapsiblePanelExtender.ClientState = "false"; this.pnlResults_CollapsiblePanelExtender.Collapsed = false; }
private void PopulateContactDetails() { bizMessage bizM = new bizMessage(); bizSetting bizS = new bizSetting(); bizContact biz = new bizContact(); Contact c; c = biz.GetContact(Convert.ToInt32(Request.QueryString["coid"])); this.ucMessanger1.ProcessMessages(biz.MSGS, true); if (c == null) { return; } //general this.lblContactName.Text = c.ContactName; this.lblTitle.Text = c.Title; this.lblMobile.Text = c.Mobile; this.lblDirectLine.Text = c.DirectLine; this.lblEmail.Text = c.Email; //buttons this.btnActiveInactive.Text = c.Inactive == true ? "Activate" : "Inactivate"; if (c.Email != "") { this.btnSendEmail.OnClientClick = "javascript:location.href='mailto:" + c.Email + "'"; } else { this.btnSendEmail.Visible = false; } //audit ((Main)Master).HeaderDetails = "Client added by " + bizActiveDirectory.GetUserFullName(c.AddedBy) + " (" + string.Format("{0:dd-MMM-yy}", c.Added) + ")"; if (c.Modified.HasValue == true) { ((Main)Master).HeaderDetails += " / modified by " + bizActiveDirectory.GetUserFullName(c.ModifiedBy) + " (" + string.Format("{0:dd-MMM-yy}", c.Modified.Value) + ")"; } }
protected void btnSave_Click(object sender, EventArgs e) { try { this.ucMessanger1.ClearMessages(); this.ucMessanger1.UnmarkControls(); bizMessage bizM = new bizMessage(); if (Session["USER"] == null) { this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } if (UIValidation() == false) { return; } switch (this.ddlBusinessType.SelectedItem.Text) { case "Quick quote": // go-to-market InsertQuickQuote(); break; case "Quick win": // accepted InsertQuickWin(); break; case "Quick call": InsertQuickCall(); break; default: Insert(); break; } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
private void PopulateClassification() { var bizM = new bizMessage(); var biz = new bizOpportunity(); List <Classification> cls; cls = biz.ListClassifications(); if (cls == null) { return; } ddlClassification.Items.Clear(); ddlClassification.Items.Add(new ListItem("(All)", "0")); foreach (var cl in cls) { ddlClassification.Items.Add(new ListItem(cl.ClassificationName, cl.ClassificationID.ToString())); } }
private bool UIValidation() { var bizM = new bizMessage(); if (txtFrom.Text == "") { ucMessanger1.ProcessMessage("From Date: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "From", typeof(TextBox), true); return(false); } DateTime res; if (DateTime.TryParse(txtFrom.Text, out res) == false) { ucMessanger1.ProcessMessage("From Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "From", typeof(TextBox), true); return(false); } if (txtTo.Text == "") { ucMessanger1.ProcessMessage("To Date: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "To", typeof(TextBox), true); return(false); } //DateTime res; if (DateTime.TryParse(txtTo.Text, out res) == false) { ucMessanger1.ProcessMessage("To Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "To", typeof(TextBox), true); return(false); } if (DateTime.Parse(txtFrom.Text) > DateTime.Parse(txtTo.Text)) { ucMessanger1.ProcessMessage("From - To: " + bizM.GetMessageText("DateFromGreaterThanDateTo"), Enums.enMsgType.Err, "From", typeof(TextBox), true); return(false); } return(true); }
protected void Page_Load(object sender, EventArgs e) { try { if (!this.IsPostBack) { if (Session["USER"] == null) { bizMessage bizM = new bizMessage(); this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } } ((Main)Master).HeaderTitle = "Client Opportunities All"; PopulateClientDetails(); } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
private void PopulateAdditionalControls() { bizMessage bizM = new bizMessage(); bizOpportunity biz = new bizOpportunity(); Opportunity o = biz.GetOpportunity(int.Parse(Request.QueryString["oid"])); if (o == null) { return; } this.txtIncumbentBroker.Text = o.IncumbentBroker; this.txtIncumbentInsurer.Text = o.IncumbentInsurer; this.txtOpportunityDue.Text = String.Format("{0:dd/MM/yyyy}", o.OpportunityDue); this.ddlClassification.SelectedValue = o.ClassificationID.ToString(); this.txtNetBrokerageQuoted.Text = o.NetBrokerageQuoted.ToString(); this.txtNetBrokerageActual.Text = o.NetBrokerageActual.ToString(); this.txtDateCompleted.Text = String.Format("{0:dd/MM/yyyy}", o.DateCompleted); this.txtMemoNumber.Text = o.MemoNumber; this.txtClientCode.Text = o.Client.ClientCode; }
private void PopulateClassification() { bizMessage bizM = new bizMessage(); bizOpportunity biz = new bizOpportunity(); List <Classification> cls; cls = biz.ListClassifications(); this.ucMessanger1.ProcessMessages(biz.MSGS, true); if (cls == null) { return; } this.ddlClassification.Items.Clear(); this.ddlClassification.Items.Add(new ListItem("-- Please Select --", "")); foreach (Classification cl in cls) { this.ddlClassification.Items.Add(new ListItem(cl.ClassificationName, cl.ClassificationID.ToString())); } }
protected void Page_Load(object sender, EventArgs e) { try { using (Timeline.Capture("FindClientAll.aspx", "ASP.NET")) { if (Session["USER"] == null) { bizMessage bizM = new bizMessage(); this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } ((Main)Master).HeaderTitle = "List client search results"; LoadClients(); } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
protected void Page_Load(object sender, EventArgs e) { try { using (Timeline.Capture("FollowUps.aspx", "ASP.NET")) { if (!this.IsPostBack) { //((Main)Master).AuthenticateUser(); /********************************/ /* Start Section Authentication */ /********************************/ Stopwatch authenticationStopwatch = Stopwatch.StartNew(); if (Session["USER"] == null) { bizMessage bizM = new bizMessage(); this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } ((Main)Master).HeaderTitle = "Opportunities on-the-go"; bizUser.enGageUser user = (bizUser.enGageUser)Session["USER"]; authenticationStopwatch.Stop(); Debug.WriteLine("Authentication stop watch " + authenticationStopwatch.ElapsedMilliseconds); /*************************/ /* Start Section Filters */ /*************************/ Stopwatch filtersStopWatch = Stopwatch.StartNew(); PopulateFilters(); filtersStopWatch.Stop(); Debug.WriteLine("Filters stop watch " + filtersStopWatch.ElapsedMilliseconds); /*****************/ /* Start Regions */ /*****************/ Stopwatch regionsStopWatch = Stopwatch.StartNew(); FilterGridsUtilities.PopulateRegionsBranchesAndExecutives(user, ddlRegion, ddlBranch, ddlExecutive, (user.Role == (int)Enums.enUserRole.Executive || user.Role == (int)Enums.enUserRole.Branch) ? false : true, true); regionsStopWatch.Stop(); Debug.WriteLine("Regions stop watch " + regionsStopWatch.ElapsedMilliseconds); /********************/ /* Start Follow Ups */ /********************/ Stopwatch followupsStopWatch = Stopwatch.StartNew(); PopulateFollowUps(); followupsStopWatch.Stop(); Debug.WriteLine("Followups stop watch " + followupsStopWatch.ElapsedMilliseconds); ddlRegion_SelectedIndexChanged(ddlRegion, new EventArgs()); ddlBranch_SelectedIndexChanged(ddlRegion, new EventArgs()); } } } catch (Exception ex) { bizLog.InsertExceptionLog(ex); Response.Redirect("~/ErrorPage.aspx", false); } }
private void PopulateFollowUps() { bizMessage bizM = new bizMessage(); if (Session["USER"] == null) { this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true); return; } bizUser.enGageUser user = (bizUser.enGageUser)Session["USER"]; bizActivity biz = new bizActivity(); var u = bizUser.GetAccountExecutiveIdBySmiUserName(ddlExecutive.SelectedValue); List <sp_web_FollowUpsResult> d1 = biz.GetFollowUps(u, int.Parse(this.ddlOAMPSIncome.SelectedValue), int.Parse(this.ddlBusinessType.SelectedValue), int.Parse(this.ddlFlagged.SelectedValue), string.Join(",", new string[] { Enums.ActivityActions.Qualify.ToString(), Enums.ActivityActions.Recognise.ToString() }), ddlRegion.SelectedValue, ddlBranch.SelectedValue, false); List <sp_web_FollowUpsResult> d2 = biz.GetFollowUps(u, int.Parse(this.ddlOAMPSIncome.SelectedValue), int.Parse(this.ddlBusinessType.SelectedValue), int.Parse(this.ddlFlagged.SelectedValue), string.Join(",", new string[] { Enums.ActivityActions.Contact.ToString(), Enums.ActivityActions.Discover.ToString(), Enums.ActivityActions.Respond.ToString() }), ddlRegion.SelectedValue, ddlBranch.SelectedValue, false); List <sp_web_FollowUpsResult> d3 = biz.GetFollowUps(u, int.Parse(this.ddlOAMPSIncome.SelectedValue), int.Parse(this.ddlBusinessType.SelectedValue), int.Parse(this.ddlFlagged.SelectedValue), string.Join(",", new string[] { Enums.ActivityActions.Agree.ToString(), Enums.ActivityActions.Process.ToString() }), ddlRegion.SelectedValue, ddlBranch.SelectedValue, false); //_allIdentify = d1.Where(x => x.OutcomeType != "C" && x.FollowUpDate >= CalenderUtilities.CutOffDate).ToList(); _allQualify = d1.Where(x => x.OutcomeType != "C" && x.FollowUpDate >= CalenderUtilities.CutOffDate).ToList(); _allRespond = d2.Where(x => x.OutcomeType != "C" && x.FollowUpDate >= CalenderUtilities.CutOffDate).ToList(); _allComplete = d3.Where(x => x.OutcomeType != "C" && x.FollowUpDate >= CalenderUtilities.CutOffDate).ToList(); estimated = _allQualify.Sum(x => (x.NetBrokerageEstimated.HasValue) ? x.NetBrokerageEstimated : 0); quoted = _allRespond.Sum(x => (x.NetBrokerageQuoted.HasValue) ? x.NetBrokerageQuoted : 0); actual = _allComplete.Sum(x => (x.NetBrokerageActual.HasValue) ? x.NetBrokerageActual : 0); this.ucMessanger1.ProcessMessages(biz.MSGS, true); this.ucMessanger1.ProcessMessages(biz.MSGS, true); this.ucMessanger1.ProcessMessages(biz.MSGS, true); // combine all results to have a filtered summery for the week var allFollowups = _allQualify.Concat(_allRespond).Concat(_allComplete).Where(x => x.OutcomeType != "C" && x.FollowUpDate >= CalenderUtilities.CutOffDate).ToList();; var weekStartDate = (DateTime.Now.AddDays(-(DateTime.Now.DayOfWeek - DayOfWeek.Monday))); var weekEndDate = weekStartDate.AddDays(6); var weeklyFilteredFollowUps = allFollowups.Where(x => { return(((x.FollowUpDate.HasValue) ? (x.FollowUpDate.Value.Date >= weekStartDate.Date && x.FollowUpDate.Value.Date <= weekEndDate.Date) : false) || ((x.OpportunityDue.HasValue) ? DateTime.Now.Date >= x.OpportunityDue.Value.Date : false ) ); }).ToList(); this.grvSummary.DataSource = weeklyFilteredFollowUps; this.ucMessanger1.ProcessMessages(biz.MSGS, true); this.grvSummary.DataBind(); // change the way the gridview displays the header AlterGridRendering(grvSummary); if (weeklyFilteredFollowUps.Count() <= this.grvSummary.PageSize) { this.lnkSeeAll0.Enabled = false; } else { this.lnkSeeAll0.Enabled = true; } }