public void GenerateDataBase() { try { BrHome br = new BrHome(); //br.GenerateDataBase(); } catch (Exception ex) { } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); CoHome home = new BrHome().Exists(); if (home != null) { Application.Run(new HomeAuthentication(home)); } else { Application.Run(new HomeRegistry()); } }
public Boolean ValidateFields() { Boolean validate = true; BrHome br = new BrHome(); if (txtCorreo.Text == "") { errorProvider.SetError(txtCorreo, "El campo Correo Electrónico es obligatorio."); validate = false; } else { errorProvider.SetError(txtCorreo, ""); } if (txtNick.Text == "") { errorProvider.SetError(txtNick, "El campo Nick del Hogar es obligatorio."); validate = false; } else { errorProvider.SetError(txtNick, ""); } if (txtCorreo.Text != "") { if (br.ValidateEmailFormat(txtCorreo.Text) == false) { errorProvider.SetError(txtCorreo, "El campo Correo Electrónico no tiene un formato correcto."); validate = false; } else { errorProvider.SetError(txtCorreo, ""); } } return(validate); }
private void txtCorreo_Leave(object sender, EventArgs e) { if (txtCorreo.Text != "") { BrHome br = new BrHome(); //vamos a validar que el correo sea valido if (br.ValidateEmailFormat(txtCorreo.Text) == true) { //si el email ya existe lo tengo que mandar a iniciar session string status = string.Empty, code = string.Empty; BrAnimusRest brAnimus = new BrAnimusRest(); Boolean validateMail = brAnimus.validateMail(txtCorreo.Text, out status, out code); if (status.ToUpper().Trim() != "OK" || code != "200") { MetroFramework.MetroMessageBox.Show(this, "No existe conexión con el servidor, vuelva a reintentarlo.", "Animus", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (validateMail == true) { MetroFramework.MetroMessageBox.Show(this, "La cuenta de correo existe, debe ingresar por la opción ya tengo una cuenta.", "Animus", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //CoHome coHome = new CoHome(); //int homeIdRescue = 0; //coHome.mail = txtCorreo.Text; ////buscamos si el correo es valido para cargar la foto en el picture //int countExist = new BrHome().HomeExits(coHome, out homeIdRescue); //if (homeIdRescue != 0) //{ // DataTable dtHome = new BrHome().GetHomeId(homeIdRescue); // if (dtHome.Rows.Count > 0) // { // string pathImage = dtHome.Rows[0]["imagehome"].ToString(); // if (pathImage != "") // pictureBox1.Image = Image.FromFile(pathImage); // else // pictureBox1.Image = Image.FromFile(pathImageDefault + imageDefault); // txtNick.Text = dtHome.Rows[0]["nickhome"].ToString(); // errorProvider.SetError(txtCorreo, ""); // errorProvider.SetError(txtNick, ""); // idHome = Convert.ToInt32(dtHome.Rows[0]["idhome"].ToString()); // } //} //else //{ // if (File.Exists(pathImageDefault + imageDefault)) // { // pictureBox1.Image = Image.FromFile(pathImageDefault + imageDefault); // txtNick.Text = ""; // errorProvider.SetError(txtCorreo, ""); // errorProvider.SetError(txtNick, ""); // } // idHome = 0; // mail = ""; // nick = ""; //} } else { MetroFramework.MetroMessageBox.Show(this, "El campo correo electrónico no tiene un formato correcto.", "Animus", MessageBoxButtons.OK, MessageBoxIcon.Information); txtCorreo.Text = string.Empty; txtNick.Text = string.Empty; // if (File.Exists(pathImageDefault + imageDefault)) // { // pictureBox1.Image = Image.FromFile(pathImageDefault + imageDefault); // txtNick.Text = ""; // errorProvider.SetError(txtCorreo, ""); // errorProvider.SetError(txtNick, ""); // } // idHome = 0; // mail = ""; // nick = ""; } } else { //idHome = 0; //mail = ""; //nick = ""; } }