Beispiel #1
0
        public ActionResult AssignPatients(int id)
        {
            EHMSEntities ent = new EHMSEntities();
            DemandPatientAssignmentModel model = new DemandPatientAssignmentModel();

            model.OpdModelList = new List <OpdModel>();
            model.DemandId     = id;

            var list = (from om in ent.OpdMasters
                        join
                        pa in ent.DemandPatientAssignments on om.OpdID equals pa.OpdId
                        join
                        dm in ent.ItemDemandMasters on pa.DemandId equals dm.ItemDemandID
                        where pa.DemandId == model.DemandId && pa.Status == true
                        select new { om, pa, dm }).ToList();

            foreach (var item in list)
            {
                OpdModel omodel = new OpdModel();
                omodel.FirstName        = item.om.FirstName;
                omodel.MiddleName       = item.om.MiddleName;
                omodel.LastName         = item.om.LastName;
                omodel.MobileNumber     = item.pa.Remarks;
                omodel.RegistrationMode = item.dm.ItemDemandNo;
                omodel.OpdID            = item.om.OpdID;
                model.OpdModelList.Add(omodel);
            }

            return(View(model));
        }
Beispiel #2
0
        public ActionResult PatientList()
        {
            DemandPatientAssignmentModel model = new DemandPatientAssignmentModel();

            model.OpdModelList = new List <OpdModel>();

            return(PartialView("PatientList"));
        }
        public void AssignPatients(DemandPatientAssignmentModel model)
        {
            EHMSEntities            ent = new EHMSEntities();
            DemandPatientAssignment obj = new DemandPatientAssignment();

            try
            {
                foreach (var item in model.OpdModelList)
                {
                    if (ent.DemandPatientAssignments.Where(x => x.OpdId == item.OpdID && x.Status == true).Any() == false)
                    {
                        obj.DemandId = model.DemandId;
                        obj.OpdId    = item.OpdID;
                        obj.Remarks  = model.Remarks;
                        obj.Status   = true;
                        ent.DemandPatientAssignments.Add(obj);
                        ent.SaveChanges();
                    }
                }
            }
            catch { }
        }
Beispiel #4
0
 public ActionResult AssignPatients(DemandPatientAssignmentModel model)
 {
     pro.AssignPatients(model);
     return(RedirectToAction("Index"));
 }