示例#1
0
        private void Btnagregar_Click(object sender, EventArgs e)
        {
            ErrProvider.Clear();
            if (TxtBanco.Text != "" & TxtMonto.Text != "" & TxtMonto.Text != "." & TxtNumBoucher.Text != "")
            {
                string  NroBoucher;
                string  Banco;
                decimal Monto;

                NroBoucher = TxtNumBoucher.Text;
                Banco      = TxtBanco.Text;
                Monto      = Convert.ToDecimal(TxtMonto.Text);

                AgregarDetalle(NroBoucher, Banco, Monto);
                this.Close();
            }
            else
            {
                if (TxtBanco.Text == "")
                {
                    ErrProvider.SetError(TxtBanco, "Ingrese el banco");
                }
                if (TxtMonto.Text == "" | TxtMonto.Text == ".")
                {
                    ErrProvider.SetError(TxtMonto, "Ingrese monto valido");
                }
                if (TxtNumBoucher.Text == "")
                {
                    ErrProvider.SetError(TxtNumBoucher, "Ingrese Nro de Boucher");
                }
            }
        }
示例#2
0
文件: Pago.cs 项目: julioanyosa/ERPH
 private void BtnMultiplesPagos_Click(object sender, EventArgs e)
 {
     ErrProvider.Clear();
     if (DtComprobanteCredito.Rows.Count > 0 && NumCaja == 0)
     {
         FrmPagosMultiples ObjFrmPagosMultiples = new FrmPagosMultiples();
         ObjFrmPagosMultiples.DtComprobantes = DtComprobanteCredito;
         ObjFrmPagosMultiples.DtFormasPago   = DtFormasPago;
         ObjFrmPagosMultiples.Numcaja        = NumCaja;
         ObjFrmPagosMultiples.CreditoID      = Convert.ToInt32(LstCreditos.Columns["CreditoID"].Value);
         ObjFrmPagosMultiples.NomCampanha    = LstCreditos.Columns["NomCampanha"].Value.ToString();
         ObjFrmPagosMultiples.DtEmpresas     = DtEmpresas;
         ObjFrmPagosMultiples.NomCaja        = NomCaja;
         ObjFrmPagosMultiples.ShowDialog();
         ObjFrmPagosMultiples.Dispose();
         LimpiarTodo();
     }
     else
     {
         if (NumCaja == 0)
         {
             ErrProvider.SetError(LblCaja, "Esta caja no existe.");
         }
     }
 }
示例#3
0
        private void Buscar()
        {
            ReadOnly(false);
            lblEstado.Text = "";
            ErrProvider.Clear();

            DtChofer = new DataTable();
            ObtenerDatosControles();
            DtChofer = ObjCL_Choferes.GetChoferesID(TxtDNI2.Text);

            if (DtChofer.Rows.Count > 0)
            {
                CboEmpresa.SelectedValue = DtChofer.Rows[0]["EmpresaID"];
                TxtChoferID.Value        = DtChofer.Rows[0]["ChoferID"];
                TxtNomChofer.Value       = DtChofer.Rows[0]["NomChofer"];
                TxtApeChofer.Value       = DtChofer.Rows[0]["ApeChofer"];
                TxtDNI.Value             = DtChofer.Rows[0]["DNI"];
                TxtLicencia.Value        = DtChofer.Rows[0]["Licencia"];
                OcultarBotones(true, true, false, true, false, true);
            }
            else
            {
                LimpiarTextos();
                ReadOnly(true);
                lblEstado.Text      = "No existe Chofer con el DNI: " + TxtChoferID.Text;
                lblEstado.ForeColor = Color.Red;
                OcultarBotones(true, true, false, false, false, false);
            }

            ReadOnly(true);
        }
示例#4
0
        private void TdgRequerimientos_DoubleClick(object sender, EventArgs e)
        {
            if (TdgRequerimientos.Row > -1)
            {
                ErrProvider.Clear();
                TbDespachoPollo.SelectedIndex = 0;
                ReadOnlyTxt(false);
                TxtAlmacenID.Value     = TdgRequerimientos.Columns["RAlmacenID"].Value.ToString();
                TxtRequerimiento.Value = TdgRequerimientos.Columns["NumRequerimiento"].Value.ToString();
                TxtCodigo.Value        = TdgRequerimientos.Columns["ProductoID"].Value.ToString();
                TxtProducto.Value      = TdgRequerimientos.Columns["NomProducto"].Value.ToString();
                TxtUM.Value            = TdgRequerimientos.Columns["UnidadMedidaID"].Value.ToString();
                TxtPrioridad.Value     = TdgRequerimientos.Columns["PrioridadID"].Value.ToString();
                TxtObservacion.Value   = TdgRequerimientos.Columns["ObservacionD"].Value.ToString();
                TxtIDEstado.Value      = TdgRequerimientos.Columns["EstadoIDD"].Value.ToString();
                TxtEstado.Value        = TdgRequerimientos.Columns["NomEstado"].Value.ToString();
                TxtStock.Value         = TdgRequerimientos.Columns["StockActual"].Value.ToString();
                TxtSolicitado.Value    = TdgRequerimientos.Columns["CantidadSolicitada"].Value.ToString();
                TxtRecibido.Value      = TdgRequerimientos.Columns["CantidadRecibida"].Value.ToString();
                TxtTransito.Value      = TdgRequerimientos.Columns["CantidadTransito"].Value.ToString();
                ReadOnlyTxt(true);
            }

            //obtener almacen local
            AlmacenIDLocal = TdgRequerimientos.Columns["AlmacenID"].Value.ToString();
        }
示例#5
0
        }//End ButItNow()

        /// <summary>
        /// Purpose: have the textboxes intereact with the Class.
        /// </summary>
        private bool UpdateObject()
        {
            ///<summary>
            /// A region for local variables
            /// </summary>
            #region Local Var
            int    _intTestValue    = 0;
            double _doubleTestValue = 0.0;
            #endregion Local Var
            ErrProvider.Clear();
            si.Description = TxtBx_ItemDescription.Text;
            si.SQuantity   = TxtBx_Quantity.Text;
            //Condition will test bool if it can prase or not, as well as, if the value is too low
            if (!(int.TryParse(si.SQuantity, out _intTestValue)) || _intTestValue <= 0)
            {
                ErrProvider.SetError(TxtBx_Quantity, INV_QNTY);
                TxtBx_Quantity.Focus();
                TxtBx_Quantity.SelectAll();
                return(false);
            }
            //Condition will test bool if it can prase or not, as well as, if the value is too low
            si.SPrice = TxtBx_UnitPrice.Text;
            if (!(double.TryParse(si.SPrice, out _doubleTestValue)) || _doubleTestValue <= 0)
            {
                ErrProvider.SetError(TxtBx_UnitPrice, INV_PRC);
                TxtBx_UnitPrice.Focus();
                TxtBx_UnitPrice.SelectAll();
                return(false);
            }
            //If everything checks out, it will return true and allow the code to show the message box salesInvoice
            else
            {
                return(true);
            }
        }//End UpdateObject()
示例#6
0
        private void BtnGenerarBajaBoletasContngencia_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (TxtFechaBaja.Value != null)
                {
                    if (MessageBox.Show("¿Seguro que desea generar el resumen diario de fecha " + TxtFechaBaja.Value.ToShortDateString() + ".?", "Aviso", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
                    {
                        objCL_Comprobante.GenerarTxtFacturadorSunatResumenDiario(TxtFechaBaja.Value, c1cboCia.SelectedValue.ToString(), LblRutaArchivo.Text, false, 1);

                        MessageBox.Show("Se genero el resumen diario correctamente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Cursor = Cursors.Default;
                    }
                }
                else
                {
                    if (TxtFechaBaja.Value == null)
                    {
                        ErrProvider.SetError(TxtFechaBaja, "Seleccione una fecha.");
                    }
                }
                Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Cursor = Cursors.Default;
            }
        }
示例#7
0
        private void BtnEnviarResumen_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (Cboempresa4.SelectedIndex != -1 & DtpFecha.Value != null)
                {
                    if (MessageBox.Show("¿Seguro que desea enviar el resumen diario de la fecha" + DtpFecha.Value.ToShortDateString() + ".?", "Aviso", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
                    {
                        ObjCL_Venta.EnviarResumen(Cboempresa4.SelectedValue.ToString(), AppSettings.UserID, DtpFecha.Value);

                        MessageBox.Show("Se envio el resumen diario a SUNAT", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Cursor = Cursors.Default;
                    }
                }
                else
                {
                    if (DtpFecha.Value == null)
                    {
                        ErrProvider.SetError(DtpFecha, "Seleccione una fecha.");
                    }
                    if (Cboempresa4.SelectedIndex == -1)
                    {
                        ErrProvider.SetError(Cboempresa4, "Seleccione una empresa.");
                    }
                }
                Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Cursor = Cursors.Default;
            }
        }
示例#8
0
        private void BtnEliminar_Click(object sender, EventArgs e)
        {
            ErrProvider.Clear();
            if (TxtSerieE.Text == "" | TxtSerieE.TextLength != 3)
            {
                ErrProvider.SetError(TxtSerieE, "Ingrese una serie válida"); return;
            }
            if (CboComprobante.SelectedIndex == -1)
            {
                ErrProvider.SetError(CboComprobante, "Seleccione un tipo de comprobante"); return;
            }
            if (CboEmpresaE.SelectedIndex == -1)
            {
                ErrProvider.SetError(CboEmpresaE, "Seleccione una empresa"); return;
            }
            if (TxtNumIni.Text == "" | TxtNumFin.Text == "")
            {
                ErrProvider.SetError(TxtNumIni, "El número inicial y el final deben ser válidos."); return;
            }
            if (Convert.ToInt32(TxtNumIni.Text) > Convert.ToInt32(TxtNumFin.Text))
            {
                ErrProvider.SetError(TxtNumIni, "El número inicial no puede ser mayor al  número final."); return;
            }

            if (MessageBox.Show("¿Seguro que desea eliminar estos comprobantes?", "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                new CL_Comprobante().ELIMINAR_COMPROBANTES(CboEmpresaE.SelectedValue.ToString(), TxtSerieE.Text, Convert.ToInt32(TxtNumIni.Text), Convert.ToInt32(TxtNumFin.Text), AppSettings.UserID, Convert.ToInt16(CboComprobante.SelectedValue));
                MessageBox.Show("Se elimino los comprobantes", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#9
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                OcultarBotones(true, true, false, false, false, false);
                validarControles();

                if (validarControles() == false)
                {
                    OcultarBotones(false, false, true, false, true, false);
                    return;
                }

                ObtenerDatosControles();
                ErrProvider.Clear();
                ObtenerDatosControles();
                if (TipoGuardar == "Nuevo")
                {
                    ObjCL_Empresas.InsertSede(ObjSede);
                    lblEstado.Text      = "Se guardo correctamente el registro";
                    lblEstado.ForeColor = Color.Black;
                    ReadOnly(true);

                    //agregar
                    DataRow Dr = DtSede.NewRow();
                    Dr["SedeID"]       = ObjSede.SedeID;
                    Dr["NomSede"]      = ObjSede.NomSede;
                    Dr["Numero"]       = ObjSede.Numero;
                    Dr["Interior"]     = ObjSede.Interior;
                    Dr["Zona"]         = ObjSede.Zona;
                    Dr["Distrito"]     = ObjSede.Distrito;
                    Dr["Provincia"]    = ObjSede.Provincia;
                    Dr["Departamento"] = ObjSede.Departamento;
                    DtSede.Rows.Add(Dr);
                }
                else if (TipoGuardar == "Actualizar")
                {
                    ObjCL_Empresas.UpdateSede(ObjSede, "A");
                    lblEstado.Text      = "Se actualizó correctamente el registro";
                    lblEstado.ForeColor = Color.Black;
                    ReadOnly(true);

                    //actualizar
                    DataRow[] customerRow = DtSede.Select("SedeID = '" + ObjSede.SedeID + "'");
                    customerRow[0]["NomSede"]      = ObjSede.NomSede;
                    customerRow[0]["Numero"]       = ObjSede.Numero;
                    customerRow[0]["Interior"]     = ObjSede.Interior;
                    customerRow[0]["Zona"]         = ObjSede.Zona;
                    customerRow[0]["Distrito"]     = ObjSede.Distrito;
                    customerRow[0]["Provincia"]    = ObjSede.Provincia;
                    customerRow[0]["Departamento"] = ObjSede.Departamento;
                }
                TipoGuardar = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                ReadOnly(false);
            }
        }
示例#10
0
 private void BtnMostrar_Click(object sender, EventArgs e)
 {
     try
     {
         ErrProvider.Clear();
         if (DtpFechaIni.Value != null & DtpFechaFin.Value != null & useCliente1.cbCliente.SelectedValue != null & CboTipoVenta.SelectedIndex != -1)
         {
             DataTable DTComprobantes = new DataTable();
             DTComprobantes = ObjCL_Cliente.GetComprobantesCliente(Convert.ToInt32(useCliente1.cbCliente.Columns["ClienteID"].Value), DtpFechaIni.Value, DtpFechaFin.Value.AddDays(1), Convert.ToInt32(CboTipoVenta.SelectedValue));
             TdgComprobantes.SetDataBinding(DTComprobantes, "", true);
         }
         else
         {
             if (useCliente1.cbCliente.SelectedIndex == -1)
             {
                 MessageBox.Show("No se ha seleccionado el cliente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Stop);
             }
             if (CboTipoVenta.SelectedIndex == -1)
             {
                 ErrProvider.SetError(CboTipoVenta, "Debe seleccionar el tipo de venta");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#11
0
        private void Buscar()
        {
            ReadOnly(false);
            lblEstado.Text = "";
            ErrProvider.Clear();

            Dtvehiculo = new DataTable();
            ObtenerDatosControles();
            Dtvehiculo = ObjCL_Vehiculo.GetVehiculosPlaca(TxtPlaca2.Text);

            if (Dtvehiculo.Rows.Count > 0)
            {
                CboEmpresa.SelectedValue        = Dtvehiculo.Rows[0]["EmpresaID"];
                TxtPlaca.Value                  = Dtvehiculo.Rows[0]["Placa"];
                TxtMarca.Value                  = Dtvehiculo.Rows[0]["Marca"];
                TxtCertificadoInscripcion.Value = Dtvehiculo.Rows[0]["CertificadoInscripcion"];
                TxtConfiguracionVehicular.Value = Dtvehiculo.Rows[0]["ConfiguracionVehicular"];
                TxtTara.Value      = Dtvehiculo.Rows[0]["Tara"];
                TxtPesoBruto.Value = Dtvehiculo.Rows[0]["PesoBruto"];
                OcultarBotones(true, true, false, true, false, true);
            }
            else
            {
                LimpiarTextos();
                ReadOnly(true);
                lblEstado.Text      = "No existe vehículo con la placa: " + TxtPlaca2.Text;
                lblEstado.ForeColor = Color.Red;
                OcultarBotones(true, true, false, false, false, false);
            }

            ReadOnly(true);
        }
示例#12
0
 private void TxtProducto_KeyPress(object sender, KeyPressEventArgs e)
 {
     ErrProvider.Clear();
     if (e.KeyChar == (char)(Keys.Enter) & TxtProducto.Text != "" & Cboempresa1.SelectedIndex != -1)
     {
         DataTable DtProductos = new DataTable();
         DtProductos = ObjCL_Producto.GetProductosPrecio(Cboempresa1.SelectedValue.ToString() + AppSettings.SedeID, TxtProducto.Text, "A");
         if (DtProductos.Rows.Count == 1)
         {
             TxtCodigoVenta.Text    = DtProductos.Rows[0]["ProductoIDVentas"].ToString();
             ProductoID             = DtProductos.Rows[0]["ProductoID"].ToString();
             TxtCodigo.Text         = DtProductos.Rows[0]["ProductoID"].ToString();
             TxtProducto.Text       = DtProductos.Rows[0]["Alias"].ToString();
             LblUM.Text             = DtProductos.Rows[0]["UnidadMedidaID"].ToString();
             LblPrecioAnterior.Text = DtProductos.Rows[0]["PrecioUnitario"].ToString();
         }
         else if (DtProductos.Rows.Count > 1)//mostrarlo en una nueva ventana
         {
             FrmPreciosBuscados ObjFrmPreciosBuscados = new FrmPreciosBuscados();
             ObjFrmPreciosBuscados.DtProductos = DtProductos;
             ObjFrmPreciosBuscados.ShowDialog();
             TxtCodigoVenta.Text    = ObjFrmPreciosBuscados.ProductoIDVentas;
             ProductoID             = ObjFrmPreciosBuscados.ProductoID;
             TxtCodigo.Text         = ObjFrmPreciosBuscados.ProductoID;
             TxtProducto.Text       = ObjFrmPreciosBuscados.Alias;
             LblUM.Text             = ObjFrmPreciosBuscados.UnidadMedidaID;
             LblPrecioAnterior.Text = ObjFrmPreciosBuscados.PrecioUnitario;
         }
         else
         {
             LimpiarPrecio();
         }
     }
 }
示例#13
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                OcultarBotones(true, true, false, false, false, false);
                validarControles();

                if (validarControles() == false)
                {
                    OcultarBotones(false, false, true, false, true, false);
                    return;
                }
                ErrProvider.Clear();
                ObtenerDatosControles();
                if (TipoGuardar == "Nuevo")
                {
                    //agregar
                    EmpresaID = ObjCL_Empresas.InsertEmpresa(ObjEmpresa);
                    DataRow Dr = DTEmpresas.NewRow();
                    Dr["EmpresaID"]       = EmpresaID;
                    Dr["NomEmpresa"]      = ObjEmpresa.NomEmpresa;
                    Dr["RUC"]             = ObjEmpresa.RUC;
                    Dr["DomicilioFiscal"] = ObjEmpresa.DomicilioFiscal;
                    Dr["Telefono"]        = ObjEmpresa.Telefono;
                    Dr["Logo"]            = ObjEmpresa.Logo;
                    DTEmpresas.Rows.Add(Dr);

                    lblEstado.Text      = "Se guardo correctamente el registro";
                    lblEstado.ForeColor = Color.Black;
                    ReadOnly(true);
                }
                else if (TipoGuardar == "Actualizar")
                {
                    ObjCL_Empresas.UpdateEmpresa(ObjEmpresa, "A");

                    //actualizar
                    DataRow[] customerRow = DTEmpresas.Select("EmpresaID = '" + ObjEmpresa.EmpresaID + "'");
                    customerRow[0]["NomEmpresa"]      = ObjEmpresa.NomEmpresa;
                    customerRow[0]["RUC"]             = ObjEmpresa.RUC;
                    customerRow[0]["DomicilioFiscal"] = ObjEmpresa.DomicilioFiscal;
                    customerRow[0]["Telefono"]        = ObjEmpresa.Telefono;
                    customerRow[0]["Logo"]            = ObjEmpresa.Logo;

                    lblEstado.Text      = "Se actualizó correctamente el registro";
                    lblEstado.ForeColor = Color.Black;
                    ReadOnly(true);
                }
                TipoGuardar       = "";
                BtnCargar.Enabled = false;

                //actualizar tambien la tabal estatica de empresas
                UTI_Datatables.DtEmpresas = DTEmpresas.Copy();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                ReadOnly(false);
            }
        }
示例#14
0
        private void BtnIngresar_Click(object sender, EventArgs e)
        {
            ErrProvider.Clear();
            try
            {
                if (TxtCantidad.Text != "" & TxtConcepto.Text != "")
                {
                    //inserta un ingreso a la caja

                    //llenar el objPago
                    E_Pago ObjE_Pago = new E_Pago();
                    ObjE_Pago.PagoID            = 0;
                    ObjE_Pago.NumComprobante    = "";
                    ObjE_Pago.TipoComprobanteID = 0;
                    ObjE_Pago.Importe           = Convert.ToDecimal(TxtCantidad.Text);
                    ObjE_Pago.FormaPagoID       = 2;//contado
                    ObjE_Pago.UsuarioID         = AppSettings.UserID;


                    //llenar la nota de ingreso
                    E_NotaIngreso ObjE_NotaIngreso = new E_NotaIngreso();
                    ObjE_NotaIngreso.Tipo        = "E";//es salida
                    ObjE_NotaIngreso.Numcaja     = NumCaja;
                    ObjE_NotaIngreso.EmpresaID   = EmpresaID;
                    ObjE_NotaIngreso.Observacion = "Inicio dia";
                    ObjE_NotaIngreso.LugarPago   = AppSettings.SedeID;

                    if (AppSettings.ImpresoraPago != "")
                    {
                        Int32 NotaIngresoID = 0;
                        NotaIngresoID = ObjCL_Pago.InsertPago(ObjE_Pago, ObjE_NotaIngreso, 12);

                        printDocument1.PrinterSettings.PrinterName = AppSettings.ImpresoraPago;
                        printDocument1.Print();
                        MessageBox.Show("Se registro correctamente la salida de caja", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("no se ha seleccionado la impresora de pago, no se imprimira el Egreso", "", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    }
                }
                else
                {
                    if (TxtCantidad.Text == "")
                    {
                        ErrProvider.SetError(TxtCantidad, "Debe ingresar una cantidad valida.");
                    }
                    if (TxtConcepto.Text == "")
                    {
                        ErrProvider.SetError(TxtConcepto, "Debe ingresar el concepto del egreso.");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\rMetodo Ingresar inicio caja", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#15
0
        public void SetError(String name, String message)
        {
            switch (name)
            {
            /* case "accountName"://Account name
             *   ErrProvider.SetError(nameComboBox, message);
             *   return;*/
            case "type":    //Type
                ErrProvider.SetError(typeTextBox, message);
                return;

            case "address":    //Address
                ErrProvider.SetError(addrTextBox, message);
                return;

            case "city":    //City
                ErrProvider.SetError(CityBox, message);
                return;

            case "province":    //Province or State
                ErrProvider.SetError(ProvStateBox, message);
                return;

            case "country":    //Country
                ErrProvider.SetError(CountryBox, message);
                return;

            case "postalCode":    //Postal Code
                ErrProvider.SetError(postalCodeTextBox, message);
                return;

            case "mainPhone":    //Main phone number
                ErrProvider.SetError(mainPhoneTxtBox, message);
                return;

            case "secondPhone":    //Secondary phone
                ErrProvider.SetError(SecondPhoneTextBox, message);
                return;

            case "fax":    //Fax Number
                ErrProvider.SetError(FaxTextBox, message);
                return;

            case "email":    //Email
                ErrProvider.SetError(EmailTextBox, message);
                return;

            case "poBox":    //Post Office Box
                ErrProvider.SetError(EmailTextBox, message);
                return;

            case "primaryContact":    //Primary Contact Name
                ErrProvider.SetError(PrimContactTextBox, message);
                return;

            default:
                return;
            }
        }
示例#16
0
 private bool validarControles()
 {
     if (TxtNomGenerico.Text == "")
     {
         ErrProvider.SetError(TxtNomGenerico, "Debe Ingresar la descripcion del genérico."); return(false);
     }
     return(true);
 }
示例#17
0
 private bool validarControles()
 {
     if (TxtNomMarca.Text == "")
     {
         ErrProvider.SetError(TxtNomMarca, "Debe Ingresar la descripcion de la UM."); return(false);
     }
     return(true);
 }
示例#18
0
 private void BtnCancelar_Click(object sender, EventArgs e)
 {
     //desahcer
     ErrProvider.Clear();
     OcultarBotones(true, true, false, false, false, false);
     ReadOnly(false);
     LimpiarTextos();
     ReadOnly(true);
 }
示例#19
0
 private bool validarControles()
 {
     if (TxtUnidadMedidaID.Text == "")
     {
         ErrProvider.SetError(TxtUnidadMedidaID, "Debe Ingresar el ID de la UM."); return(false);
     }
     if (TxtNomUnidadMedida.Text == "")
     {
         ErrProvider.SetError(TxtNomUnidadMedida, "Debe Ingresar la descripcion de la UM."); return(false);
     }
     return(true);
 }
示例#20
0
 private bool validarControles()
 {
     if (TxtNomSede.Text == "")
     {
         ErrProvider.SetError(TxtNomSede, "Debe Ingresar una marca."); return(false);
     }
     if (TxtSedeID.Text == "")
     {
         ErrProvider.SetError(TxtSedeID, "Debe Ingresar el codigo de la sede (5 digitos)."); return(false);
     }
     return(true);
 }
示例#21
0
 private void LimpiarPrecio()
 {
     TxtCodigoVenta.Text    = "";
     TxtCodigo.Text         = "";
     TxtProducto.Text       = "";
     LblUM.Text             = "";
     LblPrecioAnterior.Text = "";
     if (Cboempresa1.SelectedIndex == -1)
     {
         ErrProvider.SetError(Cboempresa1, "Debe seleccionar una empresa");
     }
 }
示例#22
0
 private bool validarControles()
 {
     if (CboFamilia.SelectedIndex == -1)
     {
         ErrProvider.SetError(CboFamilia, "Debe Seleccionar la Familia"); return(false);
     }
     if (TxtNomSubFamilia.Text == "")
     {
         ErrProvider.SetError(TxtNomSubFamilia, "Debe Ingresar la descripcion de la UM."); return(false);
     }
     return(true);
 }
示例#23
0
 private bool validarControles()
 {
     if (CboEmpresa.SelectedValue == null)
     {
         ErrProvider.SetError(CboEmpresa, "Debe seleccionar una empresa."); return(false);
     }
     if (TxtMarca.Text == "")
     {
         ErrProvider.SetError(TxtMarca, "Debe Ingresar una marca."); return(false);
     }
     return(true);
 }
示例#24
0
 private bool validarControles()
 {
     if (CboGenerico.SelectedIndex == -1)
     {
         ErrProvider.SetError(CboGenerico, "Debe seleccionar el código genérico."); return(false);
     }
     if (TxtNomProducto.Text == "")
     {
         ErrProvider.SetError(TxtNomProducto, "Debe Ingresar el nombre genérico del producto."); return(false);
     }
     if (TxtAlias.Text == "")
     {
         ErrProvider.SetError(TxtAlias, "Debe Ingresar el alias."); return(false);
     }
     if (TxtPeso.Text == "")
     {
         ErrProvider.SetError(TxtPeso, "Debe Ingresar el peso, si desconoce el peso coloque '0'."); return(false);
     }
     if (CboAlmacenHalley.SelectedIndex == -1)
     {
         ErrProvider.SetError(CboAlmacenHalley, "Debe Seleccionar el almacen"); return(false);
     }
     if (CboUM.SelectedIndex == -1)
     {
         ErrProvider.SetError(CboUM, "Debe seleccionar la UM."); return(false);
     }
     if (CboEnvase.SelectedIndex == -1)
     {
         ErrProvider.SetError(CboEnvase, "Debe seleccionar el envase."); return(false);
     }
     if (CboPresentacion.SelectedIndex == -1)
     {
         ErrProvider.SetError(CboPresentacion, "Debe la presentación."); return(false);
     }
     if (CboSubfamilia.SelectedIndex == -1)
     {
         ErrProvider.SetError(CboSubfamilia, "Debe seleccionar la subfamilia."); return(false);
     }
     if (CboMarca.SelectedIndex == -1)
     {
         ErrProvider.SetError(CboMarca, "Debe Seleccionar la marca."); return(false);
     }
     if (CboTipoExistencia.SelectedIndex == -1)
     {
         ErrProvider.SetError(CboTipoExistencia, "Debe Seleccionar el tipo de existencia del producto."); return(false);
     }
     if (txtCoeficienteTransformacion.Text == "")
     {
         ErrProvider.SetError(txtCoeficienteTransformacion, "Debe ingresar un número valido."); return(false);
     }
     return(true);
 }
示例#25
0
 private void BtnModificarIGV_Click(object sender, EventArgs e)
 {
     ErrProvider.Clear();
     if (TxtIGV.Text != "")
     {
         new CL_Comprobante().InsertarIGV(Convert.ToInt16(TxtIGV.Text), AppSettings.UserID);
         MessageBox.Show("Se modificó correctamente el GV", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         ErrProvider.SetError(TxtIGV, "Ingrese un Monto válido");
     }
 }
示例#26
0
        private bool validarControles()
        {
            if (TxtDocumentoID.Text == "")
            {
                ErrProvider.SetError(TxtDocumentoID, "Debe Ingresar el codigo del movimiento."); return(false);
            }
            if (TxtDescripcion.Text == "")
            {
                ErrProvider.SetError(TxtDescripcion, "Debe Ingresar la descripcion del movimiento."); return(false);
            }

            return(true);
        }
示例#27
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                OcultarBotones(true, true, false, false, false, false);
                validarControles();

                if (validarControles() == false)
                {
                    OcultarBotones(false, false, true, false, true, false);
                    return;
                }
                ErrProvider.Clear();
                ObtenerDatosControles();
                if (TipoGuardar == "Nuevo")
                {
                    //agregar
                    PresentacionID = ObjCL_Producto.InsertPresentacion(ObjPresentacion);
                    DataRow Dr = MantenimientoProductos.Ds.Tables["Presentacion"].NewRow();
                    Dr["PresentacionID"]  = PresentacionID;
                    Dr["NomPresentacion"] = ObjPresentacion.NomPresentacion;
                    Dr["Unidades"]        = ObjPresentacion.Unidades;
                    Dr["UnidadMedidaID"]  = ObjPresentacion.UnidadMedidaID;
                    MantenimientoProductos.Ds.Tables["Presentacion"].Rows.Add(Dr);

                    lblEstado.Text      = "Se guardo correctamente el registro";
                    lblEstado.ForeColor = Color.Black;
                    ReadOnly(true);
                }
                else if (TipoGuardar == "Actualizar")
                {
                    ObjCL_Producto.UpdatePresentacion(ObjPresentacion, "A");

                    //actualizar
                    DataRow[] customerRow = MantenimientoProductos.Ds.Tables["Presentacion"].Select("PresentacionID = '" + ObjPresentacion.PresentacionID + "'");
                    customerRow[0]["NomPresentacion"] = ObjPresentacion.NomPresentacion;
                    customerRow[0]["Unidades"]        = ObjPresentacion.Unidades;
                    customerRow[0]["UnidadMedidaID"]  = ObjPresentacion.UnidadMedidaID;

                    lblEstado.Text      = "Se actualizó correctamente el registro";
                    lblEstado.ForeColor = Color.Black;
                    ReadOnly(true);
                }
                TipoGuardar = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                ReadOnly(false);
            }
        }
示例#28
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                OcultarBotones(true, true, false, false, false, false);
                validarControles();

                if (validarControles() == false)
                {
                    OcultarBotones(false, false, true, false, true, false);
                    return;
                }
                ErrProvider.Clear();
                ObtenerDatosControles();
                if (TipoGuardar == "Nuevo")
                {
                    //agregar
                    ObjCL_Kardex.InsertTipoDocumento(ObjTipoDocumento);
                    DataRow Dr = Halley.Presentacion.Almacen.Reportes.Rep_Kardex.DtTipoDocumento.NewRow();
                    Dr["DocumentoID"]      = ObjTipoDocumento.DocumentoID;
                    Dr["TipoContabilidad"] = ObjTipoDocumento.TipoContabilidad;
                    Dr["Descripcion"]      = ObjTipoDocumento.Descripcion;
                    Halley.Presentacion.Almacen.Reportes.Rep_Kardex.DtTipoDocumento.Rows.Add(Dr);

                    lblEstado.Text      = "Se guardo correctamente el registro";
                    lblEstado.ForeColor = Color.Black;
                    ReadOnly(true);
                }
                else if (TipoGuardar == "Actualizar")
                {
                    ObjCL_Kardex.UpdateTipoDocumento(ObjTipoDocumento, "A");

                    //actualizar
                    DataRow[] customerRow = Halley.Presentacion.Almacen.Reportes.Rep_Kardex.DtTipoDocumento.Select("DocumentoID = '" + ObjTipoDocumento.DocumentoID + "'");
                    customerRow[0]["TipoContabilidad"] = ObjTipoDocumento.TipoContabilidad;
                    customerRow[0]["Descripcion"]      = ObjTipoDocumento.Descripcion;


                    lblEstado.Text      = "Se actualizó correctamente el registro";
                    lblEstado.ForeColor = Color.Black;
                    ReadOnly(true);
                }
                TipoGuardar = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                ReadOnly(false);
            }
        }
示例#29
0
 private void BtnActualizar_Click(object sender, EventArgs e)
 {
     try
     {
         ErrProvider.Clear();
         Cursor = Cursors.WaitCursor;
         if (Cboempresa1.SelectedIndex != -1 & ProductoID != "" & TxtNuevoPrecio.Text != "." & TxtNuevoPrecio.Text != "." & TxtNuevoPrecio.Text != "")
         {
             if (Convert.ToDecimal(TxtNuevoPrecio.Text) > 0)
             {
                 //obtener nuevo precio
                 E_ListaPrecio ObjE_ListaPrecio = new E_ListaPrecio();
                 ObjE_ListaPrecio.EmpresaID      = Cboempresa1.SelectedValue.ToString();
                 ObjE_ListaPrecio.SedeID         = AppSettings.SedeID;
                 ObjE_ListaPrecio.ProductoID     = ProductoID;
                 ObjE_ListaPrecio.PrecioUnitario = Convert.ToDecimal(TxtNuevoPrecio.Text);
                 ObjE_ListaPrecio.UsuarioID      = AppSettings.UserID;
                 ObjCL_Producto.UpdatePrecio(ObjE_ListaPrecio, AppSettings.SedeID);
                 MessageBox.Show("Se actualizo correctamente el precio", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 LimpiarPrecio();
             }
             else
             {
                 ErrProvider.SetError(TxtNuevoPrecio, "precio debe ser diferente de cero.");
             }
         }
         else
         {
             if (Cboempresa1.SelectedIndex == -1)
             {
                 ErrProvider.SetError(Cboempresa1, "Seleccione una empresa.");
             }
             if (TxtNuevoPrecio.Text == "." | TxtNuevoPrecio.Text == "")
             {
                 ErrProvider.SetError(TxtNuevoPrecio, "Ingrese un precio valido");
             }
             else if (TxtNuevoPrecio.Text.Length > 0 && Convert.ToDecimal(TxtNuevoPrecio.Text) == 0)
             {
                 ErrProvider.SetError(TxtNuevoPrecio, "precio debe ser diferente de cero.");
             }
         }
         Cursor = Cursors.Default;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Cursor = Cursors.Default;
     }
 }
示例#30
0
        private void Buscar()
        {
            ReadOnly(false);
            lblEstado.Text = "";
            ErrProvider.Clear();

            // ObtenerDatosControles();
            DtCliente = ObjCL_Cliente.GetClienteDocumento(TxtDocumento2.Text);

            if (DtCliente.Rows.Count > 0)
            {
                CboVia.SelectedValue           = DtCliente.Rows[0]["DireccionViaId"];
                CboTipoCliente.SelectedValue   = DtCliente.Rows[0]["TipoClienteID"];
                CboTipoDocumento.SelectedValue = DtCliente.Rows[0]["IDTipoDocumento"];
                CboDistrito.SelectedValue      = DtCliente.Rows[0]["DistritoId"];
                CboProvincia.SelectedValue     = DtCliente.Rows[0]["ProvinciaId"];
                CboDepartamento.SelectedValue  = DtCliente.Rows[0]["DepartamentoId"];
                CboPais.SelectedValue          = DtCliente.Rows[0]["PaisId"];
                TxtClienteID.Value             = DtCliente.Rows[0]["ClienteID"];
                TxtNroDocumento.Value          = DtCliente.Rows[0]["NroDocumento"];
                TxtRazonSocial.Value           = DtCliente.Rows[0]["RazonSocial"];
                TxtAlias.Value             = DtCliente.Rows[0]["Alias"];
                TxtContacto.Value          = DtCliente.Rows[0]["Contacto"];
                TxtTelefonoFijo.Value      = DtCliente.Rows[0]["TelefonoFijo"];
                TxtTelefonoMovil.Value     = DtCliente.Rows[0]["TelefonoMovil"];
                TxtFax.Value               = DtCliente.Rows[0]["Fax"];
                TxtEmail.Value             = DtCliente.Rows[0]["Email"];
                TxtDireccion.Value         = DtCliente.Rows[0]["Direccion"];
                TxtNombreVia.Value         = DtCliente.Rows[0]["NombreVia"];
                TxtNombre1.Value           = DtCliente.Rows[0]["Nombre1"];
                TxtNombre2.Value           = DtCliente.Rows[0]["Nombre2"];
                TxtApellido1.Value         = DtCliente.Rows[0]["Apellido1"];
                TxtApellido2.Value         = DtCliente.Rows[0]["Apellido2"];
                TxtDireccionNumero.Value   = DtCliente.Rows[0]["DireccionNumero"];
                TxtDireccionInterior.Value = DtCliente.Rows[0]["DireccionInterior"];
                TxtObservacion.Value       = DtCliente.Rows[0]["Observaciones"];
                OcultarBotones(true, true, false, true, false, true);
            }
            else
            {
                LimpiarTextos();
                ReadOnly(true);
                lblEstado.Text      = "No existe Cliente con el Nro Ducumento: " + TxtDocumento2.Text;
                lblEstado.ForeColor = Color.Red;
                OcultarBotones(true, true, false, false, false, false);
            }

            ReadOnly(true);
        }