Esempio n. 1
0
 public ActionResult Create(FormCollection collection)
 {
     var model = new Accountant();
     this.TryUpdateModel<Accountant>(model);
     this.ProjectService.SaveAccountant(model);
     return this.RefreshParent();
 }
Esempio n. 2
0
        //
        // GET: /Cms/Article/Create
        //[HttpPost]
        //public ActionResult Search(FormCollection collection)
        //{
        //    string ClassName = collection["ClassName"];
        //    string code = collection["Code"];
        //    this.ViewData["Code"] = code;
        //    this.ViewData["ClassName"] = ClassName;
        //    var result = this.BasisDataService.GetClassificationList(new ClassificationRequest() { Name = ClassName, Code = code });
        //    return View(result);
        //}
        public ActionResult Create()
        {
            //var classList = this.BasisDataService.GetClassificationList(new ClassificationRequest() { Name = "wenju" });

            //this.ViewBag.ChannelId = new SelectList(classList, "ID", "Name");

            var model = new Accountant();
            return View("Edit", model);
        }
Esempio n. 3
0
        public void SaveAccountant(Accountant account)
        {
            using (var dbContext = new ProjectDbContext())
            {

                if (account.ID > 0)
                {

                    dbContext.Update<Accountant>(account);
                }
                else
                {
                    dbContext.Insert<Accountant>(account);
                }
            }
        }