public void ShouldCreateReceiptForBasket3()
        {
            var importedPerfume = new Perfume {
                Id = 6, Name = "bottle of perfume", Price = 27.99m, IsImported = true
            };
            var perfume = new Perfume {
                Id = 7, Name = "bottle of perfume", Price = 18.99m
            };
            var pills = new Medical {
                Id = 8, Name = "packet of headache pills", Price = 9.75m
            };
            var chocolates = new Food {
                Id = 9, Name = "box of chocolates", Price = 11.25m, IsImported = true
            };

            var cart = new Cart {
                Id = 3
            };

            cart.Products.Add(importedPerfume);
            cart.Products.Add(perfume);
            cart.Products.Add(pills);
            cart.Products.Add(chocolates);

            var    receipt           = Receipt.Instance.Create(cart);
            string receiptNormalized = Regex.Replace(receipt, @"\s", "");

            Assert.AreEqual("S.No.ProductNameCountPriceSalesTax------------------------------------1Importedbottleofperfume127.994.22bottleofperfume118.991.93packetofheadachepills19.7504Importedboxofchocolates111.250.6-------------------------------------------------------------------TotalSalesTaxes:6.70Total:74.68",
                            receiptNormalized);
        }
        public void ShouldCreateReceiptForBasket3()
        {
            var importedPerfume = new Perfume {
                Id = 6, Name = "bottle of perfume", Price = 27.99m, IsImported = true
            };
            var perfume = new Perfume {
                Id = 7, Name = "bottle of perfume", Price = 18.99m
            };
            var pills = new Medical {
                Id = 8, Name = "packet of headache pills", Price = 9.75m
            };
            var chocolates = new Food {
                Id = 9, Name = "box of chocolates", Price = 11.25m, IsImported = true
            };

            var cart = new Cart {
                Id = 3
            };

            cart.Products.Add(importedPerfume);
            cart.Products.Add(perfume);
            cart.Products.Add(pills);
            cart.Products.Add(chocolates);

            var receipt = Receipt.Instance.Create(cart);

            Assert.AreEqual("1 imported bottle of perfume: 32.19\r\n1 bottle of perfume: 20.89\r\n1 packet of headache pills: 9.75\r\n1 imported box of chocolates: 11.85\r\nSales Taxes: 6.70\r\nTotal: 74.68",
                            receipt);
        }
        public Task <int> Create(Medical model)
        {
            EntityExtension.FlagForCreate(model, _identityService.Username, USER_AGENT);
            _medicalDbSet.Add(model);

            return(_dbContext.SaveChangesAsync());
        }
        public void ShouldCreateReceiptForBasket3()
        {
            var importedPerfume = new Perfume {
                Id = 6, Name = "bottle of perfume", Price = 27.99m, ProductOrigin = EProductOrigin.Imported
            };
            var perfume = new Perfume {
                Id = 7, Name = "bottle of perfume", Price = 18.99m
            };
            var pills = new Medical {
                Id = 8, Name = "packet of headache pills", Price = 9.75m
            };
            var chocolates = new Food {
                Id = 9, Name = "box of chocolates", Price = 11.25m, ProductOrigin = EProductOrigin.Imported
            };

            var cart = new Cart {
                Id = 3
            };

            cart.Products.Add(importedPerfume);
            cart.Products.Add(perfume);
            cart.Products.Add(pills);
            cart.Products.Add(chocolates);
            var container = ConfigBuilder.Register();

            using (var scope = container.BeginLifetimeScope())
            {
                var receiptUtility = scope.Resolve <IReceiptUtility>();
                var receipt        = receiptUtility.Create(cart);
                Assert.AreEqual("1 imported bottle of perfume: 32.19\r\n1 bottle of perfume: 20.89\r\n1 packet of headache pills: 9.75\r\n1 imported box of chocolates: 11.85\r\nSales Taxes: 6.70\r\nTotal: 74.68",
                                receipt);
            }
        }
        public async Task <ActionResult> PutReject(int id, [FromBody] Medical medical)
        {
            try
            {
                VerifyUser();
                _validateService.Validate(medical);
                Medical medicalToUpdate = await _medicalService.GetSingleById(id);

                await _medicalService.RejectStatus(medicalToUpdate, medical);

                return(NoContent());
            }
            catch (ServiceValidationExeption e)
            {
                var result = new ResultFormatter(API_VERSION, General.BAD_REQUEST_STATUS_CODE, General.BAD_REQUEST_MESSAGE)
                             .Fail(e);
                return(BadRequest(result));
            }
            catch (Exception e)
            {
                var result = new ResultFormatter(API_VERSION, General.INTERNAL_ERROR_STATUS_CODE, e.Message)
                             .Fail();
                return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, result));
            }
        }
        public void MedicalTest1()
        {
            for (int x = 0; x < 2; x++)
            {
                int lineNumber = 0;

                using (Medical medical = new Medical(x == 0 ? _legacySourcePath : _modernSourcePath))
                {
                    var medicalList = medical.MedicalList();

                    var lines = File.ReadLines(Path.Combine(Directory.GetCurrentDirectory(), "medical.csv"));

                    foreach (var line in lines)
                    {
                        TextFieldParser parser = new TextFieldParser(new StringReader(line));
                        parser.HasFieldsEnclosedInQuotes = true;
                        parser.SetDelimiters(",");
                        string[] fields = parser.ReadFields();

                        if (!MedicalRecordCompare(medicalList, fields, lineNumber))
                        {
                            Assert.Fail("Match failed on line: " + (lineNumber + 1).ToString());
                        }

                        lineNumber++;
                    }
                }
            }

            Assert.IsFalse(false, "MedicalTest1 Passed!!");
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,User,DogName,MedName,Periodicity,LastDateGiven")] Medical medical)
        {
            if (id != medical.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(medical);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MedicalExists(medical.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(medical));
        }
Beispiel #8
0
        /// <summary>
        /// update the game item category lists
        /// </summary>
        public void UpdateInventoryCategories()
        {
            Medical.Clear();
            Weapons.Clear();
            Treasure.Clear();
            Clues.Clear();

            foreach (var gameItem in _inventory)
            {
                if (gameItem is MedicalAid)
                {
                    Medical.Add(gameItem);
                }
                if (gameItem is Weapon)
                {
                    Weapons.Add(gameItem);
                }
                if (gameItem is Treasure)
                {
                    Treasure.Add(gameItem);
                }
                if (gameItem is Clues)
                {
                    Clues.Add(gameItem);
                }
            }
        }
Beispiel #9
0
        public void ZeroTaxesTest()
        {
            /*
             * Tests the following Inputs
             * 1 box of chocolates at 10.00
             * 1 box of ibuprofen at 11.00
             * 1 Book at 11.99
             */

            //Generate Expected receipt
            string expectedReceipt = "box of chocolates: 10.00\r\n" +
                                     "box of ibuprofen: 11.00\r\n" +
                                     "Book: 11.99\r\n" +
                                     "Sales Taxes: 0.00\r\n" +
                                     "Total: 32.99";

            //Test
            List <OrderItem> orderItems = new List <OrderItem>();

            Food    chocolate = new Food(1, 10.00m, "box of chocolates", false);
            Medical pills     = new Medical(1, 11.00m, "box of ibuprofen", false);
            Book    book      = new Book(1, 11.99m, "Book", false);


            orderItems.Add(chocolate);
            orderItems.Add(pills);
            orderItems.Add(book);

            string generatedReceipt = Receipt.GenerateReceipt(orderItems);

            Assert.AreEqual <string>(expectedReceipt, generatedReceipt);
        }
        public ActionResult DetailMedical(int id)
        {
            Medical           m     = MedicalCRUD.GetMedical(id);
            List <Medication> mList = MedicationCRUD.GetAllMedicalMedications(id);
            List <Allergy>    aList = AllergyCRUD.GetAllMedicalAllergys(id);

            return(PartialView("_DetailMedical", new Tuple <Medical, List <Medication>, List <Allergy> >(m, mList, aList)));
        }
        public Task <int> ApproveStatus(Medical medical, Medical model)
        {
            EntityExtension.FlagForUpdate(model, _identityService.Username, USER_AGENT);

            medical.Status = Models.Enum.Status.ApprovedByHR;


            return(_dbContext.SaveChangesAsync());
        }
Beispiel #12
0
        public void AddSalesTaxShouldNotAddTaxtoMedicalItems()
        {
            Item    item = new Medical("heart moniter", 5000M);
            decimal expectedItemPrice = 5000.00M;

            item.Price += SalesTax.AddSalesTax(item);

            Assert.AreEqual(expectedItemPrice, item.Price);
        }
Beispiel #13
0
 private static void timerForMedicals_Tick(object sender, EventArgs e)
 {
     for (int i = 0; i < medicals.Length; i++)
     {
         if (medicals[i] == null)
         {
             medicals[i] = new Medical(new Point(Width, Random.Next(0, Height)), new Point(i * -Random.Next(1, 2), 0), new Size(10, 10));
         }
     }
 }
        public async Task <ActionResult> Post(Medical medical, IFormFile stream)
        {
            try
            {
                VerifyUser();
                _validateService.Validate(medical);

                //upload file
                if (CloudStorageAccount.TryParse(config.Value.StorageConnection, out CloudStorageAccount storageAccount))
                {
                    CloudBlobClient    blobClient = storageAccount.CreateCloudBlobClient();
                    CloudBlobContainer container  = blobClient.GetContainerReference(config.Value.Container);

                    var chars       = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                    var stringChars = new char[8];
                    var random      = new Random();
                    for (int i = 0; i < stringChars.Length; i++)
                    {
                        stringChars[i] = chars[random.Next(chars.Length)];
                    }

                    var            finalString = new String(stringChars);
                    CloudBlockBlob blockBlob   = container.GetBlockBlobReference(finalString + stream.FileName);

                    string fileUrl = blockBlob?.Uri.ToString();
                    medical.FileUrl = fileUrl.ToString();

                    await blockBlob.UploadFromStreamAsync(stream.OpenReadStream());
                }
                else
                {
                    return(null);
                }


                await _medicalService.Create(medical);

                return(CreatedAtRoute("Get", new { Id = medical.Id }, medical));
            }


            catch (ServiceValidationExeption e)
            {
                var result = new ResultFormatter(API_VERSION, General.BAD_REQUEST_STATUS_CODE, General.BAD_REQUEST_MESSAGE)
                             .Fail(e);
                return(BadRequest(result));
            }
            catch (Exception e)
            {
                var result = new ResultFormatter(API_VERSION, General.INTERNAL_ERROR_STATUS_CODE, e.Message)
                             .Fail();
                return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, result));
            }
        }
        public Task <int> Update(Medical medical, Medical model)
        {
            EntityExtension.FlagForUpdate(model, _identityService.Username, USER_AGENT);

            medical.Name            = model.Name;
            medical.ReceiptDate     = model.ReceiptDate;
            medical.Desc            = model.Desc;
            medical.ReportedExpense = model.ReportedExpense;
            medical.Division        = model.Division;

            return(_dbContext.SaveChangesAsync());
        }
        public async Task <IActionResult> Create([Bind("ID,User,DogName,MedName,Periodicity,LastDateGiven")] Medical medical)
        {
            medical.User = _currentUser;
            if (ModelState.IsValid)
            {
                _context.Add(medical);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(medical));
        }
 public IActionResult FeverCheck(float temp)
 {
     if (temp != 0)
     {
         ViewBag.Msg = Medical.FeverTest(temp);
         return(View());
     }
     else
     {
         ViewBag.Msg = "Pls enter your temperaure and then hit Submit";
         return(View());
     }
 }
        public ActionResult EditMedicalForm(FormCollection collection)
        {
            Medical medical = new Medical();

            medical.Symptoms  = collection["Symptoms"];
            medical.Diagnosis = collection["Diagnosis"];
            medical.MedicalID = Int32.Parse(collection["MedicalID"]);

            if (MedicalCRUD.UpdateMedical(medical))
            {
                return(Content("<script>alert('Medical Updated Successfully.');window.location.href=document.referrer;</script>"));
            }
            else
            {
                return(Content("<script>alert('Medical could not be Updated');window.location.href=document.referrer</script>"));
            }
        }
        public ActionResult AddMedicalForm(FormCollection collection)
        {
            Medical medical = new Medical();

            medical.Symptoms            = collection["Symptoms"];
            medical.Diagnosis           = collection["Diagnosis"];
            medical.Prisoner            = new Prisoner();
            medical.Prisoner.PrisonerID = Int32.Parse(collection["PrisonerID"]);

            if (MedicalCRUD.InsertMedical(medical))
            {
                return(Content("<script>alert('Medical Added Successfully.');window.location.href=document.referrer;</script>"));
            }
            else
            {
                return(Content("<script>alert('Medical could not be Added');window.location.href=document.referrer</script>"));
            }
        }
        void PruebaStaffs()
        {
            Staff coach = new Coach
            {
                Name         = "Entrenador Francia",
                Active       = true,
                CountryName  = "Francia",
                DebutDate    = DateTime.Now,
                EndDate      = DateTime.Now,
                StartDate    = DateTime.Now,
                PersonalInfo = new PersonalInfo
                {
                    Address = "Direccion"
                }
            };

            Staff medico = new Medical
            {
                Name         = "Nutriologo Francia",
                Speciality   = "Nutrición",
                PersonalInfo = new PersonalInfo {
                    Address = "Direccion 01"
                }
            };

            using (var ctx = new SoccerAppContext())
            {
                //instruccion para que escriba en consola los comandos SQL
                ctx.Database.Log = Console.Write;

                try
                {
                    StaffService service = new StaffService(ctx);
                    service.Insert(medico);
                    Console.WriteLine("Registro exitoso");
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error {0}", ex);
                }
            }
            Console.ReadLine();
        }
        public Medical getMedicalDetails(int u)
        {
            Medical medical = new Medical();

            cmd = new SqlCommand("select allergies,bloodGroup,specialCondition from medicalData WHERE userId=@userId", con);
            cmd.Parameters.AddWithValue("@userId", u);
            con.Open();
            SqlDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                medical.allergies        = dr["allergies"].ToString();
                medical.bloodGroup       = dr["bloodGroup"].ToString();
                medical.specialCondition = dr["specialCondition"].ToString();
            }
            dr.Close();
            con.Close();
            return(medical);
        }
        public void resultSet3()
        {
            IItem testItem1 = new BaseItem("bottle of perfume", 27.99, isImported: true);
            IItem testItem2 = new BaseItem("bottle of perfume", 18.99);
            IItem testItem3 = new Medical("packet of paracetamol", 9.75);
            IItem testItem4 = new Food("box of chocolates", 11.25, isImported: true);

            ICart    cart    = new Cart();
            IReceipt receipt = new Receipt();

            cart.addItem(testItem1);
            cart.addItem(testItem2);
            cart.addItem(testItem3);
            cart.addItem(testItem4);

            //Provided result does not match. Perhaps I missed something...
            //Assert.Equal("1 imported bottle of perfume: 32.19\n1 bottle of perfume: 20.89\n1 packet of paracetamol: 9.75\n1 imported box of chocolates: 11.85\nSales Taxes: 6.70\nTotal: 74.68\n".ToLower(), receipt.print(cart).ToLower());
            Assert.Equal("1 imported bottle of perfume: 32.19\n1 bottle of perfume: 20.89\n1 packet of paracetamol: 9.75\n1 imported box of chocolates: 11.80\nSales Taxes: 6.65\nTotal: 74.63\n".ToLower(), receipt.print(cart).ToLower());
        }
Beispiel #23
0
        public bool CreateMedical(MedicalCreate model)
        {
            var entity =
                new Medical()
            {
                Name         = model.Name,
                Location     = model.Location,
                PhoneNumber  = model.PhoneNumber,
                Website      = model.Website,
                FinancialAid = model.FinancialAid,
                Details      = model.Details
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Medicals.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.DataBind();
            if (!IsPostBack)
            {
                userId     = (int)Session["userId"];
                user       = dc.getContactDetails(userId);
                eContactC  = user.eContact;
                nameC      = user.name;
                addressC   = user.address;
                medicalIdC = user.medicalId;

                medical           = dc.getMedicalDetails(userId);
                allergiesC        = medical.allergies;
                bloodGroupC       = medical.bloodGroup;
                specialConditionC = medical.specialCondition;


                hs = dc.getHospitalDetails();
            }
        }
Beispiel #25
0
        public void Input3Test()
        {
            /*
             * Tests the following Inputs
             * 1 Imported bottle of perfume at 27.99
             * 1 Bottle of perfume at 18.99
             * 1 Packet of headache pills at 9.75
             * 1 Imported box of chocolates at 11.25
             * 1 Imported box of chocolates at 11.25
             */

            //Generate Expected receipt
            string expectedReceipt = "Imported bottle of perfume: 32.19\r\n" +
                                     "Bottle of perfume: 20.89\r\n" +
                                     "Packet of headache pills: 9.75\r\n" +
                                     "Imported box of chocolates: 23.70 (2 @ 11.85)\r\n" +
                                     "Sales Taxes: 7.30\r\n" +
                                     "Total: 86.53";

            //Test
            List <OrderItem> orderItems = new List <OrderItem>();

            OrderItem importPerfume = new OrderItem(1, 27.99m, "bottle of perfume", true);
            OrderItem perfume       = new OrderItem(1, 18.99m, "Bottle of perfume", false);
            Medical   pills         = new Medical(1, 9.75m, "Packet of headache pills", false);
            Food      chocolate1    = new Food(1, 11.25m, "box of chocolates", true);
            Food      chocolate2    = new Food(1, 11.25m, "box of chocolates", true);

            orderItems.Add(importPerfume);
            orderItems.Add(perfume);
            orderItems.Add(pills);
            orderItems.Add(chocolate1);
            orderItems.Add(chocolate2);

            string generatedReceipt = Receipt.GenerateReceipt(orderItems);

            Assert.AreEqual <string>(expectedReceipt, generatedReceipt);
        }
        public async Task <IActionResult> Add([FromQuery] string token, string Hash, string diagnosis,
                                              string diagnosis_fully, string first_aid, string drugs, string is_important)
        {
            bool boolean;

            try
            {
                if (is_important == "true")
                {
                    boolean = true;
                }
                else
                {
                    boolean = false;
                }

                var user = await _context.User.FirstOrDefaultAsync(u => u.Hash == Hash);

                var medical = new Medical
                {
                    diagnosis       = diagnosis,
                    diagnosis_fully = diagnosis_fully,
                    first_aid       = first_aid,
                    drugs           = drugs,
                    is_important    = boolean
                };

                string json = JsonConvert.SerializeObject(medical);
                _blockchainService.AddBlockAsync(await _blockchainService.generateNextBlockAsync(json, Hash));

                return(RedirectToAction("Index", "Home"));
            }
            catch
            {
                return(View());
            }
        }
        private void Entertainment_btn1_Click(object sender, EventArgs e)
        {
            if (RB1.Checked)
            {
                if (!File.Exists(Watch_fileLoc))
                {
                    FileStream aFile = new FileStream(Watch_fileLoc, FileMode.Create, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("James Cameron's big-budget (and even bigger-grossing) films create unreal worlds all their own. In this talk, he reveals his childhood fascination with the fantastic  from reading science fiction to deep-sea diving and how it ultimately drove the success of his blockbuster hits Aliens,The Terminator,Titanic and Avatar.James Cameron is the director of Avatar, Titanic, Terminator, The Abyss and many other blockbusters. While his outsize films push the bounds of technology, they're always anchored in human stories with heart and soul.");
                    sw.WriteLine("Film producer Jeff Skoll (An Inconvenient Truth) talks about his film company, Participant Productions, and the people who've inspired him to do good.Jeff Skoll was the first president of eBay; he used his dot-com fortune to found the film house Participant Productions, making movies to inspire social change, including Syriana; Good Night, and Good Luck; Murderball; An Inconvenient Trut");
                    sw.WriteLine("Movies have the power to create a shared narrative experience and to shape memories and worldviews. British film director Beeban Kidron invokes iconic film scenes -- from Miracle in Milan to Boyz n the Hood -- as she shows how her group FILMCLUB shares great films with kids. Beeban Kidron directed Bridget Jones: The Edge of Reason and Oranges Are Not the Only Fruit. She also cofounded FILMCLUB, a charity for students devoted to the art of storytelling through film");
                    sw.WriteLine("Nathaniel Kahn shares clips from his documentary My Architect, about his quest to understand his father, the legendary architect Louis Kahn. It's a film with meaning to anyone who seeks to understand the relationship between art and love. Nathaniel Kahn is an Oscar- and Emmy-nominated maker of documentary films. His journey to understand his distant father -- the legendary modern architect Louis Kahn -- became the film My Architect.");
                    sw.WriteLine("Every act of communication is, in some way, an act of translation. Onstage at TEDxRainier, writer Chris Bliss thinks hard about the way that great comedy can translate deep truths for a mass audience. (Filmed at TEDxRainier.) Chris Bliss explores the inherent challenge of communication, and how comedy opens paths to new perspectives.");
                    sw.WriteLine("At TED2012, filmmaker Karen Bass shares some of the astonishing nature footage she's shot for the BBC and National Geographic -- including brand-new, previously unseen footage of the tube-lipped nectar bat, who feeds in a rather unusual way … Karen Bass has traveled the world to explore and capture footage from every environment across the Earth");
                    sw.Close();
                    aFile.Close();
                }
                else
                {
                    FileStream aFile = new FileStream(Watch_fileLoc, FileMode.Append, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("James Cameron's big-budget (and even bigger-grossing) films create unreal worlds all their own. In this talk, he reveals his childhood fascination with the fantastic  from reading science fiction to deep-sea diving and how it ultimately drove the success of his blockbuster hits Aliens,The Terminator,Titanic and Avatar.James Cameron is the director of Avatar, Titanic, Terminator, The Abyss and many other blockbusters. While his outsize films push the bounds of technology, they're always anchored in human stories with heart and soul.");
                    sw.WriteLine("Film producer Jeff Skoll (An Inconvenient Truth) talks about his film company, Participant Productions, and the people who've inspired him to do good.Jeff Skoll was the first president of eBay; he used his dot-com fortune to found the film house Participant Productions, making movies to inspire social change, including Syriana; Good Night, and Good Luck; Murderball; An Inconvenient Trut");
                    sw.WriteLine("Movies have the power to create a shared narrative experience and to shape memories and worldviews. British film director Beeban Kidron invokes iconic film scenes -- from Miracle in Milan to Boyz n the Hood -- as she shows how her group FILMCLUB shares great films with kids. Beeban Kidron directed Bridget Jones: The Edge of Reason and Oranges Are Not the Only Fruit. She also cofounded FILMCLUB, a charity for students devoted to the art of storytelling through film");
                    sw.WriteLine("Nathaniel Kahn shares clips from his documentary My Architect, about his quest to understand his father, the legendary architect Louis Kahn. It's a film with meaning to anyone who seeks to understand the relationship between art and love. Nathaniel Kahn is an Oscar- and Emmy-nominated maker of documentary films. His journey to understand his distant father -- the legendary modern architect Louis Kahn -- became the film My Architect.");
                    sw.WriteLine("Every act of communication is, in some way, an act of translation. Onstage at TEDxRainier, writer Chris Bliss thinks hard about the way that great comedy can translate deep truths for a mass audience. (Filmed at TEDxRainier.) Chris Bliss explores the inherent challenge of communication, and how comedy opens paths to new perspectives.");
                    sw.WriteLine("At TED2012, filmmaker Karen Bass shares some of the astonishing nature footage she's shot for the BBC and National Geographic -- including brand-new, previously unseen footage of the tube-lipped nectar bat, who feeds in a rather unusual way … Karen Bass has traveled the world to explore and capture footage from every environment across the Earth");
                    sw.Close();
                    aFile.Close();
                }
            }

            else if (RB2.Checked)
            {
                if (!File.Exists(Not_Watch_fileLoc))
                {
                    FileStream aFile = new FileStream(Not_Watch_fileLoc, FileMode.Create, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("James Cameron's big-budget (and even bigger-grossing) films create unreal worlds all their own. In this talk, he reveals his childhood fascination with the fantastic  from reading science fiction to deep-sea diving and how it ultimately drove the success of his blockbuster hits Aliens,The Terminator,Titanic and Avatar.James Cameron is the director of Avatar, Titanic, Terminator, The Abyss and many other blockbusters. While his outsize films push the bounds of technology, they're always anchored in human stories with heart and soul.");
                    sw.WriteLine("Film producer Jeff Skoll (An Inconvenient Truth) talks about his film company, Participant Productions, and the people who've inspired him to do good.Jeff Skoll was the first president of eBay; he used his dot-com fortune to found the film house Participant Productions, making movies to inspire social change, including Syriana; Good Night, and Good Luck; Murderball; An Inconvenient Trut");
                    sw.WriteLine("Movies have the power to create a shared narrative experience and to shape memories and worldviews. British film director Beeban Kidron invokes iconic film scenes -- from Miracle in Milan to Boyz n the Hood -- as she shows how her group FILMCLUB shares great films with kids. Beeban Kidron directed Bridget Jones: The Edge of Reason and Oranges Are Not the Only Fruit. She also cofounded FILMCLUB, a charity for students devoted to the art of storytelling through film");
                    sw.WriteLine("Nathaniel Kahn shares clips from his documentary My Architect, about his quest to understand his father, the legendary architect Louis Kahn. It's a film with meaning to anyone who seeks to understand the relationship between art and love. Nathaniel Kahn is an Oscar- and Emmy-nominated maker of documentary films. His journey to understand his distant father -- the legendary modern architect Louis Kahn -- became the film My Architect.");
                    sw.WriteLine("Every act of communication is, in some way, an act of translation. Onstage at TEDxRainier, writer Chris Bliss thinks hard about the way that great comedy can translate deep truths for a mass audience. (Filmed at TEDxRainier.) Chris Bliss explores the inherent challenge of communication, and how comedy opens paths to new perspectives.");
                    sw.WriteLine("At TED2012, filmmaker Karen Bass shares some of the astonishing nature footage she's shot for the BBC and National Geographic -- including brand-new, previously unseen footage of the tube-lipped nectar bat, who feeds in a rather unusual way … Karen Bass has traveled the world to explore and capture footage from every environment across the Earth");
                    sw.Close();
                    aFile.Close();
                }
                else
                {
                    FileStream aFile = new FileStream(Not_Watch_fileLoc, FileMode.Append, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                  sw.WriteLine("James Cameron's big-budget (and even bigger-grossing) films create unreal worlds all their own. In this talk, he reveals his childhood fascination with the fantastic  from reading science fiction to deep-sea diving and how it ultimately drove the success of his blockbuster hits Aliens,The Terminator,Titanic and Avatar.James Cameron is the director of Avatar, Titanic, Terminator, The Abyss and many other blockbusters. While his outsize films push the bounds of technology, they're always anchored in human stories with heart and soul.");
                    sw.WriteLine("Film producer Jeff Skoll (An Inconvenient Truth) talks about his film company, Participant Productions, and the people who've inspired him to do good.Jeff Skoll was the first president of eBay; he used his dot-com fortune to found the film house Participant Productions, making movies to inspire social change, including Syriana; Good Night, and Good Luck; Murderball; An Inconvenient Trut");
                    sw.WriteLine("Movies have the power to create a shared narrative experience and to shape memories and worldviews. British film director Beeban Kidron invokes iconic film scenes -- from Miracle in Milan to Boyz n the Hood -- as she shows how her group FILMCLUB shares great films with kids. Beeban Kidron directed Bridget Jones: The Edge of Reason and Oranges Are Not the Only Fruit. She also cofounded FILMCLUB, a charity for students devoted to the art of storytelling through film");
                    sw.WriteLine("Nathaniel Kahn shares clips from his documentary My Architect, about his quest to understand his father, the legendary architect Louis Kahn. It's a film with meaning to anyone who seeks to understand the relationship between art and love. Nathaniel Kahn is an Oscar- and Emmy-nominated maker of documentary films. His journey to understand his distant father -- the legendary modern architect Louis Kahn -- became the film My Architect.");
                    sw.WriteLine("Every act of communication is, in some way, an act of translation. Onstage at TEDxRainier, writer Chris Bliss thinks hard about the way that great comedy can translate deep truths for a mass audience. (Filmed at TEDxRainier.) Chris Bliss explores the inherent challenge of communication, and how comedy opens paths to new perspectives.");
                    sw.WriteLine("At TED2012, filmmaker Karen Bass shares some of the astonishing nature footage she's shot for the BBC and National Geographic -- including brand-new, previously unseen footage of the tube-lipped nectar bat, who feeds in a rather unusual way … Karen Bass has traveled the world to explore and capture footage from every environment across the Earth");
                    sw.Close();
                    aFile.Close();
                }
            }

             if (length == 4 || length == 3 || length == 1)
             {

                 if (Next == "Business")
                 {
                     Business frm = new Business(NewUserSlections);
                     frm.Show();
                 }

                 else if (Next == "Religious")
                 {
                     Religious_1 frm = new Religious_1(NewUserSlections);
                     frm.Show();
                 }

                 else if (Next == "Environment")
                 {
                     Environment frm = new Environment(NewUserSlections);
                     frm.Show();
                 }

                 else if (Next == "Sports")
                 {
                     Sports_1 frm = new Sports_1(NewUserSlections);
                     frm.Show();
                 }

                 else if (Next == "Politics")
                 {
                     Politics frm = new Politics(NewUserSlections);
                     frm.Show();
                 }

                 else if (Next == "Medical")
                 {
                     Medical frm = new Medical(NewUserSlections);
                     frm.Show();
                 }

                 else if (Next == "Science")
                 {
                     Science frm = new Science(NewUserSlections);
                     frm.Show();
                 }

                 else
                 {
                     Finish frm = new Finish();
                     frm.Show();
                 }
             }

             else
             {
                 Finish frm = new Finish();
                 frm.Show();
             }

             this.Close();
        }
        public async Task <IActionResult> Put(Medical medical)
        {
            await this._medicalManager.Update(medical);

            return(Ok());
        }
Beispiel #29
0
        static void Main(string[] args)
        {
            Console.WriteLine(" Console app Start: \n");

            ////////////////////////////////////////////////////
            // 1 (a + b) + 3
            ////////////////////////////////////////////////////
            Motor motorP1 = new Motor(new DateTime(2020, 1, 21),
                                      new DateTime(2020, 5, 21), 3600);

            Travel travelP1 = new Travel(new DateTime(2020, 2, 21),
                                         new DateTime(2020, 6, 21), "Kief", "Belarus", true, 20);

            List <Beneficiary> beneficiaryList1 = new List <Beneficiary>();

            beneficiaryList1.Add(new Beneficiary(Gender.Male, Relationship.Son, "Maher",
                                                 new DateTime(1993, 8, 8)));

            beneficiaryList1.Add(new Beneficiary(Gender.Female, Relationship.Daughter, "Maya",
                                                 new DateTime(1993, 10, 10)));


            Medical medicalP1 = new Medical(new DateTime(2020, 2, 21),
                                            new DateTime(2020, 6, 21), beneficiaryList1);


            Console.WriteLine();
            ////////////////////////////////////////////////////
            // 2
            ////////////////////////////////////////////////////



            Motor motorP2 = new Motor(new DateTime(2020, 2, 21),
                                      new DateTime(2020, 10, 21), 500);

            Motor motorP3 = new Motor(new DateTime(2020, 3, 21),
                                      new DateTime(2020, 11, 21), 1500);

            Travel travelP2 = new Travel(new DateTime(2020, 2, 21),
                                         new DateTime(2020, 10, 21), "Beirut", "London", false, 1);

            Travel travelP3 = new Travel(new DateTime(2020, 10, 21),
                                         new DateTime(2020, 10, 21), "Cuba", "Portugal", true, 2);

            Medical medicalP2 = new Medical(new DateTime(2020, 3, 21),
                                            new DateTime(2020, 2, 21), beneficiaryList1);


            Console.WriteLine();
            ////////////////////////////////////////////////////
            // 4
            ////////////////////////////////////////////////////

            Console.WriteLine(" All available policies following the Display Template.\n");

            motorP1.DisplayMotorPolicyTemplate();
            motorP2.DisplayMotorPolicyTemplate();
            motorP3.DisplayMotorPolicyTemplate();

            travelP1.DisplayTravelPolicyTemplate();
            travelP2.DisplayTravelPolicyTemplate();
            travelP3.DisplayTravelPolicyTemplate();

            medicalP1.DisplayMedicalPolicyTemplate();
            medicalP2.DisplayMedicalPolicyTemplate();


            Console.WriteLine();
            ////////////////////////////////////////////////////
            // 5
            ////////////////////////////////////////////////////
            Console.WriteLine(" All policies whose premium is between 500 USD and 2000 USD.\n");

            List <Policy> policyList = new List <Policy>();

            policyList.Add(motorP1);
            policyList.Add(motorP2);
            policyList.Add(motorP3);

            policyList.Add(travelP1);
            policyList.Add(travelP2);
            policyList.Add(travelP3);

            policyList.Add(medicalP1);
            policyList.Add(medicalP2);

            foreach (var policy in policyList)
            {
                policy.DisplayPoliciesWherePremiumBetweenFiveHundredAndTwoThousand();
            }



            Console.WriteLine();
            ////////////////////////////////////////////////////
            // 6 a + b
            ////////////////////////////////////////////////////

            motorP2.IsValid = false;

            List <Claim> ClaimList = new List <Claim>();

            Claim claim1  = new Claim(new DateTime(2020, 1, 1), "asdads", 200);
            Claim claim2  = new Claim(new DateTime(2020, 2, 2), motorP1.Police_No, 100);
            Claim claim3  = new Claim(new DateTime(2020, 3, 3), motorP3.Police_No, 300);
            Claim claim4  = new Claim(new DateTime(2020, 4, 4), travelP1.Police_No, 400);
            Claim claim5  = new Claim(new DateTime(2020, 5, 5), travelP2.Police_No, 500);
            Claim claim6  = new Claim(new DateTime(2020, 6, 6), travelP3.Police_No, 600);
            Claim claim7  = new Claim(new DateTime(2020, 7, 7), medicalP1.Police_No, 700);
            Claim claim8  = new Claim(new DateTime(2020, 8, 8), medicalP2.Police_No, 800);
            Claim claim9  = new Claim(new DateTime(2020, 9, 9), travelP1.Police_No, 900);
            Claim claim10 = new Claim(new DateTime(2020, 10, 10), travelP2.Police_No, 1000);
            Claim claim11 = new Claim(new DateTime(2020, 11, 11), travelP3.Police_No, 1100);
            Claim claim12 = new Claim(new DateTime(2020, 12, 12), motorP1.Police_No, 1200);
            Claim claim13 = new Claim(new DateTime(2020, 1, 13), medicalP1.Police_No, 1300);
            Claim claim14 = new Claim(new DateTime(2020, 2, 14), motorP3.Police_No, 1400);
            Claim claim15 = new Claim(new DateTime(2020, 3, 15), motorP2.Police_No, 1500);

            ClaimList.Add(claim1);
            ClaimList.Add(claim2);
            ClaimList.Add(claim3);
            ClaimList.Add(claim4);
            ClaimList.Add(claim5);
            ClaimList.Add(claim6);
            ClaimList.Add(claim7);
            ClaimList.Add(claim8);
            ClaimList.Add(claim9);
            ClaimList.Add(claim10);
            ClaimList.Add(claim11);
            ClaimList.Add(claim12);
            ClaimList.Add(claim13);
            ClaimList.Add(claim14);
            ClaimList.Add(claim15);

            // we tend to not do nested loops due to time complexity => performance issues.

            // 6a
            foreach (var claim in ClaimList)
            {
                if (!policyList.Exists(p => p.Police_No == claim.Police_No))
                {
                    Console.WriteLine(" Cannot submit a claim for " +
                                      "Policy# " + claim.Police_No + " because it does not exist");
                }
            }


            Console.WriteLine();

            // 6b
            foreach (var claim in ClaimList)
            {
                if (claim.Police_No != null)
                {
                    var validPolicies = policyList.FirstOrDefault((p => p.Effective <= claim.Incured_Date &&
                                                                   claim.Incured_Date < p.Expiry));

                    if (validPolicies == null)
                    {
                        Console.WriteLine(" Claim is rejected because Policy# "
                                          + claim.Police_No + " is inactive or expired");
                    }
                }
            }



            Console.WriteLine();
            ////////////////////////////////////////////////////
            // 7 a + b + c
            ////////////////////////////////////////////////////



            foreach (var police in policyList)
            {
                if (police.Police_No != null)
                {
                    var Submitted_Claims = ClaimList
                                           .FindAll(c => c.Police_No == police.Police_No);

                    var Claim_Sum_Ammount = Submitted_Claims.Sum(c => c.Claimed_Amount);



                    var policyMaxClaimedAmount = Submitted_Claims.Max(c => c.Claimed_Amount);
                    var policyMinClaimedAmount = Submitted_Claims.Min(c => c.Claimed_Amount);

                    Console.WriteLine(" Police# " + police.Police_No + " has "
                                      + Submitted_Claims.Count() + " claims with max: " + policyMaxClaimedAmount
                                      + " and min: " + policyMinClaimedAmount + " and sum: " + Claim_Sum_Ammount
                                      );
                }
            }

            Console.WriteLine("\n Console app Finish: \n");
        }
Beispiel #30
0
        private void Entertainment_btn1_Click(object sender, EventArgs e)
        {
            if (RB1.Checked)
            {
                if (!File.Exists(Watch_fileLoc))
                {
                    FileStream aFile = new FileStream(Watch_fileLoc, FileMode.Create, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("Lewis Pugh talks about his record-breaking swim across the North Pole. He braved the icy waters (in a Speedo) to highlight the melting icecap. Watch for astonishing footage -- and some blunt commentary on the realities of supercold-water swims. Pushing his body through epic cold-water swims, Lewis Gordon Pugh wants to draw attention to our global climate. He's just back from swimming in a meltwater lake on the slopes of Mount Everest.");
                    sw.WriteLine("After he swam the North Pole, Lewis Pugh vowed never to take another cold-water dip. Then he heard of Lake Imja in the Himalayas, created by recent glacial melting, and Lake Pumori, a body of water at an altitude of 5300 m on Everest -- and so began a journey that would teach him a radical new way to approach swimming and think about climate change.Pushing his body through epic cold-water swims, Lewis Gordon Pugh wants to draw attention to our global climate. He's just back from swimming in a meltwater lake on the slopes of Mount Everest");
                    sw.Close();
                    aFile.Close();
                }
                else
                {
                    FileStream aFile = new FileStream(Watch_fileLoc, FileMode.Append, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("Lewis Pugh talks about his record-breaking swim across the North Pole. He braved the icy waters (in a Speedo) to highlight the melting icecap. Watch for astonishing footage -- and some blunt commentary on the realities of supercold-water swims. Pushing his body through epic cold-water swims, Lewis Gordon Pugh wants to draw attention to our global climate. He's just back from swimming in a meltwater lake on the slopes of Mount Everest.");
                    sw.WriteLine("After he swam the North Pole, Lewis Pugh vowed never to take another cold-water dip. Then he heard of Lake Imja in the Himalayas, created by recent glacial melting, and Lake Pumori, a body of water at an altitude of 5300 m on Everest -- and so began a journey that would teach him a radical new way to approach swimming and think about climate change.Pushing his body through epic cold-water swims, Lewis Gordon Pugh wants to draw attention to our global climate. He's just back from swimming in a meltwater lake on the slopes of Mount Everest");
                    sw.Close();
                    aFile.Close();
                }
            }

            else if (RB2.Checked)
            {
                if (!File.Exists(Not_Watch_fileLoc))
                {
                    FileStream aFile = new FileStream(Not_Watch_fileLoc, FileMode.Create, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("Lewis Pugh talks about his record-breaking swim across the North Pole. He braved the icy waters (in a Speedo) to highlight the melting icecap. Watch for astonishing footage -- and some blunt commentary on the realities of supercold-water swims. Pushing his body through epic cold-water swims, Lewis Gordon Pugh wants to draw attention to our global climate. He's just back from swimming in a meltwater lake on the slopes of Mount Everest.");
                    sw.WriteLine("After he swam the North Pole, Lewis Pugh vowed never to take another cold-water dip. Then he heard of Lake Imja in the Himalayas, created by recent glacial melting, and Lake Pumori, a body of water at an altitude of 5300 m on Everest -- and so began a journey that would teach him a radical new way to approach swimming and think about climate change.Pushing his body through epic cold-water swims, Lewis Gordon Pugh wants to draw attention to our global climate. He's just back from swimming in a meltwater lake on the slopes of Mount Everest");
                    sw.Close();
                    aFile.Close();
                }
                else
                {
                    FileStream aFile = new FileStream(Not_Watch_fileLoc, FileMode.Append, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("Lewis Pugh talks about his record-breaking swim across the North Pole. He braved the icy waters (in a Speedo) to highlight the melting icecap. Watch for astonishing footage -- and some blunt commentary on the realities of supercold-water swims. Pushing his body through epic cold-water swims, Lewis Gordon Pugh wants to draw attention to our global climate. He's just back from swimming in a meltwater lake on the slopes of Mount Everest.");
                    sw.WriteLine("After he swam the North Pole, Lewis Pugh vowed never to take another cold-water dip. Then he heard of Lake Imja in the Himalayas, created by recent glacial melting, and Lake Pumori, a body of water at an altitude of 5300 m on Everest -- and so began a journey that would teach him a radical new way to approach swimming and think about climate change.Pushing his body through epic cold-water swims, Lewis Gordon Pugh wants to draw attention to our global climate. He's just back from swimming in a meltwater lake on the slopes of Mount Everest");
                    sw.Close();
                    aFile.Close();
                }
            }

            if (length == 4 || length == 3 || length == 1)
            {

                if (Next == "Politics")
                {
                    Politics frm = new Politics(NewUserSlections);
                    frm.Show();
                }

                else if (Next == "Medical")
                {
                    Medical frm = new Medical(NewUserSlections);
                    frm.Show();
                }

                else if (Next == "Science")
                {
                    Science frm = new Science(NewUserSlections);
                    frm.Show();
                }
                else
                {
                    Finish frm = new Finish();
                    frm.Show();
                }

            }
                else
                {
                    Finish frm = new Finish();
                    frm.Show();
                }

            this.Close();
        }
        private void Entertainment_btn1_Click(object sender, EventArgs e)
        {
            if (RB1.Checked)
            {
                if (!File.Exists(Watch_fileLoc))
                {
                    FileStream aFile = new FileStream(Watch_fileLoc, FileMode.Create, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("Pastor Rick Warren, author of The Purpose-Driven Life, reflects on his own crisis of purpose in the wake of his book's wild success. He explains his belief that God's intention is for each of us to use our talents and influence to do good.Pastor Rick Warren is the author of The Purpose-Driven Life, which has sold more than 30 million copies worldwide. His has become an immensely influential voice seeking to apply the values of his faith to issues such as global poverty, HIV/AIDS and injustice.");
                    sw.WriteLine("Speaking at TED in 1998, Rev. Billy Graham marvels at technology's power to improve lives and change the world -- but says the end of evil, suffering and death will come only after the world accepts Christ. A legendary talk from TED's archives. The Rev. Billy Graham is a religious leader with a worldwide reach. In his long career as an evangelist, he has spoken to millions and been an advisor to US presidents");
                    sw.WriteLine("Julia Sweeney (God Said, Ha!) performs the first 15 minutes of her 2006 solo show Letting Go of God. When two young Mormon missionaries knock on her door one day, it touches off a quest to completely rethink her own beliefs. As a solo performer, comic actor Julia Sweeney explores love, cancer, family and faith. Her latest solo show and CD, Letting Go of God, is about the quest for something I could really believe in -- which turns out to be no God at all");
                    sw.Close();
                    aFile.Close();
                }
                else
                {
                    FileStream aFile = new FileStream(Watch_fileLoc, FileMode.Append, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("Pastor Rick Warren, author of The Purpose-Driven Life, reflects on his own crisis of purpose in the wake of his book's wild success. He explains his belief that God's intention is for each of us to use our talents and influence to do good.Pastor Rick Warren is the author of The Purpose-Driven Life, which has sold more than 30 million copies worldwide. His has become an immensely influential voice seeking to apply the values of his faith to issues such as global poverty, HIV/AIDS and injustice.");
                    sw.WriteLine("Speaking at TED in 1998, Rev. Billy Graham marvels at technology's power to improve lives and change the world -- but says the end of evil, suffering and death will come only after the world accepts Christ. A legendary talk from TED's archives. The Rev. Billy Graham is a religious leader with a worldwide reach. In his long career as an evangelist, he has spoken to millions and been an advisor to US presidents");
                    sw.WriteLine("Julia Sweeney (God Said, Ha!) performs the first 15 minutes of her 2006 solo show Letting Go of God. When two young Mormon missionaries knock on her door one day, it touches off a quest to completely rethink her own beliefs. As a solo performer, comic actor Julia Sweeney explores love, cancer, family and faith. Her latest solo show and CD, Letting Go of God, is about the quest for something I could really believe in -- which turns out to be no God at all");
                    sw.Close();
                    aFile.Close();
                }
            }

            else if (RB2.Checked)
            {
                if (!File.Exists(Not_Watch_fileLoc))
                {
                    FileStream aFile = new FileStream(Not_Watch_fileLoc, FileMode.Create, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("Pastor Rick Warren, author of The Purpose-Driven Life, reflects on his own crisis of purpose in the wake of his book's wild success. He explains his belief that God's intention is for each of us to use our talents and influence to do good.Pastor Rick Warren is the author of The Purpose-Driven Life, which has sold more than 30 million copies worldwide. His has become an immensely influential voice seeking to apply the values of his faith to issues such as global poverty, HIV/AIDS and injustice.");
                    sw.WriteLine("Speaking at TED in 1998, Rev. Billy Graham marvels at technology's power to improve lives and change the world -- but says the end of evil, suffering and death will come only after the world accepts Christ. A legendary talk from TED's archives. The Rev. Billy Graham is a religious leader with a worldwide reach. In his long career as an evangelist, he has spoken to millions and been an advisor to US presidents");
                    sw.WriteLine("Julia Sweeney (God Said, Ha!) performs the first 15 minutes of her 2006 solo show Letting Go of God. When two young Mormon missionaries knock on her door one day, it touches off a quest to completely rethink her own beliefs. As a solo performer, comic actor Julia Sweeney explores love, cancer, family and faith. Her latest solo show and CD, Letting Go of God, is about the quest for something I could really believe in -- which turns out to be no God at all");
                    sw.Close();
                    aFile.Close();
                }
                else
                {
                    FileStream aFile = new FileStream(Not_Watch_fileLoc, FileMode.Append, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(aFile);
                    sw.WriteLine("Pastor Rick Warren, author of The Purpose-Driven Life, reflects on his own crisis of purpose in the wake of his book's wild success. He explains his belief that God's intention is for each of us to use our talents and influence to do good.Pastor Rick Warren is the author of The Purpose-Driven Life, which has sold more than 30 million copies worldwide. His has become an immensely influential voice seeking to apply the values of his faith to issues such as global poverty, HIV/AIDS and injustice.");
                    sw.WriteLine("Speaking at TED in 1998, Rev. Billy Graham marvels at technology's power to improve lives and change the world -- but says the end of evil, suffering and death will come only after the world accepts Christ. A legendary talk from TED's archives. The Rev. Billy Graham is a religious leader with a worldwide reach. In his long career as an evangelist, he has spoken to millions and been an advisor to US presidents");
                    sw.WriteLine("Julia Sweeney (God Said, Ha!) performs the first 15 minutes of her 2006 solo show Letting Go of God. When two young Mormon missionaries knock on her door one day, it touches off a quest to completely rethink her own beliefs. As a solo performer, comic actor Julia Sweeney explores love, cancer, family and faith. Her latest solo show and CD, Letting Go of God, is about the quest for something I could really believe in -- which turns out to be no God at all");
                    sw.Close();
                    aFile.Close();
                }
            }

            if (length == 4 || length == 3 || length == 1)
            {

                 if (Next == "Environment")
                {
                    Environment frm = new Environment(NewUserSlections);
                    frm.Show();
                }

                else if (Next == "Sports")
                {
                    Sports_1 frm = new Sports_1(NewUserSlections);
                    frm.Show();
                }

                else if (Next == "Politics")
                {
                    Politics frm = new Politics(NewUserSlections);
                    frm.Show();
                }

                else if (Next == "Medical")
                {
                    Medical frm = new Medical(NewUserSlections);
                    frm.Show();
                }

                else if (Next == "Science")
                {
                    Science frm = new Science(NewUserSlections);
                    frm.Show();
                }
                 else
                 {
                     Finish frm = new Finish();
                     frm.Show();
                 }
            }

                else
                {
                    Finish frm = new Finish();
                    frm.Show();
                }

            this.Close();
        }
Beispiel #32
0
        public static bool OnTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                //bool isAutonomous = Common.IsAutonomous(actor);

                VaccinationSessionSituation situation = VaccinationSessionSituation.GetVaccinationSessionSituation(actor);
                if (situation != null)
                {
                    if (situation.IsInIgnoreList(target))
                    {
                        return(false);
                    }
                    else if (!situation.IsInSeekersList(target) && !situation.IsInInterruptedList(target))
                    {
                        return(false);
                    }
                    else if (isAutonomous && (actor.GetDistanceToObject(target) > AutographSessionSituation.MaxDistanceForAutonomousSign))
                    {
                        return(false);
                    }

                    return(true);
                }
                else
                {
                    FreeClinicSessionSituation freeClinicSessionSituation = FreeClinicSessionSituation.GetFreeClinicSessionSituation(actor);
                    if (freeClinicSessionSituation != null)
                    {
                        if (freeClinicSessionSituation.IsInIgnoreList(target))
                        {
                            return(false);
                        }
                        else if (!freeClinicSessionSituation.IsInSeekersList(target) && !freeClinicSessionSituation.IsInInterruptedList(target))
                        {
                            return(false);
                        }
                        else if (isAutonomous && (actor.GetDistanceToObject(target) > AutographSessionSituation.MaxDistanceForAutonomousSign))
                        {
                            return(false);
                        }
                    }
                    else if (isAutonomous)
                    {
                        return(false);
                    }
                }

                Medical medical = actor.Occupation as Medical;
                return((medical != null) && (medical.Level >= 3));
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
Beispiel #33
0
        public static void OnAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                VaccinationSessionSituation situation = VaccinationSessionSituation.GetVaccinationSessionSituation(actor);
                if (situation != null)
                {
                    situation.NumVaccinations++;
                    situation.AddToIgnoreList(target);
                    situation.BringRandomSimsToSession(0x1);
                }
                else
                {
                    FreeClinicSessionSituation freeClinicSessionSituation = FreeClinicSessionSituation.GetFreeClinicSessionSituation(actor);
                    if (freeClinicSessionSituation != null)
                    {
                        freeClinicSessionSituation.NumVaccinations++;
                        freeClinicSessionSituation.AddToIgnoreList(target);
                        freeClinicSessionSituation.BringRandomSimsToSession(0x1);
                    }
                }

                Medical medical = actor.Occupation as Medical;
                if ((medical != null) && (medical.Level >= 3))
                {
                    string vectors = null;

                    List <VectorBooter.Item> items = new List <VectorBooter.Item>();

                    int cost = 0;

                    foreach (VectorBooter.Data vector in VectorBooter.Vectors)
                    {
                        if (VectorControl.Inoculate(target.SimDescription, vector, true, true))
                        {
                            vectors += Common.NewLine + " " + vector.GetLocalizedName(target.IsFemale);

                            cost += (vector.InoculationCost / 25);
                        }
                    }

                    if (string.IsNullOrEmpty(vectors))
                    {
                        if (situation == null)
                        {
                            Common.Notify(target, Common.Localize("Inoculate:None", target.IsFemale, new object[] { target }));
                        }
                    }
                    else
                    {
                        string paid = null;
                        if (cost > target.FamilyFunds)
                        {
                            cost = target.FamilyFunds;
                        }

                        target.ModifyFunds(-cost);

                        if (target.Household != actor.Household)
                        {
                            actor.ModifyFunds(cost);

                            if (cost > 0)
                            {
                                paid += Common.NewLine + Common.NewLine + Common.Localize("Inoculate:Paid", target.IsFemale, new object[] { cost });
                            }
                        }
                        else
                        {
                            if (cost > 0)
                            {
                                paid += Common.NewLine + Common.NewLine + Common.Localize("Inoculate:Charged", target.IsFemale, new object[] { cost });
                            }
                        }

                        Common.Notify(target, Common.Localize("Inoculate:Success", target.IsFemale, new object[] { target }) + vectors + paid);
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }