Esempio n. 1
0
        private void FillGrid()
        {
            DataTable dt = ConvertListToDataTable.ConvertTo <Recipe>(_service.GetALL());

            gvResultRecepies.DataSource = dt;
            VisualAspectGrid();
        }
Esempio n. 2
0
        public void FillGrid()
        {
            DataTable dt = ConvertListToDataTable.ConvertTo <Category>(_service.GetALL());

            gvResultCategories.DataSource = dt;
            VisualAspectGrid();
        }
Esempio n. 3
0
        private void FillGrid()
        {
            DataTable dt = ConvertListToDataTable.ConvertTo <Ingredient>(_service.GetALL());

            gvResultIngredients.DataSource = dt;
            VisualAspectGrid();
        }
Esempio n. 4
0
        private void FillComboBoxes()
        {
            //DataTable dtCategory = ConvertListToDataTable.ConvertTo<Category>(_cService.GetALL());
            //cbCategory.DataSource = dtCategory;
            //foreach (Category name in _cService.GetALL())
            //{
            //    cbCategory.Items.Add(name);
            //}
            List <Category> categories    = _cService.GetALL();
            var             categoriesArr = categories.ToArray();

            cbCategory.Items.AddRange(categoriesArr);

            cbCategory.DisplayMember = "Name";
            //cbCategory.ValueMember = "ID";

            DataTable dtIngredients = ConvertListToDataTable.ConvertTo <Ingredient>(_iService.GetALL());

            cbIngredients.DataSource = dtIngredients;

            //foreach (Ingredient ingredient in _iService.GetALL())
            //{
            //    cbIngredients.Items.Add(ingredient);
            //}
            cbIngredients.DisplayMember = "Name";
            cbIngredients.ValueMember   = "ID";


            foreach (var item in Enum.GetValues(typeof(Difficulty)))
            {
                cbDifficulty.Items.Add(item);
            }
        }
Esempio n. 5
0
 private void FillGrid()
 {
     if (_title == "Receitas - Validar")
     {
         lblTitle.Text = "――――――   VALIDAR   ――――――";
         DataTable dt = ConvertListToDataTable.ConvertTo <Recipe>(_service.GetALL());
         gvResultRecepies.DataSource = dt;
         btUpdateFalse.Visible       = true;
         VisualAspectGrid();
     }
     else if (_title == "Receitas - Alterar")
     {
         lblTitle.Text  = "――――――   ALTERAR   ――――――";
         btUpdate.Text  = "Alterar";
         btUpdate.Image = Properties.Resources.diskette;
         DataTable dt = ConvertListToDataTable.ConvertTo <Recipe>(_service.GetALL());
         gvResultRecepies.DataSource = dt;
         VisualAspectGrid();
     }
     else
     {
         lblTitle.Text  = "――――――   ELIMINAR   ――――――";
         btUpdate.Text  = "Eliminar";
         btUpdate.Image = Properties.Resources.delete;
         DataTable dt = ConvertListToDataTable.ConvertTo <Recipe>(_service.GetALL());
         gvResultRecepies.DataSource = dt;
         VisualAspectGrid();
     }
     VisualAspectGrid();
 }
Esempio n. 6
0
 public void FillGrid()
 {
     if (_title == "Categorias - Alterar")
     {
         lblTitle.Text = "――――――   ALTERAR   ――――――";
         DataTable dt = ConvertListToDataTable.ConvertTo <Category>(_service.GetALL());
         gvResultCategories.DataSource = dt;
         VisualAspectGrid();
     }
     else
     {
         lblTitle.Text  = "――――――   ELIMINAR   ――――――";
         btUpdate.Text  = "Eliminar";
         btUpdate.Image = Properties.Resources.delete;
         DataTable dt = ConvertListToDataTable.ConvertTo <Category>(_service.GetALL());
         gvResultCategories.DataSource = dt;
         VisualAspectGrid();
     }
 }