Exemple #1
0
        public void getQuestionTest1()
        {
            Arts arts = new Arts();

            arts.Questions();
            Assert.AreEqual("A Russian woman was arrested in Paris in August 2009 for throwing a cup of tea at which work of art?", arts.getQuestion(5));
        }
Exemple #2
0
        public void getAnswerTest()
        {
            Arts arts = new Arts();

            arts.Questions();
            Assert.AreEqual("New York", arts.getAnswer(2, 3));
        }
Exemple #3
0
        public double GetCastingTotal(ArtPair artPair)
        {
            double techValue = Arts.GetAbility(artPair.Technique).Value;
            double formValue = Arts.GetAbility(artPair.Form).Value;

            return(techValue + formValue + GetAttribute(AttributeType.Stamina).Value);
        }
Exemple #4
0
        public void getQuestionTest()
        {
            Arts arts = new Arts();

            arts.Questions();
            Assert.AreEqual("What nationality was painter Frida Kahlo ? ", arts.getQuestion(1));
        }
Exemple #5
0
        public ActionResult DeleteArt(Arts art)
        {
            var ArtinDB = _context.Arts.Single(a => a.ArtsId == art.ArtsId);

            _context.Arts.Remove(ArtinDB);
            _context.SaveChanges();
            return(RedirectToAction("Collection", "Arts"));
        }
Exemple #6
0
 public void AddArt(Art art)
 {
     if (art == null)
     {
         throw new ArgumentNullException("art");
     }
     Arts.Add(art);
 }
        //overlaoded constructor : Takes student ID, Student Name and his grade



        public Student(string name, int age, int grade, string fatherName, Arts artSubject) : this()
        {
            // this.student_id = id;
            Name            = name;
            Age             = age;
            StudentGrade    = grade;
            Father_Name     = fatherName;
            ArtSubjectTaken = artSubject;
        }
Exemple #8
0
        public byte[] GetAlbumArtDataById(int id)
        {
            /*
             * https://stackoverflow.com/questions/27641606/loading-a-large-amount-of-images-to-be-displayed-in-a-wrappanel
             * https://metanit.com/sharp/entityframeworkcore/5.7.php
             * https://stackoverflow.com/questions/34967116/how-to-combine-find-and-asnotracking
             */

            return(Arts.AsNoTracking().First(a => a.Id == id).Data);
        }
    private void Start()
    {
        character = GetComponent <CharacterController>();
        rig       = GetComponent <XRRig>();
        rb        = GetComponent <Rigidbody>();
        art       = GetComponent <Arts>();

        leftHand  = InputDevices.GetDeviceAtXRNode(leftSource);
        rightHand = InputDevices.GetDeviceAtXRNode(rightSource);
    }
Exemple #10
0
 public override CharacterAbilityBase GetAbility(Ability ability)
 {
     if (MagicArts.IsArt(ability))
     {
         return(Arts.GetAbility(ability));
     }
     else
     {
         return(base.GetAbility(ability));
     }
 }
Exemple #11
0
        private void dataGridView3_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                currentArts = (Arts)dataGridView3.CurrentRow.DataBoundItem;

                ArtsIDBOX.Text = currentArts.ArtsId.ToString();
                // ArtsContractBOX.Text = currentArts. .ToString();
                ArtsEmailBOX.Text = currentArts.Email.ToString();
                ArtsAdresBOX.Text = currentArts.Adresgegevens.ToString();
                ArstNaamBOX.Text  = currentArts.Naam.ToString();
            }
        }
Exemple #12
0
        static void Main(string[] args)
        {
            Console.WriteLine("***Iterator Pattern Demo***\n");
            ISubjects ScienceSubjects = new Science();
            ISubjects ArtsSubjects    = new Arts();

            IIterator IteratorForScience = ScienceSubjects.CreateIterator();
            IIterator IteratorForArts    = ArtsSubjects.CreateIterator();

            Console.WriteLine("\nScience subjects:");
            Print(IteratorForScience);

            Console.WriteLine("\nArts subjects:");
            Print(IteratorForArts);
        }
Exemple #13
0
        public ActionResult Save(Arts art)
        {
            Random random = new Random();

            //get picture.
            var    upload  = Request.Files["Image"];
            Random randomN = new Random();

            var fileName = Path.Combine(Server.MapPath(mapPathPictures), upload.FileName);

            if (upload.ContentLength > 0)
            {
                upload.SaveAs(fileName);
            }

            if (art.ArtsId == 0)
            {
                var inStock  = art.NumbersInStock;
                var artValue = new Arts()
                {
                    Name             = art.Name,
                    Image            = mapPathPictures + upload.FileName,
                    NumbersInStock   = art.NumbersInStock,
                    NumbersAvailable = art.NumbersInStock,
                    DateAdded        = art.DateAdded,
                    Price            = art.Price,
                    Creator          = art.Creator
                };

                _context.Arts.Add(artValue);
            }
            else
            {
                var ArtinDB = _context.Arts.Single(a => a.ArtsId == art.ArtsId);
                ArtinDB.Name           = art.Name;
                ArtinDB.Image          = art.Image;
                ArtinDB.NumbersInStock = art.NumbersInStock;
                ArtinDB.Price          = art.Price;
                ArtinDB.Creator        = art.Creator;
                ArtinDB.DateAdded      = art.DateAdded;
            }

            _context.SaveChanges();
            return(RedirectToAction("Collection", "Arts"));
        }
Exemple #14
0
        public ActionResult SaveEditedArt(Arts art)
        {
            if (!ModelState.IsValid)
            {
                return(View(art));
            }

            var ArtinDB = _context.Arts.Single(a => a.ArtsId == art.ArtsId);

            ArtinDB.Name           = art.Name;
            ArtinDB.Image          = art.Image;
            ArtinDB.NumbersInStock = art.NumbersInStock;
            ArtinDB.Price          = art.Price;
            ArtinDB.Creator        = art.Creator;
            ArtinDB.DateAdded      = art.DateAdded;

            _context.SaveChanges();
            return(RedirectToAction("Collection", "Arts"));
        }
Exemple #15
0
        public Magus(Ability magicAbility, Ability writingLanguage, Ability writingAbility, Ability areaAbility, uint baseAge = 20)
            : base(writingLanguage, writingAbility, areaAbility, baseAge)
        {
            _magicAbility = magicAbility;
            Arts = new Arts();
            Covenant = null;
            Laboratory = null;
            _visStock = new Dictionary<Ability, double>();
            SpellList = new List<Spell>();
            //_tractatusGoals = new List<TractatusGoal>();
            //_summaGoals = new List<SummaGoal>();
            _partialSpell = null;
            _partialSpellProgress = 0;
            VisStudyRate = 6;
            House = Houses.Apprentice;
            foreach (Ability art in MagicArts.GetEnumerator())
            {
                _visStock[art] = 0;
            }

            InitializeGoals();
        }
Exemple #16
0
        public double GetLabTotal(ArtPair artPair, Activity activity)
        {
            double magicTheory = GetAbility(_magicAbility).Value;
            double techValue   = Arts.GetAbility(artPair.Technique).Value;
            double formValue   = Arts.GetAbility(artPair.Form).Value;
            double labTotal    = magicTheory + techValue + formValue + GetAttribute(AttributeType.Intelligence).Value;

            if (Covenant != null)
            {
                labTotal += Covenant.Aura.Strength;

                if (Laboratory != null)
                {
                    labTotal += Laboratory.GetModifier(artPair, activity);
                }
            }

            //TODO: foci
            //TODO: lab assistant
            //TODO: familiar
            return(labTotal);
        }
Exemple #17
0
        public Magus(Ability magicAbility, Ability writingLanguage, Ability writingAbility, Ability areaAbility, uint baseAge = 20)
            : base(writingLanguage, writingAbility, areaAbility, baseAge)
        {
            _magicAbility = magicAbility;
            Arts          = new Arts();
            Covenant      = null;
            Laboratory    = null;
            _visStock     = new Dictionary <Ability, double>();
            SpellList     = new List <Spell>();
            //_tractatusGoals = new List<TractatusGoal>();
            //_summaGoals = new List<SummaGoal>();
            _partialSpell         = null;
            _partialSpellProgress = 0;
            VisStudyRate          = 6.75;
            House = Houses.Apprentice;
            foreach (Ability art in MagicArts.GetEnumerator())
            {
                _visStock[art] = 0;
            }

            InitializeGoals();
        }
Exemple #18
0
        /// <summary>
        /// calculates the students total tuition fee depending on his/her grade and art subject taken
        /// </summary>
        /// <param name="grade"></param>
        /// <param name="subject"></param>
        /// <returns></returns>
        public static decimal CalculateStudentTotalFee(Grades grade, Arts subject)
        {
            decimal amount   = 0;
            decimal totalFee = 0;
            //int x = (int) Enum.Parse(typeof (CategoriesType), Enum.GetName(typeof (CategoriesType), mycategory));
            var GradeChoice = (int)Enum.Parse(typeof(Grades), Enum.GetName(typeof(Grades), grade));
            var ArtSubject  = Enum.GetName(typeof(Arts), subject);

            switch (GradeChoice)
            {
            case 0:
                amount = 100;
                break;

            case 1:
                amount = 200;
                break;

            case 2:
                amount = 250;
                break;

            case 3:
                amount = 300;
                break;

            case 4:
                amount = 350;
                break;

            case 5:
                amount = 400;
                break;
            }

            totalFee = amount + GetArtSubjectFee(ArtSubject);
            return(totalFee);
        }
Exemple #19
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                using (var db = new KlantContext())
                {
                    string Naam          = NaamBox.Text;
                    string Email         = EmailBox.Text;
                    string Adresgegevens = AdresBox.Text;
                    string Telefoon      = TelefoonBox.Text;


                    var Arts = new Arts
                    {
                        Naam          = Naam,
                        Email         = Email,
                        Adresgegevens = Adresgegevens,
                        Telefoon      = Telefoon
                    };

                    db.Artsen.Add(Arts);
                    db.SaveChanges();

                    var query = from b in db.Artsen
                                orderby b.ArtsId
                                select b;

                    var Form1 = new Form1();
                    Form1.dataGridView3.DataSource = query.ToList();
                    Hide();
                }
            }
            catch (Exception Eerror)
            {
                MessageBox.Show(Eerror.Message);
            }
        }
Exemple #20
0
        public async Task ArtCommands(params string[] args)
        {
            if (args.Length == 0)
            {
                await ReplyAsync(Arts.GetRandomArt(random).GetFormattedArt());
            }
            else if (args[0] == "add")
            {
                if (args.Length > 2)
                {
                    string name = args.BuildName(1, args.Length - 2).ToLower();
                    string url  = args[args.Length - 1];
                    Art    art  = new Art(name, url);
                    Arts.AddArt(art);
                    await ReplyAsync("Added art.");
                }
                else
                {
                    await ReplyAsync("Please say which artist made this " + Context.User.Mention);
                }
            }
            else if (args[0] == "count")
            {
                await ReplyAsync(string.Format("There are {0} arts stored.", Arts.GetArtCount()));
            }
            else if (args[0] == "remove")
            {
                string name  = args.BuildName(1, args.Length - 2).ToLower();
                int    index = int.Parse(args[args.Length - 1]) - 1;

                try
                {
                    Art art = Arts.GetArt(name, index);
                    Arts.RemoveArt(name, index);
                    Arts.SaveArts();
                    await ReplyAsync(string.Format("Art removed from {0}: \"{1}\"", name, art.URL));
                }
                catch (ArgumentOutOfRangeException)
                {
                    await ReplyAsync("Invalid art number.");
                }
            }
            else
            {
                string name = args.BuildName().ToLower();

                List <Art> arts = Arts.GetArtistArts(name);
                if (arts.Count > 0)
                {
                    Art art = arts[random.Next(arts.Count)];
                    if (art != null)
                    {
                        await ReplyAsync(art.GetFormattedArt());
                    }
                }
                else
                {
                    await ReplyAsync(string.Format("{0} has no arts.", name.ToTitleCase()));
                }
            }
        }
Exemple #21
0
        //duty is to enroll a student
        /// <summary>
        /// This creates a new student
        /// </summary>
        /// <param name="name">Name of the student</param>
        /// <param name="age">Age of student</param>
        /// <param name="grade">Grdae in which he is studying</param>
        /// <param name="fatherName">Student's Father name</param>
        /// <param name="artSubject">the special art subject taken by a student</param>
        /// <returns></returns>


        public static Student EnrollStudent(string name, int age, Grades grade, string fatherName, Arts artSubject)
        {
            var student = new Student(name, age, grade, fatherName, artSubject);

            student.FeeTotal = CalculateStudentTotalFee(student.StudentGrade, student.ArtSubjectTaken);
            db.Students.Add(student);
            db.SaveChanges();

            return(student);
        }
 public IAddMusic AddArts(Arts arts)
 {
     Majors.Add(arts);
     return(this);
 }
Exemple #23
0
        public void getQuestionNumberTest()
        {
            Arts arts = new Arts();

            Assert.AreEqual(20, arts.getQuestionNumber);
        }
Exemple #24
0
        //duty is to enroll a student
        /// <summary>
        /// This creates a new student
        /// </summary>
        /// <param name="name">Name of the student</param>
        /// <param name="age">Age of student</param>
        /// <param name="grade">Grdae in which he is studying</param>
        /// <param name="fatherName">Student's Father name</param>
        /// <param name="artSubject">the special art subject taken by a student</param>
        /// <returns></returns>


        public static Student EnrollStudent(string name, int age, int grade, string fatherName, Arts artSubject)
        {
            var student = new Student(name, age, grade, fatherName, artSubject);

            db.Students.Add(student);
            db.SaveChanges();

            return(student);
        }
Exemple #25
0
        public void domainNameTest()
        {
            Arts arts = new Arts();

            Assert.AreEqual("Arts", arts.domainName);
        }