Esempio n. 1
0
        private void txt_buscar_ing_PreviewTextInput(object sender, TextCompositionEventArgs e)

        {
            int tamanio = txt_buscar_ing.Text.Length;
            int ascii   = Convert.ToInt32(Convert.ToChar(e.Text));

            if (ascii >= 65 && ascii <= 90 || ascii >= 97 && ascii <= 122)
            {
                if (tamanio < 100)
                {
                    e.Handled = false;
                }
                else
                {
                    e.Handled = true;
                }
            }
            else
            {
                e.Handled = true;
            }

            {
                IngredienteBLL        ib = new IngredienteBLL();
                string                nombre_ingrediente = txt_buscar_ing.Text;
                System.Data.DataTable dt = ib.NombreIngredienteList(nombre_ingrediente);
                dtg_ingredientes.ItemsSource = dt.DefaultView;
            }
        }
Esempio n. 2
0
        public PartialViewResult TrMontagemLanche(int idIngrediente, int quantidade)
        {
            var bllIngrediente    = new IngredienteBLL();
            var ingrediente       = bllIngrediente.Obter(idIngrediente);
            var ingredientePedido = new IngredienteLanchePedidoMdl(ingrediente, quantidade);

            return(PartialView("pvTrMontagemLanche", ingredientePedido));
        }
Esempio n. 3
0
        private void rbt_ing_Checked(object sender, RoutedEventArgs e)
        {
            IngredienteBLL ib = new IngredienteBLL();

            System.Data.DataTable dt = ib.AllingredientesList();
            dtg_eli.ItemsSource        = dt.DefaultView;
            txt_id_eli_ing.Visibility  = Visibility.Visible;
            txt_id_eli_bebi.Visibility = Visibility.Hidden;
            txt_id_eli_ing.IsEnabled   = true;
        }
Esempio n. 4
0
        private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
        {
            IngredienteBLL ingBLL = new IngredienteBLL();
            DataTable      dt     = ingBLL.getalling();

            cbb_ingre.ItemsSource = dt.DefaultView;

            cbb_ingre.DisplayMemberPath = "NOMBRE_INGREDIENTE";
            cbb_ingre.SelectedValuePath = "ID_INGREDIENTE";
        }
Esempio n. 5
0
 private void btn_listar_ingrediente_Click(object sender, RoutedEventArgs e)
 {
     if (rbt_ing.IsChecked == true)
     {
         IngredienteBLL        ib = new IngredienteBLL();
         System.Data.DataTable dt = ib.AllingredientesList();
         dtg_ingredientes.ItemsSource = dt.DefaultView;
     }
     else if (rbt_bebi.IsChecked == true)
     {
         BebestibleBLL         ib = new BebestibleBLL();
         System.Data.DataTable dt = ib.Allbebestible();
         dtg_ingredientes.ItemsSource = dt.DefaultView;
     }
 }
Esempio n. 6
0
        public ActionResult Index()
        {
            var bllIngrediente = new IngredienteBLL();

            ViewBag.Ingredientes = bllIngrediente.SelecionarTodos();
            var bllLanche = new StartupLanches.BLL.LancheBLL();

            var model = bllLanche.ListarLanches().Select(s => new LanchePedidoMdl(s)).ToList();

            foreach (var lanche in model)
            {
                bllLanche.CalcularValor(lanche);
                bllLanche.CalcularPromocao(lanche);
            }
            return(View(model));
        }
        private void Btn_anular_Click(object sender, RoutedEventArgs e)
        {
            PedidoBLL      pb = new PedidoBLL();
            IngredienteBLL ib = new IngredienteBLL();
            BebestibleBLL  bb = new BebestibleBLL();
            DataTable      dt = new DataTable();

            int id_pe = Int32.Parse(txt_id_pedido.Text);

            string tipo     = pb.Get_tipo_pedido(id_pe);
            string ni       = txt_nombreInsumo.Text;
            int    idinsumo = -1;

            if (tipo == "Pedido de ingredientes")
            {
                idinsumo = ib.Get_idbynom(ni);
            }
            else if (tipo == "Pedido de bebestibles")
            {
                idinsumo = bb.Get_bebyid(ni);
            }
            pb.Anularpedido(id_pe, idinsumo);
            txt_id_pedido.Text          = "";
            txt_cant.Text               = "";
            txt_monto.Text              = "";
            txt_nombreInsumo.Text       = "";
            txt_stockcocina_bar.Text    = "";
            txt_stock_bodega.Text       = "";
            txt_stock_critico.Text      = "";
            txt_stock_total.Text        = "";
            cbb_proveedor.SelectedIndex = -1;

            if (tipo == "Pedido de bebestibles")
            {
                dt = pb.Get_detaPediById_bebestible(id_pe);
                dtg_detalle.ItemsSource = dt.DefaultView;
            }
            else if (tipo == "Pedido de ingredientes")
            {
                dt = pb.Get_detPediById_ingredientes(id_pe);
                dtg_detalle.ItemsSource = dt.DefaultView;
            }
        }
Esempio n. 8
0
        private void Btn_Confirmar_Click(object sender, RoutedEventArgs e)
        {
            BebestibleBLL  us  = new BebestibleBLL();
            IngredienteBLL ig  = new IngredienteBLL();
            string         act = ACCION.Content.ToString();

            if (act == "Modificarbebi")
            {
                int id = Int32.Parse(lb_rut.Content.ToString());
                lb_titulo.VerticalAlignment = VerticalAlignment.Center;
                us.id_bebestible            = id;
                us.Alterinhabilitado(us);
                Close();
            }
            else if (act == "Modificaring")
            {
                int id = Int32.Parse(lb_rut.Content.ToString());
                lb_titulo.VerticalAlignment = VerticalAlignment.Center;
                ig.id_ingrediente           = id;
                ig.Alterinhabilitadoing(ig);
                Close();
            }
        }
Esempio n. 9
0
        private void btn_eli_Click(object sender, RoutedEventArgs e)
        {
            bool    idid = true;
            Generic gen  = new Generic();

            gen.ACCION.Content    = "deshabilitar";
            gen.ACCION.Visibility = Visibility.Hidden;
            BebestibleBLL  us = new BebestibleBLL();
            IngredienteBLL ig = new IngredienteBLL();

            if (txt_id_eli_bebi.Text == "" && txt_id_eli_ing.Text == "")
            {
                idid          = false;
                lbl_1.Content = "El Debe selecionar una ID";
            }
            if (idid)
            {
                if (rbt_bebi.IsChecked == true)
                {
                    int idbebestible = Int32.Parse(txt_id_eli_bebi.Text);
                    try
                    {
                        DataTable da     = us.listarmodificar(idbebestible);
                        DataRow   row    = da.Rows[0];
                        string    id     = row[0].ToString();
                        string    Nombre = row[1].ToString();
                        gen.lb_titulo.FontSize       = 18;
                        gen.lb_confirmacion.FontSize = 16;
                        gen.lb_contenido.FontSize    = 16;
                        gen.lb_titulo.Content        = "¿Desea deshabilitar este Bebestible?";
                        gen.lb_confirmacion.Content  = "Al realizar esta accion, se deshabilitara el Bebestible:";
                        gen.lb_contenido.Content     = "id : " + id + "\n" +
                                                       "Nombre: " + Nombre;

                        gen.Title = "Confirmación";
                        gen.btn_Cancelar.Content  = "Volver";
                        gen.btn_Confirmar.Content = "Deshabilitar";
                        gen.ACCION.Content        = "Modificarbebi";
                        gen.lb_rut.Content        = txt_id_eli_bebi.Text;
                        gen.Owner = this;
                        gen.ShowDialog();
                    }

                    catch (Exception ex)

                    {
                        Console.WriteLine(ex);
                        MessageBox.Show("Este Bebestible no existe en el sistema");
                    }
                }
                else if (rbt_ing.IsChecked == true)
                {
                    int idingrediente = Int32.Parse(txt_id_eli_ing.Text);
                    try
                    {
                        DataTable da     = ig.listarmodificar(idingrediente);
                        DataRow   row    = da.Rows[0];
                        string    id     = row[0].ToString();
                        string    Nombre = row[1].ToString();
                        gen.lb_titulo.FontSize       = 18;
                        gen.lb_confirmacion.FontSize = 16;
                        gen.lb_contenido.FontSize    = 16;
                        gen.lb_titulo.Content        = "¿Desea deshabilitar este Ingrediente?";
                        gen.lb_confirmacion.Content  = "Al realizar esta accion, se deshabilitara el Ingrediente:";
                        gen.lb_contenido.Content     = "id : " + id + "\n" +
                                                       "Nombre: " + Nombre;

                        gen.Title = "Confirmación";
                        gen.btn_Cancelar.Content  = "Volver";
                        gen.btn_Confirmar.Content = "Deshabilitar";
                        gen.ACCION.Content        = "Modificaring";
                        gen.lb_rut.Content        = txt_id_eli_ing.Text;
                        gen.Owner = this;
                        gen.ShowDialog();
                    }

                    catch (Exception ex)
                    {
                        Console.WriteLine(ex);
                        MessageBox.Show("Este Ingrediente no existe en el sistema");
                    }
                }
            }
        }
Esempio n. 10
0
        private void btn_crear_Click(object sender, RoutedEventArgs e)
        {
            bool txtcampo1 = true;
            bool txtcampo2 = true;
            bool txtcampo3 = true;
            bool txtcampo4 = true;
            bool txtcampo5 = true;
            bool txtcampo6 = true;
            bool txtcampo7 = true;
            bool critico   = true;

            if (rbt_alimentos.IsChecked == true)
            {
                if (txt_insumo_alimento.Text.Trim() == "" && txt_insumo_bebi.Text.Trim() == "")
                {
                    txtcampo1    = false;
                    lbl1.Content = "Debe Completar el campo";
                }

                if (txt_stock_alimento.Text.Trim() == "" && txt_stock_bebi.Text.Trim() == "")
                {
                    txtcampo2    = false;
                    lbl2.Content = "Debe Completar el campo";
                }

                if (txt_stock_coci_alimento.Text.Trim() == "" && txt_stock_coci_bebi.Text.Trim() == "")
                {
                    txtcampo3    = false;
                    lbl3.Content = "Debe Completar el campo";
                }

                if (cmb_proveedor.Text.Trim() == "" && txt_marca_bebi.Text.Trim() == "")
                {
                    txtcampo4    = false;
                    lbl4.Content = "Debe Completar el campo";
                }

                if (txt_precio_bebi.Text.Trim() == "" && txt_habili_ingre.Text.Trim() == "")
                {
                    txtcampo5    = false;
                    lbl5.Content = "Debe Completar el campo";
                }

                if (txt_stock_critico.Text == "")
                {
                    critico     = false;
                    lb8.Content = "Debe Completar el campo";
                }

                if (txtcampo1 && txtcampo2 && txtcampo3 && txtcampo4 && txtcampo5 && critico)

                {
                    IngredienteBLL ib = new IngredienteBLL();
                    ib.nombre_ingrediente = txt_insumo_alimento.Text;
                    ib.proveedor          = cmb_proveedor.Text;
                    ib.habilitado         = txt_habili_ingre.Text;
                    ib.stock         = Int32.Parse(txt_stock_alimento.Text);
                    ib.stock_cocina  = Int32.Parse(txt_stock_coci_alimento.Text);
                    ib.stock_critico = Int32.Parse(txt_stock_critico.Text);
                    bool estado = ib.AddIngrediente(ib);

                    if (estado)
                    {
                        PopupNotifier popup = new PopupNotifier();
                        popup.TitleText         = "Aviso";
                        popup.Image             = restaurantexxi_adminstrador.Properties.Resources.add;
                        popup.ContentText       = "Se ha Creado el ingrediente: " + txt_insumo_alimento.Text;
                        popup.AnimationDuration = 800;
                        popup.Delay             = 1700;
                        popup.Popup();

                        txt_insumo_alimento.Clear();
                        txt_stock_alimento.Clear();
                        txt_stock_coci_alimento.Clear();
                        cmb_proveedor.SelectedIndex    = -1;
                        txt_habili_ingre.SelectedIndex = -1;
                    }
                    else
                    {
                        MessageBox.Show("Bebestible no fue creado");
                    }
                }
            }

            else if (rbt_bebestibles.IsChecked == true)
            {
                if (txt_insumo_alimento.Text.Trim() == "" && txt_insumo_bebi.Text.Trim() == "")
                {
                    txtcampo1    = false;
                    lbl1.Content = "Debe Completar el campo";
                }

                if (txt_stock_alimento.Text.Trim() == "" && txt_stock_bebi.Text.Trim() == "")
                {
                    txtcampo2    = false;
                    lbl2.Content = "Debe Completar el campo";
                }

                if (txt_stock_coci_alimento.Text.Trim() == "" && txt_stock_coci_bebi.Text.Trim() == "")
                {
                    txtcampo3    = false;
                    lbl3.Content = "Debe Completar el campo";
                }

                if (cmb_proveedor.Text.Trim() == "" && txt_marca_bebi.Text.Trim() == "")
                {
                    txtcampo4    = false;
                    lbl4.Content = "Debe Completar el campo";
                }

                if (txt_precio_bebi.Text.Trim() == "" && txt_habili_ingre.Text.Trim() == "")
                {
                    txtcampo5    = false;
                    lbl5.Content = "Debe Completar el campo";
                }

                if (txt_habili_bebi.Text.Trim() == "")
                {
                    txtcampo6    = false;
                    lbl6.Content = "Debe Completar el campo";
                }

                if (txt_conpre_bebi.Text.Trim() == "")
                {
                    txtcampo7    = false;
                    lbl7.Content = "Debe Completar el campo";
                }

                if (txt_stock_critico.Text == "")
                {
                    critico     = false;
                    lb8.Content = "Debe Completar el campo";
                }

                if (txtcampo1 && txtcampo2 && txtcampo3 && txtcampo4 && txtcampo5 && txtcampo6 && txtcampo7 && critico)

                {
                    BebestibleBLL ib = new BebestibleBLL();
                    ib.nombre_beb    = txt_insumo_bebi.Text;
                    ib.marca         = cmb_proveedor.Text;
                    ib.precio        = Int32.Parse(txt_precio_bebi.Text);
                    ib.stock         = Int32.Parse(txt_stock_bebi.Text);
                    ib.stock_bar     = Int32.Parse(txt_stock_coci_bebi.Text);
                    ib.stock_critico = Int32.Parse(txt_stock_critico.Text);
                    ib.imagen        = imageBt;
                    string habilitado = "";
                    if (si_habilitado.IsSelected)
                    {
                        habilitado = "Si";
                    }
                    else if (no_habilitado.IsSelected)
                    {
                        habilitado = "No";
                    }
                    else
                    {
                        MessageBox.Show("Debe seleccionar un estado para el Insumo");
                    }
                    ib.habilitado = habilitado;
                    string con_prep = "";
                    if (si_con.IsSelected)
                    {
                        con_prep = "Si";
                    }
                    else if (no_con.IsSelected)
                    {
                        con_prep = "No";
                    }
                    else
                    {
                        MessageBox.Show("Debe seleccionar un estadi para el Insumo");
                    }
                    ib.con_prep = con_prep;
                    bool estado = ib.AddBebestible(ib);
                    if (estado)
                    {
                        PopupNotifier popup = new PopupNotifier();
                        popup.TitleText         = "Aviso";
                        popup.Image             = restaurantexxi_adminstrador.Properties.Resources.add;
                        popup.ContentText       = "Se ha Creado el bebestible: " + txt_insumo_alimento.Text;
                        popup.AnimationDuration = 800;
                        popup.Delay             = 1700;
                        popup.Popup();

                        txt_insumo_bebi.Clear();
                        txt_stock_bebi.Clear();
                        txt_stock_coci_bebi.Clear();
                        txt_marca_bebi.Clear();
                        txt_precio_bebi.Clear();
                        txt_habili_bebi.SelectedIndex = -1;
                        txt_conpre_bebi.SelectedIndex = -1;
                    }
                    else
                    {
                        MessageBox.Show("Insumo no fue creado");
                    }
                }
            }
        }
        private void Btn_Aceptar_pedido_Click(object sender, RoutedEventArgs e)
        {
            bool cantidad    = true;
            bool id_prov     = true;
            bool monto_total = true;


            if (txt_cant.Text.Trim() == "")
            {
                cantidad    = false;
                lb1.Content = "Debe ingresar una cantidad";
            }

            if (cbb_proveedor.SelectedIndex == -1)
            {
                id_prov     = false;
                lb2.Content = "Debe seleccionar un proveedor";
            }

            if (txt_monto.Text.Trim() == "")
            {
                monto_total = false;
                lb3.Content = "Ingrese un monto";
            }

            if (cantidad && id_prov && monto_total)
            {
                PedidoBLL      pb        = new PedidoBLL();
                BebestibleBLL  bb        = new BebestibleBLL();
                IngredienteBLL ib        = new IngredienteBLL();
                DataTable      dt        = new DataTable();
                int            id_pedido = Int32.Parse(txt_id_pedido.Text);
                int            monto     = Int32.Parse(txt_monto.Text);
                int            id_provee = Int32.Parse(cbb_proveedor.SelectedValue.ToString());
                string         ni        = txt_nombreInsumo.Text;
                string         tipo      = pb.Get_tipo_pedido(id_pedido);
                int            idinsumo  = -1;
                if (tipo == "Pedido de ingredientes")
                {
                    idinsumo = ib.Get_idbynom(ni);
                }
                else if (tipo == "Pedido de bebestibles")
                {
                    idinsumo = bb.Get_bebyid(ni);
                }
                int canti = Int32.Parse(txt_cant.Text);
                pb.Alter_detalle_pedido(canti, id_provee, monto, idinsumo, id_pedido);
                pb.Alter_montototalporboleta(id_pedido);
                txt_id_pedido.Text       = "";
                txt_cant.Text            = "";
                txt_monto.Text           = "";
                txt_nombreInsumo.Text    = "";
                txt_stockcocina_bar.Text = "";
                txt_stock_bodega.Text    = "";
                txt_stock_critico.Text   = "";
                txt_stock_total.Text     = "";
                if (rdb_todos.IsChecked == true)
                {
                    DataTable dtt = pb.Get_all_pedidos();
                    dtg_pedidos.ItemsSource = dtt.DefaultView;
                }
                else if (rdb_todos_hoy.IsChecked == true)
                {
                    DataTable dth = pb.Get_all_pedidos_hoy();
                    dtg_pedidos.ItemsSource = dth.DefaultView;
                }
                else if (rdb_todos_senana.IsChecked == true)
                {
                    DataTable dts = pb.Get_all_pedidos_semana();
                    dtg_pedidos.ItemsSource = dts.DefaultView;
                }
                else if (rdb_todos_mes.IsChecked == true)
                {
                    DataTable dtm = pb.Get_all_pedidos_mes();
                    dtg_pedidos.ItemsSource = dtm.DefaultView;
                }
                //cbb_proveedor.SelectedIndex = -1;

                if (tipo == "Pedido de bebestibles")
                {
                    dt = pb.Get_detaPediById_bebestible(id_pedido);
                    dtg_detalle.ItemsSource = dt.DefaultView;
                }
                else if (tipo == "Pedido de ingredientes")
                {
                    dt = pb.Get_detPediById_ingredientes(id_pedido);
                    dtg_detalle.ItemsSource = dt.DefaultView;
                }
            }
        }
Esempio n. 12
0
        private void Modificar_id_Click(object sender, RoutedEventArgs e)
        {
            bool txtcampo1 = true;
            bool txtcampo2 = true;
            bool txtcampo3 = true;
            bool txtcampo4 = true;
            bool txtcampo5 = true;
            bool txtcampo6 = true;
            bool txtcampo7 = true;
            bool txtcampo8 = true;

            if (rbt_ing.IsChecked == true)
            {
                if (txt_id_bebida.Text.Trim() == "" && txt_id_alimento.Text.Trim() == "")
                {
                    txtcampo1    = false;
                    lbl1.Content = "Debe Completar el campo";
                }

                if (txt_nombre_ali.Text.Trim() == "" && txt_nombre_bebi.Text.Trim() == "")
                {
                    txtcampo2    = false;
                    lbl2.Content = "Debe Completar el campo";
                }

                if (txt_stock_ali.Text.Trim() == "" && txt_stock_bebi.Text.Trim() == "")
                {
                    txtcampo3    = false;
                    lbl3.Content = "Debe Completar el campo";
                }

                if (txt_stock_coci_alimento.Text.Trim() == "" && txt_stock_bar_bebi.Text.Trim() == "")
                {
                    txtcampo4    = false;
                    lbl4.Content = "Debe Completar el campo";
                }

                if (txt_proveedor.Text.Trim() == "" && txt_marca_bebi.Text.Trim() == "")
                {
                    txtcampo5    = false;
                    lbl5.Content = "Debe Completar el campo";
                }

                if (txt_precio_bebi.Text.Trim() == "" && cmb_habili_ing.Text.Trim() == "")
                {
                    txtcampo6    = false;
                    lbl6.Content = "Debe Completar el campo";
                }

                if (txtcampo1 && txtcampo2 && txtcampo3 && txtcampo4 && txtcampo5 && txtcampo6)

                {
                    IngredienteBLL ub = new IngredienteBLL();
                    ub.id_ingrediente     = Int32.Parse(txt_id_alimento.Text);
                    ub.nombre_ingrediente = txt_nombre_ali.Text;
                    ub.proveedor          = txt_proveedor.Text;
                    ub.habilitado         = cmb_habili_ing.Text;
                    ub.stock        = Int32.Parse(txt_stock_ali.Text);
                    ub.stock_cocina = Int32.Parse(txt_stock_coci_alimento.Text);
                    ub.AlterinIngrediente(ub);
                    MessageBox.Show("Usuario Modificado correctamente");
                }
            }
            else if (rbt_bebi.IsChecked == true)
            {
                if (txt_id_bebida.Text.Trim() == "" && txt_id_alimento.Text.Trim() == "")
                {
                    txtcampo1    = false;
                    lbl1.Content = "Debe Completar el campo";
                }

                if (txt_nombre_ali.Text.Trim() == "" && txt_nombre_bebi.Text.Trim() == "")
                {
                    txtcampo2    = false;
                    lbl2.Content = "Debe Completar el campo";
                }

                if (txt_stock_ali.Text.Trim() == "" && txt_stock_bebi.Text.Trim() == "")
                {
                    txtcampo3    = false;
                    lbl3.Content = "Debe Completar el campo";
                }

                if (txt_stock_coci_alimento.Text.Trim() == "" && txt_stock_bar_bebi.Text.Trim() == "")
                {
                    txtcampo4    = false;
                    lbl4.Content = "Debe Completar el campo";
                }

                if (txt_proveedor.Text.Trim() == "" && txt_marca_bebi.Text.Trim() == "")
                {
                    txtcampo5    = false;
                    lbl5.Content = "Debe Completar el campo";
                }

                if (txt_precio_bebi.Text.Trim() == "" && cmb_habili_ing.Text.Trim() == "")
                {
                    txtcampo6    = false;
                    lbl6.Content = "Debe Completar el campo";
                }

                if (cmb_habili_bebi.Text.Trim() == "")
                {
                    txtcampo7    = false;
                    lbl7.Content = "Debe Completar el campo";
                }

                if (cmb_conpre_bebi.Text.Trim() == "")
                {
                    txtcampo8    = false;
                    lbl8.Content = "Debe Completar el campo";
                }

                if (txtcampo1 && txtcampo2 && txtcampo3 && txtcampo4 && txtcampo5 && txtcampo6 && txtcampo7 && txtcampo8)

                {
                    BebestibleBLL ub = new BebestibleBLL();
                    ub.id_bebestible = Int32.Parse(txt_id_bebida.Text);
                    ub.nombre_beb    = txt_nombre_bebi.Text;
                    ub.marca         = txt_marca_bebi.Text;
                    ub.precio        = Int32.Parse(txt_precio_bebi.Text);
                    ub.stock         = Int32.Parse(txt_stock_bebi.Text);
                    ub.stock_bar     = Int32.Parse(txt_stock_bar_bebi.Text);
                    ub.habilitado    = cmb_habili_bebi.Text;
                    ub.con_prep      = cmb_conpre_bebi.Text;
                    ub.AlterinBebestible(ub);
                    MessageBox.Show("Usuario Modificado correctamente");
                }
            }
        }
Esempio n. 13
0
        static void Main()
        {
            int idIngrediente = 1, idReceita = 0, idReceitaIngrediente = 1, idPizza = 1, idEstoque = 1;

            // Lista de ingredientes que estão em estoque

            IngredienteBLL.IngredienteDB = new List <IngredienteModel>();
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Farinha", UnidadeMedida = "g"
            });
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Mussarela", UnidadeMedida = "g"
            });
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Calabresa", UnidadeMedida = "g"
            });
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Frango", UnidadeMedida = "g"
            });
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Provolone", UnidadeMedida = "g"
            });
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Catupiry", UnidadeMedida = "g"
            });
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Cebola", UnidadeMedida = "g"
            });
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Tomate", UnidadeMedida = "g"
            });
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Alho", UnidadeMedida = "g"
            });
            IngredienteBLL.IngredienteDB.Add(new IngredienteModel()
            {
                IdIngrediente = idIngrediente++, Nome = "Azeitona", UnidadeMedida = "g"
            });


            // Cria receita da Pizza de Mussarela

            ReceitaBLL.ReceitaDB = new List <ReceitaModel>();
            ReceitaBLL.ReceitaDB.Add(new ReceitaModel()
            {
                IdReceita = ++idReceita, Nome = "Mussarela", Ingredientes = new List <ReceitaIngredienteModel>()
            });

            ReceitaIngredienteBLL.ReceitaIngredienteDB = new List <ReceitaIngredienteModel>();
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 200, IdIngrediente = 1, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(1)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 200, IdIngrediente = 2, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(2)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 100, IdIngrediente = 8, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(8)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 50, IdIngrediente = 10, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(10)
            });
            try { ReceitaBLL.GetPorId(idReceita).Ingredientes = ReceitaIngredienteBLL.GetByReceitaId(idReceita); } catch { }
            PizzaBLL.PizzaDB = new List <PizzaModel>();
            PizzaBLL.PizzaDB.Add(new PizzaModel()
            {
                IdPizza = idPizza++, Nome = "Mussarela", Sabor = "Mussarela", IdReceita = idReceita, Receita = ReceitaBLL.GetPorId(idReceita)
            });

            // Cria receida da Pizza de Calabresa

            ReceitaBLL.ReceitaDB = new List <ReceitaModel>();
            ReceitaBLL.ReceitaDB.Add(new ReceitaModel()
            {
                IdReceita = ++idReceita, Nome = "Calabresa", Ingredientes = new List <ReceitaIngredienteModel>()
            });

            ReceitaIngredienteBLL.ReceitaIngredienteDB = new List <ReceitaIngredienteModel>();
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 200, IdIngrediente = 1, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(1)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 200, IdIngrediente = 2, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(2)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 100, IdIngrediente = 3, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(3)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 100, IdIngrediente = 7, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(7)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 100, IdIngrediente = 8, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(8)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 50, IdIngrediente = 10, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(10)
            });
            try { ReceitaBLL.GetPorId(idReceita).Ingredientes = ReceitaIngredienteBLL.GetByReceitaId(idReceita); } catch { }
            PizzaBLL.PizzaDB.Add(new PizzaModel()
            {
                IdPizza = idPizza++, Nome = "Calabresa", Sabor = "Calabresa", IdReceita = idReceita, Receita = ReceitaBLL.GetPorId(idReceita)
            });

            // Cria receita de Frango

            ReceitaBLL.ReceitaDB = new List <ReceitaModel>();
            ReceitaBLL.ReceitaDB.Add(new ReceitaModel()
            {
                IdReceita = ++idReceita, Nome = "Frango", Ingredientes = new List <ReceitaIngredienteModel>()
            });

            ReceitaIngredienteBLL.ReceitaIngredienteDB = new List <ReceitaIngredienteModel>();
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 200, IdIngrediente = 1, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(1)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 200, IdIngrediente = 2, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(2)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 200, IdIngrediente = 3, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(3)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 100, IdIngrediente = 6, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(6)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 100, IdIngrediente = 8, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(8)
            });
            ReceitaIngredienteBLL.ReceitaIngredienteDB.Add(new ReceitaIngredienteModel()
            {
                IdReceitaIngrediente = idReceitaIngrediente++, IdReceita = idReceita, Quantidade = 50, IdIngrediente = 10, Receita = ReceitaBLL.GetPorId(idReceita), Ingrediente = IngredienteBLL.GetIngredienteById(10)
            });
            try { ReceitaBLL.GetPorId(idReceita).Ingredientes = ReceitaIngredienteBLL.GetByReceitaId(idReceita); } catch { }
            PizzaBLL.PizzaDB.Add(new PizzaModel()
            {
                IdPizza = idPizza++, Nome = "Frango", Sabor = "Frango", IdReceita = idReceita, Receita = ReceitaBLL.GetPorId(idReceita)
            });

            EstoqueBLL.EstoqueDB = new BindingList <EstoqueModel>();
            for (int i = 1; i < idIngrediente; i++)
            {
                EstoqueBLL.EstoqueDB.Add(new EstoqueModel()
                {
                    IdEstoque = idEstoque++, IdIngrediente = i, Ingrediente = IngredienteBLL.GetIngredienteById(i), Quantidade = 100000
                });
            }

            PedidoBLL.PedidoDB = new BindingList <PedidoModel>();
            //PedidoBLL.PedidoDB.Add(new PedidoModel() { IdPedido = 1, NumeroPedido = "PED - 000000" });

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmPrincipal());
        }
Esempio n. 14
0
        private void rbt_ing_Checked(object sender, RoutedEventArgs e)
        {
            txt_id_alimento.Visibility         = Visibility.Visible;
            txt_nombre_ali.Visibility          = Visibility.Visible;
            txt_stock_ali.Visibility           = Visibility.Visible;
            txt_stock_coci_alimento.Visibility = Visibility.Visible;
            txt_proveedor.Visibility           = Visibility.Visible;
            cmb_habili_ing.Visibility          = Visibility.Visible;
            txt_proveedor.SelectedIndex        = -1;

            lbl_iding.Visibility               = Visibility.Visible;
            lbl_insumo_alimento.Visibility     = Visibility.Visible;
            lbl_stock_alimento.Visibility      = Visibility.Visible;
            lbl_stock_coci_alimento.Visibility = Visibility.Visible;
            lbl_alimento.Visibility            = Visibility.Visible;
            lbl_habili_ing.Visibility          = Visibility.Visible;
            lb_stock_critico.Visibility        = Visibility.Visible;
            txt_stock_critico.Visibility       = Visibility.Visible;
            Buscar_ID.Visibility               = Visibility.Visible;
            dtg_modi.Visibility = Visibility.Visible;

            lbl_idbebi.Visibility          = Visibility.Hidden;
            lbl_insumo_bebi.Visibility     = Visibility.Hidden;
            lbl_stock_bebi.Visibility      = Visibility.Hidden;
            lbl_stock_coci_bebi.Visibility = Visibility.Hidden;
            lbl_marca_bebi.Visibility      = Visibility.Hidden;
            lbl_precio_bebi.Visibility     = Visibility.Hidden;
            lbl_habili_bebi.Visibility     = Visibility.Hidden;
            lbl_conpre_bebi.Visibility     = Visibility.Hidden;

            txt_id_bebida.Visibility      = Visibility.Hidden;
            txt_nombre_bebi.Visibility    = Visibility.Hidden;
            txt_stock_bebi.Visibility     = Visibility.Hidden;
            txt_stock_bar_bebi.Visibility = Visibility.Hidden;
            txt_marca_bebi.Visibility     = Visibility.Hidden;
            txt_precio_bebi.Visibility    = Visibility.Hidden;
            cmb_habili_bebi.Visibility    = Visibility.Hidden;
            cmb_conpre_bebi.Visibility    = Visibility.Hidden;

            Modificar_id.IsEnabled = true;

            lbl1.Content = "";
            lbl2.Content = "";
            lbl3.Content = "";
            lbl4.Content = "";
            lbl5.Content = "";
            lbl6.Content = "";
            lbl7.Content = "";
            lbl8.Content = "";

            txt_id_bebida.Clear();
            txt_nombre_bebi.Clear();
            txt_stock_bebi.Clear();
            txt_stock_bar_bebi.Clear();
            txt_marca_bebi.Clear();
            txt_precio_bebi.Clear();
            cmb_habili_bebi.SelectedIndex = -1;
            cmb_conpre_bebi.SelectedIndex = -1;

            IngredienteBLL ib = new IngredienteBLL();

            System.Data.DataTable dt = ib.AllingredientesList();
            dtg_modi.ItemsSource = dt.DefaultView;
        }
Esempio n. 15
0
        private void Modificar_id_Click(object sender, RoutedEventArgs e)
        {
            bool txtcampo1 = true;
            bool txtcampo2 = true;
            bool txtcampo3 = true;
            bool txtcampo4 = true;
            bool txtcampo5 = true;
            bool txtcampo6 = true;
            bool txtcampo7 = true;
            bool txtcampo8 = true;
            bool scv       = true;

            if (rbt_ing.IsChecked == true)
            {
                if (txt_id_bebida.Text.Trim() == "" && txt_id_alimento.Text.Trim() == "")
                {
                    txtcampo1    = false;
                    lbl1.Content = "Debe Completar el campo";
                }

                if (txt_stock_critico.Text == "")
                {
                    scv = false;
                    lb_stock_critico.Content = "Complete el campo";
                }

                if (txt_nombre_ali.Text.Trim() == "" && txt_nombre_bebi.Text.Trim() == "")
                {
                    txtcampo2    = false;
                    lbl2.Content = "Debe Completar el campo";
                }

                if (txt_stock_ali.Text.Trim() == "" && txt_stock_bebi.Text.Trim() == "")
                {
                    txtcampo3    = false;
                    lbl3.Content = "Debe Completar el campo";
                }

                if (txt_stock_coci_alimento.Text.Trim() == "" && txt_stock_bar_bebi.Text.Trim() == "")
                {
                    txtcampo4    = false;
                    lbl4.Content = "Debe Completar el campo";
                }

                if (txt_proveedor.Text.Trim() == "" && txt_marca_bebi.Text.Trim() == "")
                {
                    txtcampo5    = false;
                    lbl5.Content = "Debe Completar el campo";
                }

                if (txt_precio_bebi.Text.Trim() == "" && cmb_habili_ing.Text.Trim() == "")
                {
                    txtcampo6    = false;
                    lbl6.Content = "Debe Completar el campo";
                }

                if (txtcampo1 && txtcampo2 && txtcampo3 && txtcampo4 && txtcampo5 && txtcampo6)

                {
                    IngredienteBLL ub = new IngredienteBLL();
                    ub.id_ingrediente     = Int32.Parse(txt_id_alimento.Text);
                    ub.nombre_ingrediente = txt_nombre_ali.Text;
                    ub.proveedor          = txt_proveedor.Text;
                    ub.habilitado         = cmb_habili_ing.Text;
                    ub.stock         = Int32.Parse(txt_stock_ali.Text);
                    ub.stock_cocina  = Int32.Parse(txt_stock_coci_alimento.Text);
                    ub.stock_critico = Int32.Parse(txt_stock_critico.Text);
                    ub.AlterinIngrediente(ub);


                    System.Data.DataTable dt = ub.AllingredientesList();

                    dtg_modi.ItemsSource = dt.DefaultView;



                    PopupNotifier popup = new PopupNotifier();
                    popup.TitleText         = "Aviso";
                    popup.Image             = restaurantexxi_adminstrador.Properties.Resources.add;
                    popup.ContentText       = "Se ha modificado el Ingrediente: " + txt_nombre_ali.Text;
                    popup.AnimationDuration = 800;
                    popup.Delay             = 1700;
                    popup.Popup();

                    IngredienteBLL        ib  = new IngredienteBLL();
                    System.Data.DataTable dtt = ib.AllingredientesList();
                    dtg_modi.ItemsSource = dtt.DefaultView;
                }
            }
            else if (rbt_bebi.IsChecked == true)
            {
                if (txt_id_bebida.Text.Trim() == "" && txt_id_alimento.Text.Trim() == "")
                {
                    txtcampo1    = false;
                    lbl1.Content = "Debe Completar el campo";
                }

                if (txt_nombre_ali.Text.Trim() == "" && txt_nombre_bebi.Text.Trim() == "")
                {
                    txtcampo2    = false;
                    lbl2.Content = "Debe Completar el campo";
                }

                if (txt_stock_ali.Text.Trim() == "" && txt_stock_bebi.Text.Trim() == "")
                {
                    txtcampo3    = false;
                    lbl3.Content = "Debe Completar el campo";
                }

                if (txt_stock_critico.Text == "")
                {
                    scv = false;
                    lb_stock_critico.Content = "Complete el campo";
                }

                if (txt_stock_coci_alimento.Text.Trim() == "" && txt_stock_bar_bebi.Text.Trim() == "")
                {
                    txtcampo4    = false;
                    lbl4.Content = "Debe Completar el campo";
                }

                if (txt_proveedor.Text.Trim() == "" && txt_marca_bebi.Text.Trim() == "")
                {
                    txtcampo5    = false;
                    lbl5.Content = "Debe Completar el campo";
                }

                if (txt_precio_bebi.Text.Trim() == "" && cmb_habili_ing.Text.Trim() == "")
                {
                    txtcampo6    = false;
                    lbl6.Content = "Debe Completar el campo";
                }

                if (cmb_habili_bebi.Text.Trim() == "")
                {
                    txtcampo7    = false;
                    lbl7.Content = "Debe Completar el campo";
                }

                if (cmb_conpre_bebi.Text.Trim() == "")
                {
                    txtcampo8    = false;
                    lbl8.Content = "Debe Completar el campo";
                }

                if (txtcampo1 && txtcampo2 && txtcampo3 && txtcampo4 && txtcampo5 && txtcampo6 && txtcampo7 && txtcampo8)
                {
                    BebestibleBLL ub = new BebestibleBLL();
                    ub.id_bebestible = Int32.Parse(txt_id_bebida.Text);
                    ub.nombre_beb    = txt_nombre_bebi.Text;
                    ub.marca         = txt_proveedor.Text;
                    ub.precio        = Int32.Parse(txt_precio_bebi.Text);
                    ub.stock         = Int32.Parse(txt_stock_bebi.Text);
                    ub.stock_bar     = Int32.Parse(txt_stock_bar_bebi.Text);
                    ub.stock_critico = Int32.Parse(txt_stock_critico.Text);
                    ub.habilitado    = cmb_habili_bebi.Text;
                    ub.con_prep      = cmb_conpre_bebi.Text;

                    ub.AlterinBebestible(ub);


                    System.Data.DataTable dt = ub.Allbebestible();
                    dtg_modi.ItemsSource = dt.DefaultView;
                    PopupNotifier popup = new PopupNotifier();
                    popup.TitleText         = "Aviso";
                    popup.Image             = restaurantexxi_adminstrador.Properties.Resources.add;
                    popup.ContentText       = "Se ha modificado el bebestible: " + txt_nombre_bebi.Text;
                    popup.AnimationDuration = 800;
                    popup.Delay             = 1700;
                    popup.Popup();

                    BebestibleBLL         ib  = new BebestibleBLL();
                    System.Data.DataTable dtt = ib.Allbebestible();
                    dtg_modi.ItemsSource = dtt.DefaultView;
                }
            }
        }
 public TestValoresLanche()
 {
     _lancheBLL      = new LancheBLL();
     _ingredienteBLL = new IngredienteBLL();
 }
Esempio n. 17
0
        private void btn_crear_Click(object sender, RoutedEventArgs e)
        {
            bool           nombre      = true;
            bool           precio      = true;
            bool           seleccionar = true;
            bool           cantidad    = true;
            bool           descripcion = true;
            bool           categ       = true;
            bool           hab         = true;
            IngredienteBLL ib          = new IngredienteBLL();
            PlatoBLL       plbll       = new PlatoBLL();

            if (txt_nomb.Text.Trim() == "")
            {
                nombre       = false;
                lb12.Content = "Debe ingresar el Nombre del Plato";
            }
            if (txt_precio.Text.Trim() == "")
            {
                precio       = false;
                lb13.Content = "Debe ingresar el Precio del Plato";
            }

            if (cbb_ingre.Text == "")
            {
                nombre       = false;
                lb14.Content = "Debe ingresar Los Ingredientes del Plato";
            }
            if (txt_cant.Text.Trim() == "")
            {
                cantidad     = false;
                lb15.Content = "Debe ingresar la Cantidad del ingrediente";
            }
            if (txt_desc.Text.Trim() == "")
            {
                descripcion  = false;
                lb16.Content = "Debe ingresar una Descripcion para el plato";
            }
            if (cbb_catego.Text == "")
            {
                categ        = false;
                lb17.Content = "Debe ingresar una Categoria al plato";
            }
            if (cbb_habi.Text.Trim() == "")
            {
                hab          = false;
                lb18.Content = "Debe ingresar el estado del Pato";
            }

            if (nombre && precio && seleccionar && cantidad && descripcion && categ && hab)
            {
                plbll.Categoria    = cbb_catego.Text;
                plbll.Habilitado   = cbb_habi.Text;
                plbll.Nombre_plato = txt_nomb.Text;
                plbll.Precio       = int.Parse(txt_precio.Text);
                plbll.Imagen       = imageBt;
                plbll.descripcion  = txt_desc.Text;
                int cantinicial = Int32.Parse(txt_cantinicial.Text);
                plbll.insert_plato(plbll, cantinicial);


                foreach (DataRow line in dtl.Rows)
                {
                    int      id    = int.Parse(line["id"].ToString());
                    int      cant  = int.Parse(line["cantidad"].ToString());
                    PlatoBLL ptbll = new PlatoBLL();
                    ptbll.crea_relacion_plato_ing(id, cant);
                }

                MessageBox.Show("Receta creada correctamente");
            }
        }
Esempio n. 18
0
        private void Buscar_ID_Click(object sender, RoutedEventArgs e)
        {
            if (rbt_ing.IsChecked == true)
            {
                IngredienteBLL us = new IngredienteBLL();
                bool           id = true;
                if (txt_id_alimento.Text == "")
                {
                    id           = false;
                    lbl1.Content = "Debe ingresar una id";
                }

                if (id)
                {
                    int id_ingrediente = Int32.Parse(txt_id_alimento.Text);
                    try
                    {
                        DataTable da  = us.listarmodificar(id_ingrediente);
                        DataRow   row = da.Rows[0];
                        txt_nombre_ali.Text          = row[0].ToString();
                        txt_proveedor.Text           = row[1].ToString();
                        txt_stock_ali.Text           = row[2].ToString();
                        txt_stock_coci_alimento.Text = row[3].ToString();
                        cmb_habili_ing.Text          = row[4].ToString();
                        txt_stock_critico.Text       = row[5].ToString();



                        txt_id_alimento.IsEnabled         = true;
                        txt_nombre_ali.IsEnabled          = true;
                        txt_stock_ali.IsEnabled           = true;
                        txt_stock_coci_alimento.IsEnabled = true;
                        txt_proveedor.IsEnabled           = true;
                        cmb_habili_ing.IsEnabled          = true;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("" + ex);
                    }
                }
            }
            else if (rbt_bebi.IsChecked == true)
            {
                BebestibleBLL us = new BebestibleBLL();
                if (txt_id_bebida.Text == "")
                {
                    MessageBox.Show("Debe ingresar un ID para poder buscar a un Insumo");
                }
                else if (txt_id_bebida.Text != "")
                {
                    int id_bebestible = Int32.Parse(txt_id_bebida.Text);
                    us.listarmodificar(id_bebestible);
                    try
                    {
                        DataTable da  = us.listarmodificar(id_bebestible);
                        DataRow   row = da.Rows[0];
                        txt_nombre_bebi.Text    = row[1].ToString();
                        txt_proveedor.Text      = row[2].ToString();
                        txt_precio_bebi.Text    = row[3].ToString();
                        txt_stock_bebi.Text     = row[4].ToString();
                        txt_stock_bar_bebi.Text = row[5].ToString();
                        cmb_habili_bebi.Text    = row[6].ToString();
                        cmb_conpre_bebi.Text    = row[7].ToString();
                        txt_stock_critico.Text  = row[8].ToString();

                        txt_id_bebida.IsEnabled      = true;
                        txt_nombre_bebi.IsEnabled    = true;
                        txt_stock_bebi.IsEnabled     = true;
                        txt_stock_bar_bebi.IsEnabled = true;
                        txt_precio_bebi.IsEnabled    = true;
                        cmb_habili_bebi.IsEnabled    = true;
                        txt_proveedor.IsEnabled      = true;
                        cmb_conpre_bebi.IsEnabled    = true;
                    }
                    catch
                    {
                        MessageBox.Show("Esta ID no existe en el sistema");
                    }
                }
            }
        }
Esempio n. 19
0
        private void Btn_Confirmar_Click(object sender, RoutedEventArgs e)
        {
            usuarioBLL us  = new usuarioBLL();
            string     act = ACCION.Content.ToString();

            if (act == "eliminar")
            {
                int rut = Int32.Parse(lb_rut.Content.ToString());
                lb_titulo.VerticalAlignment = VerticalAlignment.Center;
                us.rut = rut;
                us.DeleteUser(us);
                PopupNotifier popup = new PopupNotifier();
                popup.TitleText         = "Aviso";
                popup.Image             = Properties.Resources.delete;
                popup.ContentText       = "Se ha Eliminado el usuario con rut: " + rut;
                popup.AnimationDuration = 800;
                popup.Delay             = 1400;
                popup.Popup();
                Close();
            }
            else if (act == "eliminarprov")
            {
                ProveedorBLL pb = new ProveedorBLL();
                int          id = Int32.Parse(lb_rut.Content.ToString());
                pb.deleteprov(id);
                PopupNotifier popup = new PopupNotifier();
                popup.TitleText         = "Aviso";
                popup.Image             = Properties.Resources.delete;
                popup.ContentText       = "Se ha Eliminado el Proveedor con id: " + id;
                popup.AnimationDuration = 500;
                popup.Delay             = 2500;
                popup.Popup();
                Close();
            }
            else if (act == "deletemesa")
            {
                MesaBLL mb  = new MesaBLL();
                int     num = Int32.Parse(lb_rut.Content.ToString());
                mb.DeleteMesa(num);
                PopupNotifier popup = new PopupNotifier();
                popup.TitleText         = "Aviso";
                popup.Image             = Properties.Resources.delete;
                popup.ContentText       = "Se ha Eliminado la mesa número: " + num;
                popup.AnimationDuration = 500;
                popup.Delay             = 2500;
                popup.Popup();
                Close();
            }
            else if (act == "Modificarbebi")
            {
                int           id = Int32.Parse(lb_rut.Content.ToString());
                BebestibleBLL bb = new BebestibleBLL();
                lb_titulo.VerticalAlignment = VerticalAlignment.Center;
                PopupNotifier popup = new PopupNotifier();
                popup.TitleText         = "Aviso";
                popup.Image             = Properties.Resources.add;
                popup.ContentText       = "Se ha Deshabilitado el bebestible con id: " + id;
                popup.AnimationDuration = 500;
                popup.Delay             = 2000;
                popup.Popup();
                bb.id_bebestible = id;
                bb.Alterinhabilitado(bb);
                Close();
            }
            else if (act == "Modificaring")
            {
                int id = Int32.Parse(lb_rut.Content.ToString());
                lb_titulo.VerticalAlignment = VerticalAlignment.Center;
                IngredienteBLL ib = new IngredienteBLL();
                ib.id_ingrediente = id;
                PopupNotifier popup = new PopupNotifier();
                popup.TitleText         = "Aviso";
                popup.Image             = Properties.Resources.add;
                popup.ContentText       = "Se ha Deshabilitado el ingrediente con id: " + id;
                popup.AnimationDuration = 500;
                popup.Delay             = 2000;
                popup.Popup();
                ib.Alterinhabilitadoing(ib);
                Close();
            }
            else if (act == "deshabilitar")
            {
                PlatoBLL pb = new PlatoBLL();
                pb.Id_plato = Int32.Parse(lb_rut.Content.ToString());
                pb.DesPlato(pb);
                Close();
                PopupNotifier popup = new PopupNotifier();
                popup.TitleText         = "Aviso";
                popup.Image             = Properties.Resources.delete;
                popup.ContentText       = "Se ha Deshabilitado el plato con id: " + Int32.Parse(lb_rut.Content.ToString());
                popup.AnimationDuration = 500;
                popup.Delay             = 2000;
                popup.Popup();
                Close();
            }
            else if (act == "go_list")
            {
                ListarMesas lm = new ListarMesas();
                lm.Owner = this;
                lm.rdb_todas.IsChecked = true;
                lm.ShowDialog();
                Close();
            }
            else
            {
            }
        }
Esempio n. 20
0
        private void btn_crear_Click(object sender, RoutedEventArgs e)
        {
            bool txtcampo1 = true;
            bool txtcampo2 = true;
            bool txtcampo3 = true;
            bool txtcampo4 = true;
            bool txtcampo5 = true;
            bool txtcampo6 = true;
            bool txtcampo7 = true;

            if (rbt_alimentos.IsChecked == true)
            {
                if (txt_insumo_alimento.Text.Trim() == "" && txt_insumo_bebi.Text.Trim() == "")
                {
                    txtcampo1    = false;
                    lbl1.Content = "Debe Completar el campo";
                }

                if (txt_stock_alimento.Text.Trim() == "" && txt_stock_bebi.Text.Trim() == "")
                {
                    txtcampo2    = false;
                    lbl2.Content = "Debe Completar el campo";
                }

                if (txt_stock_coci_alimento.Text.Trim() == "" && txt_stock_coci_bebi.Text.Trim() == "")
                {
                    txtcampo3    = false;
                    lbl3.Content = "Debe Completar el campo";
                }

                if (cmb_proveedor.Text.Trim() == "" && txt_marca_bebi.Text.Trim() == "")
                {
                    txtcampo4    = false;
                    lbl4.Content = "Debe Completar el campo";
                }

                if (txt_precio_bebi.Text.Trim() == "" && txt_habili_ingre.Text.Trim() == "")
                {
                    txtcampo5    = false;
                    lbl5.Content = "Debe Completar el campo";
                }

                if (txtcampo1 && txtcampo2 && txtcampo3 && txtcampo4 && txtcampo5)

                {
                    IngredienteBLL ib = new IngredienteBLL();
                    ib.nombre_ingrediente = txt_insumo_alimento.Text;
                    ib.proveedor          = cmb_proveedor.Text;
                    ib.habilitado         = txt_habili_ingre.Text;
                    ib.stock        = Int32.Parse(txt_stock_alimento.Text);
                    ib.stock_cocina = Int32.Parse(txt_stock_coci_alimento.Text);
                    bool estado = ib.AddIngrediente(ib);

                    if (estado)
                    {
                        MessageBox.Show("Bebestible creado correctamente");
                        txt_insumo_alimento.Clear();
                        txt_stock_alimento.Clear();
                        txt_stock_coci_alimento.Clear();
                        cmb_proveedor.SelectedIndex    = -1;
                        txt_habili_ingre.SelectedIndex = -1;
                    }
                    else
                    {
                        MessageBox.Show("Bebestible no fue creado");
                    }
                }
            }

            else if (rbt_bebestibles.IsChecked == true)
            {
                if (txt_insumo_alimento.Text.Trim() == "" && txt_insumo_bebi.Text.Trim() == "")
                {
                    txtcampo1    = false;
                    lbl1.Content = "Debe Completar el campo";
                }

                if (txt_stock_alimento.Text.Trim() == "" && txt_stock_bebi.Text.Trim() == "")
                {
                    txtcampo2    = false;
                    lbl2.Content = "Debe Completar el campo";
                }

                if (txt_stock_coci_alimento.Text.Trim() == "" && txt_stock_coci_bebi.Text.Trim() == "")
                {
                    txtcampo3    = false;
                    lbl3.Content = "Debe Completar el campo";
                }

                if (cmb_proveedor.Text.Trim() == "" && txt_marca_bebi.Text.Trim() == "")
                {
                    txtcampo4    = false;
                    lbl4.Content = "Debe Completar el campo";
                }

                if (txt_precio_bebi.Text.Trim() == "" && txt_habili_ingre.Text.Trim() == "")
                {
                    txtcampo5    = false;
                    lbl5.Content = "Debe Completar el campo";
                }

                if (txt_habili_bebi.Text.Trim() == "")
                {
                    txtcampo6    = false;
                    lbl6.Content = "Debe Completar el campo";
                }

                if (txt_conpre_bebi.Text.Trim() == "")
                {
                    txtcampo7    = false;
                    lbl7.Content = "Debe Completar el campo";
                }

                if (txtcampo1 && txtcampo2 && txtcampo3 && txtcampo4 && txtcampo5 && txtcampo6 && txtcampo7)

                {
                    BebestibleBLL ib = new BebestibleBLL();
                    ib.nombre_beb = txt_insumo_bebi.Text;
                    ib.marca      = txt_marca_bebi.Text;
                    ib.precio     = Int32.Parse(txt_precio_bebi.Text);
                    ib.stock      = Int32.Parse(txt_stock_bebi.Text);
                    ib.stock_bar  = Int32.Parse(txt_stock_coci_bebi.Text);
                    ib.imagen     = imageBt;
                    string habilitado = "";
                    if (si_habilitado.IsSelected)
                    {
                        habilitado = "Si";
                    }
                    else if (no_habilitado.IsSelected)
                    {
                        habilitado = "No";
                    }
                    else
                    {
                        MessageBox.Show("Debe seleccionar un estado para el Insumo");
                    }
                    ib.habilitado = habilitado;
                    string con_prep = "";
                    if (si_con.IsSelected)
                    {
                        con_prep = "Si";
                    }
                    else if (no_con.IsSelected)
                    {
                        con_prep = "No";
                    }
                    else
                    {
                        MessageBox.Show("Debe seleccionar un estadi para el Insumo");
                    }
                    ib.con_prep = con_prep;
                    bool estado = ib.AddBebestible(ib);
                    if (estado)
                    {
                        MessageBox.Show("Insumo creado correctamente");
                        txt_insumo_bebi.Clear();
                        txt_stock_bebi.Clear();
                        txt_stock_coci_bebi.Clear();
                        txt_marca_bebi.Clear();
                        txt_precio_bebi.Clear();
                        txt_habili_bebi.SelectedIndex = -1;
                        txt_conpre_bebi.SelectedIndex = -1;
                    }
                    else
                    {
                        MessageBox.Show("Insumo no fue creado");
                    }
                }
            }
        }