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);
        }
Exemple #2
0
 // PUT api/employeehobby/5
 public bool Put(int id, [FromBody] EmployeeHobbiesEntity item)
 {
     if (id > 0)
     {
         return(_Hobbydetails.UpdateEmployeeHobbiesDetails(id, item));
     }
     return(false);
 }
Exemple #3
0
        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));
 }
Exemple #5
0
 // POST api/employeehobby
 public int Post([FromBody] EmployeeHobbiesEntity item)
 {
     return(_Hobbydetails.CreateEmployeeHobbiesDetails(item));
 }