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)); }
public void getAnswerTest() { Arts arts = new Arts(); arts.Questions(); Assert.AreEqual("New York", arts.getAnswer(2, 3)); }
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); }
public void getQuestionTest() { Arts arts = new Arts(); arts.Questions(); Assert.AreEqual("What nationality was painter Frida Kahlo ? ", arts.getQuestion(1)); }
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")); }
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; }
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); }
public override CharacterAbilityBase GetAbility(Ability ability) { if (MagicArts.IsArt(ability)) { return(Arts.GetAbility(ability)); } else { return(base.GetAbility(ability)); } }
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(); } }
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); }
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")); }
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")); }
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(); }
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); }
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(); }
/// <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); }
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); } }
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())); } } }
//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); }
public void getQuestionNumberTest() { Arts arts = new Arts(); Assert.AreEqual(20, arts.getQuestionNumber); }
//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); }
public void domainNameTest() { Arts arts = new Arts(); Assert.AreEqual("Arts", arts.domainName); }