public ActionResult Edit(Sick sick)
        {
            db.Entry(sick).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Sick sick = db.sicks.Find(id);

            db.sicks.Remove(sick);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit(Guid Id)
        {
            Sick sick = db.Sick.Find(Id);

            ViewBag.SexId    = new SelectList(db.Sex.ToList(), "Id", "SexName");
            ViewBag.StatusId = new SelectList(db.Status.ToList(), "Id", "StatusName");

            return(View(sick));
        }
        public ActionResult Create(Sick sick)
        {
            sick.Id = Guid.NewGuid();

            db.Sick.Add(sick);

            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
예제 #5
0
 public ActionResult Edit([Bind(Include = "SickId,Place")] Sick sick)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sick).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sick));
 }
        public IHttpActionResult Delete(int id)
        {
            Sick sick = db.Sicks.Find(id);

            if (sick != null)
            {
                db.Sicks.Remove(sick);
                db.SaveChanges();
                return(Ok());
            }
            return(NotFound());
        }
        public ActionResult DetailViewBagResult(Guid Id)
        {
            Sick entity = db.Sick.Find(Id);

            ViewBag.SicknessName = db.Visit.Where(x => x.SickId == Id).ToList();
            //ViewBag.MdicineName = db.Visit.Where(x => x.UserId == Id).ToList();
            //Visit model = new Visit();
            //model.Sick entity = db.Sick.Find(Id);
            //model.visits = db.Visit.Where(x => x.s)

            return(View(entity));
        }
예제 #8
0
        public ActionResult Create([Bind(Include = "PeoplesId,places,Placeid")] Sick sick)
        {
            if (ModelState.IsValid)
            {
                string place = sick.places.City;
                sick.Place = place;
                db.sicks.Add(sick);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sick));
        }
예제 #9
0
        // GET: Sicks/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Sick sick = db.sicks.Find(id);

            if (sick == null)
            {
                return(HttpNotFound());
            }
            return(View(sick));
        }
        // PUT api/<controller>/5
        public IHttpActionResult Put(HttpRequestMessage request)
        {
            var  jsonString = request.Content.ReadAsStringAsync().Result;
            var  jsonObj    = JsonConvert.DeserializeObject <Dictionary <string, string> >(jsonString);
            Sick sick       = new Sick
            {
                Id        = int.Parse(jsonObj["id"]),
                Full_Name = jsonObj["pFullName"],
                Address   = jsonObj["pAddress"],
                Disease   = jsonObj["pDisease"],
                Form      = jsonObj["pForm"],
                Treatment = jsonObj["pTreatment"]
            };

            db.Entry(sick).State = EntityState.Modified;
            db.SaveChanges();
            return(Ok(sick));
        }
        // POST api/<controller>
        public IHttpActionResult Post(HttpRequestMessage request)
        {
            var jsonString = request.Content.ReadAsStringAsync().Result;
            var jsonObj    = JsonConvert.DeserializeObject <Dictionary <string, string> >(jsonString);

            Sick sick = new Sick
            {
                Full_Name = jsonObj["pFullName"],
                Address   = jsonObj["pAddress"],
                Disease   = jsonObj["pDisease"],
                Form      = jsonObj["pForm"],
                Treatment = jsonObj["pTreatment"]
            };

            db.Sicks.Add(sick);
            db.SaveChanges();
            return(Ok(sick));
        }
예제 #12
0
        private void Calcular_Click(object sender, EventArgs e)
        {
            double Aguinaldo, Vacaciones, Prima, Infonavit, Imss, Rcv;
            double Sgmm, Sgmmd, Vales, Comedor, Seguro, Personal, Sick;
            double Saldo, Ley, Empresa, Total;

            Aguinaldo  = (Convert.ToDouble(aguinaldo.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Vacaciones = (Convert.ToDouble(vacaciones.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Prima      = (Convert.ToDouble(prima.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Infonavit  = (Convert.ToDouble(infonavit.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Imss       = (Convert.ToDouble(imss.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Rcv        = (Convert.ToDouble(rcv.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Sgmm       = (Convert.ToDouble(sgmm.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Sgmmd      = Sgmm * (Convert.ToDouble(dependents.Text));
            Vales      = (Convert.ToDouble(vales.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Comedor    = Convert.ToDouble(comedor.Text);
            Seguro     = Convert.ToDouble(seguro.Text);
            Personal   = Convert.ToDouble(personal.Text);
            Sick       = Convert.ToDouble(sick.Text);

            aguinaldo2.Text  = Aguinaldo.ToString("C");
            vacaciones2.Text = Vacaciones.ToString("C");
            prima2.Text      = Prima.ToString("C");
            infonavit2.Text  = Infonavit.ToString("C");
            imss2.Text       = Imss.ToString("C");
            rcv2.Text        = Rcv.ToString("C");
            sgmm2.Text       = Sgmm.ToString("C");
            sgmmd2.Text      = Sgmmd.ToString("C");
            vales2.Text      = Vales.ToString("C");
            comedor2.Text    = Comedor.ToString("C");
            seguro2.Text     = Seguro.ToString("C");
            personal2.Text   = Personal.ToString("C");
            sick2.Text       = Sick.ToString("C");

            Saldo   = Convert.ToDouble(saldo1.Text);
            Ley     = Aguinaldo + Vacaciones + Prima + Infonavit + Imss + Rcv;
            Empresa = Sgmm + Sgmmd + Vales + Comedor + Seguro + Personal + Sick;;
            Total   = Saldo + Empresa + Ley;

            saldo2.Text  = Saldo.ToString("C");
            ley.Text     = Ley.ToString("C");
            empresa.Text = Empresa.ToString("C");
            total.Text   = Total.ToString("C");
        }
예제 #13
0
    /// <summary>
    /// This generates the conditions of the new cow
    /// </summary>
    private void GenerateConditions()
    {
        //:TODO: add individual variation into fuzzy distributions

        // Wellness - Physical conditions
        m_Pain    = new Pain(this);
        m_Sick    = new Sick(this);
        m_Wounded = new Wounded(this);
        m_Damage  = new Damage(this);
        m_Tired   = new Tired(this);
        m_Hungry  = new Hungry(this);
        m_Thirsty = new Thirsty(this);
        m_Dead    = new Dead(this);

        // Contentment - Mental conditions
        m_Anger  = new Angry(this);
        m_Sleepy = new Sleepy(this);
        m_Scared = new Scared(this);
        m_Bored  = new Bored(this);
        m_Lonely = new Lonely(this);
        m_Happy  = new Happy(this);
        m_Eager  = new Eager(this);
    }
        public ActionResult Detail(Guid Id)
        {
            Sick entity = db.Sick.Find(Id);

            return(View(entity));
        }