Esempio n. 1
0
        ///<summary>Creates an appointment view with amount of operatories specified from list of op nums passed in for the
        ///specified clinic. Does not handle assigning providers to operatories. </summary>
        public static ApptView SetApptView(List <long> listOpNums, long clinicNum = 0)      //Create aptView items for list of providers passed in, list of ops passed in
        {
            ApptView aptView = new ApptView();

            aptView.ClinicNum = clinicNum;
            ApptViews.Insert(aptView);
            for (int i = 0; i < listOpNums.Count; i++)
            {
                ApptViewItem viewItem = new ApptViewItem();
                viewItem.ApptViewNum = aptView.ApptViewNum;
                viewItem.OpNum       = listOpNums[i];
                ApptViewItems.Insert(viewItem);
            }
            ApptViews.RefreshCache();
            ApptViewItems.RefreshCache();
            return(aptView);
        }
Esempio n. 2
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;
     }));
 }