Exemplo n.º 1
0
        ///<summary></summary>
        public static ApptView CreateApptView(string description, TimeSpan apptTimeScrollStart = new TimeSpan())
        {
            ApptView apptView = new ApptView()
            {
                Description         = description,
                ApptTimeScrollStart = apptTimeScrollStart,
            };

            ApptViews.Insert(apptView);
            ApptViews.RefreshCache();
            return(apptView);
        }
Exemplo n.º 2
0
        public void MiddleTier_GetListToTable_TimeSpans()
        {
            ApptViewT.ClearApptView();
            long            apptViewNum1  = ApptViewT.CreateApptView(MethodBase.GetCurrentMethod().Name, new TimeSpan(5, 20, 13)).ApptViewNum;
            long            apptViewNum2  = ApptViewT.CreateApptView(MethodBase.GetCurrentMethod().Name, new TimeSpan(9, 0, 45)).ApptViewNum;
            long            apptViewNum3  = ApptViewT.CreateApptView(MethodBase.GetCurrentMethod().Name).ApptViewNum;
            List <ApptView> listApptViews = ApptViews.GetDeepCopy();

            Assert.AreEqual(listApptViews.Count, 3);
            Assert.AreEqual(5, listApptViews.First(x => x.ApptViewNum == apptViewNum1).ApptTimeScrollStart.Hours);
            Assert.AreEqual(20, listApptViews.First(x => x.ApptViewNum == apptViewNum1).ApptTimeScrollStart.Minutes);
            Assert.AreEqual(13, listApptViews.First(x => x.ApptViewNum == apptViewNum1).ApptTimeScrollStart.Seconds);
            Assert.AreEqual(9, listApptViews.First(x => x.ApptViewNum == apptViewNum2).ApptTimeScrollStart.Hours);
            Assert.AreEqual(0, listApptViews.First(x => x.ApptViewNum == apptViewNum2).ApptTimeScrollStart.Minutes);
            Assert.AreEqual(45, listApptViews.First(x => x.ApptViewNum == apptViewNum2).ApptTimeScrollStart.Seconds);
            Assert.AreEqual(TimeSpan.Zero.Hours, listApptViews.First(x => x.ApptViewNum == apptViewNum3).ApptTimeScrollStart.Hours);
            Assert.AreEqual(TimeSpan.Zero.Minutes, listApptViews.First(x => x.ApptViewNum == apptViewNum3).ApptTimeScrollStart.Minutes);
            Assert.AreEqual(TimeSpan.Zero.Seconds, listApptViews.First(x => x.ApptViewNum == apptViewNum3).ApptTimeScrollStart.Seconds);
        }
Exemplo n.º 3
0
 public static ApptViewItem CreateApptViewItem(long opNum, long provNum, long clinicNum = 0, string apptViewDesc = "All")
 {
     return(DataAction.GetPractice(() => {
         ApptView aptView = ApptViews.GetForClinic(clinicNum).FirstOrDefault(x => x.Description.ToLower() == apptViewDesc.ToLower());
         if (aptView == null)
         {
             aptView = new ApptView()
             {
                 Description = apptViewDesc,
                 ItemOrder = 99,
                 ClinicNum = clinicNum,
             };
             ApptViews.Insert(aptView);
         }
         ApptViewItem ret = new ApptViewItem()
         {
             ApptViewNum = aptView.ApptViewNum,
             OpNum = opNum,
             ProvNum = provNum,
         };
         ApptViewItems.Insert(ret);
         return ret;
     }));
 }