コード例 #1
0
        public JsonResult jsonSubmitCommunicationMethod(ReferringPractice prac)
        {
            string            result  = "";
            ReferringPractice newPrac = DataCollections.getPractice(db, prac.PracID);

            newPrac.EmailNotification = prac.EmailNotification;
            newPrac.FaxNotification   = prac.FaxNotification;

            DataSubmissions.SavePractice(db, newPrac);

            result = "Communication Methods Saved";
            return(Json(result));
        }
コード例 #2
0
        public JsonResult jsonSubmitPracticeInformation(ReferringPractice prac)
        {
            string            result  = "";
            ReferringPractice newPrac = DataCollections.getPractice(db, prac.PracID);

            newPrac.Address1      = prac.Address1;
            newPrac.Address2      = prac.Address2;
            newPrac.Address3      = prac.Address3;
            newPrac.City          = prac.City;
            newPrac.State         = prac.State;
            newPrac.Zip           = prac.Zip;
            newPrac.Phone         = prac.Phone;
            newPrac.Fax           = prac.Fax;
            newPrac.Email         = prac.Email;
            newPrac.OfficeManager = prac.OfficeManager;
            newPrac.Other         = prac.Other;
            newPrac.PDFPassword   = prac.PDFPassword;

            DataSubmissions.SavePractice(db, newPrac);

            result = "Practice Information Saved";
            return(Json(result));
        }
コード例 #3
0
        public ActionResult EditPreferences(PracticeAdminEditPreferencesViewModel viewM)
        {
            PracticeAdminEditPreferencesViewModel returnM = new PracticeAdminEditPreferencesViewModel();
            ReferringPractice oldPrac;

            returnM.practices = DataCollections.getPractices(db, HubSecurity.getLoggedInUserID());
            int id;

            if (viewM.UpdatePracticeInformation != null)
            {
                if (viewM.hidAll == "true")
                {
                    foreach (SelectListItem prac in returnM.practices)
                    {
                        if (prac.Value == "ALL")
                        {
                            continue;
                        }
                        id                    = Convert.ToInt32(prac.Value);
                        oldPrac               = (from r in db.ReferringPractices where r.PracID == id select r).Single();
                        oldPrac.Address1      = viewM.selectedPrac.Address1;
                        oldPrac.Address2      = viewM.selectedPrac.Address2;
                        oldPrac.Address3      = viewM.selectedPrac.Address3;
                        oldPrac.City          = viewM.selectedPrac.City;
                        oldPrac.State         = viewM.selectedPrac.State;
                        oldPrac.Zip           = viewM.selectedPrac.Zip;
                        oldPrac.Phone         = viewM.selectedPrac.Phone;
                        oldPrac.Fax           = viewM.selectedPrac.Fax;
                        oldPrac.OfficeManager = viewM.selectedPrac.OfficeManager;
                        oldPrac.Other         = viewM.selectedPrac.Other;
                        oldPrac.PDFPassword   = viewM.selectedPrac.PDFPassword;
                        DataSubmissions.SavePractice(db, oldPrac);
                    }
                }
                else
                {
                    oldPrac               = (from r in db.ReferringPractices where r.PracID == viewM.selectedPrac.PracID select r).Single();
                    oldPrac.Address1      = viewM.selectedPrac.Address1;
                    oldPrac.Address2      = viewM.selectedPrac.Address2;
                    oldPrac.Address3      = viewM.selectedPrac.Address3;
                    oldPrac.City          = viewM.selectedPrac.City;
                    oldPrac.State         = viewM.selectedPrac.State;
                    oldPrac.Zip           = viewM.selectedPrac.Zip;
                    oldPrac.Phone         = viewM.selectedPrac.Phone;
                    oldPrac.Fax           = viewM.selectedPrac.Fax;
                    oldPrac.OfficeManager = viewM.selectedPrac.OfficeManager;
                    oldPrac.Other         = viewM.selectedPrac.Other;
                    oldPrac.PDFPassword   = viewM.selectedPrac.PDFPassword;
                    DataSubmissions.SavePractice(db, oldPrac);
                }
            }
            if (viewM.UpdateCommunicationMethod != null)
            {
                if (viewM.hidAll == "true")
                {
                    foreach (SelectListItem prac in returnM.practices)
                    {
                        if (prac.Value == "ALL")
                        {
                            continue;
                        }
                        id      = Convert.ToInt32(prac.Value);
                        oldPrac = (from r in db.ReferringPractices where r.PracID == id select r).Single();
                        oldPrac.EmailNotification = viewM.selectedPrac.EmailNotification;
                        oldPrac.FaxNotification   = viewM.selectedPrac.FaxNotification;
                        DataSubmissions.SavePractice(db, oldPrac);
                    }
                }
                else
                {
                    oldPrac = (from r in db.ReferringPractices where r.PracID == viewM.selectedPrac.PracID select r).Single();
                    oldPrac.EmailNotification = viewM.selectedPrac.EmailNotification;
                    oldPrac.FaxNotification   = viewM.selectedPrac.FaxNotification;
                    DataSubmissions.SavePractice(db, oldPrac);
                }
            }

            returnM.practices    = DataCollections.getPractices(db, HubSecurity.getLoggedInUserID());
            returnM.selectedPrac = DataCollections.getPractice(db, viewM.hidPrac);
            returnM.specialties  = DataCollections.getSpecialties(db, viewM.selectedPrac.PracID);
            returnM.hidPrac      = viewM.hidPrac;
            returnM.tabReturn    = viewM.tabReturn;
            returnM.hidAll       = viewM.hidAll;

            return(View(returnM));
        }