Inheritance: ModelBusinessBase
示例#1
0
        public ActionResult Create(int projectId)
        {
            var model = new StatusFormModel();
            var status = StatusRepository.StatusNew();

            status.ProjectId = projectId;

            model.Title = "Status Create";
            model.Status = status;

            return this.View(model);
        }
示例#2
0
        public ActionResult Create(int projectId, FormCollection collection)
        {
            var model = new StatusFormModel();
            var status = StatusRepository.StatusNew();

            this.Map(collection, status);

            status.ProjectId = projectId;

            status = StatusRepository.StatusSave(status);

            if (status.IsValid)
            {
                return this.RedirectToAction("Details", "Project", new { id = status.ProjectId });
            }

            model.Title = "Status Create";
            model.Status = status;

            ModelHelper.MapBrokenRules(this.ModelState, status);

            return this.View(model);
        }
示例#3
0
        public ActionResult Edit(int id)
        {
            var model = new StatusFormModel();
            var status = StatusRepository.StatusFetch(id);

            model.Title = "Status Edit";
            model.Status = status;

            return this.View(model);
        }