示例#1
0
        public ActionResult Delete(string id)
        {
            COALevel coaLevelToDelete = context.Find(id);

            if (coaLevelToDelete == null)
            {
                return(HttpNotFound());
            }
            else
            {
                return(View(coaLevelToDelete));
            }
        }
示例#2
0
        public ActionResult Edit(string id)
        {
            COALevel coaLevel = context.Find(id);

            if (coaLevel == null)
            {
                return(HttpNotFound());
            }
            else
            {
                return(View(coaLevel));
            }
        }
示例#3
0
        public ActionResult Create(COALevel coaLevel)
        {
            if (!ModelState.IsValid)
            {
                return(View(coaLevel));
            }
            else
            {
                context.Insert(coaLevel);
                context.Commit();

                return(RedirectToAction("Index"));
            }
        }
示例#4
0
        public ActionResult Edit(COALevel coaLevel, string id)
        {
            COALevel coaLevelToEdit = context.Find(id);

            if (coaLevelToEdit == null)
            {
                return(HttpNotFound());
            }
            else
            {
                if (!ModelState.IsValid)
                {
                    return(View(coaLevel));
                }

                coaLevelToEdit.Level = coaLevel.Level;

                context.Commit();

                return(RedirectToAction("Index"));
            }
        }
        public ActionResult Edit(COALevel coaAttachment, string id)
        {
            COAReportType coaReportToEdit = context.Find(id);

            if (coaReportToEdit == null)
            {
                return(HttpNotFound());
            }
            else
            {
                if (!ModelState.IsValid)
                {
                    return(View(coaReportToEdit));
                }

                coaReportToEdit.ReportType = coaReportToEdit.ReportType;

                context.Commit();

                return(RedirectToAction("Index"));
            }
        }
示例#6
0
        public ActionResult Create()
        {
            COALevel coaLevel = new COALevel();

            return(View(coaLevel));
        }