コード例 #1
0
        // Default action result for forms.
        private ActionResult Form(string id = null)
        {
            var model = string.IsNullOrEmpty(id)
        ? new TenantViewModel()
        : _repo.ProjectToList <TenantViewModel>(id).Single();

            return(FormActionResult(model, id));
        }
コード例 #2
0
        // Default action result for forms.
        private ActionResult Form(string id = null)
        {
            var model = string.IsNullOrEmpty(id)
        ? new UserViewModel()
            {
                ExternalTenant = new Framework.SelectList()
            }
        : _repo.ProjectToList <UserViewModel>(id).Single();

            if (model != null)
            {
                model.ExternalTenant = _tenantRepo.ProjectToList <TenantViewModel>().ToSelectList(t => t.TenantCode, t => t.TenantName, model.ExternalTenant.SelectedValue, "");
            }
            return(FormActionResult(model, id));
        }