Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ContactId,Address,Comment,EmailAddress,IsCustomer,IsSupplier,Name,PhoneNumber1,PhoneNumber2,PhoneNumber3,PhoneNumber4,Timestamp,VersionNumber")] Contact val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(val));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("VehicleId,Comment,Name,RegistrationNumber,Timestamp,VersionNumber,WeightKg")] Vehicle val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(val));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("HoldingId,Address,Comment,ContactId,GridReference,HoldingNumber,Postcode,RegisterForCows,RegisterForFish,RegisterForPigs,RegisterForPoultry,RegisterForSheepGoats,Timestamp,VersionNumber")] Holding val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ContactId"] = new SelectList(_context.Contact, "ContactId", "Name", val.ContactId);
            return(View(val));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("EnumVehicleLifeEventTypeId,Comment,Description,Timestamp,VersionNumber")] EnumVehicleLifeEventType val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(val));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("CritterLifeEventGiveBirthId,Comment,DateTime,Timestamp,VersionNumber")] CritterLifeEventDatetime val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(val));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("ProductId,Comment,DefaultVolume,Description,EnumProductTypeId,RequiresRefridgeration,Timestamp,VersionNumber")] Product val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EnumProductTypeId"] = new SelectList(_context.EnumProductType, "EnumProductTypeId", "Description", val.EnumProductTypeId);
            return(View(val));
        }
        public async Task <IActionResult> Create([Bind("AlUserInfoId,Comment,FirstName,LastName,PrivacyConsent,Timestamp,TosConsent")] AlUserInfo val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(val));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> Create([Bind("EnumCritterLifeEventTypeId,Comment,DataType,Description,EnumCritterLifeEventCategoryId,FlagCantReproduce,FlagEndOfSystem,FlagIllness,Timestamp,VersionNumber")] EnumCritterLifeEventType val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(val));
        }
Ejemplo n.º 9
0
        public async Task <IActionResult> Create([Bind("TagId,Comment,CritterId,DateTime,Rfid,Tag1,Timestamp,UserId,VersionNumber")] Tag val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CritterId"] = new SelectList(_context.Critter, "CritterId", "CritterImageId", val.CritterId);
            return(View(val));
        }
Ejemplo n.º 10
0
        public async Task <IActionResult> Create([Bind("CritterImageId,Data")] CritterImage val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(val));
        }
Ejemplo n.º 11
0
        public async Task <IActionResult> Create([Bind("MenuItemId,Action,Comment,Controller,IconUri,RoleId,SequenceNumber,Timestamp,Title,VersionNumber")] MenuItem val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(val));
        }
        public async Task <IActionResult> Create([Bind("PoultryClassificationId,Comment,CritterTypeId,Timestamp,VersionNumber")] PoultryClassification val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CritterTypeId"] = new SelectList(_context.CritterType, "CritterTypeId", "Name", val.CritterTypeId);
            return(View(val));
        }
Ejemplo n.º 13
0
        public async Task <IActionResult> Create([Bind("BreedId,BreedSocietyContactId,Comment,CritterTypeId,Description,Registerable,Timestamp,VersionNumber")] Breed val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BreedSocietyContactId"] = new SelectList(_context.Contact, "ContactId", "Name", val.BreedSocietyContactId);
            ViewData["CritterTypeId"]         = new SelectList(_context.CritterType, "CritterTypeId", "Name", val.CritterTypeId);
            return(View(val));
        }
Ejemplo n.º 14
0
        public async Task <IActionResult> Create([Bind("MenuHeaderItemMapId,Comment,MenuHeaderId,MenuItemId,Timestamp,VersionNumber")] MenuHeaderItemMap val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MenuHeaderId"] = new SelectList(_context.MenuHeader, "MenuHeaderId", "Name", val.MenuHeaderId);
            ViewData["MenuItemId"]   = new SelectList(_context.MenuItem, "MenuItemId", "Title", val.MenuItemId);
            return(View(val));
        }
        public async Task <IActionResult> Create([Bind("CritterLifeEventId,Comment,CritterId,DateTime,Description,EnumCritterLifeEventDataId,EnumCritterLifeEventTypeId,Timestamp,VersionNumber")] CritterLifeEvent val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CritterId"] = new SelectList(_context.Critter, "CritterId", "CritterImageId", val.CritterId);
            ViewData["EnumCritterLifeEventTypeId"] = new SelectList(_context.EnumCritterLifeEventType, "EnumCritterLifeEventTypeId", "Description", val.EnumCritterLifeEventTypeId);
            return(View(val));
        }
Ejemplo n.º 16
0
        public async Task <IActionResult> Create([Bind("MenuHeaderId,ApplicationCode,Comment,ImageUri,MenuHeaderParentId,Name,RoleId,Timestamp,Title,VersionNumber")] MenuHeader val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MenuHeaderParentId"] = new SelectList(_context.MenuHeader, "MenuHeaderId", "Name", val.MenuHeaderParentId);
            ViewData["RoleId"]             = new SelectList(_context.Role, "RoleId", "Description", val.RoleId);
            return(View(val));
        }
        public async Task <IActionResult> Create([Bind("VehicleTrailerMapId,Comment,Timestamp,TrailerId,VehicleMainId,VersionNumber")] VehicleTrailerMap val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TrailerId"]     = new SelectList(_context.Vehicle, "VehicleId", "Name", val.TrailerId);
            ViewData["VehicleMainId"] = new SelectList(_context.Vehicle, "VehicleId", "Name", val.VehicleMainId);
            return(View(val));
        }
        public async Task <IActionResult> Create([Bind("CritterImageVariantId,CritterImageModifiedId,CritterImageOriginalId,Height,Timestamp,Width")] CritterImageVariant val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CritterImageModifiedId"] = new SelectList(_context.CritterImage, "CritterImageId", "CritterImageId", val.CritterImageModifiedId);
            ViewData["CritterImageOriginalId"] = new SelectList(_context.CritterImage, "CritterImageId", "CritterImageId", val.CritterImageOriginalId);
            return(View(val));
        }
Ejemplo n.º 19
0
        public async Task <IActionResult> Create([Bind("LocationId,Comment,EnumLocationTypeId,HoldingId,Name,ParentId,Timestamp,VersionNumber")] Location val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EnumLocationTypeId"] = new SelectList(_context.EnumLocationType, "EnumLocationTypeId", "Description", val.EnumLocationTypeId);
            ViewData["HoldingId"]          = new SelectList(_context.Holding, "HoldingId", "Postcode", val.HoldingId);
            ViewData["ParentId"]           = new SelectList(_context.Location, "LocationId", "Name", val.ParentId);
            return(View(val));
        }
Ejemplo n.º 20
0
        public async Task <IActionResult> Create([Bind("ProductPurchaseId,BatchNumber,Comment,Cost,DateTime,Expiry,LocationId,ProductId,SupplierId,Timestamp,VersionNumber,Volume")] ProductPurchase val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LocationId"] = new SelectList(_context.Location, "LocationId", "Name", val.LocationId);
            ViewData["ProductId"]  = new SelectList(_context.Product, "ProductId", "Description", val.ProductId);
            ViewData["SupplierId"] = new SelectList(_context.Contact, "ContactId", "Name", val.SupplierId);
            return(View(val));
        }
Ejemplo n.º 21
0
        public async Task <IActionResult> Create([Bind("CritterId,BreedId,Comment,CritterImageId,CritterTypeId,DadCritterId,DadFurther,Flags,Gender,MumCritterId,MumFurther,Name,OwnerContactId,TagNumber,Timestamp,VersionNumber")] Critter val)
        {
            this.FixNullFields(val);
            if (ModelState.IsValid)
            {
                _context.Add(val);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BreedId"]        = new SelectList(_context.Breed, "BreedId", "Description", val.BreedId);
            ViewData["CritterImageId"] = new SelectList(_context.CritterImage, "CritterImageId", "CritterImageId", val.CritterImageId);
            ViewData["CritterTypeId"]  = new SelectList(_context.CritterType, "CritterTypeId", "Name", val.CritterTypeId);
            ViewData["DadCritterId"]   = new SelectList(_context.Critter, "CritterId", "CritterImageId", val.DadCritterId);
            ViewData["MumCritterId"]   = new SelectList(_context.Critter, "CritterId", "CritterImageId", val.MumCritterId);
            ViewData["OwnerContactId"] = new SelectList(_context.Contact, "ContactId", "Name", val.OwnerContactId);
            return(View(val));
        }