public ActionResult Index(LayoutTest.Models.Account model) { if (string.IsNullOrEmpty(model.Username)) { ModelState.AddModelError("Username", "Username is required"); }else if (string.IsNullOrEmpty(model.Password)) { ModelState.AddModelError("Password", "Password is required"); } else { Account ok = dal.FindAcc(model); if (ok != null) { ViewBag.acc = ok; if (model.Username.Equals(ok.Username) && model.Password.Equals(ok.Password)) { Session["USER"] = model; return RedirectToAction("Index", "Home", ok); } } } return View(); }
/// <summary> /// /// </summary> /// <param name="test"></param> /// <param name="masterDimensions"></param> public VScanCommon(LayoutTest test, IMasterDimension[] masterDimensions) { if (test != null) { index = new LayoutMasterIndex(masterDimensions); index.FileName = Common.ResolveName(test); index.Path = Common.ResolvePath(test); GlobalLog.LogStatus("Master Name : {0}", index.FileName); GlobalLog.LogStatus("Master Path : {0}", index.Path); SetWindow(test.window); } }
/// <summary> /// Constructor for Vscan Common /// </summary> ///<param name="test">Test of type LayoutTest that is currently running</param> public VScanCommon(LayoutTest test) { //HACK: Visual Verification technology should not be taking a dependency on layout technology. if (test != null) { index = new LayoutMasterIndex(null); index.FileName = Common.ResolveName(test); index.Path = Common.ResolvePath(test); GlobalLog.LogStatus("Master Name : {0}", index.FileName); GlobalLog.LogStatus("Master Path : {0}", index.Path); SetWindow(test.window); } }
public ActionResult Index(LayoutTest.Models.Account model) { if (string.IsNullOrEmpty(model.Username)) { ModelState.AddModelError("Name", "Name is required"); } if (string.IsNullOrEmpty(model.Password)) { ModelState.AddModelError("Password", "Password is required"); } if (!string.IsNullOrEmpty(model.Email)) { string emailRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"; Regex re = new Regex(emailRegex); if (!re.IsMatch(model.Email)) { ModelState.AddModelError("Email", "Email is not valid"); } } else { ModelState.AddModelError("Email", "Email is required"); } if (ModelState.IsValid) { ViewBag.Name = model.Username; ViewBag.Email = model.Email; ViewBag.Password = model.Password; Boolean ok = dal.AddAccount(model); ViewBag.d = ok; } return View(model); }
static void Main(string[] args) { LayoutTest layout = new LayoutTest(); layout.Serializable(); }
public void SendKey(LayoutTest.Models.Account model) { String NPass = GetUniqueKey(8); Debug.Write(NPass); Cryptography e = new Cryptography(); dal.ChangePass(model,e.md5(NPass)); string sender = dal.GetAccountEmail(model); SendMail(sender,"Your new password" ,NPass); }
public ActionResult RecoverPass(LayoutTest.Models.Account model) { SendKey(model); return View(model); }
public App() { InitializeComponent(); MainPage = new LayoutTest(); }