public ActionResult Create(FormCollection collection)
 {
     var model = new Payables();
     this.TryUpdateModel<Payables>(model);
     this.ProjectService.SavePayables(model);
     return this.RefreshParent();
 }
        //
        // 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 Payables();
            return View("Edit", model);
        }
Beispiel #3
0
        public void SavePayables(Payables pay)
        {
            using (var dbContext = new ProjectDbContext())
            {

                if (pay.ID > 0)
                {

                    dbContext.Update<Payables>(pay);
                }
                else
                {
                    dbContext.Insert<Payables>(pay);
                }
            }
        }