コード例 #1
0
 public Alertas Edit(Alertas model)
 {
     entities.Alertas.Attach(model);
       entities.ObjectStateManager.ChangeObjectState(model, EntityState.Modified);
       this.Commit();
       return model;
 }
コード例 #2
0
 public Alertas EditAnulada(Alertas model)
 {
     Alertas _Alertas = entities.Alertas.First(e => e.Id_alerta == model.Id_alerta);
       _Alertas.Estado_alerta="N";
       entities.SaveChanges();
       this.Commit();
       return model;
 }
コード例 #3
0
        public ActionResult ActualizarListas(Alertas model, FormCollection formCollection)
        {
            try
              {
            iOpcion = Int32.Parse(formCollection["iOption"]);

            if (iOpcion == 1)
            {
              iOpcion = 0;
              return RedirectToAction("Edit", "Alertas", new { id = model.Id_alerta });
            }
            else
              return RedirectToAction("Index", "Alertas");
              }
              catch (Exception ex)
              {
            TempData["ErrorMessage"] = ex.Message;
            return RedirectToAction("Index", "Alertas", new { id = model.Id_alerta });
              }
        }
コード例 #4
0
        public ActionResult Edit(Alertas model, FormCollection formCollection)
        {
            try
              {

            AlertasService.Edit(model);

            iOpcion = Int32.Parse(formCollection["iOption"]);

            if (iOpcion == 1)
            {
              iOpcion = 0;
              return RedirectToAction("Details", new { id = model.Id_alerta });
            }
            else
              return RedirectToAction("Index", new { id = model.Id_alerta });

              }
              catch (Exception ex)
              {
            TempData["ErrorMessage"] = ex.Message;
            return View(model);
              }
        }
コード例 #5
0
        public ActionResult DeletePost(int id)
        {
            try
              {
            Alertas _alerta = AlertasService.GetAlertaById(id);
            Alertas _alertaEdit = new Alertas();

            _alertaEdit.Cip = _alerta.Cip;
            _alertaEdit.Ean = _alerta.Ean;
            _alertaEdit.Detalle_alerta = _alerta.Detalle_alerta;
            _alertaEdit.Fecha_alerta = _alerta.Fecha_alerta;
            _alertaEdit.Id_alerta = _alerta.Id_alerta;
            _alertaEdit.Id_empresa = _alerta.Id_empresa;
            _alertaEdit.Id_responsable_calidad = _alerta.Id_responsable_calidad;
            _alertaEdit.Id_seccion = _alerta.Id_seccion;
            _alertaEdit.Id_sector = _alerta.Id_sector;
            _alertaEdit.Motivo_alerta = _alerta.Motivo_alerta;
            _alertaEdit.Observaciones = _alerta.Observaciones;
            _alertaEdit.Proveedor = _alerta.Proveedor;
            _alertaEdit.Estado_alerta = "N";

            AlertasService.EditAnulada(_alertaEdit);

            TempData["DisplayMessage"] = "Alerta eliminado correctamente";
            return Json(JsonResponseFactory.SuccessResponse(), JsonRequestBehavior.DenyGet);

              }
              catch (Exception ex)
              {
            TempData["ErrorMessage"] = ex.Message;
            return RedirectToAction("Index");
              }
        }
コード例 #6
0
        public ActionResult Create(Alertas model, int? id, FormCollection formCollection)
        {
            try
              {

            AlertasService.Create(model);

            iOpcion = Int32.Parse(formCollection["iOption"]);

            new Alertas_detalleRepository().CreateAlertsDetail(model.Id_alerta, Convert.ToInt32(model.Id_empresa), this.User.Identity.Name);
            if (iOpcion == 1)
            {
              iOpcion = 0;
              return RedirectToAction("Details", new { id = model.Id_alerta });
            }
            else
              return RedirectToAction("Index", new { id = model.Id_alerta });

              }
              catch (Exception ex)
              {
            TempData["ErrorMessage"] = ex.Message;
            return View(model);
              }
        }
コード例 #7
0
 public Alertas Create(Alertas model)
 {
     entities.Alertas.AddObject(model);
       this.Commit();
       return model;
 }
コード例 #8
0
 /// <summary>
 /// Create a new Alertas object.
 /// </summary>
 /// <param name="id_alerta">Initial value of the Id_alerta property.</param>
 public static Alertas CreateAlertas(global::System.Int32 id_alerta)
 {
     Alertas alertas = new Alertas();
     alertas.Id_alerta = id_alerta;
     return alertas;
 }
コード例 #9
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Alertas EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAlertas(Alertas alertas)
 {
     base.AddObject("Alertas", alertas);
 }