private void buttonSelectCustomerUpdateEmail_Click(object sender, EventArgs e) { validate callValidate = new validate(); if (callValidate.IsValidEmail(textBoxCustEmail.Text)) { try { DataTable _dt_email = callServer.dialogServerInsert("TAB_LOAD_CUSTOMER_UPDATE", " @SYSAPPID = " + AID + ", @USERAPPID = "+ LID + ", @USERNUMBER = '" + USERNUMBER + "', @USERLOGID = '" + LOGUSERID + "', @CUSTNUMBER = '" + CUSTNUMBER + "', @UPDATETYPE = 'EMAIL', @UPDATEDATA = '" + textBoxCustEmail.Text + "'"); DataRow dr = _dt_email.Rows[0]; if (dr["SUCCES"].ToString() == "1") { MessageBox.Show(dr["MESSAGE"].ToString(), "Email Update", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show(dr["MESSAGE"].ToString(), "Email Update", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception) { MessageBox.Show("Call the administrator.", "Update Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } buttonSelectCustomerUpdateEmail.Enabled = false; pictureBoxWorning.Visible = false; pictureBoxSuccess.Visible = false; } else { pictureBoxWorning.Visible = true; pictureBoxSuccess.Visible = false; } }
private void textBoxCustEmail_TextChanged(object sender, EventArgs e) { if (CUSTOMERTYPE == "SYS") { pictureBoxWorning.Visible = false; pictureBoxSuccess.Visible = false; if (textBoxCustEmail.Text != "") { validate callValidate = new validate(); if (callValidate.IsValidEmail(textBoxCustEmail.Text)) { pictureBoxWorning.Visible = false; buttonSelectCustomerUpdateEmail.Enabled = true; pictureBoxSuccess.Visible = true; } else { pictureBoxWorning.Visible = true; pictureBoxSuccess.Visible = false; } } } }
private void textBoxEmail_TextChanged(object sender, EventArgs e) { labelEmailE.ForeColor = Color.Red; labelEmailE.Visible = false; if (textBoxEmail.Text != "") { validate callValidate = new validate(); if (callValidate.IsValidEmail(textBoxEmail.Text)) { labelEmailE.ForeColor = Color.Green; labelEmailE.Text = "Valied Customer Email."; labelEmailE.Visible = true; custEmail = true; } else { labelEmailE.ForeColor = Color.Red; labelEmailE.Text = "Inalied Customer Email."; labelEmailE.Visible = true; } } }