Ejemplo n.º 1
0
        private List <servicio> ObtenerServicios(List <ordenservicio> Lidservidcios)
        {
            List <servicio> Lservicio = new List <servicio>();
            Buscadores      bus       = new Buscadores();

            foreach (ordenservicio idservicios in Lidservidcios)
            {
                servicio oservicio = bus.buscarservicio(idservicios.id_servicio);
                Lservicio.Add(oservicio);
            }
            return(Lservicio);
        }
Ejemplo n.º 2
0
        public void Calculaelprimero()
        {
            if (txtcantidad.Text == "")
            {
                txtcantidad.Text = "1";
            }
            Buscadores bus = new Buscadores();

            if (DropServicio.SelectedIndex != -1)
            {
                servicio oservicio = bus.buscarservicio(int.Parse(DropServicio.SelectedItem.Value));
                txtprecioporcantidad.Value = (int.Parse(oservicio.precio) * int.Parse(txtcantidad.Text)).ToString();
            }
        }
Ejemplo n.º 3
0
        protected void CargarServicios(object sender, EventArgs e)
        {
            StockError.Visible   = false;
            StockWarning.Visible = false;
            List <servicio> Lse        = new List <servicio>();
            List <servicio> Lservicios = new List <servicio>();

            lblpreciototal.Visible = true;
            lblprecio.Visible      = true;

            if ((GridView2.Rows.Count < 5) && (DropServicio.SelectedValue.ToString() != ""))
            {
                Buscadores bus         = new Buscadores();
                string     id          = DropServicio.SelectedValue.ToString();
                int        id_servicio = int.Parse(id);
                servicio   oservicio   = bus.buscarservicio(id_servicio);
                Lse = LSM;
                foreach (servicio x in Lse)
                {
                    if (id_servicio == x.id_servicios)
                    {
                        oservicio = x;
                    }
                }
                Lse.Remove(oservicio);
                Lservi = Lse;
                string   detalle   = oservicio.detalle;
                string   precio    = oservicio.precio;
                string   total     = (double.Parse(oservicio.precio) * double.Parse(txtcantidad.Text)).ToString();
                string   cantidad  = txtcantidad.Text;
                Cantidad oCantidad = new Cantidad(oservicio.id_servicios, int.Parse(cantidad));
                Lcantidades.Add(oCantidad);

                List <serviciostock> Lserstock = Lserviciostock(id_servicio.ToString());
                List <stock>         Nstock    = Lstockuso(Lserstock);//revisar esto


                LSAC.Add(oservicio);
                dtable.Rows.Add(detalle, precio, cantidad, total);
                lblprecio.Visible = true;
                int a = int.Parse(lblprecio.Text) + int.Parse(total);
                lblprecio.Text = a.ToString();

                foreach (stock ostock in Nstock)
                {
                    Lstock.Add(ostock);
                    if (int.Parse(ostock.cantidad) <= int.Parse(ostock.minimo))
                    {
                        StockError.Visible = true;
                        Label1.Text        = "¡ATENCION! EL STOCK ES MENOR AL MINIMO: " + ostock.detalle;
                    }
                    if ((int.Parse(ostock.cantidad) >= int.Parse(ostock.minimo)) && (int.Parse(ostock.cantidad) <= (int.Parse(ostock.minimo) + 5)) && (StockError.Visible == false))
                    {
                        StockWarning.Visible = true; //Aca alerta queda poco stock Queda restar
                        Label2.Text          = "¡ATENCION! EL STOCK ESTA CERCANO AL MINIMO: " + ostock.detalle;
                    }
                }
                NoAuto.Visible = false;
                //Lservi = Lse;
                GridView2.DataSource = dtable;
                GridView2.DataBind();
                VerGrid(oservicio);
                Calculaelprimero();
            }
            else
            {
                NoAuto.Visible = true;
                Label3.Text    = "No ingrese mas de 5 servicios";
            }
        }