public void CloseExpedient(OrderExpedient orderExpedient) { StandartPersistence standartPersistence = new StandartPersistence(this.Connection); string txt = $"Update orderexpedient set idstatus=2,enddate='{DateTime.Now}',comment='{orderExpedient.Comment}' where id={orderExpedient.Id}"; standartPersistence.Execute(CommandType.Text, txt); }
public void StartExpedient(OrderExpedient orderExpedient) { StandartPersistence standartPersistence = new StandartPersistence(this.Connection); orderExpedient.IdStatus = 1; orderExpedient.StartDate = DateTime.Now; standartPersistence.Insert <OrderExpedient>(orderExpedient); }
public ActionResult <ObjectResult> StartExpedient([FromBody] OrderExpedient expedient) { try { OrderService orderService = new OrderService(Startup.BeePlaceDataBaseConnectionString); orderService.StartExpedient(expedient); return(StatusCode((int)HttpStatusCode.OK, expedient)); } catch (Exception e) { return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message)); } }
public ActionResult <ObjectResult> CloseExpedient([FromBody] OrderExpedient expedient) { try { if (expedient.Id != null && expedient.Id > 0) { OrderService orderService = new OrderService(Startup.BeePlaceDataBaseConnectionString); orderService.CloseExpedient(expedient); return(StatusCode((int)HttpStatusCode.OK, expedient)); } else { return(StatusCode((int)HttpStatusCode.BadRequest, "Id do Expediente Inválido")); } } catch (Exception e) { return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message)); } }