Ejemplo n.º 1
0
        ///<summary>If an appt is already on the pinboard, and the information in it is change externally, this 'refreshes' the data.</summary>
        public void ResetData(long aptNum)
        {
            ContrApptSingle ctrl = apptList.FirstOrDefault(x => x.AptNum == aptNum);

            if (ctrl == null)
            {
                return;
            }
            DataTable tableAppts = Appointments.RefreshOneApt(aptNum, false).Tables["Appointments"];
            DataRow   row        = tableAppts.Rows[0];

            if (row["AptStatus"].ToString() == "6")           //planned so do it again the right way
            {
                tableAppts = Appointments.RefreshOneApt(aptNum, true).Tables["Appointments"];
                row        = tableAppts.Rows[0];
            }
            //The appt fields are not in DS.Tables["ApptFields"] since the appt is not visible on the schedule.
            DataTable tableApptFields = Appointments.GetApptFields(tableAppts);

            ctrl.ResetData(row
                           , tableApptFields
                           , Appointments.GetPatFields(tableAppts.Select().Select(x => PIn.Long(x["PatNum"].ToString())).ToList())
                           , ctrl.Location
                           , false);
            ctrl.Width = this.Width - 2;
            Invalidate();
        }
Ejemplo n.º 2
0
        ///<summary>Gets the data necesary to load FormApptEdit.</summary>
        public static LoadData GetLoadData(Appointment AptCur, bool IsNew)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <LoadData>(MethodBase.GetCurrentMethod(), AptCur, IsNew));
            }
            LoadData data = new LoadData();

            data.ListProcsForAppt = Procedures.GetProcsForApptEdit(AptCur);
            data.ListAppointments = Appointments.GetAppointmentsForProcs(data.ListProcsForAppt);
            data.Family           = Patients.GetFamily(AptCur.PatNum);
            data.ListPatPlans     = PatPlans.Refresh(AptCur.PatNum);
            data.ListInsSubs      = InsSubs.RefreshForFam(data.Family);
            data.ListBenefits     = Benefits.Refresh(data.ListPatPlans, data.ListInsSubs);
            data.ListInsPlans     = InsPlans.RefreshForSubList(data.ListInsSubs);
            data.TableApptFields  = Appointments.GetApptFields(AptCur.AptNum);
            data.TableComms       = Appointments.GetCommTable(AptCur.PatNum.ToString(), AptCur.AptNum);
            data.Lab          = (IsNew ? null : LabCases.GetForApt(AptCur));
            data.PatientTable = Appointments.GetPatTable(AptCur.PatNum.ToString());
            if (!PrefC.GetBool(PrefName.EasyHideDentalSchools))
            {
                data.ListStudents = ReqStudents.GetForAppt(AptCur.AptNum);
            }
            return(data);
        }
Ejemplo n.º 3
0
        ///<Summary>Supply an aptNum to get the corresponding DataRow and DataTables necessary to create the ContrApptSingle. Calls directly to database.</Summary>
        public ContrApptSingle AddAppointment(long aptNum)
        {
            DataTable tableAppts = Appointments.RefreshOneApt(aptNum, false).Tables["Appointments"];
            DataRow   row        = tableAppts.Rows[0];

            if (row["AptStatus"].ToString() == "6")           //planned so do it again the right way
            {
                tableAppts = Appointments.RefreshOneApt(aptNum, true).Tables["Appointments"];
                row        = tableAppts.Rows[0];
            }
            //The appt fields are not in DS.Tables["ApptFields"] since the appt is not visible on the schedule.
            DataTable tableApptFields = Appointments.GetApptFields(tableAppts);

            return(AddAppointment(row, tableApptFields, Appointments.GetPatFields(tableAppts.Select().Select(x => PIn.Long(x["PatNum"].ToString())).ToList())));
        }