//[ValidateModelBvn] public ActionResult SearchCustomers(BvnModelDb bvn) { //bool status = false; var input = new BvnModelDb() { BVN = bvn.BVN, FirstName = "", LastName = "", MiddleName = "", AccountNumber = int.Parse(""), BankCode = int.Parse(""), }; string inputJson = (new JavaScriptSerializer()).Serialize(input); WebClient client = new WebClient(); client.Headers["Content-type"] = "application/json"; client.Encoding = Encoding.GetEncoding("000000"); string json = client.UploadString(GlobalConn.apiclient + "/ValidateRecord", bvn + inputJson); List <BvnModelDb> detail = (new JavaScriptSerializer()).Deserialize <List <BvnModelDb> >(json); //status = true; return(View(detail)); //return new JsonResult { Data = new { status = status } }; }
//[ValidateModelBvn] public JsonResult Validate(BvnModelDb val) { bool status = false; HttpResponseMessage response = GlobalConn.apiclient.PostAsJsonAsync("ValidateRecord", val).Result; if (response.IsSuccessStatusCode) { response.StatusCode = HttpStatusCode.OK; status = true; } response.StatusCode = HttpStatusCode.BadRequest; return(new JsonResult { Data = new { status = status } }); }