public IHttpActionResult GetAllEmployee() { PayLeavesBL objUser = new PayLeavesBL(); List <PayLeavesDC> objResultList = new List <PayLeavesDC>(); objResultList = objUser.LoadAllEmployee(); return(Ok(objResultList)); }
public IHttpActionResult Delete([FromBody] PayLeavesDC objUsers) { PayLeavesBL objUser = new PayLeavesBL(); List <EXCEPTIONDC> lstException = new List <EXCEPTIONDC>(); List <PayLeavesDC> list = new List <PayLeavesDC>(); list.Add(objUsers); try { int IsDeleted = objUser.Delete(list); return(Ok(IsDeleted)); } catch (Exception ex) { return(new TextResult(lstException, Request, "Following PayDesignations cannot be deleted as: ", "All the other records deleted successfully.", true)); } }
public IHttpActionResult postShifts([FromBody] PayLeavesDC payDepartment) { //List<EXCEPTIONDC> lstException = new List<EXCEPTIONDC>(); try { var bl = new PayLeavesBL(); PayLeavesBL objUser = new PayLeavesBL(); PayLeavesDC oldObj = new PayLeavesDC(); //get Object before saving //oldObj = objUser.LoadByPrimaryKey(PayLeavesDC.Code); List <PayLeavesDC> list = new List <PayLeavesDC>(); list.Add(payDepartment); int UpdatedCount = 0; if (payDepartment.ID != null && payDepartment.ID > 0) { UpdatedCount = bl.Update(list); } else { UpdatedCount = bl.Insert(list); } if (UpdatedCount > 0) { return(Ok(true)); } return(Ok(false)); } catch (Exception ex) { throw new Exception(ex.Message); //return new TextResult(lstException, Request); } }