示例#1
0
        public ActionResult Edit(Cause Cause)
        {

            Cause dbCause = new Cause
            {

            };
            if (Cause.CauseID != Guid.Empty) dbCause = reposetory.GetCauseItem(Cause.CauseID);
            if (dbCause == null) return HttpNotFound();

            if (ModelState.IsValid)
            {
                dbCause.Name = Cause.Name;
                dbCause.Description = Cause.Description;

                dbCause.Trim();

                if (reposetory.Save(dbCause))
                {
                    Cause.CauseID = dbCause.CauseID;
                    ViewBag.FormSucces = true;
                }
            }

            return View(Cause);
        }
示例#2
0
        public ActionResult Edit(Guid? Id)
        {
            Cause Cause = new Cause
            {

            };
            if (Id != null) Cause = reposetory.GetCauseItem((Guid)Id);
            if (Cause == null) return HttpNotFound();

            return View(Cause);
        }