Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                if (Request["__EVENTARGUMENT"] == "SaveModelSwitchDetails")
                {
                    btnSave_Click();
                }
                else if (Request["__EVENTARGUMENT"] == "ChangeFund")
                {
                    replaceFund(int.Parse(this.hfFundIDOrig.Value), int.Parse(this.hfFundIDNew.Value));
                }
                else if (Request["__EVENTARGUMENT"] == "AddMoreFund")
                {
                    addNewFund(int.Parse(this.hfFundIDNew.Value));
                }
            }
            else
            {
                Session["SourcePage"] = string.Format("/MP/details.asp?MID={0}&MPID={1}", ModelGroupID(), ModelPortfolioID());

                clsPortfolio oPortfolio = new clsPortfolio(ModelGroupID(), ModelPortfolioID(), UserID());
                populateHeader(oPortfolio);
                populateDetails(oPortfolio.propPortfolioDetails);
                clsModelGroup     _clsModelGroup     = new clsModelGroup(Portfolio(), ModelGroupID(), ModelPortfolioID(), IFA_ID());
                clsModelPortfolio _clsModelPortfolio = _clsModelGroup.propModelPortfolio;
                populateSwitchDetails(_clsModelPortfolio.propModelPortfolioDetails);
            }
        }
Пример #2
0
        protected void SortClientList(object sender, EventArgs e)
        {
            LinkButton          oClick              = (LinkButton)sender;
            clsModelGroup       _clsModelGroup      = new clsModelGroup(Portfolio(), ModelID(), ModelPortfolioID(), IFA_ID());
            clsModelPortfolio   _clsModelPortfolio  = _clsModelGroup.propModelPortfolio;
            List <clsPortfolio> clientListWithModel = clsPortfolio.getClientListWithModel(IFA_ID(), _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID(), oClick.CommandName);

            populateModelClientList(clientListWithModel);
        }
Пример #3
0
        protected void btnOkDescription_Click(object sender, EventArgs e)
        {
            saveSwitch();
            clsModelGroup _clsModelGroup = new clsModelGroup(Portfolio(), ModelGroupID(), ModelPortfolioID(), IFA_ID());

            _clsModelGroup.propModelPortfolio.propModelPortfolioDesc = txtDescription.Text.Trim();
            _clsModelGroup.propModelPortfolio.updateModelPortfolioHeader();
            Response.Redirect("SwitchBulkClientList.aspx");
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ((NAV)this.Page.Master).FindControl("btnBack_Classic").Visible = false;

                clsModelGroup     _clsModelGroup     = new clsModelGroup(Portfolio(), ModelID(), ModelPortfolioID(), IFA_ID());
                clsModelPortfolio _clsModelPortfolio = _clsModelGroup.propModelPortfolio;

                List <clsPortfolio> clientListWithModel = clsPortfolio.getClientListWithModel(IFA_ID(), _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID(), string.Empty);
                populateModelClientList(clientListWithModel);
            }
        }
Пример #5
0
        private void saveSwitch()
        {
            captureSwitchGridviewDetails();
            List <clsModelPortfolioDetails> newListSwitchDetails = (List <clsModelPortfolioDetails>)Session["ModelPortfolioDetails"];

            clsModelGroup            _clsModelGroup            = new clsModelGroup(Portfolio(), ModelGroupID(), ModelPortfolioID(), IFA_ID());
            int                      result                    = _clsModelGroup.saveModelGroupSwitch();
            int                      intModelID                = _clsModelGroup.propModelPortfolio.saveModelPortfolioSwitch();
            clsModelPortfolioDetails _clsModelPortfolioDetails = new clsModelPortfolioDetails();

            clsModelPortfolioDetails.deleteModelPortfolioDetails(IFA_ID(), intModelID, ModelGroupID(), ModelPortfolioID());
            _clsModelPortfolioDetails.saveModelPortfolioDetails(newListSwitchDetails, IFA_ID(), intModelID, ModelGroupID(), ModelPortfolioID());
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                if (Request["__EVENTARGUMENT"] == "SaveModelSwitchDetails") { btnSave_Click(); }
                else if (Request["__EVENTARGUMENT"] == "ChangeFund") { replaceFund(int.Parse(this.hfFundIDOrig.Value), int.Parse(this.hfFundIDNew.Value)); }
                else if (Request["__EVENTARGUMENT"] == "AddMoreFund") { addNewFund(int.Parse(this.hfFundIDNew.Value)); }
            }
            else
            {
                Session["SourcePage"] = string.Format("/MP/details.asp?MID={0}&MPID={1}", ModelGroupID(), ModelPortfolioID());

                clsPortfolio oPortfolio = new clsPortfolio(ModelGroupID(), ModelPortfolioID(), UserID());
                populateHeader(oPortfolio);
                populateDetails(oPortfolio.propPortfolioDetails);
                clsModelGroup _clsModelGroup = new clsModelGroup(Portfolio(), ModelGroupID(), ModelPortfolioID(), IFA_ID());
                clsModelPortfolio _clsModelPortfolio = _clsModelGroup.propModelPortfolio;
                populateSwitchDetails(_clsModelPortfolio.propModelPortfolioDetails);
            }
        }
Пример #7
0
        protected void btnProceedBulkSwitch_Click(object sender, EventArgs e)
        {
            clsModelGroup     _clsModelGroup     = new clsModelGroup(Portfolio(), ModelID(), ModelPortfolioID(), IFA_ID());
            clsModelPortfolio _clsModelPortfolio = _clsModelGroup.propModelPortfolio;

            foreach (GridViewRow row in gvClientAndMobileNumberList.Rows)
            {
                TextBox txtMobileNumber = (TextBox)row.FindControl("txtMobileNumber");
                Label   lblForename     = (Label)row.FindControl("gvClientAndMobileNumberListLabelForename");
                Label   lblSurname      = (Label)row.FindControl("gvClientAndMobileNumberListLabelSurname");
                string  strClientID     = Convert.ToString(gvClientAndMobileNumberList.DataKeys[row.RowIndex].Values[0]);

                if (!txtMobileNumber.Text.Trim().Equals(string.Empty))
                {
                    processBulkSwitch(strClientID, txtMobileNumber.Text.Trim(), _clsModelPortfolio);
                }
            }
            _clsModelPortfolio.propIsConsumed = true;
            _clsModelPortfolio.updateModelPortfolioHeader();
            clsSwitchTemp.deleteSwitchTempByModel(_clsModelPortfolio.propModelID);


            string strPopupMessage = string.Empty;

            if (ViewState["SMSErrorMessage"] != null)
            {
                System.Text.StringBuilder sbErrorMessage = (System.Text.StringBuilder)ViewState["SMSErrorMessage"];
                strPopupMessage = sbErrorMessage.ToString();
            }
            else
            {
                strPopupMessage = "Bulk Switch processed successfully";
            }
            string backPageURL = string.Format("https://{0}:{1}/MP/details.asp?MID={2}&MPID={3}", Request.ServerVariables["SERVER_NAME"], Request.ServerVariables["SERVER_PORT"], ModelID(), ModelPortfolioID());

            ClientScript.RegisterStartupScript(this.GetType(), "alertPopupMessage", string.Format("alert('{0}'); window.location='{1}';", strPopupMessage, backPageURL), true);
        }
Пример #8
0
        //original function to Process Bulk Switch
        private void doBulkSwitch()
        {
            int      intSwitchID     = 0;
            string   strPopupMessage = "Message sent.";
            GridView gvClientList    = new GridView();
            List <clsSwitchDetails> clsSwitchDetailsList = new List <clsSwitchDetails>();
            clsModelGroup           _clsModelGroup       = new clsModelGroup(Portfolio(), ModelID(), ModelPortfolioID(), IFA_ID());
            clsModelPortfolio       _clsModelPortfolio   = _clsModelGroup.propModelPortfolio;

            foreach (clsModelPortfolioDetails item in _clsModelPortfolio.propModelPortfolioDetails)
            {
                clsSwitchDetails _clsSwitchDetails = new clsSwitchDetails();
                _clsSwitchDetails.propSwitchID        = 0;
                _clsSwitchDetails.propFund            = item.propFund;
                _clsSwitchDetails.propFundID          = item.propFundID;
                _clsSwitchDetails.propAllocation      = item.propAllocation;
                _clsSwitchDetails.propSwitchDetailsID = 0;
                _clsSwitchDetails.propIsDeletable     = item.propIsDeletable;

                clsSwitchDetailsList.Add(_clsSwitchDetails);
            }
            gvClientList = this.gvClientListInModel;

            clsSwitch.enumSwitchStatus enumSwitchStatus;// = (clsSwitch.enumSwitchStatus)Enum.ToObject(typeof(clsSwitch.enumSwitchStatus), intSwitchStatus);

            foreach (GridViewRow row in gvClientList.Rows)
            {
                CheckBox cbox             = (CheckBox)row.FindControl("cboxSelected");
                Label    lblSwitchID      = (Label)row.FindControl("lblSwitchID");
                Label    lblDiscretionary = (Label)row.FindControl("lblDiscretionary");
                Label    lblCustomized    = (Label)row.FindControl("lblCustomized");
                if (lblDiscretionary.Text == "Yes")
                {
                    enumSwitchStatus = clsSwitch.enumSwitchStatus.Approved;
                }
                else
                {
                    enumSwitchStatus = clsSwitch.enumSwitchStatus.Proposed;
                }

                string strClientID    = Convert.ToString(gvClientList.DataKeys[row.RowIndex].Values[0]);
                string strPortfolioID = Convert.ToString(gvClientList.DataKeys[row.RowIndex].Values[1]);

                if (cbox.Checked)
                {
                    string strMessage   = getSMSMessage(strClientID, strPortfolioID, UserID());
                    string strMobileNum = clsSMS.getMobileNumber(strClientID);
                    if (strMobileNum.Trim().Equals(string.Empty))
                    {
                        strMobileNum = "9228829490";
                    }
                    //if (sendSMS(UserID(), strMessage, strPopupMessage, strMobileNum))
                    //{
                    if (lblCustomized.Text.Trim() == "Yes")
                    {
                        intSwitchID = saveCustomizedSwitch(IFA_ID(), strClientID, strPortfolioID, UserID(), enumSwitchStatus, int.Parse(lblSwitchID.Text.Trim()), ModelID(), ModelPortfolioID());
                        clsPortfolio _clsPortfolio = new clsPortfolio(strClientID, strPortfolioID, UserID());
                        saveSwitchHistory(_clsPortfolio, intSwitchID, strPortfolioID, UserID(), enumSwitchStatus, _clsModelPortfolio.propModelPortfolioDesc);
                    }
                    else
                    {
                        clsPortfolio _clsPortfolio = new clsPortfolio(strClientID, strPortfolioID, UserID());
                        _clsPortfolio.propModelGroupID     = ModelID();
                        _clsPortfolio.propModelPortfolioID = ModelPortfolioID();
                        //_clsPortfolio.propSwitchTemp = new clsSwitchTemp(_clsPortfolio, UserID(), 1, IFA_ID(), ModelID(), ModelPortfolioID());


                        //clsModelPortfolio _clsModelPortfolio = new clsModelPortfolio(_clsPortfolio, ViewState["MGID"].ToString(), ViewState["MPID"].ToString());
                        clsSwitchTemp _clsSwitchTemp = new clsSwitchTemp();
                        //_clsSwitchTemp.propModelID = _clsModelPortfolio.propModelID;
                        _clsSwitchTemp.propModelGroupID     = _clsModelPortfolio.propModelGroupID;
                        _clsSwitchTemp.propModelPortfolioID = _clsModelPortfolio.propModelPortfolioID;
                        _clsPortfolio.propSwitchTemp        = new clsSwitchTemp(_clsPortfolio, UserID(), IFA_ID(), _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID());

                        intSwitchID = saveSwitch(strClientID, strPortfolioID, UserID(), enumSwitchStatus, int.Parse(lblSwitchID.Text.Trim()), _clsPortfolio.propSwitchTemp.propSwitchDetails, _clsModelPortfolio.propModelPortfolioDesc, _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID());

                        saveSwitchHistory(_clsPortfolio, intSwitchID, strPortfolioID, UserID(), enumSwitchStatus, _clsModelPortfolio.propModelPortfolioDesc);
                    }
                    //}
                }
            }
            _clsModelPortfolio.propIsConsumed = true;
            _clsModelPortfolio.updateModelPortfolioHeader();
            clsSwitchTemp.deleteSwitchTempByModel(_clsModelPortfolio.propModelID);

            List <clsPortfolio> clientListWithModel = clsPortfolio.getClientListWithModel(IFA_ID(), _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID(), "");

            populateModelClientList(clientListWithModel);
        }
        //original function to Process Bulk Switch
        private void doBulkSwitch()
        {
            int intSwitchID = 0;
            string strPopupMessage = "Message sent.";
            GridView gvClientList = new GridView();
            List<clsSwitchDetails> clsSwitchDetailsList = new List<clsSwitchDetails>();
            clsModelGroup _clsModelGroup = new clsModelGroup(Portfolio(), ModelID(), ModelPortfolioID(), IFA_ID());
            clsModelPortfolio _clsModelPortfolio = _clsModelGroup.propModelPortfolio;

            foreach (clsModelPortfolioDetails item in _clsModelPortfolio.propModelPortfolioDetails)
            {
                clsSwitchDetails _clsSwitchDetails = new clsSwitchDetails();
                _clsSwitchDetails.propSwitchID = 0;
                _clsSwitchDetails.propFund = item.propFund;
                _clsSwitchDetails.propFundID = item.propFundID;
                _clsSwitchDetails.propAllocation = item.propAllocation;
                _clsSwitchDetails.propSwitchDetailsID = 0;
                _clsSwitchDetails.propIsDeletable = item.propIsDeletable;

                clsSwitchDetailsList.Add(_clsSwitchDetails);
            }
            gvClientList = this.gvClientListInModel;

            clsSwitch.enumSwitchStatus enumSwitchStatus;// = (clsSwitch.enumSwitchStatus)Enum.ToObject(typeof(clsSwitch.enumSwitchStatus), intSwitchStatus);

            foreach (GridViewRow row in gvClientList.Rows)
            {
                CheckBox cbox = (CheckBox)row.FindControl("cboxSelected");
                Label lblSwitchID = (Label)row.FindControl("lblSwitchID");
                Label lblDiscretionary = (Label)row.FindControl("lblDiscretionary");
                Label lblCustomized = (Label)row.FindControl("lblCustomized");
                if (lblDiscretionary.Text == "Yes")
                {
                    enumSwitchStatus = clsSwitch.enumSwitchStatus.Approved;
                }
                else
                {
                    enumSwitchStatus = clsSwitch.enumSwitchStatus.Proposed;
                }

                string strClientID = Convert.ToString(gvClientList.DataKeys[row.RowIndex].Values[0]);
                string strPortfolioID = Convert.ToString(gvClientList.DataKeys[row.RowIndex].Values[1]);

                if (cbox.Checked)
                {
                    string strMessage = getSMSMessage(strClientID, strPortfolioID, UserID());
                    string strMobileNum = clsSMS.getMobileNumber(strClientID);
                    if (strMobileNum.Trim().Equals(string.Empty))
                    {
                        strMobileNum = "9228829490";
                    }
                    //if (sendSMS(UserID(), strMessage, strPopupMessage, strMobileNum))
                    //{
                    if (lblCustomized.Text.Trim() == "Yes")
                    {
                        intSwitchID = saveCustomizedSwitch(IFA_ID(), strClientID, strPortfolioID, UserID(), enumSwitchStatus, int.Parse(lblSwitchID.Text.Trim()), ModelID(), ModelPortfolioID());
                        clsPortfolio _clsPortfolio = new clsPortfolio(strClientID, strPortfolioID, UserID());
                        saveSwitchHistory(_clsPortfolio, intSwitchID, strPortfolioID, UserID(), enumSwitchStatus, _clsModelPortfolio.propModelPortfolioDesc);
                    }
                    else
                    {
                        clsPortfolio _clsPortfolio = new clsPortfolio(strClientID, strPortfolioID, UserID());
                        _clsPortfolio.propModelGroupID = ModelID();
                        _clsPortfolio.propModelPortfolioID = ModelPortfolioID();
                        //_clsPortfolio.propSwitchTemp = new clsSwitchTemp(_clsPortfolio, UserID(), 1, IFA_ID(), ModelID(), ModelPortfolioID());


                        //clsModelPortfolio _clsModelPortfolio = new clsModelPortfolio(_clsPortfolio, ViewState["MGID"].ToString(), ViewState["MPID"].ToString());
                        clsSwitchTemp _clsSwitchTemp = new clsSwitchTemp();
                        //_clsSwitchTemp.propModelID = _clsModelPortfolio.propModelID;
                        _clsSwitchTemp.propModelGroupID = _clsModelPortfolio.propModelGroupID;
                        _clsSwitchTemp.propModelPortfolioID = _clsModelPortfolio.propModelPortfolioID;
                        _clsPortfolio.propSwitchTemp = new clsSwitchTemp(_clsPortfolio, UserID(), IFA_ID(), _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID());

                        intSwitchID = saveSwitch(strClientID, strPortfolioID, UserID(), enumSwitchStatus, int.Parse(lblSwitchID.Text.Trim()), _clsPortfolio.propSwitchTemp.propSwitchDetails, _clsModelPortfolio.propModelPortfolioDesc, _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID());

                        saveSwitchHistory(_clsPortfolio, intSwitchID, strPortfolioID, UserID(), enumSwitchStatus, _clsModelPortfolio.propModelPortfolioDesc);
                    }
                    //}
                }
            }
            _clsModelPortfolio.propIsConsumed = true;
            _clsModelPortfolio.updateModelPortfolioHeader();
            clsSwitchTemp.deleteSwitchTempByModel(_clsModelPortfolio.propModelID);

            List<clsPortfolio> clientListWithModel = clsPortfolio.getClientListWithModel(IFA_ID(), _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID(), "");
            populateModelClientList(clientListWithModel);
        }
 protected void SortClientList(object sender, EventArgs e)
 {
     LinkButton oClick = (LinkButton)sender;
     clsModelGroup _clsModelGroup = new clsModelGroup(Portfolio(), ModelID(), ModelPortfolioID(), IFA_ID());
     clsModelPortfolio _clsModelPortfolio = _clsModelGroup.propModelPortfolio;
     List<clsPortfolio> clientListWithModel = clsPortfolio.getClientListWithModel(IFA_ID(), _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID(), oClick.CommandName);
     populateModelClientList(clientListWithModel);
 }
        protected void btnProceedBulkSwitch_Click(object sender, EventArgs e)
        {
            clsModelGroup _clsModelGroup = new clsModelGroup(Portfolio(), ModelID(), ModelPortfolioID(), IFA_ID());
            clsModelPortfolio _clsModelPortfolio = _clsModelGroup.propModelPortfolio;

            foreach (GridViewRow row in gvClientAndMobileNumberList.Rows)
            {
                TextBox txtMobileNumber = (TextBox)row.FindControl("txtMobileNumber");
                Label lblForename = (Label)row.FindControl("gvClientAndMobileNumberListLabelForename");
                Label lblSurname = (Label)row.FindControl("gvClientAndMobileNumberListLabelSurname");
                string strClientID = Convert.ToString(gvClientAndMobileNumberList.DataKeys[row.RowIndex].Values[0]);

                if (!txtMobileNumber.Text.Trim().Equals(string.Empty))
                {
                    processBulkSwitch(strClientID, txtMobileNumber.Text.Trim(), _clsModelPortfolio);
                }
            }
            _clsModelPortfolio.propIsConsumed = true;
            _clsModelPortfolio.updateModelPortfolioHeader();
            clsSwitchTemp.deleteSwitchTempByModel(_clsModelPortfolio.propModelID);


            string strPopupMessage = string.Empty;
            if (ViewState["SMSErrorMessage"] != null)
            {
                System.Text.StringBuilder sbErrorMessage = (System.Text.StringBuilder)ViewState["SMSErrorMessage"];
                strPopupMessage = sbErrorMessage.ToString();
            }
            else
            {
                strPopupMessage = "Bulk Switch processed successfully";
            }
            string backPageURL = string.Format("https://{0}:{1}/MP/details.asp?MID={2}&MPID={3}", Request.ServerVariables["SERVER_NAME"], Request.ServerVariables["SERVER_PORT"], ModelID(), ModelPortfolioID());            
            ClientScript.RegisterStartupScript(this.GetType(), "alertPopupMessage", string.Format("alert('{0}'); window.location='{1}';", strPopupMessage, backPageURL), true);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ((NAV)this.Page.Master).FindControl("btnBack_Classic").Visible = false;

                clsModelGroup _clsModelGroup = new clsModelGroup(Portfolio(), ModelID(), ModelPortfolioID(), IFA_ID());
                clsModelPortfolio _clsModelPortfolio = _clsModelGroup.propModelPortfolio;

                List<clsPortfolio> clientListWithModel = clsPortfolio.getClientListWithModel(IFA_ID(), _clsModelPortfolio.propModelID, ModelID(), ModelPortfolioID(), string.Empty);
                populateModelClientList(clientListWithModel);
            }
        }
Пример #13
0
 protected void btnOkDescription_Click(object sender, EventArgs e)
 {
     saveSwitch();
     clsModelGroup _clsModelGroup = new clsModelGroup(Portfolio(), ModelGroupID(), ModelPortfolioID(), IFA_ID());
     _clsModelGroup.propModelPortfolio.propModelPortfolioDesc = txtDescription.Text.Trim();
     _clsModelGroup.propModelPortfolio.updateModelPortfolioHeader();
     Response.Redirect("SwitchBulkClientList.aspx");
 }
Пример #14
0
        private void saveSwitch()
        {
            captureSwitchGridviewDetails();
            List<clsModelPortfolioDetails> newListSwitchDetails = (List<clsModelPortfolioDetails>)Session["ModelPortfolioDetails"];

            clsModelGroup _clsModelGroup = new clsModelGroup(Portfolio(), ModelGroupID(), ModelPortfolioID(), IFA_ID());
            int result = _clsModelGroup.saveModelGroupSwitch();
            int intModelID = _clsModelGroup.propModelPortfolio.saveModelPortfolioSwitch();
            clsModelPortfolioDetails _clsModelPortfolioDetails = new clsModelPortfolioDetails();
            clsModelPortfolioDetails.deleteModelPortfolioDetails(IFA_ID(), intModelID, ModelGroupID(), ModelPortfolioID());
            _clsModelPortfolioDetails.saveModelPortfolioDetails(newListSwitchDetails, IFA_ID(), intModelID, ModelGroupID(), ModelPortfolioID());
        }