/// <summary> /// Consulta el Credito del Cliente y obtenemos los valores de su Esatdo de Cuenta /// </summary> /// <param name="idCliente"></param> private void CreditoConsultaNumCliente(int idCliente) { DtRegistros = Consulta.Credito_ConsultaNumCliente(idCliente); if (DtRegistros.Rows.Count > 0) { Id_Credito = Convert.ToInt32(DtRegistros.Rows[0]["Id_Credito"].ToString()); Id_Cliente = Convert.ToInt32(DtRegistros.Rows[0]["Id_Cliente"].ToString()); LblCliente.Text = "Cliente: " + DtRegistros.Rows[0]["Cliente"].ToString(); LblSaldo_Autorizado.Text = "Credito: $ " + DtRegistros.Rows[0]["Saldo_Autorizado"].ToString(); lblCredito_Acumulado.Text = "Saldo Acumulado: $ " + DtRegistros.Rows[0]["Credito_Acumulado"].ToString(); LblSaldo_Actual.Text = "Saldo Actual: $ " + DtRegistros.Rows[0]["Saldo_Actual"].ToString(); lblSaldo_Abonado.Text = "Saldo Abonado: $ " + DtRegistros.Rows[0]["Saldo_Abonado"].ToString(); Credito_Autorizado = Convert.ToDecimal(DtRegistros.Rows[0]["Saldo_Autorizado"]); Credito_Acumulado = Convert.ToDecimal(DtRegistros.Rows[0]["Credito_Acumulado"]); Credito_Actual = Convert.ToDecimal(DtRegistros.Rows[0]["Saldo_Actual"]); } else { Id_Credito = 0; Id_Cliente = 0; LblCliente.Text = "Cliente:Sin Registro"; lblSaldo_Abonado.Text = "Saldo Abonado: $ 0"; LblSaldo_Actual.Text = "Saldo Actual: $ 0"; LblSaldo_Autorizado.Text = "Credito: $ 0"; lblCredito_Acumulado.Text = "Saldo Acumulado: $ 0"; Soporte.MsgError(" No se encontraro el Numero de Cliente, revisar que se encuentre en la Base de Datos.", "Cliente Sin Registro"); } }
internal void EnviarCorreo(string emisor, string contraseña, string mensaje, string asunto, string destinatario, string ruta) { try { Cursor = Cursors.WaitCursor; MailMessage correos = new MailMessage(); SmtpClient envios = new SmtpClient(); correos.To.Clear(); correos.Body = ""; correos.Subject = ""; correos.Body = mensaje; correos.Subject = asunto; correos.IsBodyHtml = true; correos.To.Add(destinatario); correos.From = new MailAddress(emisor); envios.Credentials = new NetworkCredential(emisor, contraseña); envios.Host = "smtp.gmail.com"; envios.Port = 587; envios.EnableSsl = true; envios.Send(correos); Cursor = Cursors.Default; FormInformacion formInformacion = new FormInformacion(); MemoriaCache.Mensaje = "Se ha enviado su contraseña al correo " + destinatario + " ingrese ahora mismo y verificalo."; formInformacion.ShowDialog(); //Soporte.MsgInformacion("Se ha enviado su contraseña al correo " + destinatario + " ingrese ahora mismo y verificalo."); } catch (Exception ex) { Soporte.MsgError(ex.Message); } }
private void BtnBuscar_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(TxtNomina.Text) && TxtNomina.Text != "Ingrese nomina...") { Nomina = Convert.ToInt32(TxtNomina.Text); DtRegistro = Consulta.EmpleadoEnviarCorreo(Nomina); if (DtRegistro.Rows.Count > 0) { Correo = DtRegistro.Rows[0]["Correo"].ToString(); if (Soporte.ValidarMail(Correo)) { Contraseña = Encryption.Decrypt(DtRegistro.Rows[0]["Contraseña"].ToString()); NombreCompleto = DtRegistro.Rows[0]["Nombre"].ToString(); Usuario = DtRegistro.Rows[0]["Usuario_Name"].ToString(); //Proceso de Enviar Correo richTextBox1.Text = richTextBox1.Text.Replace("@Contradeseña", Contraseña); richTextBox1.Text = richTextBox1.Text.Replace("@Empleado", NombreCompleto); EnviarCorreo("*****@*****.**", "38641rene", richTextBox1.Text, "Recuperacion", Correo, ""); Close(); } } else { Soporte.MsgError("No se encontraron datos con este numero de nomina", "Sin Registros"); } } else { Soporte.Msg_Alerta("Igrese el numero de nomina"); } }
private void BtnCobrar_Click(object sender, EventArgs e) { if (DgvVenta.Rows.Count > 0) { ValidarPago(); } else { Soporte.MsgError("Ingrese almenos un Articulo para poder combrar..."); } }
private bool ValidarValorVariables() { if (PrecioCompra == 0) { Soporte.MsgError("Ingrese el precio de compra del articulo"); TxtPrecioCompra.Focus(); return(false); } if (GananciaObtener == 0) { Soporte.MsgError("Ingrese el Saldo de Ganancia a Obtener"); TxtGananciaObtener.Focus(); return(false); } if (Cantidad == 0) { Soporte.MsgError("Capture la Cantidad de Artiulos que se ingresaran."); TxtCantidad.Focus(); return(false); } if (Convert.ToInt32(CmbTipEntradas.SelectedValue) == 4) { if (MontoTotal == 0) { Soporte.MsgError("Ingrese el Monto Total del Comprobante."); TxtMontoTotal.Focus(); return(false); } if (TotalArticulos == 0) { Soporte.MsgError("Ingrese la Cantidad total de Articulos del Comprobante."); TxtTotalArticulos.Focus(); return(false); } if (NumeroComprobante == 0) { Soporte.MsgError("Ingrese el Numero del Comprobante."); TxtNumComprobante.Focus(); return(false); } } else { } return(true); }
private void BtnGuardar_Click(object sender, EventArgs e) { Resultado = ClsGuardar.PaisGuardar(textBox1.Text, textBox2.Text); if (Resultado == "Insertado") { Soporte.MsgInformacion("El Registro se ha Guardado correctamente."); ConsultaPais(); } else { Soporte.MsgError(Resultado); } }
private void BtnCancelar_Click(object sender, EventArgs e) { Resultado = Eliminar.Pais(Convert.ToInt32(radGridView1.CurrentRow.Cells["IdPais"].Value)); if (Resultado == "Eliminado") { Soporte.MsgInformacion("Se ha eliminado correctamente el nombre del Pais"); ConsultaPais(); } else { Soporte.MsgError(Resultado); } }
private void GuardarArticulo() { try { ClsGuardar.ArticuloGuardar(Codigo, Nombre, Marca, Descripcion, ID_Presentacion_Art, ID_Unidad_Medida, Id_Fabricante, Contenido_Neto, Cantidad_Minimo, Cantidad_Maximo, Unidad_Venta, Foto, Id_Estatus, IdAgranel, IdSucursal, IdEmpresa); Soporte.MsgInformacion("Articulo Registrado Correctamente."); } catch (Exception ex) { Soporte.MsgError("Sql: Posible Dupliacion de Codigo, Revisar e intentar con otro Codigo." + ex.Message); } }
private void BtnCancelar_Click(object sender, EventArgs e) { Resultado = Eliminar.Colonias(Convert.ToInt32(radGridView1.CurrentRow.Cells["IdColonia"].Value)); if (Resultado == "Eliminado") { Limpiar(); ConsultaColonias(); Soporte.MsgInformacion("El registro se ha eliminado correctamente"); } else { Soporte.MsgError(Resultado); } }
private void ActulizarSucursal() { Resultado = ClsEditar.Sucursal(IdSucursal, Nombre, Telefono, Correo, IdEmpresa, Calle, Numero_Interno, Numero_Externo, Entre_Calles, IdColonia, CodigoPostal, IdMunicipio, IdEstado, IdPais, Direccion); if (Resultado == "Actualizado") { Limpiar(); Soporte.MsgInformacion("La Sucursal se actualizado correctamente."); } else { Soporte.MsgError(Resultado); } }
private bool ValidarTxtUserContra() { if (TxtUsuario.Text == "USUARIO" && TxtUsuario.TextLength < 4) { Soporte.MsgError("Ingrese un Nombre de Usuario para continuar."); return(false); } if (TxtContraseña.Text == "CONTRASEÑA") { Soporte.MsgError("Ingrese Su contraseña de Usuario"); return(false); } return(true); }
private void BtnGuardar_Click(object sender, EventArgs e) { Resultado = ClsGuardar.EstadoInsertar(textBox1.Text, textBox2.Text, Convert.ToInt32(CmbxPais.SelectedValue)); if (Resultado == "Insertado") { Limpiar(); ConsultaEstados(); Soporte.MsgInformacion("El Registro se ha guardado correctamente"); } else { Soporte.MsgError(Resultado); } }
private void GuardarSucursal() { Resultado = ClsGuardar.Sucursal(Nombre, Telefono, Correo, IdEmpresa, Calle, Numero_Interno, Numero_Externo, Entre_Calles, IdColonia, CodigoPostal, IdMunicipio, IdEstado, IdPais, Direccion); if (Resultado == "Insertado") { Limpiar(); Soporte.MsgInformacion("El Registro de la Sucursal se ha guardado correctamente."); } else { Soporte.MsgError(Resultado); } }
private bool ValidarArticulo() { if (RadgvLista.Rows.Count > 0) { for (int i = 0; i < RadgvLista.Rows.Count; i++) { string Codigo2 = RadgvLista.Rows[i].Cells["Codigo"].Value.ToString(); if (TxtCodigo.Text == Codigo2) { Soporte.MsgError("El articulo ya se encuentra en la Lista, puede Eliminarlo y volver a Cargarlo"); return(true); } } } return(false); }
private void BtnSeleccionarRuta_Click(object sender, EventArgs e) { if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { TxtRutaCopiaSeguridad.Text = folderBrowserDialog1.SelectedPath; string ruta = TxtRutaCopiaSeguridad.Text; if (ruta.Contains(@"C:\")) { Soporte.MsgError("Seleccione un Disco Diferente al Disco 'C'.", "Ruta Invalido"); TxtRutaCopiaSeguridad.Clear(); } else { TxtRutaCopiaSeguridad.Text = folderBrowserDialog1.SelectedPath; } } }
private void BtnEliminar_Click(object sender, EventArgs e) { DialogResult Opcion; Opcion = MessageBox.Show("Ha selecionado Eliminar el Registro, desea Continuar?", "Eliminando Registro", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (Opcion == DialogResult.OK) { Nomina = Convert.ToInt32(RadGVEmpleados.CurrentRow.Cells["Nomina"].Value); if (ClsGuardar.EliminarEmpleado(Nomina)) { Soporte.MsgInformacion("El Usuario se ha eliminado correctamente"); MostrarRegistros(); } else { Soporte.MsgError("No se Puede Eliminar un Administrador, verifique el Registro.", "Registro no Eliminado"); } } }
private void BtnGuardar_Click(object sender, EventArgs e) { if (Convert.ToInt32(CmbxMunicipio.SelectedValue) == 0) { Soporte.MsgError("Seleccione una Colonia"); } else { Resultado = ClsGuardar.ColoniaGuardar(TxtColonia.Text, TxtDescripcion.Text, Convert.ToInt32(CmbxMunicipio.SelectedValue), Convert.ToInt32(TxtCodigoPostal.Text)); if (Resultado == "Insertado") { ConsultaColonias(); Limpiar(); Soporte.MsgInformacion("La Colonia se ha registrado correctamente"); } else { Soporte.MsgError(Resultado); } } }
private void BtnGuardar_Click(object sender, EventArgs e) { if (Convert.ToInt32(CmbxEstado.SelectedValue) == 0) { Soporte.MsgError("Seleccione un estado"); } else { Resultado = ClsGuardar.MunicipioInsertar(TxtMunicipio.Text, TxtDescripcion.Text, Convert.ToInt32(CmbxEstado.SelectedValue)); if (Resultado == "Insertado") { ConsultaMunicipio(); Limpiar(); Soporte.MsgInformacion("El Municipio se ha regustrado correctamente"); } else { Soporte.MsgError(Resultado); } } }
private void BuscarArticuloKerdex(string sCodigo) { try { DtRegistros = Kardex.ConsultaKardexArticupoCodigo(sCodigo); if (DtRegistros.Rows.Count > 0) { dataGridView1.DataSource = DtRegistros; Ayuda.Multilinea(ref dataGridView1); } else { DgvAutoCompletar.Visible = false; TxtBuscarArticulo.Text = "Escriba lo que desea buscar..."; TxtBuscarArticulo.ForeColor = Color.Gray; dataGridView1.DataSource = dataTable; Soporte.MsgError("No se encontro ningun producto."); } } catch (Exception ex) { Soporte.MsgError(ex.Message); } }
private void BtnProbarConexion_Click(object sender, EventArgs e) { try { if (CmbModoAutenticacion.Text == "SQL Server Authentication") { CadenaConexion = "Data Source=" + TxtTipoConexion.Text + ";Initial Catalog=" + TxtBaseDatos.Text + ";user id=" + TxtUserName.Text + ";password="******"Windows Authentication") { CadenaConexion = "Data Source =" + TxtTipoConexion.Text + "; Initial Catalog=" + TxtBaseDatos.Text + ";Integrated Security=True;"; } TxtConexionCadena.Text = CadenaConexion; DataTable dt = new DataTable(); SqlDataAdapter da; SqlConnection sqlConnection = new SqlConnection(); sqlConnection.ConnectionString = CadenaConexion; sqlConnection.Open(); //da = new SqlDataAdapter("Sp_Consulta_Empleados", sqlConnection); da = new SqlDataAdapter("Sp_Consulta_Proveedor", sqlConnection); da.Fill(dt); datalistado.DataSource = dt; sqlConnection.Close(); MessageBox.Show("Coneccion realizada correctamente", "Conexion", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception) { Soporte.MsgError("Sin conexion a la Base de datos", "Conexion fallida"); } }
/// <summary> /// Validamos si El Pago va a Ser en Efectivo o CRedito /// </summary> private void ValidarPago() { if (ChkCredito.Checked == true && ChkEfctivo.Checked == false) { #region Credito //if (Soporte.Msg_Dialog("La cantidad de efectivo a Cobrar no debe se Cero, Desea el Cobro a Credito?") == DialogResult.Yes) //{ if (Credito_Actual < dTotalVentaVariable) { Soporte.MsgError("No cuenta con credito suficiente, Solicitar Abono a la Cuenta para poder continuar."); } else { dCredito = dTotalVentaVariable; if (ChkCredito.Checked == true && dCredito > 0 && Id_Cliente > 0) { iCantidadCobros += 1; if (iCantidadCobros == 1) { //Obtenemos el numero de la Venta consecutivo y este meto guardara el numero de venta en la variable if (MemoriaCache.ValidarVenta != "Suspendido") { NumeroConsecutivoVenta(); } AsignarValoresVenta(); dEfectivo = 0; Estatus = 4; FinalizarVenta(); } ClsGuardar.CreditoGuardar(Id_Cliente, Id_Venta, dCredito, Id_Credito); //FinalizarVenta(); LimpiarControlesVenta(); ImprimirTicketCredito(); iCantidadCobros = 0; } else { Soporte.MsgError("Busque el Numero de cliente al cual se cargara la cuenta.", "Error Datos Cliente"); } } //} #endregion } else { if (ChkEfctivo.Checked == true && ChkCredito.Checked == false) { #region Efectivo /*Pago en Efectivo*/ /* Primero Validamos que la caja de texto TxtCantidadRecibido no este vacio, si esta vacio enviamos un * mensaje de que tiene que ingresar la cantidad a recobir */ if (string.IsNullOrEmpty(TxtCantidadRecibido.Text)) { Soporte.MsgError("No ha ingresado la Cantidad de Efectivo Recibido"); TxtCantidadRecibido.Focus(); } else /*Si caja de texto TxtCantidadRecibido no esta vacio ahora validaremos la cantidad que recibimos*/ { //Pasamos el valor de la caja de texto TxtCantidadRecibido a la variable Recicbo_Cantidad esto para vaidarlo. Recicbo_Cantidad = Convert.ToDecimal(TxtCantidadRecibido.Text); //Si la cantidad que Recibimos de Efectivo es mayor a cero entonces continuamos validando si no es asi enviamos un mensaje. if (Recicbo_Cantidad > 0) { /* Contara cuantas veces se ha dado click al Boton Cobrar, * al dar el primer click la variable iCantidadCobros tomara como valor 1 y guardara la venta y el detalle de la venta * cuando se vuelva a dar click la cantidad de cobrar la variable iCantidadCobros ahora valdra 2 es deccir la venta ya no tiene * que ser guardada nuevamente por que ya se guardo al dar el primer click */ iCantidadCobros += 1; if (iCantidadCobros == 1) { //Obtenemos el numero de la Venta consecutivo y este meto guardara el numero de venta en la variable if (MemoriaCache.ValidarVenta != "Suspendido") { NumeroConsecutivoVenta(); } AsignarValoresVenta(); Estatus = 4; FinalizarVenta(); } //Si la cantidad que recibimos para cobrar la venta es mayor a la Venta a combra entonces quiere decir que tenemos que regresar el cambio al cliente //Por lo tanto la venta finalizara y guardamos el detalle del pago Limpiamos los controles y despues imprimimos el ticket if (Recicbo_Cantidad > dTotalVentaVariable) { Cambio_Regresar = Recicbo_Cantidad - dTotalVentaVariable; if (Cambio_Regresar >= 0) { dTotalVentaVariable = 0; } TxtCambioRegresar.Text = Convert.ToString(Cambio_Regresar); //Guarda el dellate de PAGO ClsGuardar.PagosVentaDetalle(Id_Venta, dTotalVentaNeto, Recicbo_Cantidad, dTotalVentaVariable, Cambio_Regresar, UsuarioCache.Id_Usuario); // FinalizarVenta(); if (Cambio_Regresar != 0) { Soporte.MsgInformacion("Regresar Cambio al Cliente Cantidad:" + Cambio_Regresar); } LimpiarControlesVenta(); ImprimirTicket(); iCantidadCobros = 0; } //Pero si la cantidad que recibimos es menor a la venta a cobrar entonces Hacemos una resta a la venta por la cantidad que recibimos //Y nos quedara el nuevo monto a cobrar es decir el resto y despues guardamos el Pago realizado y el faltante pendiente a cobrar else { Faltante_Pago = dTotalVentaVariable - Recicbo_Cantidad; TxtTotalPagar.Text = Convert.ToString(Faltante_Pago); dTotalVentaVariable = Faltante_Pago; ClsGuardar.PagosVentaDetalle(Id_Venta, dTotalVentaNeto, Recicbo_Cantidad, dTotalVentaVariable, Cambio_Regresar, UsuarioCache.Id_Usuario); TxtCantidadRecibido.Text = "0"; } } else //cuando la cantidad que recibimos es igual a cero entonces enviamos mensaje es decir que no recibimos nada de efectivo por lo contrario no podemos continuar { Soporte.MsgError("Ingrese una cantidad Mayor a Cero '0'.."); } } #endregion } } }
private bool ValidarCampos() { if (Editar) { if (IdSucursal == 0) { Soporte.MsgError("Seleccione un registro al que desea Actualizar."); TxtNombre.Focus(); return(false); } } if (string.IsNullOrEmpty(TxtNombre.Text) || TxtNombre.Text == "0") { Soporte.MsgError("Ingrese Nombre de la Sucursal"); TxtNombre.Focus(); return(false); } if (string.IsNullOrEmpty(TxtTelefono.Text) || TxtTelefono.Text == "0") { Telefono = "Registro Pendiente"; } if (string.IsNullOrEmpty(TxtCorreo.Text) || TxtCorreo.Text == "0") { Correo = "*****@*****.**"; } else { if (Soporte.ValidarMail(TxtCorreo.Text) == false) { Soporte.MsgError("El correo no cuenta con el Formato correcto"); TxtCorreo.Focus(); TxtCorreo.SelectAll(); return(false); } } if (CmbEmpresa.SelectedIndex == 0) { Soporte.MsgError("Seleccione una empresa al que pertenecera la Sucursal"); CmbEmpresa.Focus(); CmbEmpresa.SelectAll(); return(false); } if (CmbxPais.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Pais"); CmbxPais.Focus(); CmbxPais.SelectAll(); return(false); } if (CmbxEstado.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Estado"); CmbxEstado.Focus(); CmbxEstado.SelectAll(); return(false); } if (CmbxMunicipio.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Municipio"); CmbxMunicipio.Focus(); CmbxMunicipio.SelectAll(); return(false); } if (CmbColonias.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Colonia"); CmbColonias.Focus(); CmbColonias.SelectAll(); return(false); } if (TxtCodigoPostal.TextLength < 4) { Soporte.MsgError("Ingrse un Codigo Postal Valido."); TxtCodigoPostal.Focus(); return(false); } if (TxtCalle.TextLength < 5) { Soporte.MsgError("Ingrse una calle valido"); TxtCalle.Focus(); return(false); } if (string.IsNullOrEmpty(TxtEntreCalles.Text) || TxtEntreCalles.Text == "0") { Entre_Calles = "Sin Registro"; } if (string.IsNullOrEmpty(TxtNumExterno.Text) || TxtNumExterno.Text == "0") { Numero_Externo = "SIN NUMERO"; } if (string.IsNullOrEmpty(TxtNumInterno.Text) || TxtNumInterno.Text == "0") { Numero_Interno = "SIN NUMERO"; } return(true); }
private bool ValidarCampos() { if (ChkbAgranel.Checked == true) { if (CmbFamiliaAgranel.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Categoria del Articulo en Agranel"); CmbFamiliaAgranel.Focus(); return(false); } } if (TxtCodigo.Visible == true) { if (TxtCodigo.TextLength < 4) { Soporte.MsgError("Ingrese un Codigo del Articulo"); TxtCodigo.Focus(); return(false); } } if (string.IsNullOrEmpty(TxtNombre.Text)) { Soporte.MsgError("Ingrese una Nombre del Articulo"); TxtNombre.Focus(); return(false); } if (string.IsNullOrEmpty(TxtMarca.Text)) { Soporte.MsgError("Ingrese una Marca."); TxtMarca.Focus(); return(false); } if (string.IsNullOrEmpty(TxtDescripcion.Text)) { Soporte.MsgError("Ingrese una Descripcion del Articulo."); TxtDescripcion.Focus(); return(false); } if (CmbPrestArt.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Presentacion del Articulo"); CmbPrestArt.Focus(); return(false); } if (string.IsNullOrEmpty(TxtContenido.Text)) { Soporte.MsgError("Ingrese el Contenido del Articulo"); TxtContenido.Focus(); return(false); } if (CmbUnidMed.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Unidad de Medina del Articulo"); CmbUnidMed.Focus(); return(false); } if (CmbUnidadVenta.SelectedIndex == 0) { Soporte.MsgError("Seleccione Unidad de Medida para la Venta del Articulo"); CmbUnidadVenta.Focus(); return(false); } if (string.IsNullOrEmpty(TxtCantidadMinimo.Text)) { Soporte.MsgError("Ingrese un Valor Valido para la cantidad Minimo del Articulo"); TxtCantidadMinimo.Focus(); return(false); } if (string.IsNullOrEmpty(TxtCantidadMaximo.Text)) { Soporte.MsgError("Ingrese un Valor Valido para la cantidad Maximo del Articulo"); TxtCantidadMaximo.Focus(); return(false); } if (CmbEstatus.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Estatus del Articulo"); CmbPrestArt.Focus(); return(false); } if (CmbFabricante.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Fabricante o elige sin Fabricante"); CmbFabricante.Focus(); return(false); } if (CmbEmpresa.SelectedIndex == 0) { Soporte.MsgError("Seleccione la Empresa en donde se registrara el Articulo"); CmbEmpresa.Focus(); return(false); } if (CmbSucursal.SelectedIndex == 0) { Soporte.MsgError("Seleccione la Sucursal en donde se registrara el Articulo"); CmbSucursal.Focus(); return(false); } return(true); }
private bool ValidarCampos() { //if (string.IsNullOrEmpty(TxtNomina.Text)) //{ // Soporte.MsgInformacion("Ingrese el Numero de Nomina"); // return false; //} if (string.IsNullOrEmpty(TxtNombres.Text)) { Soporte.MsgInformacion("Ingrese un Nombre del Empleado"); return(false); } if (string.IsNullOrEmpty(TxtApPaterno.Text)) { Soporte.MsgInformacion("Ingrese el Apellido Paterno del Empleado"); return(false); } if (string.IsNullOrEmpty(TxtApMaterno.Text)) { Soporte.MsgInformacion("Ingrese el Apellido Materno del Empleado"); return(false); } if (string.IsNullOrEmpty(TxtCURP.Text)) { TxtCURP.Text = "Sin Registro"; } if (string.IsNullOrEmpty(TxtRFC.Text)) { TxtRFC.Text = "Sin Registro"; } if (string.IsNullOrEmpty(TxtTelefono.Text)) { TxtTelefono.Text = "0"; } if (string.IsNullOrEmpty(TxtCelular.Text)) { TxtCelular.Text = "0"; } if (string.IsNullOrEmpty(TxtEmail.Text)) { TxtEmail.Text = "*****@*****.**"; } if (CmbAreas.SelectedIndex == 0) { Soporte.MsgInformacion("Seleccione un Area"); return(false); } if (string.IsNullOrEmpty(CmbPuesto.Text)) { Soporte.MsgInformacion("Seleccione un Puesto para el Empleado"); return(false); } if (CmbPuesto.SelectedIndex == 0) { Soporte.MsgInformacion("Seleccione un Puesto para el Empleado"); return(false); } if (string.IsNullOrEmpty(CmbEstatus.Text)) { Soporte.MsgInformacion("Seleccione el estatus del Empleado"); return(false); } if (CmbEstatus.SelectedIndex == 0) { Soporte.MsgInformacion("Seleccione el estatus del Empleado"); return(false); } if (string.IsNullOrEmpty(TxtCalle.Text)) { TxtCalle.Text = "Registro Pendiente"; } if (string.IsNullOrEmpty(TxtNumInterno.Text)) { TxtNumInterno.Text = "0"; } if (string.IsNullOrEmpty(TxtNumExterno.Text)) { TxtNumExterno.Text = "0"; } if (string.IsNullOrEmpty(TxtEntreCalles.Text)) { TxtEntreCalles.Text = "Registro Pendiente"; } if (CmbxPais.SelectedIndex == 0) { Soporte.MsgError("Seleccione el Pais."); return(false); } if (CmbxEstado.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Estado"); return(false); } if (CmbxMunicipio.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Municipio"); return(false); } if (CmbColonias.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Colonia"); return(false); } if (string.IsNullOrEmpty(TxtCodigoPostal.Text)) { TxtCodigoPostal.Text = "0"; } if (Soporte.ValidarMail(TxtEmail.Text) == false) { Soporte.MsgInformacion("Correo no valido"); TxtEmail.Focus(); TxtEmail.SelectAll(); return(false); } if (CmbEmpresa.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Empresa"); return(false); } if (CmbSucursal.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Sucursal."); return(false); } return(true); }
/// <summary> /// Asignamos el valor a La varaible cantidad, este se obtiene del TextBox TxtCantidadArt /// </summary> private bool AsignarValorCantidadArticulo() { if (dCantidad == 0) { if (string.IsNullOrEmpty(TxtCantidadArt.Text) || TxtCantidadArt.Text == "0") { dCantidad = 1; return(true); } else { if (sUnidad_MedidaVenta == "Pieza") { if (!ValidarEsDecimal()) { dCantidad = 1; } else { dCantidad = Convert.ToDecimal(TxtCantidadArt.Text); } return(true); } else { if (Soporte.ValidarFormatoMoneda(TxtCantidadArt.Text)) { dCantidad = Convert.ToDecimal(TxtCantidadArt.Text); return(true); } else { Soporte.MsgError("Error en los Datos ingresados de la cantidad"); return(false); } } } } else { if (sUnidad_MedidaVenta == "Pieza") { if (!ValidarEsDecimal()) { dCantidad = 1; return(true); } else { return(false); } } else { if (Soporte.ValidarFormatoMoneda(TxtCantidadArt.Text)) { dCantidad += Convert.ToDecimal(TxtCantidadArt.Text); return(true); } else { Soporte.MsgError("Error en los Datos ingresados de la cantidad"); return(false); } } } }