public HttpResponseMessage Initialize([FromBody] CloseBatchModel model) { var dateStart = DateTime.Now; _performancelog.Debug($"Start,MaintenanceController,CloseBatch,{string.Empty},{dateStart:hh.mm.ss.ffffff}"); ErrorMessage error; _maintenanceManager.Initialize(out error); if (!string.IsNullOrEmpty(error?.MessageStyle?.Message)) { return(Request.CreateResponse(error.StatusCode, new ErrorResponse { Error = error.MessageStyle, })); } _performancelog.Debug($"End,MaintenanceController,CloseBatch,{DateTime.Now.Subtract(dateStart).TotalMilliseconds},{DateTime.Now:hh.mm.ss.ffffff}"); return(Request.CreateResponse(HttpStatusCode.OK, new ErrorResponse { Error = new MessageStyle { Message = Resource.Error, MessageType = 0 } })); }
public HttpResponseMessage CloseBatch([FromBody] CloseBatchModel model) { var dateStart = DateTime.Now; _performancelog.Debug($"Start,MaintenanceController,CloseBatch,{string.Empty},{dateStart:hh.mm.ss.ffffff}"); ErrorMessage error; var reports = _maintenanceManager.CloseBatch(model.PosId, model.TillNumber, model.SaleNumber, model.RegisterNumber, out error); if (!string.IsNullOrEmpty(error?.MessageStyle?.Message)) { return(Request.CreateResponse(HttpStatusCode.Conflict, new ErrorResponse { Error = error.MessageStyle, })); } _performancelog.Debug($"End,MaintenanceController,CloseBatch,{DateTime.Now.Subtract(dateStart).TotalMilliseconds},{DateTime.Now:hh.mm.ss.ffffff}"); return(Request.CreateResponse(HttpStatusCode.OK, reports)); }