public ActionResult FromBuildingDetails(int id)
        {
            var IcuSeat   = _context.Seats.Where(x => x.Where == "ICU").ToList();
            var CountSeat = IcuSeat.Count(x => x.WhereID == id);

            ViewBag.IcuId     = id;
            ViewBag.CountSeat = CountSeat;
            ICU model = _context.Icu.FirstOrDefault(x => x.BuildingId == id);

            return(View(model));
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            if (args == null || args.Count() < 2)
            {
                Console.WriteLine("Please specify 2 arguments: operation filename");
                return;
            }

            var operation = args[0];
            var filename  = args[1];

            ICU.DoOperation(operation, filename);
        }
Exemplo n.º 3
0
        public void TestICU()
        {
            ICU     obj = new ICU();
            Patient p   = new Patient();

            p.PatientId    = "JW3214";
            p.PulseRate    = 72;
            p.Spo2         = 94;
            p.Temperature  = 98.6;
            p.BedNo        = 4;
            obj.ICUPatient = p;
            Assert.AreEqual(98.6, obj.ICUPatient.Temperature);
            Assert.AreEqual(94, obj.ICUPatient.Spo2);
            Assert.AreEqual(72, obj.ICUPatient.PulseRate);
            Assert.AreEqual("JW3214", obj.ICUPatient.PatientId);
            Assert.AreEqual(4, obj.ICUPatient.BedNo);
        }
        public ActionResult FromBuildingCreate(ICU collection, int BuildingId)
        {
            try
            {
                // TODO: Add insert logic here
                collection.BuildingName = _context.Building.FirstOrDefault(x => x.Id == BuildingId).BuildingName;
                collection.FloorNumber  = _context.Floors.FirstOrDefault(x => x.Id == collection.FloorId).FloorNumber;
                collection.ICUName      = collection.BuildingName + " - ICU";
                collection.Updated      = DateTime.Now;
                collection.UpdatedBy    = User.Identity.Name;

                _context.Icu.Add(collection);
                _context.SaveChanges();

                return(RedirectToAction("Details", "Building", new { id = BuildingId }));
            }
            catch
            {
                return(View());
            }
        }