コード例 #1
0
ファイル: Ventas.cs プロジェクト: AmiVelas04/Agro
        private void limpiar()
        {
            while (DgvProd.Rows.Count > 0)
            {
                DgvProd.Rows.RemoveAt(0);
            }

            DgvProd.Columns.RemoveAt(8);
            DgvProd.Columns.RemoveAt(7);
            DgvProd.Columns.RemoveAt(6);
            DgvProd.Columns.RemoveAt(5);
            DgvProd.Columns.RemoveAt(4);
            DgvProd.Columns.RemoveAt(3);
            DgvProd.Columns.RemoveAt(2);
            DgvProd.Columns.RemoveAt(1);
            DgvProd.Columns.RemoveAt(0);


            TxtCod.Clear();
            TxtCamb.Clear();
            Txtdesc.Clear();
            TxtMarca.Clear();
            TxtPrecio.Clear();
            TxtTotal.Clear();
            TxtCod.Focus();
            TxtEfect.Clear();
        }
コード例 #2
0
 private void BtnLimpiar_Click(object sender, EventArgs e)
 {
     TxtPrecio.Text = String.Empty;
     TxtPrecio.Focus();
     Lblva.Visible         = false;
     LblTotalPagar.Visible = false;
 }
コード例 #3
0
 public void LimpiarTextBox()
 {
     TxtIdProductp.Clear();
     TxtProducto.Clear();
     TxtPrecio.Clear();
     TxtEstadoProdutc.Clear();
 }
コード例 #4
0
        private void BtnCalcular_Click(object sender, EventArgs e)
        {
            if (TxtCantidad.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese Cantidad");
                TxtCantidad.Focus();
                return;
            }
            if (TxtPrecio.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese Precio");
                TxtPrecio.Focus();
                return;
            }
            double c, p, subt, t, tp;

            c = Convert.ToDouble(TxtCantidad.Text);
            p = Convert.ToDouble(TxtPrecio.Text);
            if (c >= 3)
            {
                t                   = c * p;
                subt                = (c * p) * 0.20;
                tp                  = t - subt;
                TxtSubtotal.Text    = subt.ToString();
                TxtTotalaPagar.Text = tp.ToString();
            }
            else
            {
                t                   = c * p;
                subt                = (c * p) * 0.20;
                tp                  = t - subt;
                TxtSubtotal.Text    = subt.ToString();
                TxtTotalaPagar.Text = tp.ToString();
            }
        }
コード例 #5
0
 private void BtnLimpiar_Click(object sender, EventArgs e)
 {
     TxtCantidad.Clear();
     TxtPrecio.Clear();
     TxtSubtotal.Clear();
     TxtTotalaPagar.Clear();
 }
コード例 #6
0
        private void BtnModificar_Click(object sender, EventArgs e)
        {
            if (TxtCodigo.Text != "" && TxtNombre.Text != "" && TxtCantidad.Text != "" && TxtPrecio.Text != "" && CmbPlataforma.Text != "" && CmbGenero.Text != "")
            {
                ClsEProductos Eobj = new ClsEProductos();
                ClsNProductos Nobj = new ClsNProductos();
                Eobj.codprod  = TxtCodigo.Text;
                Eobj.nomprod  = TxtNombre.Text;
                Eobj.cantprod = Convert.ToInt32(TxtCantidad.Text);
                Eobj.preprod  = Convert.ToInt32(TxtPrecio.Text);
                Eobj.codplat  = CmbPlataforma.Text;
                Eobj.codgen   = CmbGenero.Text;
                Nobj.MtdActualizarProductos(Eobj);
                DgvProductos.DataSource = Nobj.MtdListarProductos();

                TxtCodigo.Enabled = true;
                TxtCodigo.Clear();
                TxtNombre.Clear();
                TxtCantidad.Clear();
                TxtPrecio.Clear();
                CmbPlataforma.Text       = "";
                CmbGenero.Text           = "";
                CmbNombreGenero.Text     = "";
                CmbNombrePlataforma.Text = "";
            }
            else
            {
                MessageBox.Show("Por favor llene todos los campos", "Mensaje");
            }
        }
コード例 #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (TxtProducto.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar la cantidad del Producto");
                TxtProducto.Focus();
                return;
            }
            if (TxtPrecio.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar el Precio del Producto");
                TxtPrecio.Focus();
                return;
            }



            double prod, prec, impto, tot, totisv;


            prod = Convert.ToDouble(TxtProducto.Text);
            prec = Convert.ToDouble(TxtPrecio.Text);


            tot    = prod * prec;
            impto  = tot * 0.15;
            totisv = tot + impto;

            TxtTotal.Text    = tot.ToString();
            TxtImpto.Text    = impto.ToString();
            TxtTotalISV.Text = totisv.ToString();
        }
コード例 #8
0
        private void BtnCalcular_Click(object sender, EventArgs e)
        {
            if (TxtDias.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar los Dias Trabajados");
                TxtDias.Focus();
                return;
            }
            if (TxtPrecio.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar los Dias Trabajados");
                TxtPrecio.Focus();
                return;
            }

            double d, p, tot;

            d = Convert.ToDouble(TxtDias.Text);

            p = Convert.ToDouble(TxtPrecio.Text);

            tot = d * p;

            TxtSalario.Text = tot.ToString();
        }
コード例 #9
0
 private void BtnCancelar_Click(object sender, EventArgs e)
 {
     TxtCantidad.Clear();
     TxtPrecio.Clear();
     TxtTotal.Clear();
     TxtCantidad.Focus();
 }
コード例 #10
0
 private void button2_Click(object sender, EventArgs e)
 {
     TxtImpto.Clear();
     TxtPrecio.Clear();
     TxtProducto.Clear();
     TxtTotal.Clear();
     TxtTotalISV.Clear();
 }
コード例 #11
0
 private void BtnNuevo_Click(object sender, EventArgs e)
 {
     TxtCodigo.Enabled   = true;
     TxtCantidad.Enabled = true;
     TxtCodigo.Clear();
     TxtNombre.Clear();
     TxtCantidad.Clear();
     TxtPrecio.Clear();
     CmbPlataforma.Text       = "";
     CmbGenero.Text           = "";
     CmbNombreGenero.Text     = "";
     CmbNombrePlataforma.Text = "";
 }
コード例 #12
0
        protected void BtnGrabarPedido_Click(object sender, EventArgs e)
        {
            if (Session.Count == 0)
            {
                LblMensaje.Text = "Debe Acceder Cuenta con su Usuario y Contraseña";
                return;
            }
            if (TxtCantidad.Text.Trim() == "")
            {
                LblMensaje.Text = "Ingrese Cantidad";
                TxtCantidad.Focus();
                return;
            }
            if (TxtPrecio.Text.Trim() == "")
            {
                LblMensaje.Text = "Ingrese Precio";
                TxtPrecio.Focus();
                return;
            }

            GrabarCabecera();
            try
            {
                Ent.Idpedido = int.Parse(0 + TxtIdPedido.Text);
                Ent.Iditem   = int.Parse(DDLItem.SelectedValue);
                Ent.Cantidad = Double.Parse(0 + TxtCantidad.Text);
                Ent.Precio   = Double.Parse(0 + TxtPrecio.Text);
                Ent.Importe  = Double.Parse(0 + TxtCantidad.Text) * Double.Parse(0 + TxtPrecio.Text);

                int filas;
                filas = NegPedidos.GrabarPedidoDetalle(Ent);
                if (filas > 0)
                {
                    RellenarPedidoDetalle();
                }
            }
            catch (Exception ex)
            {
                LblMensaje.Text = ex.Message;
            }
        }
コード例 #13
0
        private void BtnCalcular_Click(object sender, EventArgs e)
        {
            if (TxtDias.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar los Dias Trabajados");
                TxtDias.Focus();
                return;
            }
            if (TxtPrecio.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar Precio por Dia Trabajado");
                TxtPrecio.Focus();
                return;
            }
            if (TxtHe.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar la Cantidad de Horas Extras");
                TxtHe.Focus();
                return;
            }
            if (TxtPhe.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar la Precio por Hora Extra");
                TxtPhe.Focus();
                return;
            }
            double d, p, t, he, ph, the, sn;

            d   = Convert.ToDouble(TxtDias.Text);
            p   = Convert.ToDouble(TxtPrecio.Text);
            he  = Convert.ToDouble(TxtHe.Text);
            ph  = Convert.ToDouble(TxtPhe.Text);
            t   = d * p;
            the = he * ph;
            sn  = t + the;

            TxtSalarioBase.Text  = t.ToString();
            TxtSalarioExtra.Text = the.ToString();
            TxtSalarioNeto.Text  = sn.ToString();
        }
コード例 #14
0
        private void BtnCalcular_Click(object sender, EventArgs e)
        {
            if (TxtCantidad.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese Cantidad");
                TxtCantidad.Focus();
                return;
            }
            if (TxtPrecio.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese Precio");
                TxtPrecio.Focus();
                return;
            }

            double c, p, t;

            c = Convert.ToDouble(TxtCantidad.Text);
            p = Convert.ToDouble(TxtPrecio.Text);

            t = c * p;

            TxtTotal.Text = t.ToString();
        }
コード例 #15
0
 private void button1_Click(object sender, EventArgs e)
 {
     TxtDias.Clear();
     TxtPrecio.Clear();
     TxtSalario.Clear();
 }
コード例 #16
0
        //BOTÓN AGREGAR INMUEBLE..........
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            { //Creación de una casa o un apartamento (Según el RadioButton)
                if (RBtnCasa.IsChecked == false && RBtnApartamento.IsChecked == false)
                {
                    System.Windows.Forms.MessageBox.Show("No está seleccionado ni casa ni apartamento");
                }

                else
                {
                    //Si es una casa:
                    if (RBtnCasa.IsChecked == true)
                    {
                        Casa casa = new Casa(Convert.ToBoolean(ChBxAlquiler.IsChecked), Convert.ToBoolean(ChBxVenta.IsChecked),
                                             Convert.ToDouble(TxtPrecio.Text), Convert.ToInt32(TxtNDormitorios.Text), Convert.ToInt32(TxtNBanios.Text),
                                             Convert.ToInt32(TxtNGarajes.Text), Convert.ToInt32(TxtAnioConstruccion.Text),
                                             Convert.ToDouble(TxtMetrosEdificados.Text), TxtBarrio.Text, TxtCiudad.Text,
                                             CmBxEstado.Text, TxtDireccion.Text, RutaImagenes, TxtComentarios.Text, Convert.ToBoolean(ChBxDisponibilidad.IsChecked),
                                             Convert.ToInt32(TxtNPlantas.Text), Convert.ToBoolean(ChBxJardin.IsChecked), Convert.ToBoolean(ChBxParrillero.IsChecked),
                                             Convert.ToBoolean(ChBxPatio.IsChecked));

                        //Instancia una casa y la agrega al Array de Casas
                        Contenedor.ArrayCasas.Add(casa);

                        //Luego crea una carpeta con todas las fotos de la casa, si se agregaron.

                        //Comprueba la ruta de las imágenes:
                        if (RutaImagenes != "" && RutaImagenes != null)
                        {
                            DirectoryInfo RutaImagenesCasa     = new DirectoryInfo(RutaImagenes);  //Crea un DirectoryInfo con la ruta de la carpeta con imágenes del inmueble
                            string[]      archivosImagenesCasa = Directory.GetFiles(RutaImagenes); //Toma la ruta de los archivos y los pone en un Array
                            //Se define la nueva carpeta que tendrá las imágenes del inmueble
                            DirectoryInfo DirectorioCasa = new DirectoryInfo(System.IO.Path.Combine(@".\" + "Casa " + casa.IdInmueble.ToString()));

                            //Copia todos los archivos de la carpeta seleccionada a la nueva carpeta del inmueble
                            CopiarDirectorio(RutaImagenesCasa, DirectorioCasa);
                        }

                        //Si no se selecciona ninguna carpeta con el botón Agregar Fotos
                        else
                        {
                            // Crea la carpeta del inmueble pero vacía
                            DirectoryInfo Directorio = new DirectoryInfo(System.IO.Path.Combine(@".\" + "Casa " + casa.IdInmueble.ToString()));

                            Directory.CreateDirectory(Directorio.ToString());

                            RutaImagenes = Directorio.FullName.ToString();

                            casa.ConjuntoFotos = RutaImagenes;
                        }
                    }
                    else if (RBtnApartamento.IsChecked == true)
                    {
                        //Al crear un apartamento el procedimiento es el mismo que se utilizó para Casa

                        Apartamento apto = new Apartamento(Convert.ToBoolean(ChBxAlquiler.IsChecked), Convert.ToBoolean(ChBxVenta.IsChecked),
                                                           Convert.ToDouble(TxtPrecio.Text), Convert.ToInt32(TxtNDormitorios.Text), Convert.ToInt32(TxtNBanios.Text),
                                                           Convert.ToInt32(TxtNGarajes.Text), Convert.ToInt32(TxtAnioConstruccion.Text),
                                                           Convert.ToDouble(TxtMetrosEdificados.Text), TxtBarrio.Text, TxtCiudad.Text,
                                                           CmBxEstado.Text, TxtDireccion.Text, RutaImagenes, TxtComentarios.Text, Convert.ToBoolean(ChBxDisponibilidad.IsChecked), Convert.ToInt32(TxtPiso.Text),
                                                           Convert.ToBoolean(ChBxPorteria.IsChecked), TxtGastosComunes.Text, Convert.ToBoolean(ChBxJardin.IsChecked), Convert.ToBoolean(ChBxParrillero.IsChecked));

                        Contenedor.ArrayApartamentos.Add(apto);

                        if (RutaImagenes != "" && RutaImagenes != null)
                        {
                            DirectoryInfo RutaImagenesApto     = new DirectoryInfo(RutaImagenes);
                            string[]      archivosImagenesApto = Directory.GetFiles(RutaImagenes);

                            DirectoryInfo DirectorioCasa = new DirectoryInfo(System.IO.Path.Combine(@".\" + "Apto " + apto.IdInmueble.ToString()));

                            CopiarDirectorio(RutaImagenesApto, DirectorioCasa);
                        }
                        else
                        {
                            DirectoryInfo Directorio = new DirectoryInfo(System.IO.Path.Combine(@".\" + "Apto " + apto.IdInmueble.ToString()));

                            Directory.CreateDirectory(Directorio.ToString());

                            RutaImagenes = Directorio.FullName.ToString();

                            apto.ConjuntoFotos = RutaImagenes;
                        }
                    }

                    //Luego de agregar el nuevo inmueble y demás, limpia los campos para un nuevo ingreso

                    TxtBarrio.Clear();
                    TxtCiudad.Clear();
                    TxtAnioConstruccion.Clear();
                    TxtComentarios.Clear();
                    TxtDireccion.Clear();
                    TxtGastosComunes.Clear();
                    TxtMetrosEdificados.Clear();
                    TxtNBanios.Clear();
                    TxtNDormitorios.Clear();
                    TxtNGarajes.Clear();
                    TxtNPlantas.Clear();
                    TxtPiso.Clear();
                    TxtPrecio.Clear();
                    ChBxAlquiler.IsChecked       = false;
                    ChBxDisponibilidad.IsChecked = false;
                    ChBxJardin.IsChecked         = false;
                    ChBxParrillero.IsChecked     = false;
                    ChBxPatio.IsChecked          = false;
                    ChBxPorteria.IsChecked       = false;
                    ChBxVenta.IsChecked          = false;
                    RBtnApartamento.IsChecked    = false;
                    RBtnCasa.IsChecked           = false;
                    RutaImagenes = "";


                    System.Windows.Forms.MessageBox.Show("Agregado/Actualizado exitosamente");

                    //Muestra cuántos inmuebles existe hasta el momento
                    System.Windows.Forms.MessageBox.Show("Casas: " + Contenedor.ArrayCasas.Count.ToString());
                    System.Windows.Forms.MessageBox.Show("Aptos: " + Contenedor.ArrayApartamentos.Count.ToString());

                    try
                    { //Graba los archivos
                        File.Exists("Casas.txt");
                        File.Delete("Casas.txt");
                        File.Exists("Apartamentos.txt");
                        File.Delete("Apartamentos.txt");
                    }
                    finally {
                        AdministradorArchivos.EscribirCasas(@".\Casas.txt");
                        AdministradorArchivos.EscribirApartamentos(@".\Apartamentos.txt");
                    }
                }
            }
            catch { System.Windows.Forms.MessageBox.Show("Verifique los datos. Alguno no se ingresó correctamente"); }
        }
コード例 #17
0
 private void LimpiarFormulario()
 {
     TxtReferencia.Clear();
     TxtDescripcion.Clear();
     TxtPrecio.Clear();
 }
コード例 #18
0
        bool CamposOK()
        {
            bool booEstado = true;

            TxtCodPro.Text = GeneraCodigoProducto();

            if (Convert.ToInt16(CboTipExi.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado el tipo de existencia !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboTipExi.Focus();
                return(booEstado);
            }

            if (Convert.ToInt16(CboFam.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la familia del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboFam.Focus();
                return(booEstado);
            }

            if (Convert.ToInt16(CboCla.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la clase del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboCla.Focus();
                return(booEstado);
            }
            if (Convert.ToInt16(CboSubCla.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la sub clase del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboSubCla.Focus();
                return(booEstado);
            }
            //if (Convert.ToInt16(CboUniMed.SelectedValue) == 0)
            //{
            //    MessageBox.Show("¡ No ha especificado la unidad de medida del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            //    booEstado = false;
            //    CboUniMed.Focus();
            //    return booEstado;
            //}
            if (Convert.ToInt16(CboMoneda.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la moneda del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboMoneda.Focus();
                return(booEstado);
            }
            if (Convert.ToInt16(CboPlay.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la playa de venta del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboPlay.Focus();
                return(booEstado);
            }
            if (funFunciones.NulosC(TxtCodPro.Text) == "")
            {
                MessageBox.Show("¡ No ha especificado el codigo del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtCodPro.Focus();
                return(booEstado);
            }
            if (funFunciones.NulosC(TxtDesc.Text) == "")
            {
                MessageBox.Show("¡ No ha especificado la descripcion del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtDesc.Focus();
                return(booEstado);
            }
            if (OptSiPagSer.Checked == true)
            {
                if (funFunciones.NulosC(TxtPrecio.Text) == "")
                {
                    MessageBox.Show("¡ No ha especificado el precio bruto del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                    booEstado = false;
                    TxtPrecio.Focus();
                    return(booEstado);
                }
            }
            return(booEstado);
        }