Пример #1
0
        public static void AddResource(string name, string link, ResourceType resourceType = ResourceType.Other)
        {
            using (var db = new StudentSystemContext())
            {
                db.Resources.Add(new Resource
                {
                    Name = name,
                    Link = link,
                    ResourceTypes = resourceType
                });

                db.SaveChanges();
            }
        }
Пример #2
0
        public ResourceSearch(List<Disaster> disasters, List<ResourceType> resourceTypes)
        {
            var alldisasters = new Disaster()
            {
                Id = GeneralSelectId,
                IsActive = true,
                Name = "All Disasters"
            };
            disasters.Insert(0, alldisasters);

            var allResourceTypes = new ResourceType()
            {
                ResourceTypeId = GeneralSelectId,
                TypeName = "All Resource Types"
            };
            resourceTypes.Insert(0, allResourceTypes);

            _disasters = disasters;
            _resourceTypes = resourceTypes;
        }
        public IResource CreateResource(ResourceType resourceType, int quantity)
        {
            var resource = new Resource(resourceType, quantity);

            return resource;
        }