Esempio n. 1
0
        public ActionResult Create([Bind(Include = "DepartmentId,DepartmentName,TenantId,AccountID,DateCreated,DateUpdated,CreatedBy,UpdatedBy,IsDeleted")] TenantDepartments tenantDepartments)
        {
            if (ModelState.IsValid)
            {
                _LookupService.SaveTenantDepartment(tenantDepartments.DepartmentName, tenantDepartments.AccountID, CurrentUserId, CurrentTenantId);

                return(RedirectToAction("Index"));
            }

            var accounts = AccountServices.GetAllValidAccounts(CurrentTenantId).Select(acnts => new
            {
                acnts.AccountID,
                acnts.AccountNameCode
            }).ToList();

            ViewBag.AccountIDs = new SelectList(accounts, "AccountID", "AccountNameCode");
            return(View(tenantDepartments));
        }