示例#1
0
        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)
                {
                    //((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);
            }
        }
        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);
            }
        }
示例#4
0
        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);
            }
        }
示例#5
0
        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);
            }
        }
示例#6
0
        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);
            }
        }
 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);
     }
 }
示例#9
0
        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);
        }
示例#10
0
        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;
        }
示例#11
0
        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);
            }
        }
示例#12
0
 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);
     }
 }
示例#13
0
        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);
            }
        }
示例#14
0
        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.txtContactName.Text    = c.ContactName;
            this.ddlTitle.SelectedValue = c.Title;
            this.txtMobile.Text         = c.Mobile;
            this.txtDirectLine.Text     = c.DirectLine;
            this.txtEmail.Text          = c.Email;

            //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) + ")";
            }

            bizClient bizC = new bizClient();
            Client    cl   = bizC.GetClient(int.Parse(Request.QueryString["cid"]));
            var       u    = bizUser.GetSMIAccountExecutiveIdBOAMPSUserName(cl.AccountExecutiveID);

            bizUser.enGageUser exec = bizUser.GetAccountExecutive(u);
            this.ucMessanger1.ProcessMessages(bizC.MSGS, false);

            if (Session["USER"] == null)
            {
                this.ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "", null, true);
                return;
            }
            bizUser.enGageUser user = (bizUser.enGageUser)Session["USER"];

            switch (user.Role)
            {
            case (int)Enums.enUserRole.Executive:
                if (user.Branch == exec.Branch)
                {
                    if (user.DisplayName != exec.DisplayName)
                    {
                        this.btnSave.Visible = false;
                    }
                }
                else
                {
                    Response.Redirect("~/FindClient.aspx", false);
                    return;
                }
                break;

            case (int)Enums.enUserRole.Branch:
                if (user.Branch != exec.Branch)
                {
                    Response.Redirect("~/FindClient.aspx", false);
                    return;
                }
                break;

            case (int)Enums.enUserRole.Region:
                if (user.Region == exec.Region)
                {
                    this.btnSave.Visible = false;
                }
                else
                {
                    Response.Redirect("~/FindClient.aspx", false);
                    return;
                }
                break;

            case (int)Enums.enUserRole.Company:
                this.btnSave.Visible = false;
                break;

            case (int)Enums.enUserRole.Administrator:
                // full access
                break;
            }
        }
示例#15
0
        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);
            }
        }
示例#16
0
        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;
            }
        }
示例#17
0
        private void LoadClientsBA()
        {
            bizMessage bizM = new bizMessage();

            //this.ucMessanger1.ClearMessages();

            if (this.txtSearchCriteria.Text == "")
            {
                this.ucMessanger1.ProcessMessage(bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "SearchCriteria", typeof(TextBox), false);
                return;
            }

            bizSetting bizS       = new bizSetting();
            int        MaxRecords = int.Parse(bizS.GetSetting("FindClient.MaxRecords"));

            bizClient biz     = new bizClient();
            int?      records = 0;
            List <sp_engage_search_clientResult> clients = biz.FindClientInBA(this.txtSearchCriteria.Text
                                                                              , this.ddlClient.SelectedValue
                                                                              , char.Parse(this.ddlMatch.SelectedValue)
                                                                              , MaxRecords
                                                                              , ref records);

            this.ucMessanger1.ProcessMessages(biz.MSGS, false);

            if (clients == null)
            {
                return;
            }

            if (records == 0)
            {
                this.btnAdd.Visible       = true;
                this.tdHeaderBA.Visible   = false;
                this.grvClientsBA.Visible = false;
                this.tdFooterBA.Visible   = false;
                this.ucMessanger1.ProcessMessage("iBAIS: " + bizM.GetMessageText("NoClientsFound"), Enums.enMsgType.Warn, "", null, false);
            }
            if (records > 0 && records <= MaxRecords)
            {
                this.btnAdd.Visible          = true;
                this.lblResultCountBA.Text   = clients.Count.ToString();
                this.lblSearchBA.Text        = this.txtSearchCriteria.Text;
                this.tdHeaderBA.Visible      = true;
                this.grvClientsBA.DataSource = clients;
                this.grvClientsBA.DataBind();
                this.grvClientsBA.Visible = true;
                this.tdFooterBA.Visible   = true;
                this.lnkBA.Enabled        = true;
                if (clients.Count <= this.grvClientsBA.PageSize)
                {
                    this.lnkBA.Enabled = false;
                }
                if (records == MaxRecords)
                {
                    this.ucMessanger1.ProcessMessage("iBAIS: " + bizM.GetMessageText("MaxClientsReached"), Enums.enMsgType.Warn, "", null, false);
                }
            }
            if (records > MaxRecords)
            {
                this.btnAdd.Visible       = false;
                this.tdHeaderBA.Visible   = false;
                this.grvClientsBA.Visible = false;
                this.tdFooterBA.Visible   = false;
                this.ucMessanger1.ProcessMessage("iBAIS: " + bizM.GetMessageText("TooManyClientsFound"), Enums.enMsgType.Warn, "", null, false);
            }
        }
示例#18
0
        private void LoadDashboardReport()
        {
            using (Timeline.Capture("Dashboard.aspx: LoadDashboardReport", "ASP.NET"))
            {
                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_DashboardResult> rs = biz.GetDashboardData(
                    so.DateFrom,
                    so.DateTo,
                    so.Region,
                    so.Branch,
                    so.Executive,
                    so.Classification,
                    so.BusinessType,
                    so.Industries,
                    so.Sources,
                    so.Opportunities);
                this.ucMessanger1.ProcessMessages(biz.MSGS, true);

                if (rs == null)
                {
                    return;
                }

                this.ReportViewer1.Reset();
                this.ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
                string ssrsURL = ConfigurationSettings.AppSettings["SSRS_URL"];
                if (string.IsNullOrEmpty(ssrsURL))
                {
                    throw new Exception("Error: Please set the SSRS_URL in the AppSetting in web.config");
                }
                this.ReportViewer1.ServerReport.ReportServerUrl = new Uri(ssrsURL);
                this.ReportViewer1.ServerReport.ReportPath      = "/enGage/Dashboard";

                using (Timeline.Capture("ServerReport.Refresh()", "Reports"))
                {
                    this.ReportViewer1.ServerReport.Refresh();
                }

                this.ReportViewer1.Height  = Unit.Point(480);
                this.ReportViewer1.Visible = true;
                /* Start */

                /*
                 *  ReportParameter p1 = new ReportParameter("ReportStart", so.DateFrom.ToString("dd MMM yyyy"));
                 *  ReportParameter p2 = new ReportParameter("ReportEnd", so.DateTo.ToString("dd MMM yyyy"));
                 *  ReportParameter p3 = new ReportParameter("Region", so.Region);
                 *  ReportParameter p4 = new ReportParameter("Branch", so.Branch);
                 *  ReportParameter p5 = new ReportParameter("AccountExecutiveID", so.Executive);
                 *  ReportParameter p6 = new ReportParameter("ClassificationID", so.Classification.ToString());
                 *  ReportParameter p7 = new ReportParameter("BusinessTypeID", so.BusinessType.ToString());
                 *  ReportParameter p8 = new ReportParameter("ANZSICDelimitedList", so.Industries == null ? "" : so.Industries);
                 *  ReportParameter p9 = new ReportParameter("SourceDelimitedList", so.Sources == null ? "" : so.Sources);
                 *  string ExecutiveName = this.ucSearchOptions1.GetExecutiveName(so.Executive);
                 *  string label = so.Executive != "(All)" ? ExecutiveName : so.Branch != "(All)" && so.Executive == "(All)" ? so.Region + " (" + so.Branch + ")" : so.Region != "(All)" && so.Branch == "(All)" ? so.Region : so.Region == "(All)" ? "OAMPS Insurance Brokers Ltd" : "";
                 *  ReportParameter p10 = new ReportParameter("OpportunitiesDelimitedList", label);
                 */

                /* End */

                ReportParameter p11 = new ReportParameter("parDateFrom", so.DateFrom.ToString("dd MMM yyyy"));
                ReportParameter p12 = new ReportParameter("parDateTo", so.DateTo.ToString("dd MMM yyyy"));
                ReportParameter p13 = new ReportParameter("parRegion", so.Region);
                ReportParameter p14 = new ReportParameter("parBranch", so.Branch);
                ReportParameter p15 = new ReportParameter("parExecutive", so.Executive);

                //Uncommented after the fix up of the NULL values.
                ReportParameter p16 = new ReportParameter("parClassification",
                                                          so.Classification.ToString() == string.Empty || so.Classification.ToString() == "0"
                        ? null
                        : so.Classification.ToString());
                ReportParameter p17 = new ReportParameter("parBusinessType",
                                                          so.BusinessType.ToString() == string.Empty || so.BusinessType.ToString() == "0"
                        ? null
                        : so.BusinessType.ToString());
                ReportParameter p18 = new ReportParameter("parIndustries",
                                                          string.IsNullOrEmpty(so.Industries) ? null : so.Industries);
                ReportParameter p19 = new ReportParameter("parSources",
                                                          string.IsNullOrEmpty(so.Sources) ? null : so.Sources);

                string ExecutiveName = this.ucSearchOptions1.GetExecutiveName(so.Executive);
                string label         = so.Executive != "(All)"
                    ? ExecutiveName
                    : so.Branch != "(All)" && so.Executive == "(All)"
                        ? so.Region + " (" + so.Branch + ")"
                        : so.Region != "(All)" && so.Branch == "(All)"
                            ? so.Region
                            : so.Region == "(All)" ? "OAMPS Insurance Brokers Ltd" : "";
                ReportParameter p20 = new ReportParameter("parReportLabel", label);
                //ReportParameter p21 = new ReportParameter("parURL", HttpContext.Current.Request.Url.Authority);
                ReportParameter p22 = new ReportParameter("parOpportunities", so.Opportunities);

                this.ReportViewer1.ServerReport.SetParameters(new ReportParameter[]
                                                              { p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p22 });

                using (Timeline.Capture("ServerReport.Refresh()", "Reports"))
                {
                    this.ReportViewer1.ServerReport.Refresh();
                }

                this.ReportViewer1.Height  = Unit.Point(480);
                this.ReportViewer1.Visible = true;

                /*
                 * this.ReportViewer1.LocalReport.EnableHyperlinks = true;
                 * this.ReportViewer1.LocalReport.ReportPath = "Reports//Dashboard.rdlc";
                 * ReportParameter p1 = new ReportParameter("parDateFrom", so.DateFrom.ToString());
                 * ReportParameter p2 = new ReportParameter("parDateTo", so.DateTo.ToString());
                 * ReportParameter p3 = new ReportParameter("parRegion", so.Region);
                 * ReportParameter p4 = new ReportParameter("parBranch", so.Branch);
                 * ReportParameter p5 = new ReportParameter("parExecutive", so.Executive);
                 * ReportParameter p6 = new ReportParameter("parClassification", so.Classification.ToString());
                 * ReportParameter p7 = new ReportParameter("parBusinessType", so.BusinessType.ToString());
                 * ReportParameter p8 = new ReportParameter("parIndustries", so.Industries == null ? "" : so.Industries);
                 * ReportParameter p9 = new ReportParameter("parSources", so.Sources == null ? "" : so.Sources);
                 * string ExecutiveName = this.ucSearchOptions1.GetExecutiveName(so.Executive);
                 * string label = so.Executive != "(All)" ? ExecutiveName : so.Branch != "(All)" && so.Executive == "(All)" ? so.Region + " (" + so.Branch + ")" : so.Region != "(All)" && so.Branch == "(All)" ? so.Region : so.Region == "(All)" ? "OAMPS Insurance Brokers Ltd" : "";
                 * ReportParameter p10 = new ReportParameter("parReportLabel", label);
                 * this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 });
                 * ReportDataSource myRDS = new ReportDataSource("proc_rpt_DashboardResult", rs);
                 * this.ReportViewer1.LocalReport.DataSources.Clear();
                 * this.ReportViewer1.LocalReport.DataSources.Add(myRDS);
                 * this.ReportViewer1.LocalReport.Refresh();
                 * this.ReportViewer1.Height = Unit.Point(480);
                 * this.ReportViewer1.Visible = true;
                 */

                this.pnlResults_CollapsiblePanelExtender.ClientState = "false";
                this.pnlResults_CollapsiblePanelExtender.Collapsed   = false;
            }
        }
示例#19
0
        private void LoadClients()
        {
            bizMessage biz = new bizMessage();

            this.ucMessanger1.ClearMessages();
            this.txtSearchCriteria.CssClass = "control";
            //this.ucMessanger1.UnmarkControls(); // todo: doesn't work
            this.grvClientsClientName.Visible = false;
            this.grvClientsAddress.Visible    = false;
            this.grvClientsIndustry.Visible   = false;

            if (this.txtSearchCriteria.Text == "")
            {
                this.ucMessanger1.ProcessMessage(biz.GetMessageText("EmptyField"), Enums.enMsgType.Err, "SearchCriteria", typeof(TextBox), false);
                return;
            }

            bizSetting bizS       = new bizSetting();
            int        MaxRecords = int.Parse(bizS.GetSetting("FindClient.MaxRecords"));

            bizClient bizC    = new bizClient();
            int?      records = 0;
            List <sp_web_FindClientByFieldResult> clients = bizC.FindClientByField(this.txtSearchCriteria.Text
                                                                                   , this.ddlClient.SelectedValue
                                                                                   , char.Parse(this.ddlMatch.SelectedValue)
                                                                                   , null
                                                                                   , MaxRecords
                                                                                   , ref records);

            this.ucMessanger1.ProcessMessages(bizC.MSGS, true);

            if (clients == null)
            {
                return;
            }


            // get all users in AD

            var allusersResult = bizUser.GetUsersAccountExecutives(clients.Select <sp_web_FindClientByFieldResult, string>(x => x.AccountExecutiveID).Distinct().ToList());

            // change all clients
            clients.ForEach(
                x =>
            {
                if (x.AccountExecutiveID != "" && allusersResult.ContainsKey(x.AccountExecutiveID))
                {
                    bizUser.enGageUser exec = allusersResult[x.AccountExecutiveID];    //bizUser.GetAccountExecutive(x.AccountExecutiveID);
                    if (exec != null)
                    {
                        x.DisplayName = exec.DisplayName;
                    }
                    else
                    {
                        x.DisplayName = x.AccountExecutiveID;
                    }
                }
            }

                );

            List <sp_web_FindClientByFieldResult> cn  = clients.Where(c => c.Match == "client").ToList();
            List <sp_web_FindClientByFieldResult> add = clients.Where(c => c.Match == "address").ToList();
            List <sp_web_FindClientByFieldResult> ind = clients.Where(c => c.Match == "industry").ToList();

            if (records == 0)
            {
                this.btnAdd.Visible = true;

                this.tdHeaderCN.Visible  = false;
                this.tdFooterCN.Visible  = false;
                this.tdHeaderAD.Visible  = false;
                this.tdFooterAD.Visible  = false;
                this.tdHeaderIND.Visible = false;
                this.tdFooterIND.Visible = false;
                this.ucMessanger1.ProcessMessage("enGage: " + biz.GetMessageText("NoClientsFound"), Enums.enMsgType.Warn, "", null, false);
                // change the new postpack url
                btnAdd.PostBackUrl += "?name=" + HttpUtility.UrlEncode(this.txtSearchCriteria.Text);
                return;
            }

            if (records > 0 && records <= MaxRecords)
            {
                this.btnAdd.Visible = true;

                /*foreach (sp_web_FindClientByFieldResult c in cn)
                 * {
                 *  if (c.AccountExecutiveID != "")
                 *  {
                 *      bizUser.enGageUser exec = bizUser.GetAccountExecutive(c.AccountExecutiveID);
                 *      if (exec != null)
                 *          c.DisplayName = exec.DisplayName;
                 *      else
                 *          c.DisplayName = c.AccountExecutiveID;
                 *  }
                 * }
                 * foreach (sp_web_FindClientByFieldResult c in add)
                 * {
                 *  if (c.AccountExecutiveID != "")
                 *  {
                 *      bizUser.enGageUser exec = bizUser.GetAccountExecutive(c.AccountExecutiveID);
                 *      if (exec != null)
                 *          c.DisplayName = exec.DisplayName;
                 *      else
                 *          c.DisplayName = c.AccountExecutiveID;
                 *  }
                 * }
                 * foreach (sp_web_FindClientByFieldResult c in ind)
                 * {
                 *  if (c.AccountExecutiveID != "")
                 *  {
                 *      bizUser.enGageUser exec = bizUser.GetAccountExecutive(c.AccountExecutiveID);
                 *      if (exec != null)
                 *          c.DisplayName = exec.DisplayName;
                 *      else
                 *          c.DisplayName = c.AccountExecutiveID;
                 *  }
                 * }*/

                if (cn.Count == 0)
                {
                    this.tdHeaderCN.Visible           = false;
                    this.grvClientsClientName.Visible = false;
                    this.tdFooterCN.Visible           = false;
                }
                else
                {
                    this.lblResultCountCN.Text           = cn.Count.ToString();
                    this.lblSearchCN.Text                = this.txtSearchCriteria.Text;
                    this.tdHeaderCN.Visible              = true;
                    this.grvClientsClientName.DataSource = cn;
                    this.grvClientsClientName.DataBind();
                    this.grvClientsClientName.Visible = true;
                    this.tdFooterCN.Visible           = true;
                    this.lnkCN.Enabled = true;
                    if (cn.Count <= this.grvClientsClientName.PageSize)
                    {
                        this.lnkCN.Enabled = false;
                    }
                }
                if (add.Count == 0)
                {
                    this.tdHeaderAD.Visible        = false;
                    this.grvClientsAddress.Visible = false;
                    this.tdFooterAD.Visible        = false;
                }
                else
                {
                    this.lblResultCountAD.Text        = add.Count.ToString();
                    this.lblSearchAD.Text             = this.txtSearchCriteria.Text;
                    this.tdHeaderAD.Visible           = true;
                    this.grvClientsAddress.DataSource = add;
                    this.grvClientsAddress.DataBind();
                    this.grvClientsAddress.Visible = true;
                    this.tdFooterAD.Visible        = true;
                    this.lnkAD.Enabled             = true;
                    if (add.Count <= this.grvClientsAddress.PageSize)
                    {
                        this.lnkAD.Enabled = false;
                    }
                }
                if (ind.Count == 0)
                {
                    this.tdHeaderIND.Visible        = false;
                    this.grvClientsIndustry.Visible = false;
                    this.tdFooterIND.Visible        = false;
                }
                else
                {
                    this.lblResultCountIND.Text        = ind.Count.ToString();
                    this.lblSearchIND.Text             = this.txtSearchCriteria.Text;
                    this.tdHeaderIND.Visible           = true;
                    this.grvClientsIndustry.DataSource = ind;
                    this.grvClientsIndustry.DataBind();
                    this.grvClientsIndustry.Visible = true;
                    this.tdFooterIND.Visible        = true;
                    this.lnkIND.Enabled             = true;
                    if (ind.Count <= this.grvClientsIndustry.PageSize)
                    {
                        this.lnkIND.Enabled = false;
                    }
                }

                if (records == MaxRecords)
                {
                    this.ucMessanger1.ProcessMessage("enGage: " + biz.GetMessageText("MaxClientsReached"), Enums.enMsgType.Warn, "", null, false);
                }

                return;
            }
            if (records > MaxRecords)
            {
                this.btnAdd.Visible = false;

                this.tdHeaderCN.Visible  = false;
                this.tdFooterCN.Visible  = false;
                this.tdHeaderAD.Visible  = false;
                this.tdFooterAD.Visible  = false;
                this.tdHeaderIND.Visible = false;
                this.tdFooterIND.Visible = false;
                this.ucMessanger1.ProcessMessage("enGage: " + biz.GetMessageText("TooManyClientsFound"), Enums.enMsgType.Warn, "", null, false);
                return;
            }
        }
示例#20
0
        private void LoadDashboardReport()
        {
            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_DashboardResult> rs = biz.GetDashboardData(
                so.DateFrom,
                so.DateTo,
                so.Region,
                so.Branch,
                so.Executive,
                so.Classification,
                so.BusinessType,
                so.Industries,
                so.Sources,
                so.Opportunities);

            this.ucMessanger1.ProcessMessages(biz.MSGS, true);

            if (rs == null)
            {
                return;
            }

            StringBuilder sb = new StringBuilder();

            rptDashboard.DataSource = rs;
            rptDashboard.DataBind();

            //Do the sums for the other fields.
            Decimal sumActivitiesQuoted = 0;
            Decimal sumActivitiesActual = 0;
            Decimal sumFollowUpsQuoted  = 0;
            Decimal sumFollowUpsActual  = 0;
            Decimal sumPipelineQuoted   = 0;
            Decimal sumPipelineActual   = 0;
            Decimal sumToWinQuoted      = 0;
            Decimal sumWonActual        = 0;
            Decimal sumLostQuoted       = 0;
            Decimal sumDueQuoted        = 0;
            Decimal sumDueActual        = 0;

            foreach (proc_rpt_DashboardResult r in rs)
            {
                sumActivitiesQuoted += r.ActivitiesQuoted != null ? (decimal)r.ActivitiesQuoted : 0;
                sumActivitiesActual += r.ActivitiesActual != null ? (decimal)r.ActivitiesActual : 0;
                sumFollowUpsQuoted  += r.FollowUpsQuoted != null ? (decimal)r.FollowUpsQuoted : 0;
                sumFollowUpsActual  += r.FollowUpsActual != null ? (decimal)r.FollowUpsActual : 0;
                sumPipelineQuoted   += r.PipelineQuoted != null ? (decimal)r.PipelineQuoted : 0;
                sumPipelineActual   += r.PipelineActual != null ? (decimal)r.PipelineActual : 0;
                sumToWinQuoted      += r.ToWinQuoted != null ? (decimal)r.ToWinQuoted : 0;
                sumWonActual        += r.WonActual != null ? (decimal)r.WonActual : 0;
                sumLostQuoted       += r.LostQuoted != null ? (decimal)r.LostQuoted : 0;
                sumDueQuoted        += r.DueQuoted != null ? (decimal)r.DueQuoted : 0;
                sumDueActual        += r.DueActual != null ? (decimal)r.DueActual : 0;
                //sb.AppendLine(r.Action + " "+r.Activities+" "+r.ActivitiesActual+" "+r.ActivitiesQuoted+" "+r.CompleteOutcomes+" "+r.DueActual+" "+r.DueOutcomes+" "+r.DueQuoted+" "+r.FollowUps+" "+r.FollowUpsActual+" "+r.FollowUpsQuoted+" "+r.LostQuoted+" "+r.PipelineActual+" "+r.PipelineOutcomes+" "+r.PipelineQuoted+" "+r.PreviousStatusID+" "+r.SuccessOutcomes+" "+r.ToWinQuoted+" "+r.WonActual+"<br/>");
            }



            /*
             * foreach(proc_rpt_DashboardResult r in rs)
             * {
             *  sb.AppendLine(r.Action + " "+r.Activities+" "+r.ActivitiesActual+" "+r.ActivitiesQuoted+" "+r.CompleteOutcomes+" "+r.DueActual+" "+r.DueOutcomes+" "+r.DueQuoted+" "+r.FollowUps+" "+r.FollowUpsActual+" "+r.FollowUpsQuoted+" "+r.LostQuoted+" "+r.PipelineActual+" "+r.PipelineOutcomes+" "+r.PipelineQuoted+" "+r.PreviousStatusID+" "+r.SuccessOutcomes+" "+r.ToWinQuoted+" "+r.WonActual+"<br/>");
             * }
             * ltrText.Text = sb.ToString();
             */

            /*
             * this.ReportViewer1.Reset();
             * this.ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
             * this.ReportViewer1.LocalReport.EnableHyperlinks = true;
             * this.ReportViewer1.LocalReport.ReportPath = "Reports//Dashboard.rdlc";
             * ReportParameter p1 = new ReportParameter("parDateFrom", so.DateFrom.ToString());
             * ReportParameter p2 = new ReportParameter("parDateTo", so.DateTo.ToString());
             * ReportParameter p3 = new ReportParameter("parRegion", so.Region);
             * ReportParameter p4 = new ReportParameter("parBranch", so.Branch);
             * ReportParameter p5 = new ReportParameter("parExecutive", so.Executive);
             * ReportParameter p6 = new ReportParameter("parClassification", so.Classification.ToString());
             * ReportParameter p7 = new ReportParameter("parBusinessType", so.BusinessType.ToString());
             * ReportParameter p8 = new ReportParameter("parIndustries", so.Industries == null ? "" : so.Industries);
             * ReportParameter p9 = new ReportParameter("parSources", so.Sources == null ? "" : so.Sources);
             * string ExecutiveName = this.ucSearchOptions1.GetExecutiveName(so.Executive);
             * string label = so.Executive != "(All)" ? ExecutiveName : so.Branch != "(All)" && so.Executive == "(All)" ? so.Region + " (" + so.Branch + ")" : so.Region != "(All)" && so.Branch == "(All)" ? so.Region : so.Region == "(All)" ? "OAMPS Insurance Brokers Ltd" : "";
             * ReportParameter p10 = new ReportParameter("parReportLabel", label);
             * this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 });
             * ReportDataSource myRDS = new ReportDataSource("proc_rpt_DashboardResult", rs);
             * this.ReportViewer1.LocalReport.DataSources.Clear();
             * this.ReportViewer1.LocalReport.DataSources.Add(myRDS);
             * this.ReportViewer1.LocalReport.Refresh();
             * this.ReportViewer1.Height = Unit.Point(480);
             * this.ReportViewer1.Visible = true;
             *
             * this.pnlResults_CollapsiblePanelExtender.ClientState = "false";
             * this.pnlResults_CollapsiblePanelExtender.Collapsed = false;
             * */
        }
        private bool UIValidation()
        {
            bizMessage bizM = new bizMessage();

            if (this.lblActivityStatus.Text == "")
            {
                this.ucMessanger1.ProcessMessage("Stage of Sales / Aspire Cycle: " + bizM.GetMessageText("ValueNotSelected"), Enums.enMsgType.Err, "OpportunityStatus", typeof(DropDownList), true);
                return(false);
            }
            bizActivity biz = new bizActivity();

            if (biz.GetStatusByID(int.Parse(this.hidStatusID.Value)).OutcomeType != "C")
            {
                if (this.txtFollowUpDate.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Follow Up Date: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "FollowUpDate", typeof(TextBox), true);
                    return(false);
                }
            }
            if (this.txtFollowUpDate.Text != "")
            {
                DateTime result;
                if (DateTime.TryParse(this.txtFollowUpDate.Text, out result) == false)
                {
                    this.ucMessanger1.ProcessMessage("Follow Up Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "FollowUpDate", typeof(TextBox), true);
                    return(false);
                }
            }

            switch (this.lblActivityStatus.Text)
            {
            case "Identified":
                break;

            case "Qualified-in":
                break;

            case "Qualified-out":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Interested":
                DateTime result;
                if (this.txtOpportunityDue.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    if (DateTime.TryParse(this.txtOpportunityDue.Text, out result) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                        return(false);
                    }
                }
                if (this.ddlClassification.SelectedValue == "")
                {
                    this.ucMessanger1.ProcessMessage("CSS Segment: " + bizM.GetMessageText("ValueNotSelected"), Enums.enMsgType.Err, "Classification", typeof(DropDownList), true);
                    return(false);
                }
                break;

            case "Not Interested":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Go-to-Market":
                break;

            case "Revisit next year":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Quoted":
                if (this.txtNetBrokerageQuoted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Expected OAMPS income Quoted: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "NetBrokerageQuoted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    decimal res;
                    if (Decimal.TryParse(this.txtNetBrokerageQuoted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Expected OAMPS income Quoted: " + bizM.GetMessageText("FieldNotDecimal"), Enums.enMsgType.Err, "NetBrokerageQuoted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Can't Place":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Accepted":
                if (this.txtNetBrokerageActual.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Expected OAMPS income Actual: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "NetBrokerageActual", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    decimal res;
                    if (Decimal.TryParse(this.txtNetBrokerageActual.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Expected OAMPS income Actual: " + bizM.GetMessageText("FieldNotDecimal"), Enums.enMsgType.Err, "NetBrokerageActual", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Lost":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Processed":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                if (this.txtMemoNumber.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Memo Number: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "MemoNumber", typeof(TextBox), true);
                    return(false);
                }
                if (this.txtClientCode.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Client Code: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "ClientCode", typeof(TextBox), true);
                    return(false);
                }
                break;

            default:     // all pending statuses
                break;
            }
            return(true);
        }
        private void PopulateFollowUps()
        {
            var bizM = new bizMessage();

            if (Session["USER"] == null)
            {
                ucMessanger1.ProcessMessage("Session: " + bizM.GetMessageText("SessionMissing"), Enums.enMsgType.Err, "",
                                            null, true);
                return;
            }
            var user = (bizUser.enGageUser)Session["USER"];

            var biz = new bizActivity();

            bool isRegion, isBranch, isAll;

            isRegion = isBranch = isAll = false;
            GridUtilities.SetUserAllowedOpportunities(user, ref isRegion, ref isBranch, ref isAll);

            var d1 = biz.GetFollowUps(ddlFilterExcutives.SelectedValue, int.Parse(ddlOAMPSIncome.SelectedValue),
                                      int.Parse(ddlBusinessType.SelectedValue), int.Parse(ddlFlagged.SelectedValue), "Recognise",
                                      ddlFilterRegion.SelectedValue, ddlFilterBranch.SelectedValue, isAll);
            var d2 = biz.GetFollowUps(ddlFilterExcutives.SelectedValue, int.Parse(ddlOAMPSIncome.SelectedValue),
                                      int.Parse(ddlBusinessType.SelectedValue), int.Parse(ddlFlagged.SelectedValue), "Qualify",
                                      ddlFilterRegion.SelectedValue, ddlFilterBranch.SelectedValue, isAll);
            var d3 = biz.GetFollowUps(ddlFilterExcutives.SelectedValue, int.Parse(ddlOAMPSIncome.SelectedValue),
                                      int.Parse(ddlBusinessType.SelectedValue), int.Parse(ddlFlagged.SelectedValue), "Contact",
                                      ddlFilterRegion.SelectedValue, ddlFilterBranch.SelectedValue, isAll);
            var d4 = biz.GetFollowUps(ddlFilterExcutives.SelectedValue, int.Parse(ddlOAMPSIncome.SelectedValue),
                                      int.Parse(ddlBusinessType.SelectedValue), int.Parse(ddlFlagged.SelectedValue), "Discover",
                                      ddlFilterRegion.SelectedValue, ddlFilterBranch.SelectedValue, isAll);
            var d5 = biz.GetFollowUps(ddlFilterExcutives.SelectedValue, int.Parse(ddlOAMPSIncome.SelectedValue),
                                      int.Parse(ddlBusinessType.SelectedValue), int.Parse(ddlFlagged.SelectedValue), "Respond",
                                      ddlFilterRegion.SelectedValue, ddlFilterBranch.SelectedValue, isAll);
            var d6 = biz.GetFollowUps(ddlFilterExcutives.SelectedValue, int.Parse(ddlOAMPSIncome.SelectedValue),
                                      int.Parse(ddlBusinessType.SelectedValue), int.Parse(ddlFlagged.SelectedValue), "Agree",
                                      ddlFilterRegion.SelectedValue, ddlFilterBranch.SelectedValue, isAll);
            var d7 = biz.GetFollowUps(ddlFilterExcutives.SelectedValue, int.Parse(ddlOAMPSIncome.SelectedValue),
                                      int.Parse(ddlBusinessType.SelectedValue), int.Parse(ddlFlagged.SelectedValue), "Process",
                                      ddlFilterRegion.SelectedValue, ddlFilterBranch.SelectedValue, isAll);


            _allIdentify =
                d1.Where(x => x.OutcomeType != "C" && x.FollowUpDate >= CalenderUtilities.CutOffDate).ToList();
            _allQualify =
                d2.Concat(d1)
                .Where(x => x.OutcomeType != "C" && x.FollowUpDate >= CalenderUtilities.CutOffDate)
                .ToList();
            _allRespond =
                d3.Concat(d4)
                .Concat(d5)
                .Where(x => x.OutcomeType != "C" && x.FollowUpDate >= CalenderUtilities.CutOffDate)
                .ToList();
            _allComplete =
                d6.Concat(d7)
                .Where(x => x.OutcomeType != "C" && x.FollowUpDate >= CalenderUtilities.CutOffDate)
                .ToList();

            // get the summary matrix for opprtunities
            decimal?estimated = 0, quoted = 0, actual = 0;
            int?    noOfOpportunities = 0;

            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);


            //biz.FollowUpsMatrix(user.UserName, string.Join(",", new string[] { Enums.ActivityActions.Qualify.ToString(), Enums.ActivityActions.Recognise.ToString() }),false,CalenderUtilities.CutOffDate, ref noOfOpportunities, ref estimated, ref quoted, ref actual);
            setFollowUpMatrix(lblQualifyMatrix, estimated, actual, _allQualify.Count,
                              Enums.ActivityActions.Qualify.ToString());

            //biz.FollowUpsMatrix(user.UserName, string.Join(",", new string[] { Enums.ActivityActions.Contact.ToString(), Enums.ActivityActions.Discover.ToString(), Enums.ActivityActions.Respond.ToString() }),false,CalenderUtilities.CutOffDate, ref noOfOpportunities, ref estimated, ref quoted, ref actual);
            setFollowUpMatrix(lblRespondMatrix, quoted, actual, _allRespond.Count,
                              Enums.ActivityActions.Contact.ToString());

            //biz.FollowUpsMatrix(user.UserName, string.Join(",", new string[] { Enums.ActivityActions.Agree.ToString(), Enums.ActivityActions.Process.ToString() }),false,CalenderUtilities.CutOffDate, ref noOfOpportunities, ref estimated, ref quoted, ref actual);
            setFollowUpMatrix(lblCompleteMatrix, quoted, actual, _allComplete.Count,
                              Enums.ActivityActions.Agree.ToString());


            //this.grvIdentified.DataSource = allIdentify;
            //this.ucMessanger1.ProcessMessages(biz.MSGS, true);
            //this.grvIdentified.DataBind();

            grvQualifiedIn.DataSource = _allQualify;
            ucMessanger1.ProcessMessages(biz.MSGS, true);
            grvQualifiedIn.DataBind();

            grvInterested.DataSource = _allRespond;
            ucMessanger1.ProcessMessages(biz.MSGS, true);
            grvInterested.DataBind();

            grvAccepted.DataSource = _allComplete;
            ucMessanger1.ProcessMessages(biz.MSGS, true);
            grvAccepted.DataBind();


            // combine all results to have a filtered summery for the week
            var allFollowups =
                d1.Concat(d2)
                .Concat(d3)
                .Concat(d4)
                .Concat(d5)
                .Concat(d6)
                .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();

            grvSummary.DataSource = weeklyFilteredFollowUps;
            ucMessanger1.ProcessMessages(biz.MSGS, true);
            grvSummary.DataBind();

            // change the way the gridview displays the header
            AlterGridRendering(grvSummary);
            AlterGridRendering(grvQualifiedIn);
            AlterGridRendering(grvInterested);
            AlterGridRendering(grvAccepted);


            if (weeklyFilteredFollowUps.Count() <= grvSummary.PageSize)
            {
                lnkSeeAll0.Enabled = false;
            }
            else
            {
                lnkSeeAll0.Enabled = true;
            }
            lblQualifiedIn.Text = "Qualifying"; // + _allQualify.Count.ToString() + " active)";
            lnkSeeAll2.Enabled  = true;
            lblInterested.Text  = "Responding"; // + _allRespond.Count.ToString() + " active)";
            lnkSeeAll3.Enabled  = true;
            lblAccepted.Text    = "Completing"; // + _allComplete.Count.ToString() + " active)";
            lnkSeeAll6.Enabled  = true;
        }
示例#23
0
        private bool UIValidation()
        {
            bizMessage bizM = new bizMessage();

            if (this.txtSource.Text.Trim().Length == 0)
            {
                this.ucMessanger1.ProcessMessage("Source: " + bizM.GetMessageText("EmptySource"), Enums.enMsgType.Err, "Source", typeof(TextBox), true);
                return(false);
            }

            //if (this.txtInsuredName.Text.Trim().Length == 0)
            //{
            //    this.ucMessanger1.ProcessMessage("Insured As: " + bizM.GetMessageText("EmptySource"), Enums.enMsgType.Err, "InsuredName", typeof(TextBox), true);
            //    return false;
            //}

            if (this.txtOfficePhone.Text.Trim().Length == 0)
            {
                this.ucMessanger1.ProcessMessage("Phone: " + bizM.GetMessageText("EmptySource"), Enums.enMsgType.Err, "OfficePhone", typeof(TextBox), true);
                return(false);
            }

            if (this.txtAddress.Text.Length > this.txtAddress.MaxLength)
            {
                this.ucMessanger1.ProcessMessage("Address: " + bizM.GetMessageText("ValueGreaterThanMax"), Enums.enMsgType.Err, "", null, true);
                return(false);
            }

            switch (this.ddlBusinessType.SelectedItem.Text)
            {
            case "Quick quote":     // go-to-market
                DateTime r1;
                if (this.txtOpportunityDue.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    if (DateTime.TryParse(this.txtOpportunityDue.Text, out r1) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                        return(false);
                    }
                }
                //if (this.ddlClassification.SelectedValue == "")
                //{
                //    this.ucMessanger1.ProcessMessage("CSS Segment: " + bizM.GetMessageText("ValueNotSelected"), Enums.enMsgType.Err, "Classification", typeof(DropDownList), true);
                //    return false;
                //}
                break;

            case "Quick win":     // accepted
                DateTime r2;
                if (this.txtOpportunityDue.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    if (DateTime.TryParse(this.txtOpportunityDue.Text, out r2) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                        return(false);
                    }
                }
                //if (this.ddlClassification.SelectedValue == "")
                //{
                //    this.ucMessanger1.ProcessMessage("CSS Segment: " + bizM.GetMessageText("ValueNotSelected"), Enums.enMsgType.Err, "Classification", typeof(DropDownList), true);
                //    return false;
                //}
                if (this.txtNetBrokerageQuoted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Broking Income Quoted: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "NetBrokerageQuoted", typeof(TextBox), true);
                    return(false);
                }
                if (this.txtNetBrokerageActual.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Actual Broking Income: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "NetBrokerageActual", typeof(TextBox), true);
                    return(false);
                }
                break;

            default:
                DateTime result;
                //if (this.txtOpportunityDue.Text != "")
                //{
                //    if (DateTime.TryParse(this.txtOpportunityDue.Text, out result) == false)
                //    {
                //        this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                //        return false;
                //    }
                //}
                break;
            }

            return(true);
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                Opportunity    o   = new Opportunity();
                bizOpportunity biz = new bizOpportunity();

                bizMessage bizM = new bizMessage();
                DateTime   result;
                if (this.txtOpportunityDue.Text != "")
                {
                    if (DateTime.TryParse(this.txtOpportunityDue.Text, out result) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                        return;
                    }
                }

                o.ClientID        = int.Parse(Request.QueryString["cid"]);
                o.OpportunityID   = int.Parse(Request.QueryString["oid"]);
                o.OpportunityName = this.txtOpportunityName.Text;
                if (this.txtOpportunityDue.Text != "")
                {
                    o.OpportunityDue = DateTime.Parse(this.txtOpportunityDue.Text);
                }
                o.IncumbentBroker  = this.txtIncumbentBroker.Text;
                o.IncumbentInsurer = this.txtIncumbentInsurer.Text;
                if (this.ddlClassification.SelectedValue != "")
                {
                    o.ClassificationID = int.Parse(this.ddlClassification.SelectedValue);
                }
                if (this.ddlBusinessType.SelectedValue != "")
                {
                    o.BusinessTypeID = int.Parse(this.ddlBusinessType.SelectedValue);
                }
                if (this.ddlContact.SelectedValue != "")
                {
                    o.ContactID = int.Parse(this.ddlContact.SelectedValue);
                }
                o.Flagged = bool.Parse(this.ddlFlagged.SelectedValue);
                if (this.txtEstimatedBrokingIncome.Text != "")
                {
                    o.NetBrokerageEstimated = decimal.Parse(this.txtEstimatedBrokingIncome.Text);
                }
                if (this.txtNetBrokerageQuoted.Text != "")
                {
                    o.NetBrokerageQuoted = decimal.Parse(this.txtNetBrokerageQuoted.Text);
                }
                if (this.txtNetBrokerageActual.Text != "")
                {
                    o.NetBrokerageActual = decimal.Parse(this.txtNetBrokerageActual.Text);
                }
                if (this.txtDateCompleted.Text != "")
                {
                    o.DateCompleted = DateTime.Parse(this.txtDateCompleted.Text);
                }
                o.MemoNumber = this.txtMemoNumber.Text;
                //audit
                o.ModifiedBy = bizUser.GetCurrentUserName();
                o.Modified   = DateTime.Now;
                //action
                if (biz.ValidateOpportunity(o) == false)
                {
                    this.ucMessanger1.ProcessMessages(biz.MSGS, true);
                    return;
                }
                if (biz.UpdateOpportunity(o) == true)
                {
                    Response.Redirect("ViewOpportunity.aspx?cid=" + Request.QueryString["cid"] + "&oid=" + Request.QueryString["oid"], false);
                }
                else
                {
                    this.ucMessanger1.ProcessMessages(biz.MSGS, true);
                }
            }
            catch (Exception ex)
            {
                bizLog.InsertExceptionLog(ex);
                Response.Redirect("~/ErrorPage.aspx", false);
            }
        }
示例#25
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                this.ucMessanger1.ClearMessages();
                this.ucMessanger1.UnmarkControls();

                bizMessage bizM = new bizMessage();
                if (this.txtAddress.Text.Length > this.txtAddress.MaxLength)
                {
                    this.ucMessanger1.ProcessMessage("Address: " + bizM.GetMessageText("ValueGreaterThanMax"), Enums.enMsgType.Err, "", null, true);
                    return;
                }

                Client    c   = new Client();
                bizClient biz = new bizClient();

                c.ClientID = int.Parse(Request.QueryString["cid"]);
                //if (this.ddlAccountExecutive.SelectedValue != "")
                //    c.AccountExecutiveID = int.Parse(this.ddlAccountExecutive.SelectedValue);
                c.ClientCode     = this.txtClientCode.Text;
                c.ClientName     = this.txtClientName.Text;
                c.RegisteredName = this.txtRegisteredName.Text;
                c.InsuredName    = this.txtInsuredName.Text;
                if (this.txtABNACN.Text != "")
                {
                    c.ABNACN = this.txtABNACN.Text;
                }
                c.Source           = this.txtSource.Text;
                c.OfficeFacsimilie = this.txtOfficeFacsimilie.Text;
                c.OfficePhone      = this.txtOfficePhone.Text;
                //address
                if (this.txtAddress.Text != "")
                {
                    c.Address = this.txtAddress.Text;
                }
                if (this.rblAddressTypes.SelectedIndex == 0 && this.ucAUPSS1.SuburbControl.SelectedIndex > -1)
                {
                    if (this.ucAUPSS1.PostCode != "")
                    {
                        c.PostCode = this.ucAUPSS1.PostCode;
                    }
                    if (this.ucAUPSS1.StateCode != "")
                    {
                        c.StateCode = this.ucAUPSS1.StateCode;
                    }
                    if (this.ucAUPSS1.Suburb != "")
                    {
                        c.Location = this.ucAUPSS1.Suburb;
                    }
                }
                //industry
                if (this.lstIndustry.SelectedValue != "")
                {
                    c.AnzsicCode = this.lstIndustry.SelectedValue;
                }
                if (this.ddlAssociation.SelectedValue != "")
                {
                    c.AssociationCode = this.ddlAssociation.SelectedValue;
                }
                c.AssociationMemberNumber = this.txtAssociationMemberNumber.Text;
                //audit
                c.ModifiedBy = bizUser.GetCurrentUserName();
                c.Modified   = DateTime.Now;
                //action
                if (biz.ValidateClient(c) == false)
                {
                    this.ucMessanger1.ProcessMessages(biz.MSGS, true);
                    return;
                }
                if (biz.UpdateClient(c) == true)
                {
                    Response.Redirect("ViewClient.aspx?cid=" + c.ClientID.ToString(), false);
                }
                this.ucMessanger1.ProcessMessages(biz.MSGS, true);
            }
            catch (Exception ex)
            {
                bizLog.InsertExceptionLog(ex);
                Response.Redirect("~/ErrorPage.aspx", false);
            }
        }