internal void QuitarPrototipo(Prototipo prototipo)
        {
            using (SqlConnection cnn = ObtenerConexion())
            {
                SqlCommand cmd       = ObtenerComando(cnn, " sp_ABM_prototipo", CommandType.StoredProcedure);
                int        resultado = 0;
                cmd.Parameters.Add("@xIdPrototipo", SqlDbType.Int);
                cmd.Parameters["@xIdPrototipo"].Value = prototipo.IdPrototipo;

                cmd.Parameters.Add("@xPrototipo", SqlDbType.VarChar);
                cmd.Parameters["@xPrototipo"].Value = prototipo.DescripcionPrototipo;

                cmd.Parameters.Add("@xAccion", SqlDbType.VarChar);
                cmd.Parameters["@xAccion"].Value = "B";

                cmd.Parameters.Add("@xresult", SqlDbType.Int);
                cmd.Parameters["@xresult"].Direction = ParameterDirection.Output;

                cnn.Open();
                cmd.ExecuteScalar();

                resultado = Convert.ToInt32(cmd.Parameters["@xresult"].Value);

                if (resultado == 1)
                {
                    throw new NegocioException("No se elimino el Prototipo. Verifique los datos.");
                }
            }
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Prototipo prototipo = db.Prototipos.Find(id);

            db.Prototipos.Remove(prototipo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Create([Bind(Include = "Id,Descripcion,MetrosCuadrado,Version")] Prototipo prototipo)
        {
            if (ModelState.IsValid)
            {
                db.Prototipos.Add(prototipo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(prototipo));
        }
Пример #4
0
 internal void ActualizarPrototipo(Prototipo prototipo)
 {
     if (prototipo.IdPrototipo != 0)
     {
         throw new NegocioException("El identificador del prototipo que se desea modificar no es válido. Verifique.");
     }
     if (string.IsNullOrEmpty(prototipo.DescripcionPrototipo))
     {
         throw new NegocioException("Nombre es requerido.");
     }
     prototipoDato.ActualizarPrototipo(prototipo);
 }
Пример #5
0
 internal void AgregarPrototipo(Prototipo prototipo)
 {
     if (prototipo.IdPrototipo != 0)
     {
         throw new NegocioException("El identificador de prototipo no es válido. Verifique.");
     }
     if (string.IsNullOrEmpty(prototipo.DescripcionPrototipo))
     {
         throw new NegocioException("el nombre del programa debe ser ingresados.");
     }
     prototipoDato.AgregarPrototipo(prototipo);
 }
Пример #6
0
 public void AgregarPrototipo(Prototipo prototipo)
 {
     try
     {
         prototipoLogica.AgregarPrototipo(prototipo);
     }
     catch (NegocioException ex) { throw (ex); }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        // GET: Prototipos/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Prototipo prototipo = db.Prototipos.Find(id);

            if (prototipo == null)
            {
                return(HttpNotFound());
            }
            return(View(prototipo));
        }
Пример #8
0
 public AnaliseTecnica(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 8;
 }
Пример #9
0
        internal void QuitarPrototipo(int prototipoId)
        {
            Prototipo prototipo = TraerPrototipo(prototipoId);

            prototipoDato.QuitarPrototipo(prototipo);
        }
Пример #10
0
 public AgDespAbertura(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 10;
 }
Пример #11
0
 public CandidaturaEstado(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 1;
 }
Пример #12
0
 public FechadoEstado(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 5;
 }
Пример #13
0
 public SuspensoEstado(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 2;
 }
Пример #14
0
 public Pagamento(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 4;
 }
Пример #15
0
 public RejeitadoEstado(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 3;
 }
Пример #16
0
 public AgDespFinanciamento(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 9;
 }
Пример #17
0
 public ArquivadoEstado(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 7;
 }
Пример #18
0
 public AtivoEstado(Prototipo.Projeto.Projeto projeto, ProjetoEstado estadoAnterior)
     : base(projeto, estadoAnterior)
 {
     EstadoID = 6;
 }