private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(FechaDatePicker.Text))
            {
                MessageBox.Show("EL campo Fecha orden no puede estar vacio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                FechaDatePicker.Focus();
                paso = false;
            }
            if (string.IsNullOrEmpty(TotalTextBox.Text))
            {
                MessageBox.Show("EL campo total no puede estar vacio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                TotalTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(DescripcionTextBox.Text))
            {
                MessageBox.Show("EL campo almacen no puede estar vacio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                DescripcionTextBox.Focus();
                paso = false;
            }
            if (this.Detalles.Count == 0)
            {
                MessageBox.Show("Debe agregar un Telefono", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                ProductoIdTexBox.Focus();
                CantidadTextBox.Focus();
                paso = false;
            }
            return(paso);
        }
        /// <summary>
        /// Metodo encargado de validar los campos del formulario
        /// </summary>
        /// <returns></returns>
        public bool Validar()
        {
            bool paso = true;

            ErrorProvider.Clear();
            if (string.IsNullOrWhiteSpace(CodigoTextBox.Text))
            {
                ErrorProvider.SetError(CodigoTextBox, "El codigo no puede estar vacio");
                CodigoTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(PrecioTextBox.Text))
            {
                ErrorProvider.SetError(PrecioTextBox, "El codigo no puede estar vacio");
                PrecioTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(ItebisTextBox.Text))
            {
                ErrorProvider.SetError(ItebisTextBox, "El codigo no puede estar vacio");
                ItebisTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(TotalTextBox.Text))
            {
                ErrorProvider.SetError(TotalTextBox, "El codigo no puede estar vacio");
                TotalTextBox.Focus();
                paso = false;
            }
            return(paso);
        }
Beispiel #3
0
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(FechaOrdenDateTimePicker.Text))
            {
                MessageBox.Show("Debe Ingresar una Fecha", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                FechaOrdenDateTimePicker.Focus();
                paso = false;
            }
            if (string.IsNullOrEmpty(TotalTextBox.Text))
            {
                MessageBox.Show("Debe Ingresae un Total", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                TotalTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(AlmacenIdTextBox.Text))
            {
                MessageBox.Show("Debe Ingresar un Almacen", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                AlmacenIdTextBox.Focus();
                paso = false;
            }
            if (this.Detalle.Count == 0)
            {
                MessageBox.Show("Debe Ingresar un telefono", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                ProductoIdTextBox.Focus();
                CantidadTextBox.Focus();
                paso = false;
            }
            return(paso);
        }
 private void Limpiar()
 {
     this.factura              = new Facturas();
     this.factura.Fecha        = DateTime.Now;
     detallemostrar            = new List <DetalleMostrar>();
     DatosDataGrid.ItemsSource = detallemostrar;
     this.DataContext          = factura;
     TotalTextBox.Clear();
 }
Beispiel #5
0
 private void Limpiar()
 {
     IdNumericUpDown.Value = 0;
     DescripcionTextBox.Clear();
     CostoTextBox.Clear();
     ExistenciaTextBox.Clear();
     TotalTextBox.Clear();
     MyErrorProvider.Clear();
 }
Beispiel #6
0
        private void LimparButton_Click(object sender, EventArgs e)
        {
            ClienteTextBox.Text      = "";
            ValorTextBox.Text        = String.Empty;
            UfComboBox.SelectedIndex = -1;
            FreteTextBox.Clear();
            TotalTextBox.Clear();

            ClienteTextBox.Focus();
        }
        public Form1()
        {
            InitializeComponent();
            con.Open();
            int count = 0;

            TotalTextBox.Clear();
            cmd   = new SqlCommand("Select count(*) FROM TruckShowParticipants", con);
            count = (int)cmd.ExecuteScalar();
            TotalTextBox.AppendText(count.ToString());
            con.Close();
        }
 private void NuevoButton_Click(object sender, EventArgs e)
 {
     CotizacionIdNumericUpDown.Value     = 0;
     CantidadCotizadaNumericUpDown.Value = 0;
     PrecioTextBox.Clear();
     ImporteTextBox.Clear();
     TotalTextBox.Clear();
     FechaDateTimePicker.Value = DateTime.Now;
     ObservacionesTextBox.Clear();
     DetalleCotizacionDataGridView.DataSource = null;
     MyErrorProvider.Clear();
 }
        private void ItemsListBox_DoubleClick(object sender, EventArgs e)
        {
            QuantityNumericUpDown.ResetText();
            TotalTextBox.Clear();
            string itemName = ItemsListBox.GetItemText(ItemsListBox.SelectedItem);

            ItemNameTextBox.Text = itemName;
            try
            {
                DataTable Dtitemprice = GetAndSetItemAndPrice(itemName);
                DataRow   row         = Dtitemprice.Rows[0];
                PriceTextBox.Text = row["price"].ToString();
            }
            catch { }
        }
 private void QuotaTextBox_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(QuotaTextBox.Text))
     {
         BalanceIntTextBox.Clear();
         TotalTextBox.Clear();
         BalanceIntTextBox.AppendText((Convert.ToDouble(QuotaTextBox.Text) * Convert.ToDouble(InteresTextBox.Text) / 100).ToString());
         TotalTextBox.AppendText((Convert.ToDouble(BalanceIntTextBox.Text) + Convert.ToDouble(QuotaTextBox.Text)).ToString());
     }
     else
     {
         Util.Limpiar(this);
         InteresTextBox.AppendText("4");
     }
 }
Beispiel #11
0
 private void Limpiar()
 {
     VentaIdNumericUpDown.Value    = 0;
     FechaDateTimePicker.Value     = DateTime.Now;
     ClienteComboBox.SelectedIndex = 0;
     CantidadTextBox.Clear();
     PrecioTextBox.Clear();
     ImporteTextBox.Clear();
     VentasGridView.DataSource = null;
     SubTotalTextBox.Clear();
     ItbisTextBox.Clear();
     TotalTextBox.Clear();
     MyErrorProvider.Clear();
     LlenarComboBox();
 }
 private void NuevoButton_Click(object sender, EventArgs e)
 {
     VentaIdTextBox.Clear();
     CantidadTextBox.Clear();
     PrecioTextBox.Clear();
     NFCTextBox.Clear();
     TipoNFCTextBox.Clear();
     DescuentosTextBox.Clear();
     TotalTextBox.Clear();
     VentasdataGridView.Rows.Clear();
     BuscarVentaButton.Enabled = true;
     GuardarButton.Text        = "Guardar";
     EliminarButton.Enabled    = false;
     miError.Clear();
 }
 private void LimpiaObjetos()
 {
     FacturaIdNumericUpDown.Value = 0;
     FechaDateTimePicker.Value    = DateTime.Now;
     NombreCliente.Clear();
     ProductoComboBox.SelectedIndex = 0;
     CantidadTextBox.Clear();
     PrecioTextBox.Clear();
     ImporteTextBox.Clear();
     FacturaDetalleDataGridView.DataSource = null;
     SubTotalTextBox.Clear();
     ItbisTextBox.Clear();
     TotalTextBox.Clear();
     MyErrorProvider.Clear();
 }
        private void EnterButton2_Click(object sender, EventArgs e)
        {
            NameTextBox2.Clear();
            PhoneTextBox2.Clear();
            YearTextBox2.Clear();
            MakeTextBox2.Clear();
            ModelTextBox2.Clear();
            TotalTextBox.Clear();

            string number = NumberTextBox2.Text;

            number = number.Trim();
            con.Open();
            cmd = new SqlCommand("SELECT * FROM TruckShowParticipants WHERE ShowEntryNumber= '" + NumberTextBox2.Text + "'", con);
            SqlDataReader dr = cmd.ExecuteReader();

            if (dr.Read())
            {
                string Name = (dr["Name"].ToString());
                Name = Name.Trim();
                NameTextBox2.AppendText(Name);

                string phoneNum = (dr["PhoneNumber"].ToString());
                phoneNum = phoneNum.Trim();
                PhoneTextBox2.AppendText(phoneNum);

                string year = (dr["TruckYear"].ToString());
                year = year.Trim();
                YearTextBox2.AppendText(year);

                string make = (dr["Make"].ToString());
                make = make.Trim();
                MakeTextBox2.AppendText(make);

                string model = (dr["Model"].ToString());
                model = model.Trim();
                ModelTextBox2.AppendText(model);
            }
            con.Close();
            con.Open();
            int count = 0;

            TotalTextBox.Clear();
            cmd   = new SqlCommand("Select count(*) FROM TruckShowParticipants", con);
            count = (int)cmd.ExecuteScalar();
            TotalTextBox.AppendText(count.ToString());
            con.Close();
        }
Beispiel #15
0
 private void Limpiar()
 {
     MantenimientoIdNumericUpDown.Value = 0;
     FechaDateTimePicker.Value          = DateTime.Now;
     VehiculoComboBox.SelectedIndex     = 0;
     TallerComboBox.SelectedIndex       = 0;
     ArticuloComboBox.SelectedIndex     = 0;
     CantidadNumericUpDown.Value        = 0;
     PrecioTextBox.Clear();
     ImporteTextBox.Clear();
     MantenimientoDetalleDataGridView.DataSource = null;
     SubTotalTextBox.Clear();
     ItbisTextBox.Clear();
     TotalTextBox.Clear();
     MyErrorProvider.Clear();
 }
        public void Limpiar()
        {
            IdnumericUpDown.Value       = 0;
            fechaDateTimePicker.Value   = DateTime.Now;
            fechaDateTimePicker1.Value  = DateTime.Now;
            CantidadnumericUpDown.Value = 0;
            TotalTextBox.Clear();
            ImporteTextBox.Clear();
            SubTotalTextBox.Text = 0.ToString();
            TotalTextBox.Text    = 0.ToString();
            ItbisTextBox.Text    = 0.ToString();
            MantenimientoDetalledataGridView.DataSource = null;

            itbis = 0;
            Total = 0;;
        }
Beispiel #17
0
 public void Vaciar()
 {
     IdnumericUpDown.Value       = 0;
     FechadateTimePicker.Value   = DateTime.Now;
     PFechadateTimePicker.Value  = DateTime.Now;
     CantidadNumericUpDown.Value = 0;
     TotalTextBox.Clear();
     ImporteTextBox.Clear();
     SubTextBox.Text   = 0.ToString();
     TotalTextBox.Text = 0.ToString();
     ItbisTextBox.Text = 0.ToString();
     MantenimientoDataGridView.DataSource = null;
     itbis    = 0;
     importe  = 0;
     Total    = 0;
     subtotal = 0;
 }
        private void ClearButton1_Click(object sender, EventArgs e)
        {
            NumberTextBox1.Text = "";
            NameTextBox1.Text   = "";
            PhoneTextBox1.Text  = "";
            YearTextBox1.Text   = "";
            MakeTextBox1.Text   = "";
            ModelTextBox1.Text  = "";
            con.Open();
            TotalTextBox.Clear();
            int count = 0;

            cmd   = new SqlCommand("Select count(*) FROM TruckShowParticipants", con);
            count = (int)cmd.ExecuteScalar();
            TotalTextBox.AppendText(count.ToString());
            con.Close();
        }
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            string message = "All records deleted";
            string title   = "Truck Show Records";

            MessageBox.Show(message, title);
            con.Open();
            cmd = new SqlCommand("DELETE FROM TruckShowParticipants", con);
            cmd.ExecuteNonQuery();
            con.Close();
            con.Open();
            TotalTextBox.Clear();
            int count = 0;

            cmd   = new SqlCommand("Select count(*) FROM TruckShowParticipants", con);
            count = (int)cmd.ExecuteScalar();
            TotalTextBox.AppendText(count.ToString());
            con.Close();
        }
Beispiel #20
0
        private bool Validar()
        {
            bool paso = true;

            if (SalidaIdTextBox.Text == string.Empty)
            {
                MessageBox.Show("SalidaId Vacio");
                SalidaIdTextBox.Focus();
                paso = false;
            }
            else if (ProveedorIdTextBox.Text == string.Empty || ProveedorIdTextBox.Text == "0")
            {
                MessageBox.Show("ProveedorId no Valido");
                ProveedorIdTextBox.Focus();
                paso = false;
            }
            else if (UsuarioIdTextBox.Text == string.Empty || UsuarioIdTextBox.Text == "0")
            {
                MessageBox.Show("UsuarioId no Valido");
                UsuarioIdTextBox.Focus();
                paso = false;
            }
            else if (FechaCompraDateTimePicker.Text == string.Empty)
            {
                MessageBox.Show("Fecha Vacia");
                FechaCompraDateTimePicker.Focus();
                paso = false;
            }
            else if (TotalTextBox.Text == string.Empty)
            {
                MessageBox.Show("No hay Productos Registrados");
                TotalTextBox.Focus();
                paso = false;
            }
            else if (SDetalleDataGrid.DataContext == null)
            {
                MessageBox.Show("Debe Agregar un Producto");
                paso = false;
            }

            return(paso);
        }
Beispiel #21
0
        public void LimpiarCampos()
        {
            MantenimientoIdNumericUpDown.Value = 0;
            FechaDateTimePicker.Value          = DateTime.Now;
            CantidadNumericUpDown.Value        = 0;
            TotalTextBox.Clear();

            ImporteTextBox.Clear();
            SubtotalTextBox.Text           = 0.ToString();
            TotalTextBox.Text              = 0.ToString();
            ITBISTextBox.Text              = 0.ToString();
            DetalleDataGridView.DataSource = null;

            itbis = 0;

            Total = 0;


            GeneralErrorProvider.Clear();
        }
Beispiel #22
0
        public void LimpiarCampos()
        {
            VentaIdNumericUpDown.Value     = 0;
            FechaVentaDateTimePicker.Value = DateTime.Now;
            DescripcionTextBox.Clear();
            NombreClienteTextBox.Clear();
            TelefonomaskedTextBox.Clear();
            CantidadNumericUpDown.Value = 0;
            SubTotalTextBox.Text        = 0.ToString();
            ItbisTextBox.Text           = 0.ToString();
            TotalTextBox.Clear();

            ImporteTextBox.Clear();
            TotalTextBox.Text = 0.ToString();
            VentaDetalleDataGridView.DataSource = null;

            //Total = 0;

            GeneralErrorProvider.Clear();
        }
        private void EnterButton1_Click(object sender, EventArgs e)
        {
            TotalTextBox.Clear();

            string message = "Entry Added";
            string title   = "Truck Show Participant";

            MessageBox.Show(message, title);
            con.Open();
            cmd = new SqlCommand("INSERT INTO TruckShowParticipants (ShowEntryNumber, Name, PhoneNumber, TruckYear, Make, Model)" +
                                 " Values('" + NumberTextBox1.Text + "','" + NameTextBox1.Text + "','" + PhoneTextBox1.Text + "','" + YearTextBox1.Text + "','" + MakeTextBox1.Text + "','" + ModelTextBox1.Text + "')", con);
            cmd.ExecuteNonQuery();
            con.Close();
            con.Open();
            TotalTextBox.Clear();
            int count = 0;

            cmd   = new SqlCommand("Select count(*) FROM TruckShowParticipants", con);
            count = (int)cmd.ExecuteScalar();
            TotalTextBox.AppendText(count.ToString());
            con.Close();
        }
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(UsuarioIdTextBox.Text))
            {
                paso = false;
                UsuarioIdTextBox.Focus();
            }

            if (string.IsNullOrEmpty(TotalTextBox.Text))
            {
                paso = false;
                TotalTextBox.Focus();
            }

            if (string.IsNullOrEmpty(SubTotalTextBox.Text))
            {
                paso = false;
                SubTotalTextBox.Focus();
            }


            if (string.IsNullOrEmpty(DescuentoTextBox.Text))
            {
                paso = false;
                DescuentoTextBox.Focus();
            }

            if (string.IsNullOrEmpty(ITBISTextBox.Text))
            {
                paso = false;
                ITBISTextBox.Focus();
            }

            if (string.IsNullOrEmpty(SubTotalTextBox.Text))
            {
                paso = false;
                SubTotalTextBox.Focus();
            }

            if (string.IsNullOrEmpty(FechaDeCompraTimePicker.Text))
            {
                paso = false;
                FechaDeCompraTimePicker.Focus();
            }


            if (string.IsNullOrEmpty(SuplidorIdTextbox.Text))
            {
                paso = false;
                SuplidorIdTextbox.Focus();
            }

            if (string.IsNullOrEmpty(CompraIDTextBox.Text))
            {
                paso = false;
                CompraIDTextBox.Focus();
            }

            if (this.Detalle.Count == 0)
            {
                MessageBox.Show("La Compra debe tener un producto", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                paso = false;
            }
            return(paso);
        }
Beispiel #25
0
        private bool Validar()
        {
            bool paso = true;

            MyErrorProvider.Clear();
            if (string.IsNullOrWhiteSpace(PacienteComboBox.Text))
            {
                MyErrorProvider.SetError(PacienteComboBox, "El campo Paciente no puede estar vacio");
                PacienteComboBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(OdontologoComboBox.Text))
            {
                MyErrorProvider.SetError(OdontologoComboBox, "El campo Odontologo no puede estar vacio");
                OdontologoComboBox.Focus();
                paso = false;
            }
            if (FechaConsultaProximaDateTimePicker.Value < FechaActualDateTimePicker.Value)
            {
                MyErrorProvider.SetError(FechaConsultaProximaDateTimePicker, "El campo FechaConsultaProxima no puede tener una fecha anterior a fecha actual");
                FechaConsultaProximaDateTimePicker.Focus();
                paso = false;
            }
            if (SubTotalTextBox.Text == string.Empty)
            {
                MyErrorProvider.SetError(SubTotalTextBox, "El Subtotal no puede estar vacio");
                SubTotalTextBox.Focus();
                paso = false;
            }
            if (ItibisTextBox.Text == string.Empty)
            {
                MyErrorProvider.SetError(ItibisTextBox, "El Itbis no puede estar vacio");
                ItibisTextBox.Focus();
                paso = false;
            }
            if (TotalTextBox.Text == string.Empty)
            {
                MyErrorProvider.SetError(TotalTextBox, "El Total no puede estar vacio");
                TotalTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(DiagnosticoTextBox.Text))
            {
                MyErrorProvider.SetError(DiagnosticoTextBox, "El Diagnostico no puede estar vacio");
                TotalTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(ObservacionTextBox.Text))
            {
                MyErrorProvider.SetError(ObservacionTextBox, "La Observacion no puede estar vacio");
                ObservacionTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(TratamientoTextBox.Text))
            {
                MyErrorProvider.SetError(TratamientoTextBox, "El Tratamiento no puede estar vacio");
                TratamientoTextBox.Focus();
                paso = false;
            }
            return(paso);
        }