Exemplo n.º 1
0
        public ActionResult Edit(int id)
        {
            ViewBag.CompanyType = new SelectList(CompanyRepo.All().Select(p => new { CompanyType = p.客戶分類 }).Distinct(), "CompanyType", "CompanyType");
            var data = CompanyRepo.Find(id);

            if (data == null)
            {
                throw new InvalidOperationException("操作錯誤");
            }
            return(View(data));
        }
Exemplo n.º 2
0
 public ActionResult Create()
 {
     ViewBag.CompanyType = new SelectList(CompanyRepo.All().Select(p => new { CompanyType = p.客戶分類 }).Distinct(), "CompanyType", "CompanyType");
     return(View("Edit", CompanyRepo.Find(0)));
 }
Exemplo n.º 3
0
 // GET: /Company
 public ActionResult Index(QueryCompanyModel model)
 {
     ViewBag.CompanyType = new SelectList(CompanyRepo.All().Select(p => new { CompanyType = p.客戶分類 }).Distinct(), "CompanyType", "CompanyType", model.CompanyType);
     return(View(CompanyRepo.Query(model, 1)));
 }