public ActionResult ForgotPassword(User s)
        {
            var u = db.Users.Where(x => x.EMail == s.EMail).FirstOrDefault();
            if (u == null)
            {
                ViewBag.Message = "Such user cannot be found.";
                return View();
            }
            else
            {
                if (ModelState.IsValid)
                {
                    PassReset p = new PassReset();
                    p.AutID = Guid.NewGuid().ToString();
                    p.isAvaliable = true;
                    p.EMail = u.EMail;
                    p.UserID = u.UserID;
                    db.PassResets.Add(p);
                    db.SaveChanges();

                    GMailer.GmailUsername = "******";
                    GMailer.GmailPassword = "******";

                    GMailer mailer = new GMailer();
                    mailer.ToEmail = u.EMail;
                    mailer.Subject = "Password Reset";
                    mailer.Body = "A request to reset your password has been sent. <br> Please enter the code below to Change Password page to Change your Password. <br> <a href='localhost.com/Account/ChangePassword'>verify</a> Authentication Code :" + p.AutID;
                    mailer.IsHtml = true;
                    mailer.Send();
                    ViewBag.Message = "A confirmation mail has been sent to you.";
                    // return RedirectToAction("Index", "Home");
                }
            }
            return View();
        }
        public ActionResult GenerateReport(Report r, String selectedID)
        {
            if (ModelState.IsValid)
            {
                r.SendDate = DateTime.Now;

                var id = int.Parse(Session["UserID"].ToString());
                User first = db.Users.Where(x => x.UserID == id).FirstOrDefault();
                Staff f = db.Staffs.Where(x => x.EMail == first.EMail).FirstOrDefault();

                r.SenderID = first.UserID;
                r.ReceiverID = Convert.ToInt32(selectedID);

                db.Reports.Add(r);
                db.SaveChanges();

                User u = db.Users.Where(x => x.UserID == r.ReceiverID).FirstOrDefault();

                GMailer.GmailUsername = "******";
                GMailer.GmailPassword = "******";

                GMailer mailer = new GMailer();
                mailer.ToEmail = u.EMail;
                mailer.Subject = r.Subject;
                mailer.Body = r.Body;
                mailer.IsHtml = true;
                mailer.Send();
                TempData["Success"] = "Your report has been sent.";
                return RedirectToAction("Index", "Staff");

            }
            return View();
        }