Exemplo n.º 1
0
 // GET: /Evento/Edit/5
 public ActionResult Edit(int?id)
 {
     model.Evento evento = new data.Evento().GetElement(id.Value);
     evento.OSFinalizada = false;
     if (evento == null)
     {
         return(HttpNotFound());
     }
     return(View(evento));
 }
Exemplo n.º 2
0
 // GET: /Evento/Delete/5
 public ActionResult Delete(int?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     model.Evento evento = new data.Evento().GetElement(id.Value);
     if (evento == null)
     {
         return(HttpNotFound());
     }
     return(View(evento));
 }
Exemplo n.º 3
0
 public ActionResult ItemCreated([Bind(Include = "Id,Titulo,HorarioInicio,Importante,Observacao,EventoId,RoteiroId")] model.ItemRoteiro itemroteiro, bool antesInicio = true)
 {
     model.Evento e = new data.Evento().GetElement(itemroteiro.EventoId.Value);
     if (antesInicio)
     {
         if (e.HorarioInicio > itemroteiro.HorarioInicio)
         {
             itemroteiro.HorarioInicio += 24 * 60;
         }
     }
     new data.ItemRoteiro().Insert(itemroteiro);
     return(Redirect(Request.UrlReferrer.AbsolutePath));
 }
Exemplo n.º 4
0
        public ActionResult ToggleBefore(int id)
        {
            int factor = 24 * 60;

            model.ItemRoteiro roteiro = new data.ItemRoteiro().GetElement(id);
            bool before = new data.Evento().GetElement(roteiro.EventoId.Value).HorarioInicio > roteiro.HorarioInicio;

            if (before)
            {
                roteiro.HorarioInicio += factor;
            }
            else
            {
                roteiro.HorarioInicio -= factor;
            }
            new data.ItemRoteiro().Update(roteiro);
            return(Redirect(Request.UrlReferrer.AbsolutePath + "#" + id));
        }