public IHttpActionResult Get(DateTime?DateToBalance = null) { try { var ua = UserAccess.GetUserAccess(User.Identity.Name); var dj = new DJournal(DateToBalance ?? DJournal.LastDateFinalized().AddDays(1), ua, false); return(Ok(dj)); } catch (Exception ex) { Constants.Log(ex); return(InternalServerError()); } }
public IHttpActionResult Post(DateTime DateToFinalize) { try { var ua = UserAccess.GetUserAccess(User.Identity.Name); var dj = new DJournal(DateToFinalize, ua, true); return(Ok(dj)); } catch (Exception ex) { Constants.Log(ex); return(InternalServerError()); } }
public IHttpActionResult Get(string CashierId) { // The difference in this receipt end point and the // receipt end point in the payment controller is that this one // will allow for editing the payment types if they have the necessary access. // add in somethign that checks the date of this transaction and compares it to the // last date finalized to see if it is editable var cr = new ClientResponse(CashierId); if (cr == null) { return(InternalServerError()); } else { bool IsDateFinalized = DJournal.IsDateFinalized(cr.ResponseCashierData.TransactionDate); cr.IsEditable = !IsDateFinalized; // update this based on the previous test. return(Ok(cr)); } }