コード例 #1
0
        public ActionResult GetCompanies()
        {
            var company      = _company.GetCompanies();
            var companyModel = company.Select(x => new companyViewModel
            {
                Id          = x.Id,
                Code        = x.Code,
                Name        = x.Name,
                Address     = x.Address,
                Phone       = x.Phone,
                Email       = x.Email,
                IsDelete    = x.IsDelete,
                CreatedBy   = x.CreatedBy,
                CreatedDate = x.CreatedDate,
                UpdatedBy   = x.UpdatedBy,
                UpdatedDate = x.UpdatedDate
            }).ToList();
            var companies = new companyIndex
            {
                CompanyModel = companyModel
            };

            return(View(companies));
        }
コード例 #2
0
 public ActionResult Create()
 {
     ViewBag.CompanyList = new SelectList(_company.GetCompanies(), "Id", "Name");
     return(PartialView());
 }