コード例 #1
0
ファイル: StudentSystem.cs プロジェクト: unbelt/SoftUni
        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;
        }
コード例 #3
0
        public IResource CreateResource(ResourceType resourceType, int quantity)
        {
            var resource = new Resource(resourceType, quantity);

            return resource;
        }