Ejemplo n.º 1
0
        private void btnModfiy_Click(object sender, EventArgs e)
        {
            IVaccineStorage vaccineStorage = new VaccineStorage();
            Vaccine         vaccine        = new Vaccine();

            if (textVaccineName.Text.Trim() == "" || textVaccineSort.Text.Trim() == "" ||
                cmbManufacturersName.Text.Trim() == "" || textVaccinePrice.Text.Trim() == "" ||
                textVaccineQuantity.Text.Trim() == "")
            {
                MessageBox.Show("请双击需要修改的记录!");
            }
            else
            {
                vaccine.VaccineName     = textVaccineName.Text;
                vaccine.VaccineSort     = textVaccineSort.Text;
                vaccine.ManufacturersID = Convert.ToInt32(cmbManufacturersName.SelectedValue.ToString());
                vaccine.VaccinePrice    = Convert.ToDecimal(textVaccinePrice.Text.Trim());
                vaccine.VaccineQuantity = Convert.ToInt32(textVaccineQuantity.Text.Trim());
                vaccine.VaccineID       = Convert.ToInt32(dgvVaccine[0, dgvVaccine.CurrentCell.RowIndex].Value.ToString());

                vaccineStorage.UpdateVaccine(vaccine);

                MessageBox.Show("更新成功!");

                textVaccineName.Text      = "";
                textVaccineSort.Text      = "";
                cmbManufacturersName.Text = "";
                textVaccinePrice.Text     = "";
                textVaccineQuantity.Text  = "";
            }
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            IVaccineStorage vaccineStorage = new VaccineStorage();
            Vaccine         vaccine        = new Vaccine();

            if (textVaccineName.Text.Trim() == "" || textVaccineSort.Text.Trim() == "" ||
                cmbManufacturersName.Text.Trim() == "" || textVaccinePrice.Text.Trim() == "" ||
                textVaccineQuantity.Text.Trim() == "")
            {
                MessageBox.Show("请输入全部信息,不要有遗漏。");
            }
            else
            {
                vaccine.VaccineName     = textVaccineName.Text.Trim();
                vaccine.VaccineSort     = textVaccineSort.Text.Trim();
                vaccine.ManufacturersID = Convert.ToInt32(cmbManufacturersName.SelectedValue.ToString());    //SelectedValue取后台的ID
                vaccine.VaccinePrice    = Convert.ToDecimal(textVaccinePrice.Text.Trim());
                vaccine.VaccineQuantity = Convert.ToInt32(textVaccineQuantity.Text.Trim());

                vaccineStorage.CreateVaccine(vaccine);

                MessageBox.Show("增加成功!");

                textVaccineName.Text      = "";
                textVaccineSort.Text      = "";
                cmbManufacturersName.Text = "";
                textVaccinePrice.Text     = "";
                textVaccineQuantity.Text  = "";
            }
        }
Ejemplo n.º 3
0
        Vaccine IVaccineManager.ReadVaccine(
            IVaccineStorage pStorage,
            int pVaccineID)
        {
            Vaccine response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pStorage, "pStorage");
                Verify.ArgumentNotSpecified(
                    pVaccineID <= 0,
                    "pVaccineID");
                #endregion

                response =
                    pStorage.ReadVaccine(pVaccineID);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
        public Response <VaccineDTO> Post(VaccineDTO vaccineDTO)
        {
            try
            {
                using (VDEntities entities = new VDEntities())
                {
                    Vaccine vaccinedb = Mapper.Map <Vaccine>(vaccineDTO);
                    entities.Vaccines.Add(vaccinedb);
                    entities.SaveChanges();
                    vaccineDTO.ID = vaccinedb.ID;
                    //add vaccine in brand
                    Brand dbBrand = new Brand();
                    dbBrand.VaccineID = vaccinedb.ID;
                    dbBrand.Name      = "Local";
                    entities.Brands.Add(dbBrand);
                    entities.SaveChanges();

                    return(new Response <VaccineDTO>(true, null, vaccineDTO));
                }
            }
            catch (Exception e)
            {
                return(new Response <VaccineDTO>(false, GetMessageFromExceptionObject(e), null));
            }
        }
Ejemplo n.º 5
0
 public string History(string type)
 {
     if (type == "Chip")
     {
         return(Chiping.History());
     }
     else if (type == "DentalCare")
     {
         return(Dental.History());
     }
     else if (type == "Fitness")
     {
         return(FitnessPr.History());
     }
     else if (type == "NailTrim")
     {
         return(NailJob.History());
     }
     else if (type == "Play")
     {
         return(Playing.History());
     }
     else
     {
         return(Vaccine.History());
     }
 }
        public JsonResult ValidateEditVaccine(Vaccine vaccine)
        {
            var status  = true;
            var message = String.Empty;

            if (db.Vaccines.ToList().Exists(v => v.PetId == vaccine.PetId & v.VaccineNumber <vaccine.VaccineNumber& v.VaccineDate> vaccine.VaccineDate))
            {
                status  = false;
                message = "No es posible modificar la fecha de una vacuna a una fecha inferior a la de su Nro Ordinal anterior";
            }

            if (db.Vaccines.ToList().Exists(v => v.PetId == vaccine.PetId & v.VaccineNumber > vaccine.VaccineNumber & v.VaccineDate < vaccine.VaccineDate))
            {
                status  = false;
                message = "No es posible modificar la fecha de una vacuna a una fecha superior a la de su siguiente Nro Ordinal";
            }

            var editVaccine = db.Vaccines.Find(vaccine.VaccineId);
            var done        = editVaccine.Done ? "Si" : "No";

            if (status)
            {
                editVaccine.VaccineDate     = vaccine.VaccineDate;
                db.Entry(editVaccine).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(new JsonResult {
                Data = new { status = status, message = message, vaccineId = vaccine.VaccineId, dateTitle = vaccine.VaccineDate.ToString("D"), done = done }
            });
        }
        public static int getVaccineID()
        {
            IManufacturersStorage pManufacturersStorage = new ManufacturersStorage();
            Manufacturers         myManufacturers       = CreateManufacturersForTest(
                "供应商",
                "浙江温州",
                "17733117779",
                "2013-06-30",
                "2016-06-30");

            Manufacturers createdManufacturers =
                pManufacturersStorage.CreateManufacturers(myManufacturers);


            IVaccineStorage pVaccineStorage = new VaccineStorage();
            Vaccine         myVaccine       = CreateVaccineForTest(
                "狂犬疫苗",
                "处方",
                createdManufacturers.ManufacturersID,
                "68.00",
                "45");

            Vaccine createdVaccine =
                pVaccineStorage.CreateVaccine(myVaccine);

            return(createdVaccine.VaccineID);
        }
Ejemplo n.º 8
0
    protected override void onStart()
    {
        unreadMessages       = chatContent.transform.GetChild(0);
        playerMessagePrefab  = chatContent.GetComponent <ChatPrefabs>().PlayerMessage;
        advisorMessagePrefab = chatContent.GetComponent <ChatPrefabs>().AdvisorMessage;
        panelAnimator        = chatContent.GetComponentInParent <Animator>();
        scrollRect           = chatContent.GetComponentInParent <ScrollRect>();

        // Récupération de l'échelle de temps
        time = simulationData.GetComponent <TimeScale>();
        // Récupération de données de la frontière
        frontierPermeability = simulationData.GetComponent <FrontierPermeability>();
        // Récupération de données des impôts de entreprises
        tax = simulationData.GetComponent <Tax>();
        // Récupération de données du télétravail
        remoteworking = simulationData.GetComponent <Remoteworking>();
        // Récupération de données du chômage partiel
        shortTimeWorking = simulationData.GetComponent <ShortTimeWorking>();
        // Récupération des masques
        masks = simulationData.GetComponent <Masks>();
        // Récupération des données du vaccin
        vaccine = simulationData.GetComponent <Vaccine>();

        f_chatMessage.addEntryCallback(OnNewMessage);
    }
Ejemplo n.º 9
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Lot,DrugId,BrandId")] Vaccine vaccine)
        {
            if (id != vaccine.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vaccine);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VaccineExists(vaccine.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrandId"] = new SelectList(_context.Brands, "Id", "Name", vaccine.BrandId);
            ViewData["DrugId"]  = new SelectList(_context.Drugs, "Id", "Name", vaccine.DrugId);
            return(View(vaccine));
        }
Ejemplo n.º 10
0
        public void VaccineUpdateSuccessFive()
        {
            IVaccineStorage vaccineStorage = new VaccineStorage();
            Vaccine         myVaccine      = CreateVaccineForTest(
                "狂犬疫苗1",
                "处方1",
                getManufacturersIDtwo(),
                "68.00",
                "45");

            Vaccine createdVaccine =
                vaccineStorage.CreateVaccine(myVaccine);

            Assert.AreNotEqual(
                0,
                createdVaccine.VaccineID,
                string.Format("Could not create Vaccine:{0}",
                              createdVaccine.VaccineID));

            myVaccine.VaccineQuantity = Convert.ToInt32("60");

            vaccineStorage.UpdateVaccine(myVaccine);

            Vaccine updatedVaccine = vaccineStorage.ReadVaccine(
                createdVaccine.VaccineID);

            AssertVaccineItemEqual(myVaccine, updatedVaccine);
        }
Ejemplo n.º 11
0
        private static VaccineView GetVaccine(string name)
        {
            VaccineDAL     vaccineHandler = new VaccineDAL();
            List <Vaccine> vaccines       = vaccineHandler.GetList();
            Vaccine        vaccine        = vaccines.Where(v => v.name == name).FirstOrDefault();

            if (vaccine != null)
            {
                return(new VaccineView
                {
                    Cost = vaccine.cost.ToString(),
                    Id = vaccine.id.ToString(),
                    Description = vaccine.description.Trim(),
                    Name = vaccine.name.Trim(),
                    Type = vaccine.type.Trim(),
                    Disease = vaccine.disease.Trim(),
                    Living = vaccine.living.ToString(),
                    Preparation = vaccine.preparation.Trim(),
                });
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 12
0
        public async Task <IActionResult> Edit(int id, [Bind("VaccineId,Brand,VaccineType,ExpirationDate,ValidityPeriod")] Vaccine vaccine)
        {
            if (id != vaccine.VaccineId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vaccine);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VaccineExists(vaccine.VaccineId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vaccine));
        }
Ejemplo n.º 13
0
        public ActionResult New()
        {
            Vaccine vaccine = new Vaccine();

            vaccine.Animals = new List <Animal>();
            return(View(vaccine));
        }
Ejemplo n.º 14
0
        public IHttpActionResult PutVaccine(int id, Vaccine vaccine)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != vaccine.Id)
            {
                return(BadRequest());
            }

            db.Entry(vaccine).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VaccineExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 15
0
 public bool UpdateVaccine(VaccineModel model)
 {
     using (ISession session = NHibernateSession.OpenSession())
     {
         Vaccine foundvaccine = session.Query <Vaccine>().FirstOrDefault(c => c.VaccineId == model.VaccineId.Value);
         if (foundvaccine == null)
         {
             return(false);
         }
         foundvaccine.Modified   = DateTime.UtcNow;
         foundvaccine.Comments   = model.Comments;
         foundvaccine.Title      = model.Title;
         foundvaccine.Expiration = model.Expiration;
         foundvaccine.Received   = model.Received;
         foundvaccine.Doctor     = model.Doctor;
         foundvaccine.Company    = model.Company;
         foundvaccine.Address    = model.Address;
         using (ITransaction transaction = session.BeginTransaction()) //  Begin a transaction
         {
             session.Update(foundvaccine);                             //  Save the user in session
             transaction.Commit();                                     //  Commit the changes to the database
         }
     }
     return(true);
 }
Ejemplo n.º 16
0
        public async Task <Vaccine> DeleteVaccineAsync(Vaccine vaccine2Bdeleted)
        {
            _context.Vaccine.Remove(vaccine2Bdeleted);
            await _context.SaveChangesAsync();

            return(vaccine2Bdeleted);
        }
Ejemplo n.º 17
0
 public VaccineDetailPage(Vaccine vaccine)
 {
     //InitializeComponent();
     //BindingContext = viewModel = new VaccineDetailViewModel(vaccine);
     viewModel = new VaccineDetailViewModel(vaccine);
     Content   = ContentBuilder(vaccine);
 }
Ejemplo n.º 18
0
        //public class Blue
        //{
        //    public int X { get; set; }
        //    public int Y
        //    {
        //        get; set;
        //    }
        //    public int T { get; set; }
        //}
        //List<Blue> panel = new List<Blue>();
        //List<Blue> Undo_history = new List<Blue>();


        private void Form1_Load(object sender, EventArgs e)
        {
            //this.button1.Visible = false;
            //this.textBox1.Visible = false;
            testApp = new SharpConnect.AppHost();
            Undo_Data undo = new Undo_Data();

            undo.DataArrived += DataArrived;
            undo.LoadData    += LoadData;
            //about
            About about = new About();

            about.Comment_Arrived += About_Comment_Arrived;
            //vaccine
            Vaccine vaccine = new Vaccine();

            vaccine.Load_vaccine += Load_vaccine;
            //user login
            Users login = new Users();

            login.Login += Login;
            //health
            Health health = new Health();

            health.Load_age_gender += Health_Load_age_gender;
            //appointment
            Notification appointment = new Notification();

            appointment.Load_Appointment += Load_Appoinement;

            testApp.RegisterModule(health);
            testApp.RegisterModule(vaccine);
            testApp.RegisterModule(about);
            testApp.RegisterModule(appointment);
            testApp.RegisterModule(login);

            string name = "[1,2,3,4,5]";
            JArray con  = JArray.Parse(name);


            Console.WriteLine(con);

            //testApp.RegisterModule(new MyModule());
            //testApp.RegisterModule(new MyModule2());
            //testApp.RegisterModule(new MyModule3());
            //testApp.RegisterModule(new MyAdvanceMathModule());
            //testApp.RegisterModule(new MMath1());
            //testApp.RegisterModule(new Undo_Data());
            //1. create
            WebServer webServer = new WebServer(8082, false, testApp.HandleRequest);
            //test websocket
            var webSocketServer = new WebSocketServer();

            webSocketServer.SetOnNewConnectionContext(ctx =>
            {
                ctx.SetMessageHandler(testApp.HandleWebSocket);
            });
            webServer.WebSocketServer = webSocketServer;
            webServer.Start();
        }
Ejemplo n.º 19
0
        public IHttpActionResult PostVaccine(Vaccine vaccine)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Vaccine.Add(vaccine);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (VaccineExists(vaccine.Vac_Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = vaccine.Vac_Id }, vaccine));
        }
Ejemplo n.º 20
0
        public void AddPersonDiseaseInfo(string doctorId, string personId, PersonDiseaseInfoInputModel diseaseInputModel)
        {
            Vaccine vaccine   = null;
            int     vaccineId = this.vaccinesService.GetVaccineId(diseaseInputModel.Name);

            if (vaccineId == 0)
            {
                vaccineId = this.vaccinesService.Add(diseaseInputModel.Name);
                vaccine   = vaccinesService.GetVaccine(vaccineId);
            }
            else
            {
                vaccine = vaccinesService.GetVaccine(vaccineId);
            }

            PersonVaccine personVaccine = new PersonVaccine()
            {
                DoctorId    = doctorId,
                PersonId    = personId,
                Vaccine     = vaccine,
                DiagnosedOn = DateTime.Parse(diseaseInputModel.DiagnosedOn)
            };

            this.db.PersonVaccines.Add(personVaccine);
            this.db.SaveChanges();
        }
Ejemplo n.º 21
0
        public Vaccine setVaccine(DataTable dt)
        {
            Vaccine vacc = new Vaccine();

            if (dt.Rows.Count > 0)
            {
                vacc.reserve_vaccine_id = dt.Rows[0]["reserve_vaccine_id"].ToString();
                vacc.pid            = dt.Rows[0]["pid"].ToString();
                vacc.firstname      = dt.Rows[0]["firstname"].ToString();
                vacc.lastname       = dt.Rows[0]["lastname"].ToString();
                vacc.address        = dt.Rows[0]["address"].ToString();
                vacc.email          = dt.Rows[0]["email"].ToString();
                vacc.mobile         = dt.Rows[0]["mobile"].ToString();
                vacc.vaccine        = dt.Rows[0]["vaccine"].ToString();
                vacc.dose           = dt.Rows[0]["dose"].ToString();
                vacc.payment        = dt.Rows[0]["payment"].ToString();
                vacc.active         = dt.Rows[0]["active"].ToString();
                vacc.date_create    = dt.Rows[0]["date_create"].ToString();
                vacc.drug_allergy   = dt.Rows[0]["drug_allergy"].ToString();
                vacc.status_payment = dt.Rows[0]["status_payment"].ToString();
                vacc.disease        = dt.Rows[0]["disease"].ToString();
            }
            else
            {
                setVaccine(vacc);
            }
            return(vacc);
        }
Ejemplo n.º 22
0
        public bool CreateVaccine(VaccineModel model)
        {
            Vaccine newvaccine = new Vaccine
            {
                Comments   = model.Comments,
                Title      = model.Title,
                Expiration = model.Expiration,
                Received   = model.Received,
                Doctor     = model.Doctor,
                Company    = model.Company,
                Address    = model.Address,
                Created    = model.Created,
                Modified   = model.Modified,
                Deleted    = model.Deleted
            };

            using (ISession session = NHibernateSession.OpenSession())
            {
                Dog foundDog = session.Query <Dog>().FirstOrDefault(u => u.DogId == model.Dog.DogId.Value);
                if (foundDog == null)
                {
                    return(false);
                }
                newvaccine.Dog = foundDog;
                using (ITransaction transaction = session.BeginTransaction()) //  Begin a transaction
                {
                    session.Save(newvaccine);                                 //  Save the user in session
                    transaction.Commit();                                     //  Commit the changes to the database
                }
            }
            return(true);
        }
Ejemplo n.º 23
0
 private static void AssertVaccineItemEqual(
     Vaccine pVaccine,
     Vaccine pCreatedVaccine)
 {
     Assert.AreEqual(
         pVaccine.VaccineID,
         pCreatedVaccine.VaccineID,
         string.Format("VaccineID isn't equal!"));
     Assert.AreEqual(
         pVaccine.VaccineName,
         pCreatedVaccine.VaccineName,
         string.Format("VaccineName isn't equal!"));
     Assert.AreEqual(
         pVaccine.VaccineSort,
         pCreatedVaccine.VaccineSort,
         string.Format("VaccineSort isn't equal!"));
     Assert.AreEqual(
         pVaccine.ManufacturersID,
         pCreatedVaccine.ManufacturersID,
         string.Format("ManufacturersID isn't equal!"));
     Assert.AreEqual(
         pVaccine.VaccinePrice,
         pCreatedVaccine.VaccinePrice,
         string.Format("VaccinePrice isn't equal!"));
     Assert.AreEqual(
         pVaccine.VaccineQuantity,
         pCreatedVaccine.VaccineQuantity,
         string.Format("VaccineQuantity isn't equal!"));
 }
        private void FrmCreateEditBatchVaccine_Load(object sender, EventArgs e)
        {
            var formTitle = "";

            txtRecommendedDate.Visible = false;
            lblRecommendedDate.Visible = false;

            using (var batchService = _serviceFactory.Create <IBatchService>())
            {
                _batch = batchService.GetById(_stateController.CurrentSelectedBatch.Id);

                dtpStartDate.Value      = _batch.DateOfBirth;
                dtpEndDate.Value        = _batch.DateOfBirth.AddDays(_batch.GeneticLine.ProductionWeeks * 7);
                txtRecommendedDate.Text = "";
                formTitle = string.Format("Lote {0} - Crear Vacunación", _batch.Number.ToString());
            }

            using (var vaccineService = _serviceFactory.Create <IVaccineService>())
            {
                var vaccines = vaccineService.GetAllActive().OrderBy(x => x.Name).ToList();
                ddlVaccines.ValueMember   = "Id";
                ddlVaccines.DisplayMember = "Name";
                Vaccine item = new Vaccine();
                item.Name = "Seleccione una vacuna..";
                item.Id   = Guid.Empty;
                vaccines.Insert(0, item);
                ddlVaccines.DataSource = vaccines;
                //ddlVaccines.Items.Add(item);
            }

            if (_batchVaccineId != Guid.Empty)
            {
                //Editar
                using (var batchVaccineService = _serviceFactory.Create <IBatchVaccineService>())
                {
                    _batchVaccine = batchVaccineService.GetById(_batchVaccineId);
                    if (_batchVaccine.Vaccine.RecommendedDay.HasValue)
                    {
                        txtRecommendedDate.Text     = _batch.DateOfBirth.AddDays(_batchVaccine.Vaccine.RecommendedDay.Value).ToString();
                        txtRecommendedDate.ReadOnly = true;
                    }
                    else
                    {
                        txtRecommendedDate.Visible = false;
                        lblRecommendedDate.Visible = false;
                    }

                    dtpStartDate.Value = _batchVaccine.StartDate;
                    if (_batchVaccine.EndDate != null)
                    {
                        dtpEndDate.Value = _batchVaccine.EndDate.Value;
                    }
                    ddlVaccines.SelectedValue = _batchVaccine.VaccineId;
                    formTitle = string.Format("Lote {0} - Editar Vacunación", _batch.Number.ToString());
                }
            }

            this.Text = formTitle;
        }
Ejemplo n.º 25
0
    protected virtual void OnCollisionEnter(Collision collision)
    {
        int r = 0;

        if (collision.gameObject.GetComponent <Actor>() != null)
        {
            if (canSpread)
            {
                if (enfermedades != null)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        if (enfermedades[i].Contagiado && collision.gameObject.GetComponent <Actor>().enfermedades[i].Contagiado == false)
                        {
                            r = Random.Range(1, 101);
                            if (r <= collision.gameObject.GetComponent <Actor>().probabilidadDeContagio[i])
                            {
                                collision.gameObject.GetComponent <Actor>().enfermedades[i].Contagiado = true;
                            }
                        }
                    }
                }
            }
            StartCoroutine(WaitToSpread());
        }

        if (collision.gameObject.GetComponent <Vaccine>() != null)
        {
            Vaccine vacuna = collision.gameObject.GetComponent <Vaccine>();
            int     i      = vacuna.index;

            vacuna.PlaySonido();

            enfermedades[i].speedModifier = 1;
            enfermedades[i].Contagiado    = false;
            enfermedades[i].Manifestacion = false;
            enfermedades[i].Manifestado   = false;
            enfermedades[i].OnSet        -= enfermedades[i].InicialOnSet * 0.1f;
            enfermedades[i].OnSet         = Mathf.Clamp(enfermedades[i].OnSet, enfermedades[i].InicialOnSet * 0.5f, enfermedades[i].InicialOnSet);
            if (enfermedades[i].IsInvoking("Stun"))
            {
                enfermedades[i].CancelInvoke("Stun");
            }

            if (i == 2)
            {
                (enfermedades[2] as BlackDeath).counter = 0;
                if (enfermedades[2].IsInvoking("Increase"))
                {
                    enfermedades[2].CancelInvoke("Increase");
                }
            }
            tiempoContagiado[i]       = 0;
            tiempoParaMorir[i]        = 0;
            probabilidadDeContagio[i] = Mathf.Clamp(probabilidadDeContagio[i] - vacuna.tolerancia, 40, 100);

            Destroy(collision.gameObject);
        }
    }
Ejemplo n.º 26
0
        public ActionResult DeleteConfirmed(string id)
        {
            Vaccine vaccine = db.Vaccines.Find(id);

            db.Vaccines.Remove(vaccine);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 27
0
        //Vaccine CRUD Methods
        public async Task <Vaccine> AddVaccineAsync(Vaccine vaccine2Add)
        {
            await _context.Vaccine.AddAsync(vaccine2Add);

            await _context.SaveChangesAsync();

            return(vaccine2Add);
        }
Ejemplo n.º 28
0
 public VaccineViewModel(Vaccine vaccine)
 {
     this.Id        = vaccine.Id;
     this.Name      = vaccine.Name;
     this.AppliedAt = vaccine.AppliedAt;
     this.CreatedAt = vaccine.CreatedAt;
     this.UpdatedAt = vaccine.UpdatedAt;
 }
Ejemplo n.º 29
0
        public async Task <VaccineDto> GetVaccineAsync(int id)
        {
            Vaccine vaccine = await _vaccineRepo.GetAsync(id);

            VaccineDto result = _mapper.Map <VaccineDto>(vaccine);

            return(result);
        }
Ejemplo n.º 30
0
 public VaccineViewModel(Vaccine vaccine)
 {
     this.Vaccine = vaccine;
     if (vaccine != null)
     {
         VaccineId = vaccine.Id;
     }
 }