Exemplo n.º 1
0
        public ActionResult Save(IDGeneration iDGenerationEntity)
        {
            bool saveStatus = false;

            saveStatus         = IDGenerationHelper.SaveGeneratedID(iDGenerationEntity, saveStatus);
            ViewBag.SaveStatus = saveStatus;
            return(View(new IDGeneration()));
        }
        internal static bool SaveGeneratedID(IDGeneration iDGenerationEntity, bool saveStatus)
        {
            HttpClient          client   = Utility.NewClient();
            HttpResponseMessage response = client.PostAsJsonAsync("api/AdminService/CreateIDs", iDGenerationEntity).Result;

            if (response.IsSuccessStatusCode)
            {
                saveStatus = JsonConvert.DeserializeObject <bool>(response.Content.ReadAsStringAsync().Result);
            }

            return(saveStatus);
        }