Exemplo n.º 1
0
 //For both Post (add) and Put (update)
 public void Post(BizEmployee employee)
 {
     if (employee != null)
     {
         BizEmployeeService.AddOrUpdate(employee);
     }
 }
Exemplo n.º 2
0
 public ActionResult Edit(BizStreet model)
 {
     if (ModelState.IsValid)
     {
         BizStreetRep.AddOrUpdate(model);
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
Exemplo n.º 3
0
        public HttpResponseMessage Post([FromBody] EquipVendorDTO equipVendor)
        {
            EqVendors.AddOrUpdate(equipVendor);
            string tmp = string.Format($"{equipVendor.EquipVendorID} has been saved");
            HttpResponseMessage msg = Request.CreateResponse(HttpStatusCode.OK, tmp);
            string url = Url.Link("DefaultApi", new { id = equipVendor.EquipVendorID });

            msg.Headers.Location = new Uri(url);
            return(msg);
        }
Exemplo n.º 4
0
        public HttpResponseMessage Post([FromBody] PREquipmentDTO pREquipmentDTO)
        {
            PREquipmentService.AddOrUpdate(pREquipmentDTO);
            string tmp = string.Format($"{pREquipmentDTO.PREquipID} has been saved");
            HttpResponseMessage msg = Request.CreateResponse(HttpStatusCode.OK, tmp);
            string url = Url.Link("DefaultApi", new { id = pREquipmentDTO.PREquipID });

            msg.Headers.Location = new Uri(url);
            return(msg);
        }