Example #1
0
 //For both Post (add) and Put (update)
 public void Post(BizEmployee employee)
 {
     if (employee != null)
     {
         BizEmployeeService.AddOrUpdate(employee);
     }
 }
Example #2
0
 public ActionResult Edit(BizStreet model)
 {
     if (ModelState.IsValid)
     {
         BizStreetRep.AddOrUpdate(model);
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
Example #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);
        }
Example #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);
        }