public int CountAdvisorLOB()
        {
            //  advisorVo = (AdvisorVo)Session["advisorVo"];

            AdvisorLOBBo advisorLOBBo     = new AdvisorLOBBo();
            DataSet      dsAdvisorLOBList = null;
            int          count;

            try
            {
                dsAdvisorLOBList = advisorLOBBo.GetAdvisorLOBs(advisorVo.advisorId, null, null);
                count            = dsAdvisorLOBList.Tables[0].Rows.Count;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "AdvisorDashBoard.ascx:CountAdvisorLOB()");


                object[] objects = new object[2];
                objects[0] = advisorLOBBo;
                objects[1] = dsAdvisorLOBList;


                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(count);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //btnSubmit.Attributes.Add("onclick", "Validation('" + ddlStatus.ClientID + "');");
            SessionBo.CheckSession();
            if (!IsPostBack)
            {
                BindCategory();
                BindStatus();
            }
            if (Session["IFFAdd"] != null)
            {
                if (Session["IFFAdd"].ToString() == "Edit")
                {
                    try
                    {
                        hidStatus.Value         = "1";
                        btnAddLOB.Visible       = true;
                        btnSendLoginId.Visible  = true;
                        lblIFFAdd.Text          = "Edit IFF";
                        btnSubmit.Text          = "Update";
                        Deactivation.Visible    = false;
                        lblDeactivation.Visible = false;
                        advisorVo = (AdvisorVo)Session["advisorVo"];
                        userVo    = (UserVo)Session["iffUserVo"];
                        //advisorVo = advisorBo.GetAdvisor(advisorVo.advisorId);
                        txtDeactivationDate.Text = advisorVo.DeactivationDate.ToShortDateString();
                        txtAddressLine1.Text     = advisorVo.AddressLine1;
                        txtAddressLine2.Text     = advisorVo.AddressLine2;
                        txtAddressLine3.Text     = advisorVo.AddressLine3;
                        txtCity.Text             = advisorVo.City;
                        txtContactPerson.Text    = advisorVo.ContactPersonFirstName;
                        txtCountry.Text          = advisorVo.Country;
                        txtEmailId.Text          = advisorVo.Email;
                        txtLoginId.Text          = advisorVo.LoginId;
                        txtMobileNo.Text         = advisorVo.MobileNumber.ToString();
                        txtNameofIFF.Text        = advisorVo.OrganizationName;
                        txtPinCode.Text          = advisorVo.PinCode.ToString();
                        txtTelephoneNumber.Text  = advisorVo.Phone1Number.ToString();
                        btnSendLoginId.Text      = "Reset/Send Login Id";
                        if (advisorVo.IsActive == 1)
                        {
                            ddlStatus.SelectedIndex = 0;
                            Activation.Visible      = true;
                            lblActivation.Visible   = true;
                            //lblActivation.Style.Add("display", "block");
                        }
                        else
                        {
                            ddlStatus.SelectedIndex = 1;
                            Activation.Visible      = false;
                            lblActivation.Visible   = false;
                            Deactivation.Visible    = true;
                            lblDeactivation.Visible = true;
                        }

                        if (advisorVo.Category != null)
                        {
                            for (int i = 0; i < ddlCategory.Items.Count; i++)
                            {
                                if (ddlCategory.Items[i].Text == advisorVo.Category)
                                {
                                    ddlCategory.Items[i].Selected = true;
                                }
                                else
                                {
                                    ddlCategory.Items[i].Selected = false;
                                }
                            }
                        }
                        else
                        {
                            ddlCategory.SelectedIndex = 0;
                        }

                        DataSet dsadvisorLOB = advisorLOBBo.GetAdvisorLOBs(advisorVo.advisorId, null, null);

                        showLOBList(advisorVo.advisorId);
                        if (dsadvisorLOB != null)
                        {
                            for (int i = 0; i < dsadvisorLOB.Tables[0].Rows.Count; i++)
                            {
                                if (dsadvisorLOB.Tables[0].Rows[i]["AL_IsDependent"].ToString() == "1")
                                {
                                    GridValidationForIsDependent(i);
                                }
                            }
                        }
                        txtActivationDate.Text   = advisorVo.ActivationDate.ToShortDateString();
                        txtActivationHidden.Text = advisorVo.ActivationDate.ToShortDateString();
                        dateCompareValidator.EnableClientScript = false;
                        dateCompareValidator.ControlToCompare   = "txtActivationHidden";
                        dateCompareValidator.ControlToValidate  = "txtDeactivationDate";
                        dateCompareValidator.Type         = ValidationDataType.Date;
                        dateCompareValidator.Operator     = ValidationCompareOperator.GreaterThan;
                        dateCompareValidator.ErrorMessage = "Deactivation Date should not be less than Activation Date";
                        if (advisorVo.IsActive == 1)
                        {
                            if (txtDeactivationDate.Text == "01/01/1900")
                            {
                                calExeDeactivationDate.SelectedDate = DateTime.Now;
                            }
                        }
                        else
                        {
                            if (txtActivationDate.Text == "01/01/1900")
                            {
                                calExeActivationDate.SelectedDate = DateTime.Now;
                            }
                        }
                    }

                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                else if (Session["IFFAdd"].ToString() == "Add")
                {
                    hidStatus.Value          = "0";
                    Deactivation.Visible     = false;
                    lblDeactivation.Visible  = false;
                    txtDeactivationDate.Text = "";
                    txtAddressLine1.Text     = "";
                    txtAddressLine2.Text     = "";
                    txtAddressLine3.Text     = "";
                    txtCity.Text             = "";
                    txtContactPerson.Text    = "";
                    txtCountry.Text          = "";
                    txtEmailId.Text          = "";
                    txtLoginId.Text          = "";
                    txtMobileNo.Text         = "";
                    txtNameofIFF.Text        = "";
                    txtPinCode.Text          = "";
                    Deactivation.Visible     = false;
                    lblDeactivation.Visible  = false;
                    txtTelephoneNumber.Text  = "";

                    //advisorVo = (AdvisorVo)Session["LOBAdvisorVo"];
                    if (Session["IDs"] != null)
                    {
                        btnAddLOB.Visible          = true;
                        btnSendLoginId.Visible     = true;
                        btnSubmit.Text             = "Update";
                        IsAddUpdate                = true;
                        ddlStatus.Items[1].Enabled = true;
                        advisorVo = (AdvisorVo)Session["advisorVo"];
                        DataRepopulating();
                    }
                    else
                    {
                        btnAddLOB.Visible          = false;
                        btnSendLoginId.Visible     = false;
                        ddlStatus.Items[1].Enabled = false;
                        if (!IsPostBack)
                        {
                            calExeActivationDate.SelectedDate   = DateTime.Now;
                            calExeDeactivationDate.SelectedDate = DateTime.Now;
                        }
                    }
                    if (advisorVo != null)
                    {
                        showLOBList(advisorVo.advisorId);
                    }
                    else
                    {
                        gvLOBList.DataSource = null;
                    }
                }
            }
        }
        public void showLOBList()
        {
            string path = "";
            string classificationCode = "";

            try
            {
                advisorVo = (AdvisorVo)Session["advisorVo"];


                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());

                advisorLOBList = advisorLOBBo.GetAdvisorLOBs(advisorVo.advisorId, null, null);

                if (advisorLOBList.Tables[0].Rows.Count > 0)
                {
                    gvLOBList.Visible    = true;
                    ErrorMessage.Visible = false;

                    DataTable dtAdvisorLOB = new DataTable();
                    dtAdvisorLOB.Columns.Add("SI.No");
                    dtAdvisorLOB.Columns.Add("LOBId");
                    dtAdvisorLOB.Columns.Add("Broker Name");
                    dtAdvisorLOB.Columns.Add("Business Type");
                    dtAdvisorLOB.Columns.Add("Identifier");
                    dtAdvisorLOB.Columns.Add("Identifier Type");

                    DataRow drAdvisorLOB;

                    for (int i = 0; i < advisorLOBList.Tables[0].Rows.Count; i++)
                    {
                        classificationCode = advisorLOBList.Tables[0].Rows[i]["XALC_LOBClassificationCode"].ToString();
                        drAdvisorLOB       = dtAdvisorLOB.NewRow();

                        drAdvisorLOB[0] = (i + 1).ToString();
                        drAdvisorLOB[1] = advisorLOBList.Tables[0].Rows[i]["AL_LOBId"].ToString();
                        drAdvisorLOB[2] = advisorLOBList.Tables[0].Rows[i]["AL_OrgName"].ToString();
                        drAdvisorLOB[3] = XMLBo.GetLOBType(path, advisorLOBList.Tables[0].Rows[i]["XALC_LOBClassificationCode"].ToString());
                        if (classificationCode == "LDSA" || classificationCode == "LFIA" || classificationCode == "LIAG" || classificationCode == "LPAG" || classificationCode == "LREA")
                        {
                            drAdvisorLOB[4] = advisorLOBList.Tables[0].Rows[i]["AL_AgentNo"].ToString();
                            drAdvisorLOB[5] = "Agent No./Agency Code";
                        }
                        else
                        {
                            drAdvisorLOB[4] = advisorLOBList.Tables[0].Rows[i]["AL_Identifier"].ToString();
                            drAdvisorLOB[5] = advisorLOBList.Tables[0].Rows[i]["XALIT_IdentifierTypeCode"].ToString();
                        }
                        dtAdvisorLOB.Rows.Add(drAdvisorLOB);
                    }
                    if (dtAdvisorLOB.Rows.Count > 10)
                    {
                        gvLOBList.ShowFooter = false;
                    }
                    else
                    {
                        gvLOBList.ShowFooter = true;
                    }
                    gvLOBList.DataSource = dtAdvisorLOB;
                    gvLOBList.DataBind();
                }
                else
                {
                    gvLOBList.Visible    = false;
                    ErrorMessage.Visible = true;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "ViewLOB.ascx:showLOBList()");


                object[] objects = new object[4];
                objects[0] = advisorVo;
                objects[1] = path;
                objects[2] = advisorLOBVo;
                objects[3] = advisorLOBList;


                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        public void  setAdvisorLOB()
        {
            advisorVo = (AdvisorVo)Session["advisorVo"];
            AdvisorLOBBo advisorLOBBo     = new AdvisorLOBBo();
            DataSet      dsAdvisorLOBList = null;
            AdvisorLOBVo advisorLOBVo     = null;

            string path;

            try
            {
                path             = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                dsAdvisorLOBList = advisorLOBBo.GetAdvisorLOBs(advisorVo.advisorId, null, null);
                //DataTable dtAdvisorLOB = new DataTable();
                //dtAdvisorLOB.Columns.Add("SI.No");
                //dtAdvisorLOB.Columns.Add("Organization Name");
                //dtAdvisorLOB.Columns.Add("Business Type");

                //DataRow drAdvisorLOB;

                //for (int i = 0; i < dsAdvisorLOBList.Count; i++)
                //{
                //    drAdvisorLOB = dtAdvisorLOB.NewRow();
                //    advisorLOBVo = new AdvisorLOBVo();
                //    advisorLOBVo = dsAdvisorLOBList[i];
                //    drAdvisorLOB[0] = (i + 1).ToString();
                //    drAdvisorLOB[1] = advisorLOBVo.OrganizationName.ToString();
                //    drAdvisorLOB[2] = XMLBo.GetLOBType(path, advisorLOBVo.LOBClassificationCode.ToString());

                //    dtAdvisorLOB.Rows.Add(drAdvisorLOB);
                //}
                if (dsAdvisorLOBList.Tables[0].Rows.Count > 0)
                {
                    gvAdvisorLOB.DataSource = dsAdvisorLOBList.Tables[0];
                    gvAdvisorLOB.DataBind();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "AdvisorDashBoard.ascx:setAdvisorLOB()");


                object[] objects = new object[4];
                objects[0] = advisorLOBBo;
                objects[1] = dsAdvisorLOBList;
                objects[2] = advisorVo;
                objects[3] = advisorLOBVo;


                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }