Example #1
0
 private void HabilitarCajas(bool habilitadas)
 {
     NombreMedicamento.Clear();
     Descripcion.Clear();
     PrecioCompra.Clear();
     PrecioVenta.Clear();
     Presentacion.Clear();
     NombreMedicamento.IsEnabled = habilitadas;
     Descripcion.IsEnabled       = habilitadas;
     PrecioCompra.IsEnabled      = habilitadas;
     PrecioVenta.IsEnabled       = habilitadas;
     Presentacion.IsEnabled      = habilitadas;
 }
Example #2
0
 public override string ToString()
 {
     return
         ("Nombre=" + Nombre +
          "Descripcion=" + Descripcion +
          "PrecioCosto=" + PrecioCosto.ToString() +
          "PrecioBruto=" + PrecioBruto.ToString() +
          "PrecioVenta=" + PrecioVenta.ToString() +
          "Margen=" + Margen.ToString() +
          "Iva=" + Iva.ToString() +
          "Proveedor=" + Proveedor +
          "Categoria=" + Categoria +
          "SubCategoria=" + SubCategoria);
 }
Example #3
0
        private void Save()
        {
            StreamWriter writer = new StreamWriter("Files/Inventario.txt", true);

            writer.WriteLine(Cantidad.ToString() + "," + PrecioBase.ToString() + "," + PrecioVenta.ToString() + "," +
                             FechaIngreso.ToString() + "," + FechaSalida.ToString() + "," + Car.ToString() + "," + IdInventario.ToString());

            writer.Close();
        }
Example #4
0
 public override string ToString()
 {
     return(IdInventario.ToString() + "\t" + Car.ToString() + "\t" + Cantidad.ToString() + "\t" + PrecioBase.ToString() + "\t" +
            PrecioVenta.ToString() + "\t" + FechaIngreso.ToString() + "\t" + FechaSalida.ToString());
 }
Example #5
0
        //public string List()
        //{
        //    string todos = "";
        //    foreach (Inventario Inventario in ListaInventario)
        //    {
        //        todos += Inventario.ToString();
        //    }
        //    return todos;
        //}

        /// <summary>
        /// Muestra los datos de un Inventario
        /// </summary>
        public void Show()
        {
            Console.WriteLine(Cantidad.ToString().PadRight(10) + PrecioBase.ToString().PadLeft(12).PadRight(10) + PrecioVenta.ToString().PadLeft(12).PadRight(10) +
                              FechaIngreso.ToString().PadRight(2).PadLeft(2) + FechaSalida.ToString().PadRight(2).PadLeft(2) + Car.ToString().PadRight(2).PadLeft(2) + IdInventario.ToString().PadRight(2).PadLeft(4));
        }
Example #6
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            if (Accion.Equals(1))
            {
                this.Hide();
                /*encabezado factura*/
                Factura fac = new Factura();
                fac.Id     = this.id;
                fac.Nombre = this.nombre;
                fac.Rol    = this.rol;

                /*encabezado*/
                fac.IdCliente     = Convert.ToInt32(txtCodigo.Text);
                fac.NombreCliente = txtNombre.Text;
                fac.Documento     = txtCantidad.Text;
                fac.Direccion1    = txtPrecio.Text;
                fac.Telefono1     = txtDecuento.Text;
                fac.Tipo          = txtTipo.Text;
                fac.NumeroFact    = this.numeroFact;
                /*detalle*/
                fac.Idproducto     = this.idproductoVenta;
                fac.NombreProducto = this.nombreProducto;
                fac.Cantidad       = this.cantidadVendidad;
                fac.Descuento      = this.descuento;
                fac.PrecioVenta    = this.precioVenta;
                fac.Totalproducto  = this.totalproducto;
                fac.SubTotal       = this.subTotal;
                fac.Codigo1        = this.Codigo;
                fac.Show();
            }
            else
            {
                if (this.accion.Equals(4))
                {/*cambio de cliente */
                    if (txtCodigo.Text.Equals(""))
                    {
                        MessageBox.Show("Seleccione el cliente nuevo");
                    }
                    else
                    {
                        try
                        {
                            DialogResult dialogo = MessageBox.Show("Decea Cambiar de Cliente", "Cambio", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                            if (dialogo == DialogResult.Yes)
                            {
                                modelo.CambioCliente cc = new modelo.CambioCliente();
                                cc.Idfactura = this.idfact;

                                cc.CodCliente1 = Convert.ToInt32(txtCodigo.Text);
                                cc.facCamClien();
                                if (cc.Msg.Equals("Se cambio el cliente"))
                                {
                                    MessageBox.Show(cc.Msg);
                                }
                                else
                                {
                                    MessageBox.Show(cc.Msg);
                                }
                            }
                            else
                            {
                                return;
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex);
                        }
                        this.Hide();
                        ActuFactu ff = new ActuFactu();
                        ff.IdFact = this.idfact;
                        ff.Accion = this.accion;
                        ff.Show();
                    }
                }
                else
                {
                    if (txtDecuento.Text.Equals("") || txtCantidad.Text.Equals(""))
                    {
                        MessageBox.Show("Dijite la cantidad y el Descuento");
                    }
                    else
                    {
                        int p = Convert.ToInt32(txtCantidad.Text);

                        if (p > cantidad)
                        {
                            MessageBox.Show("La cantidad ingresada es mayor a la que ay en el Inventario");
                        }
                        else
                        {
                            if (this.accion.Equals(5))
                            {
                                try
                                {
                                    DialogResult dialogo = MessageBox.Show("Decea Agregar el Producto", "Agregar", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                                    if (dialogo == DialogResult.Yes)
                                    {
                                        /*para actualizar la factura */
                                        modelo.CambioCliente ccc = new modelo.CambioCliente();
                                        ccc.Idfactura   = this.idfact;
                                        ccc.Idproducto  = Convert.ToInt32(txtCodigo.Text);
                                        ccc.PrecioVenta = Convert.ToDouble(txtPrecio.Text);
                                        ccc.Cantidad    = Convert.ToInt32(txtCantidad.Text);
                                        ccc.Descuento   = Convert.ToDouble(txtDecuento.Text);
                                        Double s, d, dd;
                                        d = Convert.ToDouble(txtDecuento.Text) / 100;
                                        s = Convert.ToInt32(txtCantidad.Text) * Convert.ToDouble(txtPrecio.Text);

                                        dd = s * d;
                                        s  = s - dd;

                                        ccc.Totalproducto = s;

                                        this.sub   = this.sub + s;
                                        this.iva   = this.sub * 0.13;
                                        this.total = this.sub + this.iva;

                                        ccc.Sub1  = this.sub;
                                        ccc.Iva   = this.iva;
                                        ccc.Total = this.total;
                                        ccc.cambioTotal();

                                        if (ccc.Msg.Equals("Producto agregado "))
                                        {
                                            MessageBox.Show(ccc.Msg);
                                        }
                                        else
                                        {
                                            MessageBox.Show(ccc.Msg);
                                        }
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex);
                                }
                                this.Hide();
                                ActuFactu ff = new ActuFactu();
                                ff.IdFact = this.idfact;
                                ff.Accion = this.accion;
                                ff.Show();
                            }
                            else
                            {
                                int con = idproductoVenta.Count;

                                if (con.Equals(0))
                                {
                                    idproductoVenta.Add(Convert.ToInt32(txtCodigo.Text));
                                    nombreProducto.Add(txtNombre.Text);
                                    CantidadVendidad.Add(Convert.ToInt32(txtCantidad.Text));
                                    Double desc = Convert.ToDouble(txtDecuento.Text) / 100;
                                    descuento.Add(Convert.ToDouble(txtDecuento.Text));

                                    PrecioVenta.Add(Convert.ToDouble(txtPrecio.Text));

                                    Double tott = Convert.ToDouble(txtPrecio.Text) * Convert.ToInt32(txtCantidad.Text);

                                    Double dessprod = tott * desc;
                                    tott          = tott - dessprod;
                                    this.subTotal = subTotal + tott;
                                    totalproducto.Add(tott);
                                    Codigo.Add(cod);

                                    this.Hide();
                                    Factura factu = new Factura();
                                    factu.Id             = this.id;
                                    factu.Nombre         = this.nombre;
                                    factu.Rol            = this.rol;
                                    factu.Idproducto     = this.idproductoVenta;
                                    factu.NombreProducto = this.nombreProducto;
                                    factu.Cantidad       = this.cantidadVendidad;
                                    factu.Descuento      = this.descuento;
                                    factu.PrecioVenta    = this.precioVenta;
                                    factu.Totalproducto  = this.totalproducto;
                                    factu.SubTotal       = this.subTotal;
                                    factu.Codigo1        = this.Codigo;
                                    /*par el cliente*/
                                    factu.IdCliente     = this.idCliente;
                                    factu.NombreCliente = this.nombreCliente;
                                    factu.Documento     = this.documento;
                                    factu.Direccion1    = this.Direccion;
                                    factu.Telefono1     = this.Telefono;
                                    factu.Tipo          = this.tipo;
                                    /*la factura*/
                                    factu.NumeroFact = this.numeroFact;
                                    factu.Show();
                                }
                                else
                                {
                                    Codigo.Add(cod);

                                    idproductoVenta.Add(Convert.ToInt32(txtCodigo.Text));
                                    nombreProducto.Add(txtNombre.Text);
                                    CantidadVendidad.Add(Convert.ToInt32(txtCantidad.Text));
                                    Double desc = Convert.ToDouble(txtDecuento.Text) / 100;

                                    descuento.Add(Convert.ToDouble(txtDecuento.Text));
                                    PrecioVenta.Add(Convert.ToDouble(txtPrecio.Text));
                                    Double tott = Convert.ToDouble(txtPrecio.Text) * Convert.ToInt32(txtCantidad.Text);
                                    this.subTotal = subTotal + tott;

                                    Totalproducto.Add(tott);

                                    this.Hide();
                                    Factura factu = new Factura();
                                    factu.Id             = this.id;
                                    factu.Nombre         = this.nombre;
                                    factu.Rol            = this.rol;
                                    factu.Idproducto     = this.idproductoVenta;
                                    factu.NombreProducto = this.nombreProducto;
                                    factu.Cantidad       = this.cantidadVendidad;
                                    factu.Descuento      = this.descuento;
                                    factu.PrecioVenta    = this.precioVenta;
                                    factu.Totalproducto  = this.totalproducto;
                                    factu.SubTotal       = this.subTotal;
                                    factu.Codigo1        = this.Codigo;
                                    /*par el cliente*/
                                    factu.IdCliente     = this.idCliente;
                                    factu.NombreCliente = this.nombreCliente;
                                    factu.Documento     = this.documento;
                                    factu.Direccion1    = this.Direccion;
                                    factu.Telefono1     = this.Telefono;
                                    factu.Tipo          = this.tipo;
                                    factu.NumeroFact    = this.numeroFact;
                                    factu.Show();
                                }
                            }
                        }
                    }
                }
            }
        }
Example #7
0
 public override string ToString()
 {
     return("Producto:\nNombre: " + Nombre + "\nDescripcion:" + Descripcion + "\nPrecio: " + PrecioVenta.ToString());
 }