示例#1
0
        //
        // GET: /Cms/Oddments/Create

        public ActionResult Create()
        {
            var model = new Oddments();
            this.RenderMyViewData(model);
            var ProjectBasedataIDList = this.ProjectService.GetProjectBasedataList(new ProjectRequest());
            this.ViewBag.ProjectBasedataID = new SelectList(ProjectBasedataIDList, "ID", "PName");
            return View("Edit", model);
        }
示例#2
0
        public ActionResult Create(FormCollection collection)
        {
            var model = new Oddments();
            this.TryUpdateModel<Oddments>(model);
            model.ChangTime = model.CreateTime.ToCnDataString();
            this.ProjectService.SaveOddments(model);

            return this.RefreshParent();
        }
示例#3
0
        //
        // GET: /Cms/Oddments/

        public ActionResult Index(OddmentsRequest requset)
        {
            var model = new Oddments();
            this.RenderMyViewData(model);
            var ProjectBasedataIDList = this.ProjectService.GetProjectBasedataList(new ProjectRequest());
            this.ViewBag.ProjectBasedataID = new SelectList(ProjectBasedataIDList, "ID", "PName");
            var result = this.ProjectService.GetOddmentsList(requset);
            return View(result);
        }
示例#4
0
        //
        // GET: /Cms/Oddments/Create

        public ActionResult Create()
        {
            var model = new Oddments() { };
            return View("Edit", model);
        }
示例#5
0
 public void SaveOddments(Oddments oddments)
 {
     using (var dbContext = new ProjectDbContext())
     {
         if (oddments.ID > 0)
         {
             dbContext.Update<Oddments>(oddments);
         }
         else
         {
             dbContext.Insert<Oddments>(oddments);
         }
     }
 }
示例#6
0
 private void RenderMyViewData(Oddments model)
 {
     ViewData.Add("OType", new SelectList(EnumHelper.GetItemValueList<EnumOType>(), "Key", "Value", model.OType));
 }