public bool UpdateEmployeeHobbiesDetails(int EmployeeHobbiesId, EmployeeHobbiesEntity EmployeeHobbiesEntities) { var success = false; if (EmployeeHobbiesEntities != null) { //using (var scope = new TransactionScope()) //{ var EmployeeHobbiesDetail = _UOW.HOBBIESRepository.GetByID(EmployeeHobbiesId); if (EmployeeHobbiesDetail != null) { if (EmployeeHobbiesEntities.EMPLOYEEID != null) { EmployeeHobbiesDetail.EMPLOYEEID = EmployeeHobbiesEntities.EMPLOYEEID; } if (EmployeeHobbiesEntities.HOBBIES != null && EmployeeHobbiesEntities.HOBBIES != "") { EmployeeHobbiesDetail.HOBBIES = EmployeeHobbiesEntities.HOBBIES; } _UOW.HOBBIESRepository.Update(EmployeeHobbiesDetail); _UOW.Save(); //scope.Complete(); success = true; //} } } return(success); }
// PUT api/employeehobby/5 public bool Put(int id, [FromBody] EmployeeHobbiesEntity item) { if (id > 0) { return(_Hobbydetails.UpdateEmployeeHobbiesDetails(id, item)); } return(false); }
public async Task <ActionResult> InsertHobbiesDetails(EmployeeHobbiesEntity employeehobby) { HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url + "employeehobby", employeehobby); if (responseMessage.IsSuccessStatusCode) { return(Json(new { success = true, responseText = "data saved successfuly !" }, JsonRequestBehavior.AllowGet)); } return(Json(new { success = false, responseText = "data saved unsuccessfuly !" }, JsonRequestBehavior.AllowGet)); }
public int CreateEmployeeHobbiesDetails(EmployeeHobbiesEntity EmployeeHobbiesEntities) { if (EmployeeHobbiesEntities != null) { var EmployeeHobbiesDetail = new TBL_EMP_HOBBIES { EMPLOYEEID = EmployeeHobbiesEntities.EMPLOYEEID, HOBBIES = EmployeeHobbiesEntities.HOBBIES }; _UOW.HOBBIESRepository.Insert(EmployeeHobbiesDetail); _UOW.Save(); } return(Convert.ToInt32(EmployeeHobbiesEntities.ID)); }
// POST api/employeehobby public int Post([FromBody] EmployeeHobbiesEntity item) { return(_Hobbydetails.CreateEmployeeHobbiesDetails(item)); }