public ActionResult Register(RegisterModel data) { TempData["TelNo"] = data.TelNo; TempData["TelCode"] = data.TelCode; TempData["yzCode"] = data.yzCode; if (Session["ValidateCode"] == null || data.yzCode == null || data.yzCode.ToUpper() != Session["ValidateCode"].ToString()) { TempData["msg"] = "验证码不正确"; TempData["yzCode"] = ""; return(RedirectToAction("Register", "Home")); } var sjcode = Codedal.First(x => x.ToNumber == data.TelNo && x.Status == CodeRecordStatus.NotUse && x.Type == CodeRecordType.Register_TelNo); //if (sjcode == null || sjcode.Code != data.TelCode) { // TempData["msg"] = "手机验证码不正确"; // TempData["TelCode"] =""; // return RedirectToAction("Register", "Home"); //} var model = dal.Register(data.TelNo, data.Pwd, data.ExtenderKey); if (model == null) { TempData["msg"] = dal.ErrorStr; return(RedirectToAction("Register", "Home")); } sjcode.Status = CodeRecordStatus.Used; Codedal.Update(sjcode, sjcode.Id); string[,] fvalue = new string[1, 2]; fvalue[0, 0] = "UserId"; fvalue[0, 1] = DESC.Encrypt(model.Id.ToString()); bool result = Cookie.Create("Gd_User", fvalue, 0); return(RedirectToAction("Index", "Home")); }
public ActionResult LoginVal(LoginValModel data) { if (Session["ValidateCode"] == null || data.yzCode == null || data.yzCode.ToUpper() != Session["ValidateCode"].ToString()) { TempData["msg"] = "验证码不正确"; return(RedirectToAction("Login", "Home")); } var logindata = dal.LoginVal(data.UserName, data.Pwd); if (logindata == null) { TempData["msg"] = dal.ErrorStr; return(RedirectToAction("Login", "Home")); } string[,] fvalue = new string[1, 2]; fvalue[0, 0] = "UserId"; fvalue[0, 1] = DESC.Encrypt(logindata.Id.ToString()); bool result = Cookie.Create("Gd_User", fvalue, 0); if (!result) { TempData["msg"] = "Cookie禁用导致无法登录"; return(RedirectToAction("Login", "Home")); } if (Request.QueryString["ReturnUrl"] != null) { return(Redirect(Request.QueryString["ReturnUrl"].ToString())); } return(RedirectToAction("Index", "Home")); }
private void DesktopWindow_ContentRendered(object sender, EventArgs e) { // Set Floating Elements as windows foreach (var fElem in FloatingElements) { Window wnd = DESC.ConvertElementToWindow(fElem, desktopWindow); // TODO Convert Element to Window do in W32 impl floatingElemWindows.Add(wnd); wnd.Closing += Closing; wnd.Closed += Closed; wnd.Show(); } //DESC.InitWin32(desktopWindow); var wih = new WindowInteropHelper(desktopWindow); HwndSource source = HwndSource.FromHwnd(wih.Handle); #if DEBUG FloatingElements.Add(new Label() { Content = source.Handle.ToString(), Foreground = Brushes.Black, HorizontalAlignment = HorizontalAlignment.Right }); #endif w32Impl.HookDesktop(source); windowsSkinManager.StartEngine(source); }
public RACE() { NAME = new NAME(); FNAM = new FNAM(); DESC = new DESC(); RADT = new RADT(); NPCS = new List <NPCS>(); }
public PartialViewResult HomeHead() { B_UserBasicInfo data = null; if (Cookie.Check("Gd_User", "UserId") == true) { var userid = Guid.Parse(DESC.Decrypt(Cookie.Get("Gd_User", "UserId"))); data = dal.Find <Guid>(userid); } return(PartialView(data)); }
public override void Initialize() { selectIndex = 0; desc = (GameSection.GetEventData() as DESC); base.Initialize(); }