public bool Insert(PolicyClientM policyClient) { using (var context = new DataEntities()) { context.PolicyClientMs.Add(policyClient); return(context.SaveChanges() > 0); } }
public bool Update(PolicyClientM policyclient) { try { return(PolicyClientproxy.Update(policyclient)); } catch (Exception) { throw; } }
public bool Insert(PolicyClientM policyclient) { try { return(PolicyClientproxy.Insert(policyclient)); } catch (Exception) { throw; } }
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); } }
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)); }
public bool Put(PolicyClientM policyClient) { var list = PolicyClientProxy.Update(policyClient); return(list); }
public bool Post(PolicyClientM policyClient) { var list = PolicyClientProxy.Insert(policyClient); return(list); }