Ejemplo n.º 1
0
        /*
         * public ActionResult Index()
         * {
         *  return View();
         * }
         *
         * [Authorize]
         * public ActionResult About()
         * {
         *  ViewBag.Message = CurrentUserID;
         *
         *  return View();
         * }
         *
         * public ActionResult Contact()
         * {
         *  string nm = "";
         *  ViewBag.Message = "Your contact page.";
         *  using (FRShoppingEntities frenty = new FRShoppingEntities())
         *  {
         *      nm = frenty.AspNetUsers.FirstOrDefault(e => e.Id == "9e1ff96e-09f5-4ed1-a776-501833f05ff6").UserName;
         *
         *  }
         *  ViewBag.Message = nm;
         *  return View();
         * }
         * public ActionResult Chat()
         * {
         *  return View();
         * }
         * [HttpPost]
         * public ActionResult ProcessChat()
         * {
         *  return Json(new
         *  {
         *      test1 = "test1",
         *      test2 = "test2"
         *  });
         * }
         * public ActionResult HotelType()
         * {
         *  return PartialView();
         * }
         */

        public ActionResult ChatHelp(string chatUsername, string chatEmail, string chatQuestion)
        {
            ViewBag.chatname     = chatUsername;
            ViewBag.chatemail    = chatEmail;
            ViewBag.chatquestion = chatQuestion;
            ViewBag.chatadmin    = CryptionClass.Encrypt("*****@*****.**");

            return(PartialView());
        }
Ejemplo n.º 2
0
        public static string DecryptPassword(string encryptPsw)
        {
            string result = string.Empty;

            try
            {
                if ((string.IsNullOrEmpty(encryptPsw) == false))
                {
                    result = CryptionClass.Decrypt(encryptPsw);
                }
            }
            catch
            {
                result = string.Empty;
            }
            return(result);
        }
Ejemplo n.º 3
0
 public void Send(string name, string message)
 {
     // Call the addNewMessageToPage method to update clients.
     Clients.User(CryptionClass.Decrypt(name)).addNewMessageToPage(name, message);
 }
Ejemplo n.º 4
0
        public async Task <ActionResult> Register(string returnUrl, RegisterViewModel model, bool captchaValid, string mobile, string captchaErrorMessage, ShoppingCart cart)
        {
            ViewBag.bagitems = GetCartItems(cart);
            if (ModelState.IsValid)
            {
                if (!captchaValid)
                {
                    ModelState.AddModelError("recaptcha", captchaErrorMessage);
                    ViewBag.ReturnUrl = returnUrl;
                    return(View(model));
                }
                var user = new ApplicationUser {
                    UserName = model.Email, Email = model.Email, AddedDate = DateTime.Now, UpdatedDate = DateTime.Now, Active = true
                };
                var result = await UserManager.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    // await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
                    var code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);

                    var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                    try
                    {
                        Address ar = AddressRepository.AddAddress(0, model.AddressLine, "", model.City, model.State, model.ZipCode,
                                                                  "", DateTime.Now, model.Email, DateTime.Now, model.Email, true);
                        ContactInfo ci = ContactInfoRepository.AddContactInfo(0, model.Phone, "", model.Email, DateTime.Now, model.Email, DateTime.Now, model.Email, true);
                        UserDetail  ud = UserDetailRepository.InsertUserDetail(0, user.Id, model.FirstName, model.LastName, ar.AddressId,
                                                                               ci.ContactInfoId, DateTime.Now, model.Email, DateTime.Now, model.Email, true, CryptionClass.Encrypt(model.Password));
                        EmailManager  em = new EmailManager();
                        EmailContents ec = new EmailContents();
                        ec.FromEmailAddress = Globals.Settings.ContactForm.MailFrom;
                        ec.FromName         = "FoodReady.Net";
                        ec.Subject          = "confirm your email address for your foodready.net account";
                        ec.To   = model.Email;
                        ec.Body = "Please confirm your account by clicking this link: <a href=\"" + callbackUrl + "\">link</a>";
                        em.Send(ec);
                    }
                    catch (Exception e)
                    {
                        ModelState.AddModelError("", "Something failed: " + e.Message);
                        return(View(model));
                    }

                    //await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking this link: <a href=\"" + callbackUrl + "\">link</a>");
                    ViewBag.Link = callbackUrl;
                    return(View("DisplayEmail"));
                }
                AddErrors(result);
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Ejemplo n.º 5
0
 public ActionResult Chat()
 {
     ViewBag.username = CryptionClass.Encrypt("*****@*****.**");
     return(View());
 }
Ejemplo n.º 6
0
 public ActionResult EditProfile(MyDetailModel model)
 {
     ViewBag.ok = "no";
     if (ModelState.IsValid)
     {
         try
         {
             UserDetail ud = UserDetailRepository.GetUserDetailById(model.UserDetailID);
             if (ud != null)
             {
                 Address ar = AddressRepository.AddAddress(ud.AddressId, model.AddressLine, "", model.City, model.State, model.ZipCode,
                                                           model.CrossStreet, ud.Address.AddedDate, ud.Address.AddedBy, DateTime.Now, UserName, true);
                 ContactInfo ci = ContactInfoRepository.AddContactInfo(ud.ContactInfoId, model.Phone, "", model.Email, ud.ContactInfo.AddedDate, ud.ContactInfo.AddedBy, DateTime.Now, UserName, true);
                 ud = UserDetailRepository.InsertUserDetail(ud.UserDetailId, ud.UserId, model.FirstName, model.LastName, ud.AddressId,
                                                            ud.ContactInfoId, ud.AddedDate, ud.AddedBy, DateTime.Now, UserName, true, CryptionClass.Encrypt("no password"));
                 ViewBag.ok = "yes";
                 return(PartialView(model));
             }
         }
         catch
         {
             ViewBag.ok = "no";
         }
     }
     return(PartialView(model));
 }
Ejemplo n.º 7
0
 public ActionResult AddMyDetail(MyDetailModel model)
 {
     ViewBag.ok = "no";
     if (ModelState.IsValid)
     {
         try
         {
             Address ar = AddressRepository.AddAddress(0, model.AddressLine, "", model.City, model.State, model.ZipCode,
                                                       model.CrossStreet, DateTime.Now, UserName, DateTime.Now, UserName, true);
             ContactInfo ci = ContactInfoRepository.AddContactInfo(0, model.Phone, "", model.Email, DateTime.Now, UserName, DateTime.Now, UserName, true);
             UserDetail  ud = UserDetailRepository.InsertUserDetail(0, model.UserID, model.FirstName, model.LastName, ar.AddressId,
                                                                    ci.ContactInfoId, DateTime.Now, UserName, DateTime.Now, UserName, true, CryptionClass.Encrypt("no password"));
             ViewBag.ok = "yes";
             return(PartialView(model));
         }
         catch
         {
             ViewBag.ok = "no";
         }
     }
     return(PartialView(model));
 }