private void BindBranchDropDown()
        {
            try
            {
                UploadCommonBo uploadsCommonDao = new UploadCommonBo();
                DataSet        ds = uploadsCommonDao.GetAdviserBranchList(advisorVo.advisorId, "adviser");
                if (ds != null)
                {
                    ddlBranch.DataSource     = ds;
                    ddlBranch.DataValueField = ds.Tables[0].Columns["AB_BranchId"].ToString();
                    ddlBranch.DataTextField  = ds.Tables[0].Columns["AB_BranchName"].ToString();
                    ddlBranch.DataBind();
                }
                ddlBranch.Items.Insert(0, new System.Web.UI.WebControls.ListItem("All", "All"));
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "RMCustomerAMCSchemewiseMIS.ascx:BindBranchDropDown()");

                object[] objects = new object[4];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        private void BindBranchDropDown(int id)
        {
            try
            {
                UploadCommonBo uploadCommonBo = new UploadCommonBo();
                DataSet        ds             = uploadCommonBo.GetAdviserBranchList(id, currentUserRole);

                ddlBMBranch.DataSource     = ds.Tables[0];
                ddlBMBranch.DataTextField  = "AB_BranchName";
                ddlBMBranch.DataValueField = "AB_BranchId";
                ddlBMBranch.DataBind();
                if (ds.Tables[0].Rows.Count > 1)
                {
                    ddlBMBranch.Items.Insert(0, new System.Web.UI.WebControls.ListItem("All", id.ToString()));
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "BMDashBoard.ascx:BindBranchDropDown()");

                object[] objects = new object[4];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        private void BindListBranch(int Id, string userType)
        {
            UploadCommonBo uploadCommonBo = new UploadCommonBo();
            DataSet        ds             = uploadCommonBo.GetAdviserBranchList(Id, userType);

            ddlAdviserBranchList.DataSource     = ds.Tables[0];
            ddlAdviserBranchList.DataTextField  = "AB_BranchName";
            ddlAdviserBranchList.DataValueField = "AB_BranchId";
            ddlAdviserBranchList.DataBind();
            ddlAdviserBranchList.Items.Insert(0, new ListItem("Select a Branch", "Select a Branch"));
        }
        //private void BindListBranch(int rmId, string userType)
        //{
        //    UploadCommonBo uploadCommonBo = new UploadCommonBo();
        //    //DataSet ds = uploadCommonBo.GetAdviserBranchList(rmId, userType);
        //    DataSet dsAssociatedBranch=advisorBranchBo.GetRMBranchAssociation(rmVo.RMId, 0, "A");
        //    if (dsAssociatedBranch!=null && dsAssociatedBranch.Tables[0].Rows.Count > 0)
        //    {
        //        ddlAdviserBranchList.DataSource = dsAssociatedBranch.Tables[0];
        //        ddlAdviserBranchList.DataTextField = "AB_BranchName";
        //        ddlAdviserBranchList.DataValueField = "AB_BranchId";
        //        ddlAdviserBranchList.DataBind();
        //        ddlAdviserBranchList.Items.Insert(0, new ListItem("Select a Branch", "Select a Branch"));
        //    }
        //    else
        //    {
        //        ddlAdviserBranchList.Items.Insert(0, new ListItem("No Branches Available to Associate", "No Branches Available to Associate"));
        //        ddlAdviserBranchList_CompareValidator2.ValueToCompare = "No Branches Available to Associate";
        //        ddlAdviserBranchList_CompareValidator2.ErrorMessage = "Cannot Add Customer Without a Branch";
        //    }
        //}
        private void BindListBranch()
        {
            if (advisorVo.A_AgentCodeBased != 1)
            {
                UploadCommonBo uploadCommonBo = new UploadCommonBo();
                DataSet        ds             = uploadCommonBo.GetAdviserBranchList(advisorVo.advisorId, "adviser");
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    ddlAdviserBranchList.DataSource     = ds.Tables[0];
                    ddlAdviserBranchList.DataTextField  = "AB_BranchName";
                    ddlAdviserBranchList.DataValueField = "AB_BranchId";
                    //ddlAdviserBranchList.SelectedValue = "1339";
                    ddlAdviserBranchList.DataBind();
                    ddlAdviserBranchList.Items.Insert(0, new ListItem("Select", "Select"));
                }
                else
                {
                    ddlAdviserBranchList.Items.Insert(0, new ListItem("No Branches Available to Associate", "No Branches Available to Associate"));
                    ddlAdviserBranchList_CompareValidator2.ValueToCompare = "No Branches Available to Associate";
                    ddlAdviserBranchList_CompareValidator2.ErrorMessage   = "Cannot Add Customer Without a Branch";
                }
            }
            else
            {
                DataSet   BMDs   = new DataSet();
                DataTable BMList = new DataTable();
                //BMList.Columns.Add("AB_BranchId");
                //BMList.Columns.Add("AB_BranchName");
                BMDs = advisorBranchBo.GetBMRoleForAgentBased(advisorVo.advisorId);

                if (BMDs.Tables[0].Rows.Count > 0)
                {
                    ddlAdviserBranchList.DataSource     = BMDs;
                    ddlAdviserBranchList.DataValueField = BMDs.Tables[0].Columns["AB_BranchId"].ToString();
                    ddlAdviserBranchList.DataTextField  = BMDs.Tables[0].Columns["AB_BranchName"].ToString();
                    ddlAdviserBranchList.DataBind();
                    ddlAdviserBranchList.Enabled = false;
                }
                else
                {
                    ddlAdviseRMList.Enabled = false;
                }
            }
        }
Пример #5
0
        //private void BindListBranch(int rmId, string userType)
        //{
        //    UploadCommonBo uploadCommonBo = new UploadCommonBo();
        //    //DataSet ds = uploadCommonBo.GetAdviserBranchList(rmId, userType);
        //    DataSet dsAssociatedBranch=advisorBranchBo.GetRMBranchAssociation(rmVo.RMId, 0, "A");
        //    if (dsAssociatedBranch!=null && dsAssociatedBranch.Tables[0].Rows.Count > 0)
        //    {
        //        ddlAdviserBranchList.DataSource = dsAssociatedBranch.Tables[0];
        //        ddlAdviserBranchList.DataTextField = "AB_BranchName";
        //        ddlAdviserBranchList.DataValueField = "AB_BranchId";
        //        ddlAdviserBranchList.DataBind();
        //        ddlAdviserBranchList.Items.Insert(0, new ListItem("Select a Branch", "Select a Branch"));
        //    }
        //    else
        //    {
        //        ddlAdviserBranchList.Items.Insert(0, new ListItem("No Branches Available to Associate", "No Branches Available to Associate"));
        //        ddlAdviserBranchList_CompareValidator2.ValueToCompare = "No Branches Available to Associate";
        //        ddlAdviserBranchList_CompareValidator2.ErrorMessage = "Cannot Add Customer Without a Branch";
        //    }
        //}
        private void BindListBranch()
        {
            UploadCommonBo uploadCommonBo = new UploadCommonBo();
            DataSet        ds             = uploadCommonBo.GetAdviserBranchList(advisorVo.advisorId, "adviser");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                ddlAdviserBranchList.DataSource     = ds.Tables[0];
                ddlAdviserBranchList.DataTextField  = "AB_BranchName";
                ddlAdviserBranchList.DataValueField = "AB_BranchId";
                ddlAdviserBranchList.DataBind();
                ddlAdviserBranchList.Items.Insert(0, new ListItem("Select", "Select"));
            }
            else
            {
                ddlAdviserBranchList.Items.Insert(0, new ListItem("No Branches Available to Associate", "No Branches Available to Associate"));
                ddlAdviserBranchList_CompareValidator2.ValueToCompare = "No Branches Available to Associate";
                ddlAdviserBranchList_CompareValidator2.ErrorMessage   = "Cannot Add Customer Without a Branch";
            }
        }