private void InsertQuickCall()
        {
            Client    c   = new Client();
            bizClient biz = new bizClient();

            //CLIENT//
            //general
            c.Inactive = false;
            bizUser.enGageUser user = (bizUser.enGageUser)Session["USER"];
            c.AccountExecutiveID = user.UserName;
            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)
            {
                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.AddedBy = bizUser.GetCurrentUserName();
            c.Added   = DateTime.Now;

            if (biz.ValidateClient(c) == false)
            {
                this.ucMessanger1.ProcessMessages(biz.MSGS, true);
                return;
            }

            //CONTACT//
            Contact    cl   = new Contact();
            bizContact bizC = new bizContact();

            if (this.ckbAddContact.Checked == true)
            {
                //general
                cl.ContactName = this.txtContactName.Text;
                cl.Title       = this.ddlTitle.SelectedValue;
                cl.Mobile      = this.txtMobile.Text;
                cl.DirectLine  = this.txtDirectLine.Text;
                cl.Email       = this.txtEmail.Text;
                //audit
                cl.AddedBy = bizUser.GetCurrentUserName();
                cl.Added   = DateTime.Now;
            }

            if (this.ckbAddContact.Checked == true)
            {
                if (bizC.ValidateContact(cl) == false)
                {
                    this.ucMessanger1.ProcessMessages(bizC.MSGS, true);
                    return;
                }
                c.Contacts.Add(cl);
            }

            //OPPORTUNITY//
            Opportunity    o    = new Opportunity();
            bizOpportunity bizO = new bizOpportunity();

            //general
            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.ddlFlagged.SelectedValue != "")
            {
                o.Flagged = bool.Parse(this.ddlFlagged.SelectedValue);
            }
            //o.NetBrokerageQuoted = decimal.Parse(this.txtNetBrokerageQuoted.Text);
            //o.NetBrokerageActual = decimal.Parse(this.txtNetBrokerageActual.Text);
            //audit
            o.AddedBy = bizUser.GetCurrentUserName();
            o.Added   = DateTime.Now;

            if (bizO.ValidateQuickQuoteOpportunity(o) == false)
            {
                this.ucMessanger1.ProcessMessages(bizO.MSGS, true);
                return;
            }
            c.Opportunities.Add(o);

            //ACTIVITY//
            bizActivity bizA = new bizActivity();
            char        ot   = 'S';
            List <sp_web_ListStatusesByOutcomeTypeResult> ss = bizA.ListStatusesByOutcomeType(ot);

            foreach (var s in ss)
            {
                Activity na = new Activity();
                //general
                na.OpportunityStatusID = s.StatusID;
                if (this.txtFollowUpDate.Text != "")
                {
                    na.FollowUpDate = DateTime.Parse(this.txtFollowUpDate.Text);
                }
                na.Inactive = false;
                if (s.StatusName == "Go-to-Market")
                {
                    na.ActivityNote = this.txtActivityNote.Text;
                }
                else
                {
                    na.ActivityNote = "Quick call";
                }
                //audit
                na.AddedBy = bizUser.GetCurrentUserName();
                na.Added   = DateTime.Now;
                o.Activities.Add(na);
                if (s.StatusName == "Go-to-Market")
                {
                    break;
                }
            }

            foreach (Activity na in o.Activities)
            {
                if (bizA.ValidateActivity(na, true) == false)
                {
                    this.ucMessanger1.ProcessMessages(bizA.MSGS, true);
                    return;
                }
            }

            int oid = biz.InsertClient(c);

            if (oid != 0)
            {
                this.ucMessanger1.ProcessMessages(biz.MSGS, true);
                Response.Redirect("ViewClient.aspx?cid=" + oid.ToString(), false);
            }
            this.ucMessanger1.ProcessMessages(biz.MSGS, true);
        }
        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);
            }
        }