Esempio n. 1
0
        public ActionResult AddPlanItem(Guid projectID, string name, string detail, int category)
        {
            var pic = new PlanItemCreate(projectID);

            pic.Name     = name;
            pic.Detail   = detail;
            pic.Category = category;
            return(RedirectToAction("Create", "PlanItem", new { model = pic }));
        }
Esempio n. 2
0
        public ActionResult Create(PlanItemCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = CreateService();

            if (service.CreatePlanItem(model))
            {
                TempData["SaveResult"] = "Your PlanItem was created.";
                return(RedirectToAction("Details", "Project", new { id = model.ProjectID }));
            }

            return(View(model));
        }
Esempio n. 3
0
        public bool CreatePlanItem(PlanItemCreate model)
        {
            PlanItem entity = new PlanItem
            {
                PlanItemID     = Guid.NewGuid(),
                Name           = model.Name,
                Details        = model.Detail,
                ProjectID      = model.ProjectID,
                Category       = model.Category,
                CreatorID      = _userId,
                LastModifiedBy = _userId,
                CreatedUTC     = DateTimeOffset.Now,
                ModifiedUTC    = null
            };

            UpdateProjectModifiedDate(model.ProjectID);
            Context.PlanItems.Add(entity);
            return(Context.TrySave());
        }
Esempio n. 4
0
        public ActionResult Create(Guid projectID, bool b)
        {
            var model = new PlanItemCreate(projectID);

            return(View(model));
        }