public static Doctor GetDoctor(int id, bool isNeedNew)
        {
            for (var t = 0; t < doctors.Count; t++) {
                if (doctors[t].ID == id)
                    return doctors[t];
            }

            var vwtDays = new WorkTime_Days ();
            vwtDays.Mon_From = new DateTime(1,1,1,9,0,0);
            vwtDays.Mon_Till = new DateTime(1,1,1,18,0,0);
            vwtDays.Tue_From = new DateTime(1,1,1,9,0,0);
            vwtDays.Tue_Till = new DateTime(1,1,1,18,0,0);
            vwtDays.Wed_From = new DateTime(1,1,1,9,0,0);
            vwtDays.Wed_Till = new DateTime(1,1,1,18,0,0);
            vwtDays.Thu_From = new DateTime(1,1,1,9,0,0);
            vwtDays.Thu_Till = new DateTime(1,1,1,18,0,0);
            vwtDays.Fri_From = new DateTime(1,1,1,9,0,0);
            vwtDays.Fri_Till = new DateTime(1,1,1,18,0,0);
            //			vwtDays.Sut_From = new DateTime(1,1,1,9,0,0);
            //			vwtDays.Sut_Till = new DateTime(1,1,1,18,0,0);
            //			vwtDays.Sun_From = new DateTime(1,1,1,9,0,0);
            //			vwtDays.Sun_Till = new DateTime(1,1,1,18,0,0);

            var vwtOddEven = new WorkTime_OddEven ();
            vwtOddEven.Odd_From = new DateTime(1,1,1,9,0,0);
            vwtOddEven.Odd_Till = new DateTime(1,1,1,18,0,0);
            vwtOddEven.Even_From = new DateTime(1,1,1,9,0,0);
            vwtOddEven.Even_Till = new DateTime(1,1,1,18,0,0);

            if (isNeedNew) {
                return new Doctor() {ID=id, wtDays = vwtDays, wtOddEven = vwtOddEven};
            } else {
                return null;
            }
        }
        public static Doctor GetDoctor(int id, bool isNeedNew)
        {
            for (var t = 0; t < doctors.Count; t++)
            {
                if (doctors[t].ID == id)
                {
                    return(doctors[t]);
                }
            }

            var vwtDays = new WorkTime_Days();

            vwtDays.Mon_From = new DateTime(1, 1, 1, 9, 0, 0);
            vwtDays.Mon_Till = new DateTime(1, 1, 1, 18, 0, 0);
            vwtDays.Tue_From = new DateTime(1, 1, 1, 9, 0, 0);
            vwtDays.Tue_Till = new DateTime(1, 1, 1, 18, 0, 0);
            vwtDays.Wed_From = new DateTime(1, 1, 1, 9, 0, 0);
            vwtDays.Wed_Till = new DateTime(1, 1, 1, 18, 0, 0);
            vwtDays.Thu_From = new DateTime(1, 1, 1, 9, 0, 0);
            vwtDays.Thu_Till = new DateTime(1, 1, 1, 18, 0, 0);
            vwtDays.Fri_From = new DateTime(1, 1, 1, 9, 0, 0);
            vwtDays.Fri_Till = new DateTime(1, 1, 1, 18, 0, 0);
//			vwtDays.Sut_From = new DateTime(1,1,1,9,0,0);
//			vwtDays.Sut_Till = new DateTime(1,1,1,18,0,0);
//			vwtDays.Sun_From = new DateTime(1,1,1,9,0,0);
//			vwtDays.Sun_Till = new DateTime(1,1,1,18,0,0);

            var vwtOddEven = new WorkTime_OddEven();

            vwtOddEven.Odd_From  = new DateTime(1, 1, 1, 9, 0, 0);
            vwtOddEven.Odd_Till  = new DateTime(1, 1, 1, 18, 0, 0);
            vwtOddEven.Even_From = new DateTime(1, 1, 1, 9, 0, 0);
            vwtOddEven.Even_Till = new DateTime(1, 1, 1, 18, 0, 0);

            if (isNeedNew)
            {
                return(new Doctor()
                {
                    ID = id, wtDays = vwtDays, wtOddEven = vwtOddEven
                });
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
        private void TimePickerCallback(object sender, TimePickerDialog.TimeSetEventArgs e)
        {
            var wtD = new WorkTime_Days();
            wtD = doctor.wtDays;
            var wtOE = new WorkTime_OddEven();
            wtOE = doctor.wtOddEven;
            switch(doctor.chooseNwtType)
            {
            case WorkTime_Type.Mon_From: { wtD.Mon_From = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            case WorkTime_Type.Mon_Till: { wtD.Mon_Till = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }

            case WorkTime_Type.Tue_From: { wtD.Tue_From = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            case WorkTime_Type.Tue_Till: { wtD.Tue_Till = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }

            case WorkTime_Type.Wed_From: { wtD.Wed_From = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            case WorkTime_Type.Wed_Till: { wtD.Wed_Till = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }

            case WorkTime_Type.Thu_From: { wtD.Thu_From = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            case WorkTime_Type.Thu_Till: { wtD.Thu_Till = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }

            case WorkTime_Type.Fri_From: { wtD.Fri_From = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            case WorkTime_Type.Fri_Till: { wtD.Fri_Till = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }

            case WorkTime_Type.Sut_From: { wtD.Sut_From = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            case WorkTime_Type.Sut_Till: { wtD.Sut_Till = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }

            case WorkTime_Type.Sun_From: { wtD.Sun_From = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            case WorkTime_Type.Sun_Till: { wtD.Sun_Till = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }

            case WorkTime_Type.Odd_From: { wtOE.Odd_From = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            case WorkTime_Type.Odd_Till: { wtOE.Odd_Till = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }

            case WorkTime_Type.Even_From: { wtOE.Even_From = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            case WorkTime_Type.Even_Till: { wtOE.Even_Till = new DateTime(1,1,1, e.HourOfDay, e.Minute, 0); break; }
            }
            doctor.wtOddEven = wtOE;
            doctor.wtDays = wtD;
            UpdateWorkTimeList();
        }