public async Task <IActionResult> Edit(int id, [Bind("UtilityId,Property,Value,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] UtilityDetail utilityDetail)
        {
            if (id != utilityDetail.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(utilityDetail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UtilityDetailExists(utilityDetail.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UtilityId"] = new SelectList(_context.Utilities, "Id", "MainName", utilityDetail.UtilityId);
            return(View(_mapper.Map <UtilityDetailViewModel>(utilityDetail)));
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Name,ProvinceId,Code,Id")] City city)
        {
            if (id != city.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(city);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CityExists(city.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProvinceId"] = new SelectList(_context.Set <Province>(), "Id", "Name", city.ProvinceId);
            return(View(_mapper.Map <CityViewModel>(city)));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Name,LatinName,LegalName,StartDate,EndDate,NetworkInfoId,PhotoId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Company company)
        {
            if (id != company.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(company);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CompanyExists(company.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["NetworkInfoId"] = new SelectList(_context.NetworkInfos, "Id", "HostName", company.NetworkInfoId);
            return(View(_mapper.Map <CompanyViewModel>(company)));
        }
Beispiel #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ParentId,Class,CurrencyId,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] PaymentGroup paymentGroup)
        {
            if (id != paymentGroup.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(paymentGroup);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaymentGroupExists(paymentGroup.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CurrencyId"] = new SelectList(_context.Currencies, "Id", "Id", paymentGroup.CurrencyId);
            ViewData["ParentId"]   = new SelectList(_context.PersonGroups, "Id", "Id", paymentGroup.ParentId);
            return(View(_mapper.Map <PaymentGroupViewModel>(paymentGroup)));
        }
Beispiel #5
0
        public async Task <IActionResult> Edit(int id, [Bind("Type,BarcodeStuff,StuffId,IsDefault,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Barcode barcode)
        {
            if (id != barcode.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(barcode);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BarcodeExists(barcode.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StuffId"] = new SelectList(_context.Stuffs, "Id", "Name", barcode.StuffId);
            return(View(_mapper.Map <BarcodeViewModel>(barcode)));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PaymentGroupId,DrawerId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] DrawerPayment drawerPayment)
        {
            if (id != drawerPayment.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(drawerPayment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DrawerPaymentExists(drawerPayment.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DrawerId"]       = new SelectList(_context.Drawers, "Id", "Name", drawerPayment.DrawerId);
            ViewData["PaymentGroupId"] = new SelectList(_context.PaymentGroups, "Id", "Class", drawerPayment.PaymentGroupId);
            return(View(_mapper.Map <DrawerPaymentViewModel>(drawerPayment)));
        }
Beispiel #7
0
        public async Task <IActionResult> Edit(int id, [Bind("BaseInfoGroupId,Name,LatinName,Value,Id")] BaseInfo baseInfo)
        {
            if (id != baseInfo.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(baseInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BaseInfoExists(baseInfo.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BaseInfoGroupId"] = new SelectList(_context.BaseInfoGroups, "Id", "Id", baseInfo.BaseInfoGroupId);
            return(View(_mapper.Map <BaseInfoViewModel>(baseInfo)));
        }
Beispiel #8
0
        public async Task <IActionResult> Edit(int id, [Bind("PersonGroupId,FirstName,LastName,BirthDate,Gender,PhotoId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Person person)
        {
            if (id != person.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(person);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonExists(person.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PersonGroupId"] = new SelectList(_context.PersonGroups, "Id", "LatinName", person.PersonGroupId);
            return(View(_mapper.Map <PersonViewModel>(person)));
        }
Beispiel #9
0
        public async Task <IActionResult> Edit(int id, [Bind("ManualCode,Name,LatinName,ShortName,StuffGroupId,StuffUnitId,WebUrl,BrandId,BarcodeId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Stuff stuff)
        {
            if (id != stuff.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stuff);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StuffExists(stuff.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrandId"]      = new SelectList(_context.Brands, "Id", "Name", stuff.BrandId);
            ViewData["StuffGroupId"] = new SelectList(_context.StuffGroups, "Id", "GroupName", stuff.StuffGroupId);
            ViewData["StuffUnitId"]  = new SelectList(_context.Set <StuffUnit>(), "Id", "Name", stuff.StuffUnitId);
            return(View(_mapper.Map <StuffViewModel>(stuff)));
        }
Beispiel #10
0
        public async Task <IActionResult> Edit(int id, [Bind("CityId,BranchId,StuffId,Price,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] PriceTag priceTag)
        {
            if (id != priceTag.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(priceTag);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PriceTagExists(priceTag.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BranchId"] = new SelectList(_context.Branches, "Id", "Name", priceTag.BranchId);
            ViewData["CityId"]   = new SelectList(_context.Cities, "Id", "Name", priceTag.CityId);
            ViewData["StuffId"]  = new SelectList(_context.Stuffs, "Id", "Name", priceTag.StuffId);
            return(View(_mapper.Map <PriceTagViewModel>(priceTag)));
        }
        public async Task <IActionResult> Edit(int id, [Bind("CashDeskId,UtilityId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] CashDeskUtility cashDeskUtility)
        {
            if (id != cashDeskUtility.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cashDeskUtility);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CashDeskUtilityExists(cashDeskUtility.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CashDeskId"] = new SelectList(_context.CashDesks, "Id", "Name", cashDeskUtility.CashDeskId);
            ViewData["UtilityId"]  = new SelectList(_context.Utilities, "Id", "MainName", cashDeskUtility.UtilityId);
            return(View(_mapper.Map <CashDeskUtilityViewModel>(cashDeskUtility)));
        }
        public async Task <IActionResult> Edit(int id, [Bind("BaseInfoGroupName,BaseInfoGroupText,Id")] BaseInfoGroup baseInfoGroup)
        {
            if (id != baseInfoGroup.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(baseInfoGroup);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BaseInfoGroupExists(baseInfoGroup.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(_mapper.Map <BaseInfoGroupViewModel>(baseInfoGroup)));
        }
        public async Task <IActionResult> Edit(int id, [Bind("StuffId,WarehouseId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] WarehouseStuff warehouseStuff)
        {
            if (id != warehouseStuff.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(warehouseStuff);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WarehouseStuffExists(warehouseStuff.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StuffId"]     = new SelectList(_context.Stuffs, "Id", "Name", warehouseStuff.StuffId);
            ViewData["WarehouseId"] = new SelectList(_context.Warehouses, "Id", "Name", warehouseStuff.WarehouseId);
            return(View(_mapper.Map <WarehouseStuffViewModel>(warehouseStuff)));
        }
Beispiel #14
0
        public async Task <IActionResult> Edit(int id, [Bind("Name,CountryId,Code,Id")] Province province)
        {
            if (id != province.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(province);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProvinceExists(province.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "Id", province.CountryId);
            return(View(_mapper.Map <ProvinceViewModel>(province)));
        }
Beispiel #15
0
        public async Task <IActionResult> Edit(int id, [Bind("HoldingName,HoldingNameEn,HoldingLogo,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] Holding holding)
        {
            if (id != holding.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(holding);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HoldingExists(holding.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(_mapper.Map <ViewModel.HoldingViewModel>(holding)));
        }
Beispiel #16
0
        public async Task <IActionResult> Edit(int id, [Bind("ISO,Name,NiceName,ISO3,CountryCode,CallingCode,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] Country country)
        {
            if (id != country.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(country);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CountryExists(country.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(_mapper.Map(country, new CountryViewModel())));
        }
        public async Task <IActionResult> Edit(int id, [Bind("StuffId,SupplierId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] StuffSupplier stuffSupplier)
        {
            if (id != stuffSupplier.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stuffSupplier);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StuffSupplierExists(stuffSupplier.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StuffId"]    = new SelectList(_context.Stuffs, "Id", "Name", stuffSupplier.StuffId);
            ViewData["SupplierId"] = new SelectList(_context.Suppliers, "Id", "Name", stuffSupplier.SupplierId);
            return(View(_mapper.Map <StuffSupplierViewModel>(stuffSupplier)));
        }
Beispiel #18
0
        public async Task <IActionResult> Edit(int id, [Bind("UserGroupId,RoleGroupId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] UserGroupRole userGroupRole)
        {
            if (id != userGroupRole.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(userGroupRole);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserGroupRoleExists(userGroupRole.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RoleGroupId"] = new SelectList(_context.RoleGroups, "Id", "Name", userGroupRole.RoleGroupId);
            ViewData["UserGroupId"] = new SelectList(_context.UserGroups, "Id", "Name", userGroupRole.UserGroupId);
            return(View(_mapper.Map <UserGroupRoleViewModel>(userGroupRole)));
        }
Beispiel #19
0
        public async Task <IActionResult> Edit(int id, [Bind("OwnerUserId,Name,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] Drawer drawer)
        {
            if (id != drawer.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(drawer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DrawerExists(drawer.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OwnerUserId"] = new SelectList(_context.Users, "Id", "UserName", drawer.OwnerUserId);
            return(View(_mapper.Map <DrawerViewModel>(drawer)));
        }
Beispiel #20
0
        public async Task <IActionResult> Edit(int id, [Bind("PermissionParentId,Title,Text,Key,URL,Priority,SateIsPage,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] Permission permission)
        {
            if (id != permission.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(permission);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PermissionExists(permission.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PermissionParentId"] = new SelectList(_context.Permissions, "Id", "Id", permission.PermissionParentId);
            return(View(_mapper.Map <PermissionViewModel>(permission)));
        }
Beispiel #21
0
        public async Task <IActionResult> Edit(int id, [Bind("ManualCode,GroupName,Photo,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] StuffGroup stuffGroup)
        {
            if (id != stuffGroup.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stuffGroup);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StuffGroupExists(stuffGroup.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(_mapper.Map <StuffGroupViewModel>(stuffGroup)));
        }
Beispiel #22
0
        public async Task <IActionResult> Edit(int id, [Bind("CurrencyName,Symbol,DecimalCount,CountryId,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] Currency currency)
        {
            if (id != currency.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(currency);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CurrencyExists(currency.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "Name", currency.CountryId);
            return(View(_mapper.Map <CurrencyViewModel>(currency)));
        }
Beispiel #23
0
        public async Task <IActionResult> Edit(int id, [Bind("LogTypeName,LogTypeEnName,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] LogType logType)
        {
            if (id != logType.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(logType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LogTypeExists(logType.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(_mapper.Map <LogTypeViewModel>(logType)));
        }
Beispiel #24
0
        public async Task <IActionResult> Edit(int id, [Bind("Name,BaseInfoActionCode,ManualCode,MeasureId,IsDefault,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Warehouse warehouse)
        {
            if (id != warehouse.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(warehouse);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WarehouseExists(warehouse.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MeasureId"] = new SelectList(_context.Measures, "Id", "Id", warehouse.MeasureId);
            return(View(_mapper.Map <WarehouseViewModel>(warehouse)));
        }
Beispiel #25
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,AppMenuId,MenuName,MenuClass,MenuUrl,Priority")] ManagementAppMenu managementAppMenu)
        {
            if (id != managementAppMenu.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(managementAppMenu);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ManagementAppMenuExists(managementAppMenu.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AppMenuId"] = new SelectList(_context.ManagementAppMenus, "Id", "MenuClass", managementAppMenu.AppMenuId);
            return(View(_mapper.Map <ManagementAppMenuViewModel>(managementAppMenu)));
        }
Beispiel #26
0
        public async Task <IActionResult> Edit(int id, [Bind("Ip,Port,Mac,HostName,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] NetworkInfo networkInfo)
        {
            if (id != networkInfo.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(networkInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!NetworkInfoExists(networkInfo.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(_mapper.Map <NetworkInfoViewModel>(networkInfo)));
        }
Beispiel #27
0
        public async Task <IActionResult> Edit(int id, [Bind("Name,BaseInfoTargetId,MainName,NetworkInfoId,Manufacturer,Model,BaseInfoColorId,BaseInfoNatureId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] ApplicationCore.Entities.Share.Utility utility)
        {
            if (id != utility.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(utility);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UtilityExists(utility.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["NetworkInfoId"] = new SelectList(_context.NetworkInfos, "Id", "HostName", utility.NetworkInfoId);
            return(View(_mapper.Map <UtilityViewModel>(utility)));
        }
Beispiel #28
0
        public async Task <IActionResult> Edit(int id, [Bind("UserGroupId,UserName,Password,EmailConfirmed,TwoFactorEnabled,AccessFailedCount,PhoneNumberCount,SecurityStamp,ConcurrencyStamp,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] User user)
        {
            if (id != user.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserGroupId"] = new SelectList(_context.UserGroups, "Id", "Name", user.UserGroupId);
            return(View(_mapper.Map <UserViewModel>(user)));
        }
Beispiel #29
0
        public async Task <IActionResult> Edit(int id, [Bind("Name,MeasureId,NetworkInfoId,StartDate,EndDate,CommercialCode,RegisterCode,CompanyId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Branch branch)
        {
            if (id != branch.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(branch);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BranchExists(branch.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompanyId"]     = new SelectList(_context.Companies, "Id", "Name", branch.CompanyId);
            ViewData["MeasureId"]     = new SelectList(_context.Measures, "Id", "Id", branch.MeasureId);
            ViewData["NetworkInfoId"] = new SelectList(_context.NetworkInfos, "Id", "HostName", branch.NetworkInfoId);
            return(View(_mapper.Map <BranchViewModel>(branch)));
        }
        public async Task <IActionResult> Edit(int id, [Bind("RoleId,PermissionId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] RolePermission rolePermission)
        {
            if (id != rolePermission.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rolePermission);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RolePermissionExists(rolePermission.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PermissionId"] = new SelectList(_context.Permissions, "Id", "Title", rolePermission.PermissionId);
            ViewData["RoleId"]       = new SelectList(_context.Roles, "Id", "ConcurrencyStamp", rolePermission.RoleId);
            return(View(_mapper.Map <RolePermissionViewModel>(rolePermission)));
        }