Ejemplo n.º 1
0
        ///<summary>Gets the data necessary from the database to run the appointment search logic.</summary>
        public static ApptSearchData GetDataForSearch(long aptNum, DateTime dateAfter, DateTime dateBefore, List <long> listProvNums, List <long> listOpNums
                                                      , List <long> listClinicNums, long blockoutType)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <ApptSearchData>(MethodBase.GetCurrentMethod(), aptNum, dateAfter, dateBefore, listProvNums, listOpNums, listClinicNums
                                                       , blockoutType));
            }
            ApptSearchData data = new ApptSearchData();

            data.DateEvaluating   = dateAfter.AddDays(1);
            data.AppointmentToAdd = Appointments.GetOneApt(aptNum);
            data.ListSchedules    = Schedules.GetSchedulesForAppointmentSearch(data.DateEvaluating, dateBefore, listClinicNums, listOpNums
                                                                               , listProvNums, blockoutType);
            //Get all appointments that exist in the operaotries we will be searching to find an opening, not just for provider we're looking for
            //so we can get conflicts when multiple provs work in a single operaotry.
            data.ListAppointments = Appointments.GetForPeriodList(data.DateEvaluating, dateBefore, listOpNums, listClinicNums);
            data.ListSchedOps     = ScheduleOps.GetForSchedList(data.ListSchedules, listOpNums);     //ops filter for case when a prov is scheduled in multiple ops
            return(data);
        }
Ejemplo n.º 2
0
        ///<summary></summary>
        public static void Update(Schedule sched)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), sched);
                return;
            }
            Validate(sched);
            Crud.ScheduleCrud.Update(sched);
            string command = "DELETE FROM scheduleop WHERE ScheduleNum=" + POut.Long(sched.ScheduleNum);

            Db.NonQ(command);
            ScheduleOp op;

            for (int i = 0; i < sched.Ops.Count; i++)
            {
                op              = new ScheduleOp();
                op.ScheduleNum  = sched.ScheduleNum;
                op.OperatoryNum = sched.Ops[i];
                ScheduleOps.Insert(op);
            }
        }
Ejemplo n.º 3
0
        ///<summary>Set validate to true to throw an exception if start and stop times need to be validated.  If validate is set to false, then the calling code is responsible for the validation.</summary>
        public static long Insert(Schedule sched, bool validate)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                sched.ScheduleNum = Meth.GetLong(MethodBase.GetCurrentMethod(), sched, validate);
                return(sched.ScheduleNum);
            }
            if (validate)
            {
                Validate(sched);
            }
            Crud.ScheduleCrud.Insert(sched);
            ScheduleOp op;

            for (int i = 0; i < sched.Ops.Count; i++)
            {
                op              = new ScheduleOp();
                op.ScheduleNum  = sched.ScheduleNum;
                op.OperatoryNum = sched.Ops[i];
                ScheduleOps.Insert(op);
            }
            return(sched.ScheduleNum);
        }