public int DeleteLateFeeDetails(int _LateFeeDetails) { LateFeeDetails LateFeeDetailsToDelete = context .DetailsLateFees.SingleOrDefault(x => x.LateFeeDetailID == _LateFeeDetails); context.DetailsLateFees.Remove(LateFeeDetailsToDelete); return(context.SaveChanges()); }
public HttpResponseMessage UpdateLateFeeDetails([FromBody] LateFeeDetails _LateFeeDetails) { LateFeeDetailsRepository ctxLateFeeDetails = new LateFeeDetailsRepository(); ctxLateFeeDetails.UpdateLateFeeDetails(_LateFeeDetails); HttpResponseMessage ms = Request.CreateResponse(HttpStatusCode.OK); ms.Headers.Location = new Uri(Request.RequestUri + "/" + (_LateFeeDetails.LateFeeDetailID).ToString()); return(ms); }
public int UpdateLateFeeDetails(LateFeeDetails _LateFeeDetails) { LateFeeDetails LateFeeDetailsToUpdate = context.DetailsLateFees.SingleOrDefault(x => x.LateFeeDetailID == _LateFeeDetails.LateFeeDetailID); LateFeeDetailsToUpdate.LateFeeValue = _LateFeeDetails.LateFeeValue; LateFeeDetailsToUpdate.Description = _LateFeeDetails.Description; LateFeeDetailsToUpdate.DurationInDays = _LateFeeDetails.DurationInDays; return(context.SaveChanges()); }
public HttpResponseMessage GetLateFeeDetailByID(int id) { LateFeeDetailsRepository ctxLateFeeDetails = new LateFeeDetailsRepository(); LateFeeDetails _LibMemeberShip = ctxLateFeeDetails.GetLateFeeDetails().FirstOrDefault(x => x.LateFeeDetailID == id); if (_LibMemeberShip != null) { return(Request.CreateResponse(HttpStatusCode.OK, _LibMemeberShip)); } { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Item not found")); } }
public int InsertLateFeeDetails(LateFeeDetails _LateFeeDetails) { context.DetailsLateFees.Add(_LateFeeDetails); return(context.SaveChanges()); }