Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SprintAuxiliar sprintAuxiliar = db.SprintAuxiliar.Find(id);

            db.SprintAuxiliar.Remove(sprintAuxiliar);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,HistoriaId,SprintId")] SprintAuxiliar sprintAuxiliar)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sprintAuxiliar).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sprintAuxiliar));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,HistoriaId,SprintId")] SprintAuxiliar sprintAuxiliar)
        {
            if (ModelState.IsValid)
            {
                db.SprintAuxiliar.Add(sprintAuxiliar);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sprintAuxiliar));
        }
Ejemplo n.º 4
0
        // GET: SprintAuxiliars/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SprintAuxiliar sprintAuxiliar = db.SprintAuxiliar.Find(id);

            if (sprintAuxiliar == null)
            {
                return(HttpNotFound());
            }
            return(View(sprintAuxiliar));
        }
Ejemplo n.º 5
0
        public JsonResult AlterBoard(int historiaId, int?boardId, int sprintId)
        {
            try
            {
                SprintAuxiliar sprintAuxiliar = db.SprintAuxiliar.FirstOrDefault(c => c.HistoriaId == historiaId && c.SprintId == sprintId);

                if (boardId == 0)
                {
                    if (sprintAuxiliar != null)
                    {
                        db.SprintAuxiliar.Remove(sprintAuxiliar);
                        db.SaveChanges();
                    }
                    return(Json(new { MessageType = "Success", Message = "História movida com sucesso!" }, new JsonRequestBehavior()));
                }
                else if (boardId == 1)
                {
                    if (sprintAuxiliar == null)
                    {
                        sprintAuxiliar = new SprintAuxiliar();

                        sprintAuxiliar.HistoriaId = historiaId;
                        sprintAuxiliar.SprintId   = sprintId;

                        db.SprintAuxiliar.Add(sprintAuxiliar);
                        db.SaveChanges();
                    }
                    return(Json(new { MessageType = "Success", Message = "História movida com sucesso!" }, new JsonRequestBehavior()));
                }

                return(Json(new { MessageType = "Error", Message = "Não foi possível mover historia de lugar." }, new JsonRequestBehavior()));
            }
            catch (Exception ex)
            {
                return(Json(new { MessageType = "Error", Message = "Não foi possível mover historia de lugar." }, new JsonRequestBehavior()));
            }
        }