Esempio n. 1
0
        public ActionResult EditExpCode(ExpertCode expert)
        {
            if (db.ExpertCodes.Any(x => x.Code == expert.Code))
            {
                ViewBag.same = "این شماره تکراری است.";
                return(View(expert));
            }

            db.Entry(expert).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("ExpertCode"));
        }
Esempio n. 2
0
        public ActionResult CreateExpCode(ExpertCode expert)
        {
            if (db.ExpertCodes.Any(x => x.Code == expert.Code))
            {
                ViewBag.same = "این شماره تکراری است.";
                return(View(expert));
            }

            db.ExpertCodes.Add(expert);
            db.SaveChanges();
            return(RedirectToAction("ExpertCode"));
        }