Example #1
0
        private void FillGridIngredients()
        {
            DataTable dt = Convert_Lists.ConvertTo <Ingredients>(_serv.GetAll());

            gridIngredients.DataSource                    = dt;
            gridIngredients.Columns["Id"].Visible         = false;
            gridIngredients.Columns["Name"].HeaderText    = "Nome";
            gridIngredients.Columns["IsValid"].HeaderText = "Valido";
            gridIngredients.Columns["Quantity"].Visible   = false;
        }
Example #2
0
 public ActionResult <IEnumerable <Ingredient> > GetAll()
 {
     try
     {
         return(Ok(_service.GetAll()));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Example #3
0
 public ActionResult <IEnumerable <Ingredient> > GetAll()
 {
     try
     {
         IEnumerable <Ingredient> ingredients = _service.GetAll();
         return(Ok(ingredients));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }