Esempio n. 1
0
 public bool Insert(PolicyClientM policyClient)
 {
     using (var context = new DataEntities())
     {
         context.PolicyClientMs.Add(policyClient);
         return(context.SaveChanges() > 0);
     }
 }
Esempio n. 2
0
 public bool Update(PolicyClientM policyclient)
 {
     try
     {
         return(PolicyClientproxy.Update(policyclient));
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 3
0
 public bool Insert(PolicyClientM policyclient)
 {
     try
     {
         return(PolicyClientproxy.Insert(policyclient));
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
        public bool Update(PolicyClientM policyClient)
        {
            using (var context = new DataEntities())
            {
                var policyClientUpdate = context.PolicyClientMs.SingleOrDefault(x => x.IdPolicyClient == policyClient.IdPolicyClient);
                policyClientUpdate.IdPolicy           = policyClient.IdPolicyClient;
                policyClientUpdate.IdClient           = policyClient.IdClient;
                policyClientUpdate.IdPolicy           = policyClient.IdPolicy;
                policyClientUpdate.CoveragePercentage = policyClient.CoveragePercentage;
                policyClientUpdate.Active             = Convert.ToBoolean(policyClient.Active);
                policyClientUpdate.UserCreate         = policyClient.UserCreate;
                policyClientUpdate.DateCreate         = policyClient.DateCreate;

                return(context.SaveChanges() > 0);
            }
        }
Esempio n. 5
0
        public ActionResult Update(PolicyClientM policyClient)
        {
            HttpClient clientHttp = new HttpClient();

            clientHttp.BaseAddress = new Uri("https://localhost:44324/");
            var request = clientHttp.PutAsync("api/PolicyClient", policyClient, new JsonMediaTypeFormatter()).Result;

            if (request.IsSuccessStatusCode)
            {
                var resulstring = request.Content.ReadAsStringAsync().Result;
                var result      = JsonConvert.DeserializeObject <bool>(resulstring);


                if (result)
                {
                    return(RedirectToAction("Index"));
                }
                return(View(policyClient));
            }
            return(View(policyClient));
        }
Esempio n. 6
0
        public bool Put(PolicyClientM policyClient)
        {
            var list = PolicyClientProxy.Update(policyClient);

            return(list);
        }
Esempio n. 7
0
        public bool Post(PolicyClientM policyClient)
        {
            var list = PolicyClientProxy.Insert(policyClient);

            return(list);
        }