public HttpResponseMessage UpdatePlan(PlanModel Model) { try { PlanBl Bl = new PlanBl(); int Status = Bl.UpdatePlan(Model); if (Status == 1) { return(new Response <string>("Added Succesfully", "", HttpStatusCode.Created)); } else if (Status == 2) { return(new Response <string>("already exist", "", HttpStatusCode.Ambiguous)); } else if (Status == 3) { return(new Response <string>("updated Successfully", "", HttpStatusCode.Created)); } else if (Status == 4) { return(new Response <string>("Not found", "", HttpStatusCode.NotFound)); } else { return(new Response <string>("Failed", "", HttpStatusCode.NotImplemented)); } } catch (Exception ex) { return(new Response <string>("Something went wrong", "", HttpStatusCode.ServiceUnavailable)); } }
public frmAddPlan(string protocolId, string aseguradoraId, string pstrNombreProtocolo) { _protocolId = protocolId; _aseguradoraId = aseguradoraId; _pstrNombreProtocolo = pstrNombreProtocolo; InitializeComponent(); _objPlanBl = new PlanBl(); }
public frmProtocolPlanAseguradora(string pstrProtocolId, string pstrAseguradoraId, string pstrNombreProtocolo) { InitializeComponent(); Text = "Plan de: " + pstrNombreProtocolo; _listToDelete = new List <planDto>(); _objPlanBl = new PlanBl(); _protocolId = pstrProtocolId; _aseguradoraId = pstrAseguradoraId; }
public HttpResponseMessage DeletePlan(int Id) { try { PlanBl Bl = new PlanBl(); int Status = Bl.DeletePlan(Id); return(new Response <string>("Added Succesfully", "", HttpStatusCode.Gone)); } catch (Exception ex) { return(new Response <string>("Something went wrong", "", HttpStatusCode.ServiceUnavailable)); } }
public HttpResponseMessage GetPlan() { try { PlanBl Bl = new PlanBl(); List <PlanModel> Model = JsonConvert.DeserializeObject <List <PlanModel> >(Bl.GetPlan()); return(new Response <List <PlanModel> >("Data Listed Succesfully", Model, HttpStatusCode.OK)); } catch (Exception ex) { return(new Response <string>("Something went wrong", "", HttpStatusCode.ServiceUnavailable)); } }