Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HisIncharge hisIncharge = db.HisIncharges.Find(id);

            db.HisIncharges.Remove(hisIncharge);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Remarks,AccntUserId")] HisIncharge hisIncharge)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hisIncharge).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(hisIncharge));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Name,Remarks,AccntUserId")] HisIncharge hisIncharge)
        {
            if (ModelState.IsValid)
            {
                db.HisIncharges.Add(hisIncharge);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(hisIncharge));
        }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "Id,RecType,Recipient,Message,DtSending,RefId,RefTable")] HisNotification hisNotification)
        {
            if (ModelState.IsValid)
            {
                db.HisNotifications.Add(hisNotification);

                Models.HisProfileReq request = db.HisProfileReqs.Find(hisNotification.RefId);
                request.dtRequested = DateTime.Now;
                request.dtSchedule  = hisNotification.DtSending;

                //create contact lists

                HisNotificationRecipient recipient = new HisNotificationRecipient();
                recipient.HisNotificationId = hisNotification.Id;

                //get contact number of physician
                HisPhysician physician        = db.HisPhysicians.Where(s => s.Id == request.HisPhysicianId).FirstOrDefault();
                var          notify_Physician = new HisNotificationRecipient //Make sure you have a table called test in DB
                {
                    HisNotificationId = hisNotification.Id,
                    ContactInfo       = physician.ContactInfo
                };

                //get contact number of incharge
                HisIncharge incharge = db.HisIncharges.Where(s => s.Id == request.HisInchargeId).FirstOrDefault();
                HisNotificationRecipient notify_inchage = new HisNotificationRecipient
                {
                    HisNotificationId = hisNotification.Id,
                    ContactInfo       = incharge.ContactInfo
                };

                //get contact info of client (hisprofile)
                HisProfile client = db.HisProfiles.Where(s => s.Id == request.HisProfileId).FirstOrDefault();
                HisNotificationRecipient notify_client = new HisNotificationRecipient
                {
                    HisNotificationId = hisNotification.Id,
                    ContactInfo       = client.ContactInfo
                };

                //add to database
                db.HisNotificationRecipients.Add(notify_Physician);
                db.HisNotificationRecipients.Add(notify_inchage);
                db.HisNotificationRecipients.Add(notify_client);
                db.SaveChanges();

                //HIS10/HisProfileReqs?RptType=1&status=0
                // return RedirectToAction("Details", "HisNotifications", new { id = hisNotification.Id });

                View(hisNotification);
            }

            return(View(hisNotification));
        }
Ejemplo n.º 5
0
        // GET: HIS10/HisIncharges/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HisIncharge hisIncharge = db.HisIncharges.Find(id);

            if (hisIncharge == null)
            {
                return(HttpNotFound());
            }
            return(View(hisIncharge));
        }
        // GET: HIS10/HisProfileIncharges
        public ActionResult Index()
        {
            if (Session["CURRENT_INCHARGE_ID"] == null)
            {
                return(RedirectToAction("ListInCharge"));
            }

            int TmpId = (int)Session["CURRENT_INCHARGE_ID"];

            ViewBag.CurrentIncharge = TmpId;

            HisIncharge profile = db.HisIncharges.Find(TmpId);

            //if (tmpdata == null)

            ViewBag.InChargeDetail = profile.Id + " - " + profile.Name;

            var hisProfileIncharges = db.HisProfileIncharges.Include(h => h.HisProfile).Include(h => h.HisIncharge)
                                      .Where(d => d.HisInchargeId == TmpId);

            return(View(hisProfileIncharges.ToList()));
        }