예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                clsPortfolio Portfolio = new clsPortfolio(this.propClientID, this.propPortfolioID, this.propUserID);
                clsClient Client = new clsClient(this.propClientID);

                populate(Portfolio, Client);
            }
        }
예제 #2
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Etes vous sur de vouloir supprimer ce client", "Suppression", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         clsClient client = new clsClient();
         client.Id = Convert.ToInt32(clsGlobal.tbClients.Rows[courant]["ClientID"]);
         clsAdministrator admin = new clsAdministrator();
         client.DeleteClient(client);
         clsDataAdmin.UpdateClients(clsGlobal.tbClients);
     }
     courant = 0;
     Row2Txt();
 }
예제 #3
0
 private void populate(clsPortfolio _clsPortfolio, clsClient Client)
 {
     this.lblValue_ClientName.Text            = Client.propForename + " " + Client.propSurname + " (" + Client.propCode + ")";
     this.lblValue_Company.Text               = _clsPortfolio.propCompany;
     this.lblValue_PortfolioType.Text         = _clsPortfolio.propPortfolioType;
     this.lblValue_Currency.Text              = _clsPortfolio.propPortfolioCurrency;
     this.lblValue_AccountNumber.Text         = _clsPortfolio.propAccountNumber;
     this.lblValue_PlanStatus.Text            = _clsPortfolio.propPlanStatus;
     this.lblValue_StartDate.Text             = _clsPortfolio.propPortfolioStartDate.ToString("dd/MM/yyyy");
     this.lblValue_PolicyCategory.Text        = _clsPortfolio.propLiquidity;
     this.lblValue_Profile.Text               = _clsPortfolio.propRiskProfile;
     this.lblValue_SpecialistInformation.Text = _clsPortfolio.propRetentionTerm;
     this.lblValue_Discretionary.Text         = _clsPortfolio.propMFPercent == 0 ? "no" : "yes";
 }
예제 #4
0
        public void ClientFindMethodOk()
        {
            //create an instance of the class clsClient
            clsClient Aclient = new clsClient();
            //boolean variable store the results of the validation
            Boolean Found = false;
            //create some test data to use with the method
            Int32 ClientNo = 1;

            //invoke the method
            Found = Aclient.Find(ClientNo);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
예제 #5
0
        public void ClientFirstNameMaxPlusOne()
        {
            //create an instance of the class
            clsClient Aclient = new clsClient();
            //create a variable to record
            Boolean Ok;
            //51 characters entry
            string SomeText = "LennisLennisLennisLennisLennisLennisLenLennisLennisLen";

            //Test the valid method with a two character string
            Ok = Aclient.Valid(SomeText);
            //Assert that the outcome should be true
            Assert.IsFalse(Ok);
        }
예제 #6
0
        public void ClientFaxNumberPropertyOK()
        {
            //create an instance of the class
            clsClient Aclient = new clsClient();
            //create a variable to store the ID of the client
            string FaxNumber;

            //assign a Faxnumber to variable
            FaxNumber = "07495846385";
            //try to send same data to the client
            Aclient.FaxNumber = FaxNumber;
            //check to see that the data in the variable and property are the same
            Assert.AreEqual(Aclient.FaxNumber, FaxNumber);
        }
예제 #7
0
        public void ClientFirstNameMinLessOne()
        {
            //create an instance of the class
            clsClient AClient = new clsClient();
            //create a variable to record the result of the validation test
            Boolean OK;
            //49 characters entry
            string SomeText = "LennisLennisLennisLennisLennisLennisLenLennisLennisL";

            //test the valid method with a blank string
            OK = AClient.Valid("");
            //assert that the outcome should be false
            Assert.IsFalse(OK);
        }
예제 #8
0
        public void ClientTelephonePropertyOK()
        {
            //create an instance of the class
            clsClient Aclient = new clsClient();
            //create a variable to store the Telephone number of the client
            string TelephoneNumber;

            //assign a client to variable
            TelephoneNumber = "07495846385";
            //try to send same data to the client
            Aclient.TelephoneNumber = TelephoneNumber;
            //check to see that the data in the variable and property are the same
            Assert.AreEqual(Aclient.TelephoneNumber, TelephoneNumber);
        }
예제 #9
0
        public void ClientPositionPropertyOK()
        {
            //create an instance of the class
            clsClient AClient = new clsClient();
            //create a variable to store the name of the client
            String Position;

            //Assign a position to variable
            Position = "Human Resource";
            //try to send some data to the variable and property are the same
            AClient.Position = Position;
            //check to see that the data in the variable and property are the same
            Assert.AreEqual(AClient.Position, Position);
        }
예제 #10
0
        public void ClientEmailPropertyOK()
        {
            //create an instance of the class
            clsClient AClient = new clsClient();
            //create a variable to store the name of the client
            String Email;

            //Assign a client to variable
            Email = "*****@*****.**";
            //try to send some data to the variable and property are the same
            AClient.Email = Email;
            //check to see that the data in the variable and property are the same
            Assert.AreEqual(AClient.Email, Email);
        }
예제 #11
0
        public void ClientFirstNamePropertyOK()
        {
            //create an instance of the class
            clsClient AClient = new clsClient();
            //create a variable to store the name of the client
            String FirstName;

            //Assign a client to variable
            FirstName = "Lennis";
            //try to send some data to the variable and property are the same
            AClient.FirstName = FirstName;
            //check to see that the data in the variable and property are the same
            Assert.AreEqual(AClient.FirstName, FirstName);
        }
예제 #12
0
 private void populate(clsPortfolio _clsPortfolio, clsClient Client) 
 {
     this.lblValue_ClientName.Text = Client.propForename + " " + Client.propSurname + " (" + Client.propCode + ")";
     this.lblValue_Company.Text = _clsPortfolio.propCompany;
     this.lblValue_PortfolioType.Text = _clsPortfolio.propPortfolioType;
     this.lblValue_Currency.Text = _clsPortfolio.propPortfolioCurrency;
     this.lblValue_AccountNumber.Text = _clsPortfolio.propAccountNumber;
     this.lblValue_PlanStatus.Text = _clsPortfolio.propPlanStatus;
     this.lblValue_StartDate.Text = _clsPortfolio.propPortfolioStartDate.ToString("dd/MM/yyyy");
     this.lblValue_PolicyCategory.Text = _clsPortfolio.propLiquidity;
     this.lblValue_Profile.Text = _clsPortfolio.propRiskProfile;
     this.lblValue_SpecialistInformation.Text = _clsPortfolio.propRetentionTerm;
     this.lblValue_Discretionary.Text = _clsPortfolio.propMFPercent == 0 ? "no" : "yes";
 }
 private void gridAll_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!txtEmail.Enabled)
     {
         ButtonControl(true, true, false, false, true, false);
         int       clientid = (int)gridAll.Rows[e.RowIndex].Cells[0].Value;
         clsClient client   = new clsClient();
         client           = admin.Searched_Client_by_RefClient(clientid);
         txtName.Text     = client.Name;
         txtPhone.Text    = client.PhoneNumber;
         txtEmail.Text    = client.EMail;
         cboRefHouse.Text = client.RefHouse.ToString();
         cboStatus.Text   = client.Status;
     }
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            clsClient client = new clsClient();

            client.Name        = txtName.Text;
            client.PhoneNumber = txtPhone.Text;
            client.EMail       = txtEmail.Text;
            client.Status      = cboStatus.Text;
            client.RefHouse    = Convert.ToInt32(cboRefHouse.Text);

            if (Addmode)
            {
                if (admin.Add_New_Client(client))
                {
                    MessageBox.Show("New Client : " + client.Name + " is successfully added", "New Client Added");
                }
                else
                {
                    MessageBox.Show("The Client " + client.Name + " is not added.", "Try Again");
                }
                admin.Refresh_Database();
            }
            else
            {
                client.RefClient = (int)gridAll.Rows[gridAll.CurrentRow.Index].Cells[0].Value;

                if (admin.Edit_Client(client))
                {
                    MessageBox.Show("Client ID " + client.RefHouse + " is successfully modified", "Client Modified");
                }
                else
                {
                    MessageBox.Show("Client ID : " + client.RefHouse + " is not modified.", "Try Again");
                }
            }
            if (permission == 2)
            {
                List <clsClient> temp = new List <clsClient>();
                temp.Add(agent.Searched_Cleint_For_This_Agent(refagent));
                gridAll.DataSource = temp;
            }
            else
            {
                gridAll.DataSource = admin.All_Client();
            }

            ButtonControl(true, true, false, false, true, false);
        }
예제 #15
0
        public void ClientPositionExtremeMax()
        {
            //create an instancce of the class
            clsClient Aclient = new clsClient();
            //Assign a client to variable
            string FirstName = "Lennis";
            string LastName  = "Ngugi";
            string Email     = "*****@*****.**";
            string Position  = " ";

            Position = Position.PadRight(60, 'a');
            //try to send some data to the variable and property are the same
            Aclient.Position = Position;
            //check to see that the data in the variable and property are the same
            Assert.AreEqual(Aclient.Position, Position);
        }
예제 #16
0
 public static bool updateClient(clsClient newClientData)
 {
     if (Exist(newClientData.Email))
     {
         int index = getIndexByEmail(newClientData.Email);
         tabClient.Rows[index]["name"]    = newClientData.Name;
         tabClient.Rows[index]["email"]   = newClientData.Email;
         tabClient.Rows[index]["phone"]   = newClientData.Phone;
         tabClient.Rows[index]["type"]    = newClientData.clientType;
         tabClient.Rows[index]["refType"] = newClientData.ParentType;
         tabClient.Rows[index]["refName"] = newClientData.ParentName;
         tabClient.Rows[index]["refid"]   = newClientData.ParentId;
         return(true);
     }
     return(false);
 }
예제 #17
0
        protected void btnContactMeSend_Click(object sender, EventArgs e)
        {
            strClientID    = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();
            strPortfolioID = Session[clsSystem_Session.strSession.tempportfolioid.ToString()].ToString();
            strUserID      = Session[clsSystem_Session.strSession.User.ToString()].ToString();

            clsIFA       IFA       = new clsIFA(int.Parse(Session["ifaid"].ToString()));
            clsClient    Client    = new clsClient(strClientID);
            clsPortfolio Portfolio = new clsPortfolio(strClientID, strPortfolioID, strUserID);

            String strEmailMessage = "";

            try
            {
                String strRecipient = IFA.propIFAEmail;

                try
                {
                    strEmailMessage = clsEmail.generateEmailBody("ClientRequestContact", IFA.propIFA_Name, Client.propForename + " " + Client.propSurname,
                                                                 Portfolio.propCompany, this.txtContactMeByTel.Text.Trim(), this.txtContactMeComments.Text.Trim(), null, null);
                }
                catch
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for this purpose. Please report this error to your systems administrator');", true);
                    return;
                }


                clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client request", strEmailMessage, Portfolio.propSwitch.propSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientRequestingContact);

                clsSwitch.updateSwitchHeader(Portfolio.propSwitch.propSwitchID, clsSwitch.enumSwitchStatus.Request_ForDiscussion);

                int intHistoryID = clsHistory.insertHeader(Portfolio.propPortfolioID, Portfolio.propSwitch.propSwitchID, (Int16)clsSwitch.enumSwitchStatus.Request_ForDiscussion);
                clsHistory.insertMessage(intHistoryID, strEmailMessage);

                ClientScript.RegisterStartupScript(this.GetType(), "EmailRequestContactSent", "alert('Request for contact to your IFA has been sent successfully');", true);

                populateProposedSwitch(Portfolio.propSwitch.propSwitchDetails);

                enableButtons(clsSwitch.enumSwitchStatus.Request_ForDiscussion);
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "EmailFailedAlert", "alert('Sending failed. Error:  " + ex.Message.Replace("'", " ") + "');", true);
                return;
            }
        }
예제 #18
0
        public void ClientPositionMaxPlusOne()
        {
            //create an instance of the class we want to create
            clsClient Aclient = new clsClient();
            //boolean variable to store the results of the validation
            Boolean OK = false;
            //assign a position to variable
            string Position = " ";

            Position = Position.PadRight(51, 'a');
            //try to send some data to the variable and property are the same
            Aclient.Position = Position;
            //invoke the method
            OK = Aclient.Valid(Position);
            //check to see that the data in the variable and property are the same
            Assert.AreEqual(Aclient.Position, Position);
        }
예제 #19
0
        public clsClientData()
        {
            clientData = new Dictionary <string, clsClient>();
            clsClient client1 = new clsClient("cl01", "Aron", "*****@*****.**", "12345", "Aron", "Seller", "Agent", "agent1", "ag01");
            clsClient client2 = new clsClient("cl02", "Glenn", "*****@*****.**", "12345", "Glenn", "Buyer", "Agent", "agent1", "ag01");
            clsClient client3 = new clsClient("cl03", "Mitchell", "*****@*****.**", "12345", "Mitchell", "Seller", "Admin", "Rahul", "ad01");
            clsClient client4 = new clsClient("cl04", "Pat", "*****@*****.**", "12345", "Pat", "Buyer", "Agent", "agent2", "ag02");
            clsClient client5 = new clsClient("cl05", "Marcus", "*****@*****.**", "12345", "Marcus", "Seller", "Agent", "agent3", "ag03");
            clsClient client6 = new clsClient("cl06", "Alex", "*****@*****.**", "12345", "Alex", "Buyer", "Admin", "John", "ad02");

            clientData.Add("*****@*****.**", client1);
            clientData.Add("*****@*****.**", client2);
            clientData.Add("*****@*****.**", client3);
            clientData.Add("*****@*****.**", client4);
            clientData.Add("*****@*****.**", client5);
            clientData.Add("*****@*****.**", client6);
        }
예제 #20
0
        protected void btnDeclineSwitch_Click(object sender, EventArgs e)
        {
            strUserID      = Session[clsSystem_Session.strSession.User.ToString()].ToString();
            strClientID    = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();
            strPortfolioID = Session[clsSystem_Session.strSession.tempportfolioid.ToString()].ToString();

            clsPortfolio oPortfolio = new clsPortfolio(strClientID, strPortfolioID, strUserID);

            int intSwitchID = (int)ViewState["intSwitchID"];

            string backPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/" + "portfoliodetails.asp";

            try
            {
                clsIFA    IFA             = new clsIFA(int.Parse(Session["ifaid"].ToString()));
                clsClient Client          = new clsClient(strClientID);
                String    strEmailMessage = "";

                String strRecipient = IFA.propIFAEmail;

                try
                {
                    strEmailMessage = clsEmail.generateEmailBody("ClientDeclineNotification", IFA.propIFA_Name, Client.propForename + " " + Client.propSurname, oPortfolio.propCompany, null, this.txtDeclineDescription.Text.Trim(), null, null);
                }
                catch
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for declining email. Please report this error to your systems administrator');", true);
                    return;
                }

                clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client declined proposed switch", strEmailMessage, intSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientDeclinedSwitchPortfolio);

                clsSwitch.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Declined_Client, new clsSwitch(intSwitchID).propDescription);

                int intHistoryID = clsHistory.insertHeader(oPortfolio.propPortfolioID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Declined_Client);
                clsHistory.insertMessage(intHistoryID, strEmailMessage);

                clsSwitch_Client.declineSwitch(intSwitchID);

                ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitch", "alert('This switch has been declined.'); window.location='" + backPageURL + "';", true);
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitcherror", "alert('Error declining switch! " + ex.ToString().Replace("'", " ") + "'); window.location='" + backPageURL + "';", true);
            }
        }
예제 #21
0
 public static bool AddClient(clsClient newClientData)
 {
     if (!Exist(newClientData.Email))
     {
         DataRow myRow = tabClient.NewRow();
         myRow["refAgentid"] = newClientData.Name;
         myRow["email"]      = newClientData.Email;
         myRow["phone"]      = newClientData.Phone;
         myRow["type"]       = newClientData.clientType;
         myRow["refType"]    = newClientData.ParentType;
         myRow["refName"]    = newClientData.ParentName;
         myRow["refid"]      = newClientData.ParentId;
         tabClient.Rows.Add(myRow);
         return(true);
     }
     return(false);
 }
예제 #22
0
        protected void btnDeclineSwitch_Click(object sender, EventArgs e)
        {
            String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString();
            String strUserID   = Session[clsSystem_Session.strSession.User.ToString()].ToString();
            String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();

            clsScheme Scheme = new clsScheme(strClientID, strSchemeID);

            int intSwitchID = propSwitchID;

            try
            {
                clsIFA    IFA             = new clsIFA(int.Parse(Session["ifaid"].ToString()));
                clsClient Client          = new clsClient(strClientID);
                String    strEmailMessage = "";

                String strRecipient = IFA.propIFAEmail;

                try
                {
                    strEmailMessage = clsEmail.generateEmailBody("ClientDeclineNotification", IFA.propIFA_Name, Client.propForename + " " + Client.propSurname, Scheme.propCompany.propCompany, null, this.txtDeclineDescription.Text.Trim(), null, null);
                }
                catch
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for declining email. Please report this error to your systems administrator');", true);
                    return;
                }

                clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client declined proposed switch", strEmailMessage, intSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientDeclinedSwitchScheme);

                clsSwitchScheme.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Declined_Client, new clsSwitch(intSwitchID).propDescription);

                int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Declined_Client);
                clsHistory.clsHistoryScheme.insertMessage(intHistoryID, strEmailMessage);

                clsSwitchScheme_Client.declineSwitch(intSwitchID);

                Page.ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitch", "alert('This switch has been declined.'); window.location='" + this.propBackPageURL + "';", true);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitcherror", "alert('Error declining switch! " + ex.ToString().Replace("'", " ") + "'); window.location='" + this.propBackPageURL + "';", true);
            }
        }
예제 #23
0
        public void ClientFaxExtremeMax()
        {
            //create an instance of the class
            clsClient Aclient = new clsClient();
            //boolean variable to store the results of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            string FirstName = "Lennis";
            string LastName  = "Ngugi";
            string Email     = "*****@*****.**";
            string Position  = "Human Resource";
            Int64  Telephone = 0748409423456;
            Int64  FaxNumber = 07484094234567678;

            //invoke the method
            OK = Aclient.Valid(FirstName, LastName, Email, Position, Telephone, FaxNumber);
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
예제 #24
0
        protected void NotifyApprovedSwtich()
        {
            //try
            //{
            String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString();
            String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();

            clsScheme       Scheme       = new clsScheme(strClientID, strSchemeID);
            clsSwitchScheme switchScheme = new clsSwitchScheme(Scheme);
            string          htmlTemplate = clsOutput.generateApprovedSwitchScheme(Scheme);
            StyleSheet      style        = clsOutput.getStyleSheet_ApprovedSwitch();
            string          strFilename  = clsOutput.generateOutputFile(clsOutput.enumOutputType.PDF, htmlTemplate, style, switchScheme.propSwitchID, clsOutput.enumSwitchType.Scheme);

            int    intIFAID     = int.Parse(Session["ifaid"].ToString());
            string strRecepient = (new clsIFA(intIFAID)).propIFAEmail;
            string strSender    = "*****@*****.**";
            string strSubject   = "Switch Instruction";
            string strBody      = clsEmail.generateEmailBody((Scheme.propConfirmationRequired ? "NotifyApprovedEmailReqSign" : "NotifyApprovedEmail"), null, null, null, null, null, Scheme.propCompany.propCompany, switchScheme.propSwitchID.ToString());

            clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, switchScheme.propSwitchID, switchScheme.propClient.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);

            clsClient client     = new clsClient(Scheme.propClient.propClientID);
            string    ClientName = client.propForename + " " + client.propSurname;

            if (!String.IsNullOrEmpty(client.propEmailWork))
            {
                strRecepient = client.propEmailWork;
                strBody      = clsEmail.generateEmailBody((Scheme.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Scheme.propCompany.propCompany, null);
                clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, switchScheme.propSwitchID, Scheme.propClient.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
            }
            if (!String.IsNullOrEmpty(client.propEmailPersonal))
            {
                strRecepient = client.propEmailPersonal;
                strBody      = clsEmail.generateEmailBody((Scheme.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Scheme.propCompany.propCompany, null);
                clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, switchScheme.propSwitchID, Scheme.propClient.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
            }
            //}
            //catch (Exception e)
            //{
            //    Response.Write("<p>" + e.ToString() + "</p>");
            //}
        }
예제 #25
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            clsDbConnection _db = clsDbConnection.Instance;

            bool result = _db.CheckLogin(txbUser.Text, txbPass.Text);

            this.blLogado = result;

            if (result)
            {
                MessageBox.Show("Seja bem vindo!");
                clsClient _clt = clsClient.Instance;
                _clt.SetLoggedUser(txbUser.Text);
                this.Close();
            }
            else
            {
                MessageBox.Show("Usuário ou senha incorreto!");
            }
        }
예제 #26
0
        public void ValidMethodOK()
        {
            //create an instance of the class we went to create
            clsClient AClient = new clsClient();
            //boolean variable to store the results of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            String CompanyNo = "1";
            String FirstName = "Lennis";
            String LastName  = "Ngugi";
            String Email     = "*****@*****.**";
            String Position  = "Human Resource";
            String Telephone = "02454435435";
            String FaxNumber = "04554354354";

            //invoke the method
            OK = AClient.Valid(CompanyNo, FirstName, LastName, Email, Position, Telephone, FaxNumber);
            //test to see what the result is correct
            Assert.IsTrue(OK);
        }
예제 #27
0
        public void ClientFirstNameMid()
        {
            //create an instaqnce of the class we want to create
            clsClient Aclient = new clsClient();
            //boolean variable to store the results of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            string FirstName = " ";

            FirstName = FirstName.PadRight(15, 'a');
            string LastName  = "Ngugi";
            string Email     = "*****@*****.**";
            string Position  = "Human Resource";
            Int64  Telephone = 07484094234;
            Int64  FaxNumber = 04545485956;

            //invoke the method
            OK = Aclient.Valid(FirstName, LastName, Email, Position, Telephone, FaxNumber);
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
        static public clsClient SearchClient_by_RefClient(int refclient)
        {
            clsClient temp = new clsClient();

            foreach (DataRow i in mySet.Tables["Clients"].Rows)
            {
                if ((int)i["RefClient"] == refclient)
                {
                    temp.RefClient   = refclient;
                    temp.Name        = i["ClientName"].ToString();
                    temp.PhoneNumber = i["PhoneNumber"].ToString();
                    temp.EMail       = i["Email"].ToString();
                    temp.Status      = i["Status"].ToString();
                    if (temp.Status.ToString() != "Buyer")
                    {
                        temp.RefHouse = (int)i["RefHouse"];
                    }
                }
            }
            return(temp);
        }
        static public List <clsClient> All_Client()
        {
            List <clsClient> temp_list = new List <clsClient>();
            clsClient        temp;

            foreach (DataRow i in mySet.Tables["Clients"].Rows)
            {
                temp             = new clsClient();
                temp.RefClient   = (int)i["RefClient"];
                temp.Name        = i["ClientName"].ToString();
                temp.PhoneNumber = i["PhoneNumber"].ToString();
                temp.EMail       = i["Email"].ToString();
                temp.Status      = i["Status"].ToString();
                if (temp.Status.ToString() != "Buyer")
                {
                    temp.RefHouse = (int)i["RefHouse"];
                }
                temp_list.Add(temp);
            }
            return(temp_list);
        }
예제 #30
0
        protected void NotifyApprovedSwtich(clsSwitch Switch)
        {
            try
            {
                int    intIFAID = int.Parse(Session["ifaid"].ToString());
                clsIFA IFA      = new clsIFA(intIFAID);

                string     htmlTemplate = clsOutput.generateApprovedSwitch(Switch, IFA.propIFA_ID);
                StyleSheet style        = clsOutput.getStyleSheet_ApprovedSwitch();
                string     strFilename  = clsOutput.generateOutputFile(clsOutput.enumOutputType.PDF, htmlTemplate, style, Switch.propSwitchID, clsOutput.enumSwitchType.Portfolio);

                string strRecepient = IFA.propIFAEmail;
                string strSender    = "*****@*****.**";
                string strSubject   = "Switch Instruction";
                string strBody      = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyApprovedEmailReqSign" : "NotifyApprovedEmail"), null, null, null, null, null, Switch.propPortfolio.propCompany, Switch.propSwitchID.ToString());
                clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);

                clsClient client     = new clsClient(Switch.propClientID);
                string    ClientName = client.propForename + " " + client.propSurname;
                if (!String.IsNullOrEmpty(client.propEmailWork))
                {
                    strRecepient = client.propEmailWork;
                    strBody      = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Switch.propPortfolio.propCompany, null);
                    clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
                }
                if (!String.IsNullOrEmpty(client.propEmailPersonal))
                {
                    strRecepient = client.propEmailPersonal;
                    strBody      = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Switch.propPortfolio.propCompany, null);
                    clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
                }

                //:SwitchType_IFA Name_Client Name_yyyy-mm-dd.pdf
            }
            catch (Exception ex)
            {
                Response.Write("Exception Occured<br/>");
                Response.Write(String.Format("<p>{0}</p><br/>", ex.ToString()));
            }
        }
예제 #31
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        //create a new instance of clsClient
        clsClient AnClient = new clsClient();

        ////capture the clients number
        //AnClient.ClientId = txtClientId.Text;
        ////capture the clients name
        //AnClient.ClientName = txtClientName.Text;
        ////capture the billing information
        //AnClient.BillingInformation = txtBillingInformation.Text;
        ////capture the subscription type
        //AnClient.SubscriptionType = txtSubscriptionType.Text;
        ////capture the sign up date
        //AnClient.SignUpDate = txtSignUpDate.Text;
        ////capture if the client is active or not
        //AnClient.Active = txtActive.Text;
        ////store the address in the session object
        //Session["AnClient"] = AnClient;
        ////redirect to the viewer page
        //Response.Write("ClientViewer.aspx");
    }
예제 #32
0
        protected void btnBulkSwitch_Click(object sender, EventArgs e)
        {
            if (!this.txtDescription.Text.Trim().Equals(string.Empty))
            {
                clsModelPortfolio _clsModelPortfolio = new clsModelPortfolio(Portfolio(), ModelID(), ModelPortfolioID());
                _clsModelPortfolio.propModelPortfolioDesc = txtDescription.Text.Trim();
                _clsModelPortfolio.updateModelPortfolioHeader();
            }
            List <clsClient> listOfClient = new List <clsClient>();

            foreach (GridViewRow row in gvClientListInModel.Rows)
            {
                CheckBox cbox        = (CheckBox)row.FindControl("cboxSelected");
                string   strClientID = Convert.ToString(gvClientListInModel.DataKeys[row.RowIndex].Values[0]);
                if (cbox.Checked)
                {
                    clsClient oClient = new clsClient(strClientID);
                    listOfClient.Add(oClient);
                }
            }
            populateClientAndMobileNumber(listOfClient);
            mpeClientPopup.Show();
        }
 protected void btnBulkSwitch_Click(object sender, EventArgs e)
 {
     if (!this.txtDescription.Text.Trim().Equals(string.Empty))
     {
         clsModelPortfolio _clsModelPortfolio = new clsModelPortfolio(Portfolio(), ModelID(), ModelPortfolioID());
         _clsModelPortfolio.propModelPortfolioDesc = txtDescription.Text.Trim();
         _clsModelPortfolio.updateModelPortfolioHeader();
     }
     List<clsClient> listOfClient = new List<clsClient>();
     foreach (GridViewRow row in gvClientListInModel.Rows)
     {
         CheckBox cbox = (CheckBox)row.FindControl("cboxSelected");
         string strClientID = Convert.ToString(gvClientListInModel.DataKeys[row.RowIndex].Values[0]);
         if (cbox.Checked)
         {
             clsClient oClient = new clsClient(strClientID);
             listOfClient.Add(oClient);
         }
     }
     populateClientAndMobileNumber(listOfClient);
     mpeClientPopup.Show();
 }
예제 #34
0
        protected void NotifyApprovedSwtich(clsSwitch Switch)
        {
            int intIFAID = int.Parse(Session["ifaid"].ToString());
            clsIFA IFA = new clsIFA(intIFAID);

            string htmlTemplate = clsOutput.generateApprovedSwitch(Switch, IFA.propIFA_ID);
            StyleSheet style = clsOutput.getStyleSheet_ApprovedSwitch();
            string strFilename = clsOutput.generateOutputFile(clsOutput.enumOutputType.PDF, htmlTemplate, style, Switch.propSwitchID, clsOutput.enumSwitchType.Portfolio);

            string strRecepient = IFA.propIFAEmail;
            string strSender = "*****@*****.**";
            string strSubject = "Switch Instruction";
            string strBody = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyApprovedEmailReqSign" : "NotifyApprovedEmail"), null, null, null, null, null, Switch.propPortfolio.propCompany, Switch.propSwitchID.ToString());
            clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);

            clsClient client = new clsClient(Switch.propClientID);
            string ClientName = client.propForename + " " + client.propSurname;
            if (!String.IsNullOrEmpty(client.propEmailWork))
            {
                strRecepient = client.propEmailWork;
                strBody = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Switch.propPortfolio.propCompany, null);
                clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
            }
            if (!String.IsNullOrEmpty(client.propEmailPersonal))
            {
                strRecepient = client.propEmailPersonal;
                strBody = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Switch.propPortfolio.propCompany, null);
                clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
            }
        }
        protected void NotifyApprovedSwtich()
        {
            //try
            //{
                String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString();
                String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();

                clsScheme Scheme = new clsScheme(strClientID, strSchemeID);
                clsSwitchScheme switchScheme = new clsSwitchScheme(Scheme);
                string htmlTemplate = clsOutput.generateApprovedSwitchScheme(Scheme);
                StyleSheet style = clsOutput.getStyleSheet_ApprovedSwitch();
                string strFilename = clsOutput.generateOutputFile(clsOutput.enumOutputType.PDF, htmlTemplate, style, switchScheme.propSwitchID, clsOutput.enumSwitchType.Scheme);

                int intIFAID = int.Parse(Session["ifaid"].ToString());
                string strRecepient = (new clsIFA(intIFAID)).propIFAEmail;
                string strSender = "*****@*****.**";
                string strSubject = "Switch Instruction";
                string strBody = clsEmail.generateEmailBody((Scheme.propConfirmationRequired ? "NotifyApprovedEmailReqSign" : "NotifyApprovedEmail"), null, null, null, null, null, Scheme.propCompany.propCompany, switchScheme.propSwitchID.ToString());
                clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, switchScheme.propSwitchID, switchScheme.propClient.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);

                clsClient client = new clsClient(Scheme.propClient.propClientID);
                string ClientName = client.propForename + " " + client.propSurname;
                if (!String.IsNullOrEmpty(client.propEmailWork))
                {
                    strRecepient = client.propEmailWork;
                    strBody = clsEmail.generateEmailBody((Scheme.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Scheme.propCompany.propCompany, null);
                    clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, switchScheme.propSwitchID, Scheme.propClient.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
                }
                if (!String.IsNullOrEmpty(client.propEmailPersonal))
                {
                    strRecepient = client.propEmailPersonal;
                    strBody = clsEmail.generateEmailBody((Scheme.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Scheme.propCompany.propCompany, null);
                    clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, switchScheme.propSwitchID, Scheme.propClient.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
                }
            //}
            //catch (Exception e)
            //{
            //    Response.Write("<p>" + e.ToString() + "</p>");
            //}
        }
        protected void btnDeclineSwitch_Click(object sender, EventArgs e)
        {
            String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString();
            String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString();
            String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();

            clsScheme Scheme = new clsScheme(strClientID, strSchemeID);

            int intSwitchID = propSwitchID;            

            try
            {
                clsIFA IFA = new clsIFA(int.Parse(Session["ifaid"].ToString()));
                clsClient Client = new clsClient(strClientID);
                String strEmailMessage = "";

                String strRecipient = IFA.propIFAEmail;

                try
                {
                    strEmailMessage = clsEmail.generateEmailBody("ClientDeclineNotification", IFA.propIFA_Name, Client.propForename + " " + Client.propSurname, Scheme.propCompany.propCompany, null, this.txtDeclineDescription.Text.Trim(), null, null);
                }
                catch
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for declining email. Please report this error to your systems administrator');", true);
                    return;
                }

                clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client declined proposed switch", strEmailMessage, intSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientDeclinedSwitchScheme);

                clsSwitchScheme.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Declined_Client, new clsSwitch(intSwitchID).propDescription);

                int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Declined_Client);
                clsHistory.clsHistoryScheme.insertMessage(intHistoryID, strEmailMessage);

                clsSwitchScheme_Client.declineSwitch(intSwitchID);
                
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitch", "alert('This switch has been declined.'); window.location='" + this.propBackPageURL + "';", true);

            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitcherror", "alert('Error declining switch! " + ex.ToString().Replace("'", " ") + "'); window.location='" + this.propBackPageURL + "';", true);                
            }
        }
예제 #37
0
        protected void btnAmendSave_Click(object sender, EventArgs e)
        {
            captureSwitchGridviewDetails();

            strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString();
            strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();
            strPortfolioID = Session[clsSystem_Session.strSession.tempportfolioid.ToString()].ToString();

            List<clsSwitchDetails_Client> ListSwitchDetails = (List<clsSwitchDetails_Client>)Session["SwitchDetails_Client"];
            saveclientSwitch(clsSwitch.enumSwitchStatus.Saved, ListSwitchDetails[0].propSwitchID, this.txtAmendDesc.Text.Trim());

            clsPortfolio oPortfolio = new clsPortfolio(strClientID, strPortfolioID, strUserID);

            bool hasIFAPermit = oPortfolio.propPortfolioDetails[0].propSwitchIFAPermit;
            int intSwitchID = ListSwitchDetails[0].propSwitchID;

            if (hasIFAPermit)
            {                
                sendValidationCode(this.txtSMSMobileNoApproval.Text.Trim());
            }
            else
            {
                clsIFA IFA = new clsIFA(int.Parse(Session["ifaid"].ToString()));
                clsClient Client = new clsClient(strClientID);
                String strEmailMessage = "";

                try
                {
                    String strRecipient = IFA.propIFAEmail;

                    try
                    {
                        strEmailMessage = clsEmail.generateEmailBody("ClientAmendmentNotification", null, Client.propForename + " " + Client.propSurname, null, null, null, null, null);
                    }
                    catch 
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for this purpose. Please report this error to your systems administrator');", true);
                        return;
                    }
                    clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client amended proposed switch", strEmailMessage, oPortfolio.propSwitch.propSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientRequestingContact);
                    clsSwitch_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, this.txtAmendDesc.Text.Trim());
                    clsSwitch.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Amended, new clsSwitch(intSwitchID).propDescription);

                    int intHistoryID = clsHistory.insertHeader(oPortfolio.propPortfolioID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Amended);
                    clsHistory.insertDetailsClient(intHistoryID, ListSwitchDetails);
                    clsHistory.insertMessage(intHistoryID, this.txtAmendDesc.Text.Trim());

                    string backPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/" + "portfoliodetails.asp";
                    ClientScript.RegisterStartupScript(this.GetType(), "EmailAmendNotification", "alert('An email was sent to notify your IFA regarding the amendments in the proposed switch.'); window.location='" + backPageURL + "';", true);                    
                }
                catch (Exception ex)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "EmailFailedAlert", "alert('Sending failed. Error:  " + ex.Message.Replace("'", " ") + "');", true);
                    return;
                }

            }

            Session["SwitchDetails_Client"] = oPortfolio.propSwitchClient.propSwitchDetails;
            populateAmendSwitch((List<clsSwitchDetails_Client>)Session["SwitchDetails_Client"]);
        }
        protected void btnAmendSave_Click(object sender, EventArgs e)
        {
            captureSwitchGridviewDetails();

            String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();
            String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString();
            String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString();            

            saveclientSwitch(clsSwitch.enumSwitchStatus.Saved, propSwitchID, this.txtAmendDesc.Text.Trim());

            bool hasIFAPermit = (bool)Session["IFAPermit"];
            int intSwitchID = propSwitchID;

            if (hasIFAPermit)
            {
                sendValidationCode(this.txtSMSMobileNoApproval.Text.Trim());
            }
            else
            {
                clsIFA IFA = new clsIFA(int.Parse(Session["ifaid"].ToString()));
                clsClient Client = new clsClient(strClientID);
                String strEmailMessage = "";

                try
                {
                    String strRecipient = IFA.propIFAEmail;

                    try
                    {
                        strEmailMessage = clsEmail.generateEmailBody("SchemeClientAmendmentNotification", null, Client.propForename + " " + Client.propSurname, null, null, null, null, null);
                        strEmailMessage = Server.HtmlEncode(strEmailMessage);
                    }
                    catch
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for this purpose. Please report this error to your systems administrator');", true);
                        return;
                    }

                    clsSwitchScheme_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, this.txtAmendDesc.Text.Trim());
                    clsSwitchScheme.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Amended, new clsSwitchScheme(intSwitchID).propDescription);

                    clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client amended proposed scheme switch", strEmailMessage, propSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientAmendmentsNotification);

                    int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Amended);
                    clsHistory.clsHistoryScheme.insertDetailsClient(intHistoryID, new clsSwitchScheme_Client(intSwitchID).propSwitchDetailsPortfolio, false);
                    clsHistory.clsHistoryScheme.insertDetailsClient(intHistoryID, new clsSwitchScheme_Client(intSwitchID).propSwitchDetailsContribution, true);
                    clsHistory.clsHistoryScheme.insertMessage(intHistoryID, this.txtAmendDesc.Text.Trim());
                    
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "EmailAmendNotification", "alert('An email was sent to notify your IFA regarding the amendments in the proposed scheme switch.'); window.location='" + propBackPageURL + "';", true);
                }
                catch (Exception ex)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "EmailFailedAlert", "alert('" + ex + "');", true);                    
                    return;
                }

            }
        }
예제 #39
0
        protected void btnContactMeSend_Click(object sender, EventArgs e) {

            strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();
            strPortfolioID = Session[clsSystem_Session.strSession.tempportfolioid.ToString()].ToString();
            strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString();

            clsIFA IFA = new clsIFA(int.Parse(Session["ifaid"].ToString()));
            clsClient Client = new clsClient(strClientID);
            clsPortfolio Portfolio = new clsPortfolio(strClientID, strPortfolioID, strUserID);

            String strEmailMessage = "";

            try
            {
                String strRecipient = IFA.propIFAEmail;

                try 
                { 
                    strEmailMessage = clsEmail.generateEmailBody("ClientRequestContact", IFA.propIFA_Name, Client.propForename + " " + Client.propSurname,
                                                                     Portfolio.propCompany, this.txtContactMeByTel.Text.Trim(), this.txtContactMeComments.Text.Trim(), null, null);
                }
                catch
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for this purpose. Please report this error to your systems administrator');", true);
                    return;
                }
                

                clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client request", strEmailMessage, Portfolio.propSwitch.propSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientRequestingContact);                

                clsSwitch.updateSwitchHeader(Portfolio.propSwitch.propSwitchID, clsSwitch.enumSwitchStatus.Request_ForDiscussion);

                int intHistoryID = clsHistory.insertHeader(Portfolio.propPortfolioID, Portfolio.propSwitch.propSwitchID, (Int16)clsSwitch.enumSwitchStatus.Request_ForDiscussion);
                clsHistory.insertMessage(intHistoryID, strEmailMessage);

                ClientScript.RegisterStartupScript(this.GetType(), "EmailRequestContactSent", "alert('Request for contact to your IFA has been sent successfully');", true);

                populateProposedSwitch(Portfolio.propSwitch.propSwitchDetails);

                enableButtons(clsSwitch.enumSwitchStatus.Request_ForDiscussion);

            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "EmailFailedAlert", "alert('Sending failed. Error:  " + ex.Message.Replace("'", " ") + "');", true);
                return;
            }

        }
예제 #40
0
        protected void btnDeclineSwitch_Click(object sender, EventArgs e)
        {
            strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString();
            strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString();
            strPortfolioID = Session[clsSystem_Session.strSession.tempportfolioid.ToString()].ToString();

            clsPortfolio oPortfolio = new clsPortfolio(strClientID, strPortfolioID, strUserID);

            int intSwitchID = (int)ViewState["intSwitchID"];

            string backPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/" + "portfoliodetails.asp";

            try
            {
                clsIFA IFA = new clsIFA(int.Parse(Session["ifaid"].ToString()));
                clsClient Client = new clsClient(strClientID);
                String strEmailMessage = "";

                String strRecipient = IFA.propIFAEmail;

                try
                {
                    strEmailMessage = clsEmail.generateEmailBody("ClientDeclineNotification", IFA.propIFA_Name, Client.propForename + " " + Client.propSurname, oPortfolio.propCompany, null, this.txtDeclineDescription.Text.Trim(), null, null);
                }
                catch
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for declining email. Please report this error to your systems administrator');", true);
                    return;
                }

                clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client declined proposed switch", strEmailMessage, intSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientDeclinedSwitchPortfolio);
                
                clsSwitch.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Declined_Client, new clsSwitch(intSwitchID).propDescription);

                int intHistoryID = clsHistory.insertHeader(oPortfolio.propPortfolioID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Declined_Client);                
                clsHistory.insertMessage(intHistoryID, strEmailMessage);

                clsSwitch_Client.declineSwitch(intSwitchID);
                
                ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitch", "alert('This switch has been declined.'); window.location='" + backPageURL + "';", true);

            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitcherror", "alert('Error declining switch! " + ex.ToString().Replace("'", " ") + "'); window.location='" + backPageURL + "';", true);
            }
        }
예제 #41
0
        private void addNewFund(int intNewFundID, Boolean isContribution)
        {

            captureSwitchGridviewDetails();

            string strSessionDetailsSet = isContribution ? "listSwitchContributionDetails" : "listSwitchDetails";

            List<clsSwitchScheme.clsSwitchSchemeDetails> currentListSwitchDetails = (List<clsSwitchScheme.clsSwitchSchemeDetails>)Session[strSessionDetailsSet];
            String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString();
            clsClient Client = new clsClient(Session[clsSystem_Session.strSession.clientID.ToString()].ToString());

            List<clsSwitchScheme.clsSwitchSchemeDetails> newListSwitchDetails = new List<clsSwitchScheme.clsSwitchSchemeDetails>();

            try
            {
                newListSwitchDetails = clsSwitchScheme.clsSwitchSchemeDetails.addFund(intNewFundID, currentListSwitchDetails, Client.propClientID, Client.propCurrency, strUserID, false);

                Session[strSessionDetailsSet] = newListSwitchDetails;

                populate(newListSwitchDetails, isContribution);

            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "errDuplicateDund", "alert('" + ex.Message + "');", true);
                populate((List<clsSwitchScheme.clsSwitchSchemeDetails>)Session[strSessionDetailsSet], isContribution);
                return;
            }        
        }
예제 #42
0
        protected void NotifyApprovedSwtich(clsPortfolio Portfolio)
        {
            //try
            //{
                int intIFAID = int.Parse(Session["ifaid"].ToString());
                clsIFA IFA = new clsIFA(intIFAID);

                string htmlTemplate = clsOutput.generateApprovedSwitch(Portfolio, IFA.propIFA_ID);
                StyleSheet style = clsOutput.getStyleSheet_ApprovedSwitch();
                string strFilename = clsOutput.generateOutputFile(clsOutput.enumOutputType.PDF, htmlTemplate, style, Portfolio.propSwitch.propSwitchID, clsOutput.enumSwitchType.Portfolio);

                string strRecepient = IFA.propIFAEmail;
                string strSender = "*****@*****.**";
                string strSubject = "Switch Instruction";
                string strBody = clsEmail.generateEmailBody(((new clsCompany(Portfolio.propCompanyID)).propSignedConfirmation ? "NotifyApprovedEmailReqSign" : "NotifyApprovedEmail"), null, null, null, null, null, Portfolio.propCompany, Portfolio.propSwitch.propSwitchID.ToString());
                clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Portfolio.propSwitch.propSwitchID, Portfolio.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);

                clsClient client = new clsClient(Portfolio.propClientID);
                string ClientName = client.propForename + " " + client.propSurname;
                if (!String.IsNullOrEmpty(client.propEmailWork))
                {
                    strRecepient = client.propEmailWork;
                    strBody = clsEmail.generateEmailBody(((new clsCompany(Portfolio.propCompanyID)).propSignedConfirmation ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Portfolio.propCompany, null);
                    clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Portfolio.propSwitch.propSwitchID, Portfolio.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
                }
                if (!String.IsNullOrEmpty(client.propEmailPersonal))
                {
                    strRecepient = client.propEmailPersonal;
                    strBody = clsEmail.generateEmailBody(((new clsCompany(Portfolio.propCompanyID)).propSignedConfirmation ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Portfolio.propCompany, null);
                    clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Portfolio.propSwitch.propSwitchID, Portfolio.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename);
                }

                //:SwitchType_IFA Name_Client Name_yyyy-mm-dd.pdf
            //}
            //catch (Exception ex)
            //{
            //    Response.Write("Exception Occured<br/>");
            //    Response.Write(String.Format("<p>{0}</p><br/>", ex.ToString()));
            //}
        }
예제 #43
0
        private void addNewFund(int intNewFundID)
        {
            captureSwitchGridviewDetails();

            List<clsSwitchDetails_Client> currentListSwitchDetails = (List<clsSwitchDetails_Client>)Session["SwitchDetails_Client"];
            String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString();
            clsClient Client = new clsClient(Session[clsSystem_Session.strSession.clientID.ToString()].ToString());

            List<clsSwitchDetails_Client> newListSwitchDetails = new List<clsSwitchDetails_Client>();

            try
            {
                newListSwitchDetails = clsSwitchDetails_Client.addFund(intNewFundID, currentListSwitchDetails, Client.propClientID, Client.propCurrency, strUserID);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "errDuplicateDund", "alert('" + ex.Message + "');", true);
                return;
            }

            Session["SwitchDetails_Client"] = newListSwitchDetails;

            populateAmendSwitch(newListSwitchDetails);

        }