private void SureEvent(object sender, EventArgs e) { string user = UserName.Text; string password = Password.Text; string twice = TwicePassword.Text; //check input if (user.Equals("") || password.Equals("") || twice.Equals("")) { SimpleAlert.Show("错误", "请输入完整", "确定"); return; } if (!password.Equals(twice)) { SimpleAlert.Show("错误", "两次密码应该一样", "确定"); return; } //finish SimpleSqlite.InsertInto("personal", "Database", "SimpleUI.db3", "UPS", new List <string>() { user, password }); this.NavigationController.PopViewController(true); }
public override void ViewDidLoad() { base.ViewDidLoad(); // // SimpleAlert.Show("info", "first", "sure", (sender, e)=> { SimpleAlert.Show("info", "second", "ok"); }); //nint index = SimpleAlert.Show("info", "first", // new List<string>() { "one", "tow", "three", "four", "five" }, (sender, e) => { Console.WriteLine("hi"); }); //Console.WriteLine(index); nint index = SimpleAlert.BlockShow("info", "first", new List <string>() { "one", "tow", "three", "four", "five" }, (sender, e) => { Console.WriteLine("hi"); }); Console.WriteLine(index); }
private void SignInEvent(object sender, EventArgs e) { //按下登录触发的事件 string input = UserName.Text; //check input if (input.Equals("")) { SimpleAlert.Show("Error", "请输入用户名", "确定"); return; } //check result if (Access(input, Password.Text)) { SimpleAlert.Show("提示", "登录成功", "确定"); UIStoryboard storyboard = UIStoryboard.FromName("MainBody", NSBundle.MainBundle); UIViewController MainBodyController = storyboard.InstantiateInitialViewController() as UIViewController; this.NavigationController.PushViewController(MainBodyController, true); } else { SimpleAlert.Show("Error", "用户名或密码错误", "确定"); } }
private void btn_ActualizarInfoBasica_Click(object sender, RoutedEventArgs e) { if (!(string.IsNullOrEmpty(txtNombreInfBasica.Text) || string.IsNullOrEmpty(DateFechNacInfoBasica.Text) || string.IsNullOrEmpty(txtNombreInfBasica.Text) || (string.IsNullOrEmpty(cbDeptos.Text)) || (string.IsNullOrEmpty(cbMunic.Text)) || (string.IsNullOrEmpty(cb_profesionesIB.Text)) || (string.IsNullOrEmpty(cbSitLab.Text)) || (string.IsNullOrEmpty(txtTeNocelularInfBasica.Text)) || (string.IsNullOrEmpty(txtCorreoInfBasica.Text)) || (string.IsNullOrEmpty(txtNoduiInfBasica.Text)) || (string.IsNullOrEmpty(txtNnitInfBasica.Text)) )) { if (DateTime.Compare(DateTime.Now.Date, DateFechNacInfoBasica.SelectedDate.Value.Date) > 0) { InfoBasicaE _InfoBasicaE = new InfoBasicaE(); DateTime edad = DateFechNacInfoBasica.SelectedDate.Value; _InfoBasicaE.id_candidato = int.Parse(idCandidato); _InfoBasicaE.nombre = txtNombreInfBasica.Text.ToUpper(); _InfoBasicaE.nacionalidad = txtNacionalidadInfBasica.Text.ToUpper(); _InfoBasicaE.telefono_celular = txtTeNocelularInfBasica.Text.ToUpper(); _InfoBasicaE.telefono_fijo = txtTelefonoCasaInfBasica.Text.ToUpper(); //_InfoBasicaE.profesiones = cb_profesionesIB.Text.ToUpper(); _InfoBasicaE.id_profesiones = Convert.ToInt32(cb_profesionesIB.SelectedValue); _InfoBasicaE.correo = txtCorreoInfBasica.Text; _InfoBasicaE.fecha_nacimiento = DateFechNacInfoBasica.SelectedDate.Value; _InfoBasicaE.direccion = txtLugarResidenciaInfBasica.Text.ToUpper(); //_Imagen = ControlImagen.ObtenerImageEnBinario(_Imagen.OnlyName); if (pCapturaImagen) _InfoBasicaE.FotoCandidato = _Imagen.OnlyName; if (rbsexoM.IsChecked == true) { _InfoBasicaE.id_genero = 1; } else if (rbsexoF.IsChecked == true) { _InfoBasicaE.id_genero = 2; } _InfoBasicaE.DUI = txtNoduiInfBasica.Text; _InfoBasicaE.NIT = txtNnitInfBasica.Text; _InfoBasicaE.AFP = txtNafpInfBasica.Text; _InfoBasicaE.ISSS = txtNiss.Text; _InfoBasicaE.id_municipio = Convert.ToInt32(cbMunic.SelectedValue); _InfoBasicaE.id_situacionProfesional = Convert.ToInt32(cbSitLab.SelectedValue); string oerro = ""; int returinfobasica = 0; //capturar la imagen por el genero #region Capturar imgen por genero switch (_InfoBasicaE.id_genero) { case 1: pMensaje = "el candidato"; pURL = string.IsNullOrEmpty(_Imagen.OnlyName) ? @"C:\Imagenes\Fotos\User_default\Userman.png" : @"C:\Imagenes\Fotos\" + _Imagen.OnlyName; break; case 2: pMensaje = "la candidata"; pURL = string.IsNullOrEmpty(_Imagen.OnlyName) ? @"C:\Imagenes\Fotos\User_default\userwoman.png" : @"C:\Imagenes\Fotos\" + _Imagen.OnlyName; break; } #endregion /*proceso de eliminacion de imagen*/ if (pCapturaImagen == true) { ControlImagen.GuardarImagenEnRuta(_Imagen); // returinfobasica = _InfobasicaBL.ActualizarInfBasica(_InfoBasicaE, _InfoBasicaE.id_candidato, ref oerro); } else { returinfobasica = _InfobasicaBL.ActualizarInfBasica(_InfoBasicaE, _InfoBasicaE.id_candidato, ref oerro); } if (returinfobasica <= 0) { MessageBox.Show("Ocurrio un error y no se pudo actualizar al candidato", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { #region Mostrar mensaje personalizado SimpleAlert simpleAlert = new SimpleAlert(); simpleAlert.Title = "Nuevo Registro"; simpleAlert.NamePeople = txtNombreInfBasica.Text; simpleAlert.Url = pURL; simpleAlert.Message = "Se ha modificado " + pMensaje; simpleAlert.ShowDialog(); #region Redireccionamiento Busqueda _menusBusqueda = new Busqueda(); _menusBusqueda.InitializeComponent(); this.Close(); _menusBusqueda.Show(); #endregion #endregion } //MessageBox.Show("El candidato "+_InfoBasicaE.nombre+ " fue actualizado", "Exito", MessageBoxButton.OK, MessageBoxImage.None); } else { MessageBox.Show("La fecha de nacimiento debe ser menor a la fecha actual.", "Error", MessageBoxButton.OK, MessageBoxImage.Information); } } else { MessageBox.Show("Asegurese de que los campos obligatorios no esten vacíos.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
//***BOTON PARA GUARDAR TODA LA INFORMACION DE UN NUEVO PERFIL***/// private void GuardarTodo_Click(object sender, RoutedEventArgs e) { //VARIABLE DE MENSAJE AL GUARDAR INFORMACION ACADEMICA int returVariable3 = 0; int variable1 = 2; int variable2 = 0; if (variable1 != returVariable3 && variable2 != returVariable3) { } else if (variable1 != returVariable3 || variable2 != returVariable3) { } string cadenaFaltanDatos = ""; ///////////////////////////////***FIN DEL IF*** ////////////////////////////// //VALIDA LOS CAMPOS OBLIGATORIOS DEL TAB 1 if (string.IsNullOrEmpty(txtNombreInfBasica.Text) || string.IsNullOrEmpty(DateFechNacInfoBasica.Text) || string.IsNullOrEmpty(txtNombreInfBasica.Text) || (string.IsNullOrEmpty(cbDeptos.Text)) || (string.IsNullOrEmpty(cbMunic.Text)) || (string.IsNullOrEmpty(cb_profesionesIB.Text)) || (string.IsNullOrEmpty(cbSitLab.Text)) || (string.IsNullOrEmpty(txtTeNocelularInfBasica.Text)) || (string.IsNullOrEmpty(txtCorreoInfBasica.Text)) || (string.IsNullOrEmpty(txtNoduiInfBasica.Text)) || (string.IsNullOrEmpty(txtNnitInfBasica.Text)) ) { MessageBox.Show("Este fomulario tiene campos obligatorios '*' ", "Informacion", MessageBoxButton.OK, MessageBoxImage.Error); } else { if (DateTime.Compare(DateTime.Now.Date, DateFechNacInfoBasica.SelectedDate.Value.Date) > 0) { //SE VALIDAN QUE LOS DEMAS GRID CONTENGAN DATOS, SE RECOMIENDA AGREGAR AQUELLOS GRID QUE CONSIDEREN SEAN NECESARIOS. if (DataG_Habilidades.Items.Count == 0 || DataGrid_InfAcademica.Items.Count == 0) { cadenaFaltanDatos = ", YA QUE NO A INGRESADO TODA LA INFORMACION NECESARIA."; MessageBox.Show("Ingrese informacion acdemica y habilidades ya que son formularios requeridos", "Infomacion", MessageBoxButton.OK, MessageBoxImage.Information); } else { //PARAMETROS QUE INGRESARAN A LA BASE TAB INFOMACION BASICA InfoBasicaE _InfoBasicaE = new InfoBasicaE(); DateTime edad = DateFechNacInfoBasica.SelectedDate.Value; _InfoBasicaE.nombre = txtNombreInfBasica.Text.ToUpper(); _InfoBasicaE.nacionalidad = txtNacionalidadInfBasica.Text.ToUpper(); _InfoBasicaE.telefono_celular = txtTeNocelularInfBasica.Text.ToUpper(); _InfoBasicaE.telefono_fijo = txtTelefonoCasaInfBasica.Text.ToUpper(); //_InfoBasicaE.profesiones = cb_profesionesIB.Text.ToUpper(); _InfoBasicaE.id_profesiones = Convert.ToInt32(cb_profesionesIB.SelectedValue); _InfoBasicaE.correo = txtCorreoInfBasica.Text; _InfoBasicaE.fecha_nacimiento = DateFechNacInfoBasica.SelectedDate.Value; _InfoBasicaE.direccion = txtLugarResidenciaInfBasica.Text.ToUpper(); //_Imagen = ControlImagen.ObtenerImagenEnObjecto(_Imagen.RutaImagen); _InfoBasicaE.FotoCandidato = _Imagen.OnlyName; if (rbsexoM.IsChecked == true) { _InfoBasicaE.id_genero = 1; } else if (rbsexoF.IsChecked == true) { _InfoBasicaE.id_genero = 2; } _InfoBasicaE.DUI = txtNoduiInfBasica.Text; _InfoBasicaE.NIT = txtNnitInfBasica.Text; _InfoBasicaE.AFP = txtNafpInfBasica.Text; _InfoBasicaE.ISSS = txtNiss.Text; _InfoBasicaE.id_municipio = Convert.ToInt32(cbMunic.SelectedValue); _InfoBasicaE.id_situacionProfesional = Convert.ToInt32(cbSitLab.SelectedValue); string oerro = ""; int returinfobasica = 0; returinfobasica = _InfobasicaBL.GudarInfBasica(_InfoBasicaE, ref oerro); // BOTON PARA GUARDAR INFORMACION ACADEMICA (EVENTO) InformacionAcademicaE refinfoAcademica = new InformacionAcademicaE(); int returinfoacademica = 0; foreach (DataRowView row in DataGrid_InfAcademica.Items) { refinfoAcademica.id_tipoEducacion = Convert.ToInt32(row[0]); refinfoAcademica.titulo = Convert.ToString(row[2]); refinfoAcademica.institucion = Convert.ToString(row[3]); refinfoAcademica.anio_de_finalizacion = Convert.ToInt32(row[4]); refinfoAcademica.id_statusAcademico = Convert.ToInt32(row[6]); returinfoacademica = _informacionAcademicaBL.GuardarInfomacionAcademica(refinfoAcademica, ref oerro); } //BOTON PARA GUARDAR INFORMACION LABORAL ExpLaboralE refExpL = new ExpLaboralE(); int returinfoLaboral = 0; foreach (DataRowView row1 in DataGrid_Inf_Laboral.Items) { refExpL.nombreEmpresa = Convert.ToString(row1[0]); refExpL.cargoDesp = Convert.ToString(row1[1]); refExpL.descripPuesto = Convert.ToString(row1[2]); refExpL.fechaInicio = Convert.ToString(row1[3]); refExpL.fechaFin = Convert.ToString(row1[4]); returinfoLaboral = _experienciaLabBL.GuardarexperienciaLab(refExpL, ref oerro); } // BOTON PARA GUARDARRR LOS DATOS HABILIDADES (METODOS) HabCandidatoE refHabCandidato = new HabCandidatoE(); int returnHabilidades = 0; foreach (DataRowView row3 in DataG_Habilidades.Items) { refHabCandidato.idhabilidadTecnica = Convert.ToInt32(row3[0]); refHabCandidato.id_nivel = Convert.ToInt32(row3[2]); refHabCandidato.id_habilidadAplicacion = Convert.ToInt32(row3[4]); returnHabilidades = _habilidadCandidatoBL.GuardarHabilidadCandidato(refHabCandidato, ref oerro); } //BOTON PARA GUARDAR CERTIFICACIONES EN LA BASE (METODOS) CertificacionesE certifi = new CertificacionesE(); int returnCertificaciones = 0; foreach (DataRowView row2 in DataGrid_Certificaciones.Items) { certifi.nombre = Convert.ToString(row2[0]); certifi.institucion = Convert.ToString(row2[1]); certifi.anio = Convert.ToInt16(row2[2]); returnCertificaciones = _certificanesBL.GuardarCertificacionesLAB(certifi, ref oerro); } //BOTON PARA INGRESAR REFERENCIAS A RefecenciasE refE = new RefecenciasE(); int returReferencias = 0; foreach (DataRowView row5 in DataGrid_Referencias.Items) { refE.id_tipoReferencias = Convert.ToInt32(row5[0]); refE.nombre = Convert.ToString(row5[2]); refE.telefono = Convert.ToString(row5[3]); refE.descripcion = Convert.ToString(row5[4]); returReferencias = _referenciasBL.GuardarReferencias(refE, ref oerro); } if (oerro == "") { #region Capturar imgen por genero string pMensaje = "", pURL = ""; switch (_InfoBasicaE.id_genero) { case 1: pMensaje = "candidato"; pURL = string.IsNullOrEmpty(_Imagen.RutaImagen) ? @"C:\Imagenes\Fotos\User_default\Userman.png" : _Imagen.RutaImagen; break; case 2: pMensaje = "candidata"; pURL = string.IsNullOrEmpty(_Imagen.RutaImagen) ? @"C:\Imagenes\Fotos\User_default\userwoman.png" : _Imagen.RutaImagen; break; } #endregion if (Elijiomagen) ControlImagen.GuardarImagenEnRuta(_Imagen); #region Mostrar mensaje personalizado SimpleAlert simpleAlert = new SimpleAlert(); simpleAlert.Title = "Nuevo Registro"; simpleAlert.NamePeople = txtNombreInfBasica.Text; simpleAlert.Url = pURL; simpleAlert.Message = "Se ha creado el nuevo " + pMensaje; simpleAlert.ShowDialog(); #region Redireccionamiento Busqueda _menusBusqueda = new Busqueda(); _menusBusqueda.InitializeComponent(); this.Close(); _menusBusqueda.Show(); #endregion #endregion } else { MessageBoxResult mbr = MessageBox.Show("OCURRIO UN ERROR AL GUARDAR SUS DATOS... ERROR: " + oerro, "Infomacion", MessageBoxButton.OK, MessageBoxImage.Information); } } } else { MessageBox.Show("La fecha de nacimiento debe ser menor a la fecha actual.","Error", MessageBoxButton.OK, MessageBoxImage.Information); } } }