Пример #1
0
        public ActionResult GetBranchList(string bankCode)
        {
            var    user               = UserManager.Users.Where(x => x.UserName == User.Identity.Name).FirstOrDefault();
            string SchemeName         = GetSchemeNameAsync(user.SponsorNumber);
            BankBranches_Service serv = new BankBranches_Service();

            serv.UseDefaultCredentials = false;
            serv.Credentials           = new NetworkCredential(PensionSetup.SoapUsername, PensionSetup.SoapPassword);

            serv.Url = "http://" + PensionSetup.ServerName +
                       ":" + PensionSetup.ServerPort +
                       "/" + PensionSetup.ServerInstance +
                       "/WS/" + SchemeName + "/Page/BankBranches";

            List <BankBranches_Filter> filterArray = new List <BankBranches_Filter>();
            BankBranches_Filter        filter      = new BankBranches_Filter();

            filter.Field    = BankBranches_Fields.Bank_Code;
            filter.Criteria = bankCode;

            filterArray.Add(filter);

            BankBranches[] branches = serv.ReadMultiple(filterArray.ToArray(), null, 0);

            return(Json(branches, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult GetName(string Bank_Code, string Bank_Branch_Code)
        {
            var    user       = UserManager.Users.Where(x => x.UserName == User.Identity.Name).FirstOrDefault();
            string SchemeName = PensionSetup.GetSchemeNameAsync(user.SponsorNumber);

            if (String.IsNullOrEmpty(Bank_Branch_Code))
            {
                //Bank Code is not empty
                Banks_Service service = new Banks_Service();
                service.UseDefaultCredentials = false;
                service.Credentials           = new NetworkCredential(PensionSetup.SoapUsername, PensionSetup.SoapPassword);

                service.Url = "http://" + PensionSetup.ServerName +
                              ":" + PensionSetup.ServerPort +
                              "/" + PensionSetup.ServerInstance +
                              "/WS/" + SchemeName + "/Page/Banks";

                Banks banks = service.Read(Bank_Code);

                return(Json(banks.Name, JsonRequestBehavior.AllowGet));
            }
            else
            {
                //Bank Branch Code is not empty
                BankBranches_Service serv = new BankBranches_Service();
                serv.UseDefaultCredentials = false;
                serv.Credentials           = new NetworkCredential(PensionSetup.SoapUsername, PensionSetup.SoapPassword);

                serv.Url = "http://" + PensionSetup.ServerName +
                           ":" + PensionSetup.ServerPort +
                           "/" + PensionSetup.ServerInstance +
                           "/WS/" + SchemeName + "/Page/BankBranches";

                BankBranches branches = serv.Read(Bank_Code, Bank_Branch_Code);

                return(Json(branches.Branch_Name, JsonRequestBehavior.AllowGet));
            }
        }