public ActionResult DropdownBranch(int CustId)
        {
            List <DDBranch_get_Result> dDBranch_s = new List <DDBranch_get_Result>();

            if (Session["ProfileId"] != null)
            {
                if (Convert.ToString(Session["ProfileId"]) == "1" || Convert.ToString(Session["ProfileId"]) == "2")
                {
                    using (SecurityDBEntities entities = new SecurityDBEntities())
                    {
                        dDBranch_s = entities.DDBranch_get(CustId).ToList();
                    }
                }
                else
                {
                    string[]            BranchName        = Convert.ToString(Session["BranchMapping"]).Split(new string[] { "||" }, StringSplitOptions.None);
                    string[]            BranchId          = Convert.ToString(Session["BranchId"]).Split(new string[] { "||" }, StringSplitOptions.None);
                    DDBranch_get_Result branch_Get_Result = new DDBranch_get_Result();
                    for (int i = 0; i < BranchName.Length; i++)
                    {
                        branch_Get_Result.BranchName = BranchName[i].ToString();
                    }
                    for (int i = 0; i < BranchId.Length; i++)
                    {
                        branch_Get_Result.BranchId = Convert.ToInt32(BranchId[i]);
                    }
                    dDBranch_s.Add(branch_Get_Result);
                }
            }
            return(Json(dDBranch_s));
        }