Example #1
0
 public ActionResult Login(Login l, string ReturnUrl = "")
 {
     if (ModelState.IsValid)
     {
         string encryptpass = FormsAuthentication.HashPasswordForStoringInConfigFile(l.Password, "SHA1");
         using (BankAccountDb b = new BankAccountDb())
         {
             var u = b.Generaltable.Where(a => a.Username.Equals(l.Username) && a.password.Equals(encryptpass)).FirstOrDefault();
             if (u != null)
             {
                 FormsAuthentication.SetAuthCookie(u.Username, false);
                 if (Url.IsLocalUrl(ReturnUrl))
                 {
                     return(Redirect(ReturnUrl));
                 }
                 else
                 {
                     return(RedirectToAction("MyProfile", "Home"));
                 }
             }
         }
     }
     ViewBag.forpas = "******";
     return(View());
 }
Example #2
0
        public ActionResult Statement(string fromd, string tod, int?page)
        {
            BankAccountDb bae = new BankAccountDb();
            DateTime      f   = Convert.ToDateTime(fromd, System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat);
            DateTime      t   = Convert.ToDateTime(tod, System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat);

            ViewBag.fd = fromd; ViewBag.td = tod;
            var ss = bae.transdetails.Where(a => a.Username.Equals(User.Identity.Name) &&
                                            (a.Datetimes >= f && a.Datetimes <= t)).ToList().ToPagedList(page ?? 1, 5);

            if (ss.Count == 0 && fromd != null)
            {
                ViewBag.er = "No Transaction Occured";
                if (f > t)
                {
                    ViewBag.dat = "Choose correct Date";
                }
            }
            return(View(ss));
        }
Example #3
0
 public BankClass(BankAccountDb _db)
 {
     this.db = _db;
 }