public IHttpActionResult GetAllEmployee() { PayAdvanceBL objUser = new PayAdvanceBL(); List <PayAdvanceDC> objResultList = new List <PayAdvanceDC>(); objResultList = objUser.LoadAllEmployee(); return(Ok(objResultList)); }
public IHttpActionResult Delete([FromBody] PayAdvanceDC objUsers) { PayAdvanceBL objUser = new PayAdvanceBL(); List <EXCEPTIONDC> lstException = new List <EXCEPTIONDC>(); List <PayAdvanceDC> list = new List <PayAdvanceDC>(); 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] PayAdvanceDC payDepartment) { //List<EXCEPTIONDC> lstException = new List<EXCEPTIONDC>(); try { var bl = new PayAdvanceBL(); PayAdvanceBL objUser = new PayAdvanceBL(); PayAdvanceDC oldObj = new PayAdvanceDC(); //get Object before saving //oldObj = objUser.LoadByPrimaryKey(PayLeavesDC.Code); List <PayAdvanceDC> list = new List <PayAdvanceDC>(); 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); } }