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; } }
public async Task <IActionResult> Index(LoginView model) { TempData["ErrorMessage"] = string.Empty; if (ModelState.IsValid) { //var url = "/cms3/ui/en"; //var url = "/cms3/category.html"; // validate v1 = new validate(); validate ldabV1 = new validate(); //ClaimsIdentity claimsIdentity; var Iresult = await ldabV1.ValidateUserUsinLdapApi(model.UserName, model.Password); if (Iresult.claimsid == null) { TempData["ErrorMessage"] = Iresult.message; TempData["ErrorMessage"] = "Please Enter A Valid User Name and Password!"; return(View("Index")); ///return View("Index"); } try { Response.Cookies.Delete("user_Lognstatus"); DleteCookie("user_Lognstatus", ""); DleteCookie("CMS", ""); HttpContext.Session.Clear(); HttpContext.Session.Remove("user_Lognstatus"); HttpContext.Session.Remove("CMS"); await HttpContext.SignOutAsync( CookieAuthenticationDefaults.AuthenticationScheme); await HttpContext.SignInAsync( CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(Iresult.claimsid) , new AuthenticationProperties { AllowRefresh = false, ExpiresUtc = DateTime.UtcNow.AddMinutes(15) //IsPersistent = false }); if (_httpContextAccessor.HttpContext.Request.Cookies["user_Lognstatus"] == null || _httpContextAccessor.HttpContext.Request.Cookies["user_Lognstatus"] == "Logout") { Set("user_Lognstatus", Guid.NewGuid().ToString(), 15); } //return RedirectToAction("index", "ui",new { language = "ar" });///this.Redirect(url); return(Redirect("~/cms3/")); } catch (Exception ex) { string err = ex.Message; TempData["ErrorMessage"] = "An error occurred. Please contact Administrator :Error" + ex.Message; return(View("Index")); } } //validate.testdir(); return(View("Index")); }
public validateResponse validate([System.Xml.Serialization.XmlElementAttribute("validate", Namespace = "")] validate validate1) { object[] results = this.Invoke("validate", new object[] { validate1 }); return((validateResponse)(results[0])); }
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; } } }
public async Task <IActionResult> Logout() { validate ldabV1 = new validate(); var url = "/cms3/login"; Response.Cookies.Delete("user_Lognstatus"); DleteCookie("user_Lognstatus", ""); DleteCookie("CMS", ""); await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme, new AuthenticationProperties { ExpiresUtc = DateTime.UtcNow }); var result = await HttpContext.AuthenticateAsync(CookieAuthenticationDefaults.AuthenticationScheme); if (result.Succeeded) { await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, HttpContext.User, new AuthenticationProperties { AllowRefresh = true, ExpiresUtc = DateTime.UtcNow.AddMinutes(-1), IsPersistent = false }); } HttpContext.Session.Clear(); HttpContext.Session.Remove("user_Lognstatus"); HttpContext.Session.Remove("CMS"); ldabV1.UnValidateUser(); var resultx = await HttpContext.AuthenticateAsync(CookieAuthenticationDefaults.AuthenticationScheme); bool test = resultx.Succeeded; /// HttpContext.Session["MyName"] = "C-SharpCorner"; return(new OkObjectResult(new { url = url, success = "true" })); //return;//this.Redirect(url); }
/// <remarks/> public System.IAsyncResult Beginvalidate(validate validate1, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("validate", new object[] { validate1}, callback, asyncState); }
/// <remarks/> public System.IAsyncResult Beginvalidate(validate validate1, System.AsyncCallback callback, object asyncState) { return(this.BeginInvoke("validate", new object[] { validate1 }, callback, asyncState)); }
public void Form1Test() { validate obj = new validate(); Form1 obj1 = new Form1(); }