Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public void StartExpedient(OrderExpedient orderExpedient)
        {
            StandartPersistence standartPersistence =
                new StandartPersistence(this.Connection);

            orderExpedient.IdStatus  = 1;
            orderExpedient.StartDate = DateTime.Now;

            standartPersistence.Insert <OrderExpedient>(orderExpedient);
        }
Ejemplo n.º 3
0
 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));
     }
 }
Ejemplo n.º 4
0
 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));
     }
 }