public ActionResult vistaMedida()
        {
            var medida = new IngredientePrin();

            medida.Medidas = Objcat.listaMedida();
            return(PartialView("vistaMedida", medida));
        }
Пример #2
0
        public int EliminarIng(IngredientePrin ObjBO)
        {
            SqlCommand cmd = new SqlCommand("Update INGREDIENTES SET ESTADO=@ESTADO Where ID=@id");

            cmd.Parameters.Add("@id", SqlDbType.Int).Value     = ObjBO.IDIn;
            cmd.Parameters.Add("@ESTADO", SqlDbType.Bit).Value = ObjBO.EstadoI;
            cmd.CommandType = CommandType.Text;
            return(ObjConexion.EjecutarComando(cmd));
        }
        public ActionResult EliminarIng(string ID)
        {
            IngredientePrin objBO = new IngredientePrin();

            objBO.IDIn    = int.Parse(ID);
            objBO.EstadoI = false;
            Objcat.EliminarIng(objBO);
            RegistarCategorias();
            return(View("RegistarCategorias"));
        }
Пример #4
0
        public int AgregarIngrediente(IngredientePrin objBo)
        {
            SqlCommand cmd = new SqlCommand("insert into INGREDIENTES (NOMBRE, Estado, FECHACREACION, IDMEDIDA) values (@NOMBRE,  @ESTADO, @FECHA, @IDMEDIDA)");

            cmd.Parameters.Add("@NOMBRE", SqlDbType.VarChar).Value = objBo.Nombre;
            cmd.Parameters.Add("@Estado", SqlDbType.Bit).Value     = objBo.EstadoI;
            cmd.Parameters.Add("@FECHA", SqlDbType.Date).Value     = objBo.Feha;
            cmd.Parameters.Add("@IDMEDIDA", SqlDbType.Int).Value   = objBo.idMedida;
            return(ObjConexion.EjecutarComando(cmd));
        }