public async Task <IActionResult> Create([Bind("Name,NormalizedName,ConcurrencyStamp,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] Role role) { if (ModelState.IsValid) { _context.Add(role); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(_mapper.Map <RoleViewModel>(role))); }
public async Task <IActionResult> Create([Bind("Ip,Port,Mac,HostName,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] NetworkInfo networkInfo) { if (ModelState.IsValid) { _context.Add(networkInfo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(_mapper.Map <NetworkInfoViewModel>(networkInfo))); }
public async Task <IActionResult> Create([Bind("ISO,Name,LatinName,ISO3,CountryCode")] Country country) { if (ModelState.IsValid) { _context.Add(country); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(_mapper.Map(country, new CountryViewModel()))); }
public async Task <IActionResult> Create([Bind("Name,LatinName,Value,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] StuffUnit stuffUnit) { if (ModelState.IsValid) { _context.Add(stuffUnit); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(_mapper.Map <StuffUnitViewModel>(stuffUnit))); }
public async Task <IActionResult> Create([Bind("Name,LatinName,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] PersonGroup personGroup) { if (ModelState.IsValid) { _context.Add(personGroup); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(_mapper.Map <PersonGroupViewModel>(personGroup))); }
public async Task <IActionResult> Create([Bind("ManualCode,Nature,ActivityCode,Name,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Supplier supplier) { if (ModelState.IsValid) { _context.Add(supplier); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(_mapper.Map <SupplierViewModel>(supplier))); }
public async Task <IActionResult> Create([Bind("ManualCode,GroupName,Photo,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] StuffGroup stuffGroup) { if (ModelState.IsValid) { _context.Add(stuffGroup); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(_mapper.Map <StuffGroupViewModel>(stuffGroup))); }
public async Task <IActionResult> Create([Bind("LogTypeName,LogTypeEnName,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] LogType logType) { if (ModelState.IsValid) { _context.Add(logType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(_mapper.Map <LogTypeViewModel>(logType))); }
public async Task <IActionResult> Create([Bind("PermissionParentId,Title,Text,Key,URL,Priority,SateIsPage,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] Permission permission) { if (ModelState.IsValid) { _context.Add(permission); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PermissionParentId"] = new SelectList(_context.Permissions, "Id", "Id", permission.PermissionParentId); return(View(_mapper.Map <PermissionViewModel>(permission))); }
public async Task <IActionResult> Create([Bind("Name,CountryId,Code")] Province province) { if (ModelState.IsValid) { _context.Add(province); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "Id", province.CountryId); return(View(_mapper.Map <ProvinceViewModel>(province))); }
public async Task <IActionResult> Create([Bind("UtilityId,Property,Value,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] UtilityDetail utilityDetail) { if (ModelState.IsValid) { _context.Add(utilityDetail); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UtilityId"] = new SelectList(_context.Utilities, "Id", "MainName", utilityDetail.UtilityId); return(View(_mapper.Map <UtilityDetailViewModel>(utilityDetail))); }
public async Task <IActionResult> Create([Bind("CurrencyName,Symbol,DecimalCount,CountryId,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] Currency currency) { if (ModelState.IsValid) { _context.Add(currency); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "Name", currency.CountryId); return(View(_mapper.Map <CurrencyViewModel>(currency))); }
public async Task <IActionResult> Create([Bind("Name,BaseInfoActionCode,ManualCode,MeasureId,IsDefault,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Warehouse warehouse) { if (ModelState.IsValid) { _context.Add(warehouse); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MeasureId"] = new SelectList(_context.Measures, "Id", "Id", warehouse.MeasureId); return(View(_mapper.Map <WarehouseViewModel>(warehouse))); }
public async Task <IActionResult> Create([Bind("StuffId,Price,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] PriceConsumer priceConsumer) { if (ModelState.IsValid) { _context.Add(priceConsumer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StuffId"] = new SelectList(_context.Stuffs, "Id", "Name", priceConsumer.StuffId); return(View(_mapper.Map <PriceConsumerViewModel>(priceConsumer))); }
public async Task <IActionResult> Create([Bind("Name,ProvinceId,Code")] City city) { if (ModelState.IsValid) { _context.Add(city); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ProvinceId"] = new SelectList(_context.Set <Province>(), "Id", "Id", city.ProvinceId); return(View(_mapper.Map <CityViewModel>(city))); }
public async Task <IActionResult> Create([Bind("Name,BaseInfoTargetId,MainName,NetworkInfoId,Manufacturer,Model,BaseInfoColorId,BaseInfoNatureId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] ApplicationCore.Entities.Share.Utility utility) { if (ModelState.IsValid) { _context.Add(utility); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["NetworkInfoId"] = new SelectList(_context.NetworkInfos, "Id", "HostName", utility.NetworkInfoId); return(View(_mapper.Map <UtilityViewModel>(utility))); }
public async Task <IActionResult> Create([Bind("Type,BarcodeStuff,StuffId,IsDefault,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Barcode barcode) { if (ModelState.IsValid) { _context.Add(barcode); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StuffId"] = new SelectList(_context.Stuffs, "Id", "Name", barcode.StuffId); return(View(_mapper.Map <BarcodeViewModel>(barcode))); }
public async Task <IActionResult> Create([Bind("Id,AppMenuId,MenuName,MenuClass,MenuUrl,Priority")] ManagementAppMenu managementAppMenu) { if (ModelState.IsValid) { _context.Add(managementAppMenu); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AppMenuId"] = new SelectList(_context.ManagementAppMenus, "Id", "MenuClass", managementAppMenu.AppMenuId); return(View(_mapper.Map <ManagementAppMenuViewModel>(managementAppMenu))); }
public async Task <IActionResult> Create([Bind("BaseInfoGroupId,Name,LatinName,Value,Id")] BaseInfo baseInfo) { if (ModelState.IsValid) { _context.Add(baseInfo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BaseInfoGroupId"] = new SelectList(_context.BaseInfoGroups, "Id", "Id", baseInfo.BaseInfoGroupId); return(View(_mapper.Map <BaseInfoViewModel>(baseInfo))); }
public async Task <IActionResult> AddContact(int EntityRecordId, int CityId, string Tel, string Mobile, string Email, string Fax, string WebSite, string Address) { var contact = new HoldingContact() { Address = Address, CityId = CityId, Email = Email, Tel = Tel, Fax = Fax, HoldingId = EntityRecordId, Mobile = Mobile, IsPrimary = false, WebSite = WebSite, }; var id = EntityRecordId; _context.Add(contact); await _context.SaveChangesAsync(); return(RedirectToAction("Details", new { id = EntityRecordId })); }
public async Task <IActionResult> Create([Bind("OwnerUserId,Name,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] Drawer drawer) { if (ModelState.IsValid) { _context.Add(drawer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["OwnerUserId"] = new SelectList(_context.Users, "Id", "UserName", drawer.OwnerUserId); return(View(_mapper.Map <DrawerViewModel>(drawer))); }
public async Task <IActionResult> Create([Bind("UserGroupId,UserName,Password,EmailConfirmed,TwoFactorEnabled,AccessFailedCount,PhoneNumberCount,SecurityStamp,ConcurrencyStamp,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserGroupId"] = new SelectList(_context.UserGroups, "Id", "Id", user.UserGroupId); return(View(_mapper.Map <UserViewModel>(user))); }
public async Task <IActionResult> Create([Bind("StuffId,WarehouseId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] WarehouseStuff warehouseStuff) { if (ModelState.IsValid) { _context.Add(warehouseStuff); await _context.SaveChangesAsync(); 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))); }
public async Task <IActionResult> Create([Bind("ParentId,Class,CurrencyId,Id,UserId,LogRecordId,Status,ModDateTime,ModByUserId,Comment")] PaymentGroup paymentGroup) { if (ModelState.IsValid) { _context.Add(paymentGroup); await _context.SaveChangesAsync(); 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))); }
public async Task <IActionResult> Create([Bind("BranchId,RoleId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] UserCashDesk userCashDesk) { if (ModelState.IsValid) { _context.Add(userCashDesk); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BranchId"] = new SelectList(_context.Branches, "Id", "Name", userCashDesk.BranchId); ViewData["RoleId"] = new SelectList(_context.Roles, "Id", "ConcurrencyStamp", userCashDesk.RoleId); return(View(_mapper.Map <UserCashDeskViewModel>(userCashDesk))); }
public async Task <IActionResult> Create([Bind("PaymentGroupId,DrawerId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] DrawerPayment drawerPayment) { if (ModelState.IsValid) { _context.Add(drawerPayment); await _context.SaveChangesAsync(); 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))); }
public async Task <IActionResult> Create([Bind("CashDeskId,UtilityId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] CashDeskUtility cashDeskUtility) { if (ModelState.IsValid) { _context.Add(cashDeskUtility); await _context.SaveChangesAsync(); 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> Create([Bind("RoleId,PermissionId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] RolePermission rolePermission) { if (ModelState.IsValid) { _context.Add(rolePermission); await _context.SaveChangesAsync(); 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))); }
public async Task <IActionResult> Create([Bind("UserGroupId,RoleGroupId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] UserGroupRole userGroupRole) { if (ModelState.IsValid) { _context.Add(userGroupRole); await _context.SaveChangesAsync(); 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))); }
public async Task <IActionResult> Create([Bind("Name,MeasureId,NetworkInfoId,StartDate,EndDate,CommercialCode,RegisterCode,CompanyId,Id,UserId,Status,ModDateTime,ModByUserId,Comment")] Branch branch) { if (ModelState.IsValid) { _context.Add(branch); await _context.SaveChangesAsync(); 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))); }