Exemplo n.º 1
0
        public ActionResult Admin_setting(FormCollection set)
        {
            int   id = Convert.ToInt32(Session["Adminid"]);
            admin u  = db.admins.Find(id);

            if (u != null)
            {
                string oldpswd = set["oldpassword"].ToString();
                string newpswd = set["newpassword"].ToString();
                if (oldpswd == u.PASSWORD)
                {
                    u.PASSWORD        = newpswd;
                    db.Entry(u).State = EntityState.Modified;
                    db.SaveChanges();
                    ViewBag.message = "Password Successfully changed..!";
                    return(View());
                }
                else
                {
                    ViewBag.message = "Enter correct Old password..!";
                    return(View());
                }
            }

            RedirectToAction("SignIn", "user");
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult confirmLawyer(string Verfy_code)
        {
            lawyer lwr = db.lawyers.Where(lr => lr.VERIFY_CODE == Verfy_code).FirstOrDefault();

            lwr.IS_ACTIVE       = true;
            db.Entry(lwr).State = EntityState.Modified;
            db.SaveChanges();
            return(View(lwr));
        }
Exemplo n.º 3
0
 public ActionResult Edit(lawyer lwr)
 {
     if (ModelState.IsValid)
     {
         db.Entry(lwr).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(lwr));
 }
        public ActionResult Edit(citation citation)
        {
            if (!Check_Session())
            {
                return(RedirectToAction("SignIn", "user"));
            }

            if (ModelState.IsValid)
            {
                db.Entry(citation).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            genericsController gn = new genericsController();

            ViewBag.crime_list = new SelectList(gn.Get_Crime_List(), "Text", "Value");
            return(View(citation));
        }