Ejemplo n.º 1
0
        public ActionResult saveConnectionId(string conId, int userId)
        {
            try {
                var user = db.users.Where(e => e.userId == userId).First();
                user.connectionid    = conId;
                user.status          = "online";
                db.Entry(user).State = EntityState.Modified;
                db.SaveChanges();

                var userInfo = db.users.Where(x => x.userId == userId).Select(e => new { e.userId, e.firstname, e.middlename, e.lastname, e.profpath, e.coverpath, e.status, e.username, e.connectionid }).ToList();
                return(Json(userInfo, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json("Failed", JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 2
0
        public ActionResult updateProject(project project, int[] users, int[] Rusers)
        {
            //try {


            db.Entry(project).State = EntityState.Modified;
            db.SaveChanges();



            if (users != null)
            {
                for (int i = 0; i < users.Length; i++)
                {
                    int userId = users[i];
                    var pps    = db.participants.Where(e => e.projId == project.projId && e.userId == userId).ToList();
                    if (pps.Count() == 1)
                    {
                        participant pp = pps[0];
                        pp.status          = "Active";
                        db.Entry(pp).State = EntityState.Modified;
                        db.SaveChanges();
                    }
                    else
                    {
                        participant pp = new participant();
                        pp.projId = project.projId;
                        pp.userId = users[i];
                        pp.status = "Active";
                        db.participants.Add(pp);
                        db.SaveChanges();
                    }
                }
            }


            if (Rusers != null)
            {
                for (int i = 0; i < Rusers.Length; i++)
                {
                    var userId      = Rusers[i];
                    var participant = db.participants.Where(e => e.projId == project.projId && e.userId == userId).First();
                    participant.status          = "Removed";
                    db.Entry(participant).State = EntityState.Modified;
                    db.SaveChanges();
                }
            }


            return(Json("Success", JsonRequestBehavior.AllowGet));
            //}
            //catch (Exception e)
            //{
            //    return Json("Success", JsonRequestBehavior.AllowGet);
            //}
        }
Ejemplo n.º 3
0
        public void UpdatePatient(Patient patient)
        {
            _pmisEntities.Patients.Attach(patient);

            _pmisEntities.Entry(patient).State = EntityState.Modified;
        }
Ejemplo n.º 4
0
        public void UpdateMedicalRecord(MedicalRecord record)
        {
            _pmisEntities.MedicalRecords.Attach(record);

            _pmisEntities.Entry(record).State = EntityState.Modified;
        }
Ejemplo n.º 5
0
 public void UpdatePhysician(Physician physician)
 {
     _pmisEntities.Physicians.Attach(physician);
     _pmisEntities.Entry(physician).State = EntityState.Modified;
 }
Ejemplo n.º 6
0
        public void UpdatePrescription(Prescription prescription)
        {
            _pmisEntities.Prescriptions.Attach(prescription);

            _pmisEntities.Entry(prescription).State = EntityState.Modified;
        }
Ejemplo n.º 7
0
 public void ModifyAppointment(Appointment appointment)
 {
     _pmisEntities.Appointments.Attach(appointment);
     _pmisEntities.Entry(appointment).State = EntityState.Modified;
 }