///<summary>Syncs any changes made by the user to the list of Program Properties that indicates this Program Link's button should be hidden
        ///per clinic.  Only syncs changes made to ProgramProperties for clinics the user has access to.</summary>
        private void SyncHiddenProgramProperties()
        {
            //Get the users total list of unrestricted clinics, then acquire their list of ProgramProperties so we can tell which PL buttons
            //should be hidden based upon the ProgramProperty PropertyDesc indicator.
            List <Clinic> listUserClinics = Clinics.GetForUserod(Security.CurUser, doIncludeHQ: true, hqClinicName: Lan.g(this, "HQ"));
            //Get the cached list of button hiding ProgramProperties for clinics this user has access to, i.e. the "Old" list.
            List <ProgramProperty> listHiddenForUserOld = ProgramProperties.GetForProgram(_progNumCur)
                                                          .Where(x => x.PropertyDesc == ProgramProperties.PropertyDescs.ClinicHideButton &&
                                                                 x.ClinicNum.In(listUserClinics.Select(y => y.ClinicNum))).ToList();

            //Compares the old list of ProgramProperties to the new one, if a clinic exists in the old list but not the new list then it was deleted by the
            //user and we remove it from the db.
            foreach (ProgramProperty propOld in listHiddenForUserOld)
            {
                if (!propOld.ProgramPropertyNum.In(_listProgramPropertiesHiddenClinics.Select(x => x.ProgramPropertyNum))) //Clinic was Removed from List
                {
                    ProgramProperties.Delete(propOld);                                                                     //Remove from ProgramProperty
                }
            }
            //Compares the new list of ProgramProperties to the old one, if a clinic exists in the new list but not the old one then it was added by the
            //user and we should add it to the db.
            foreach (ProgramProperty propNew in _listProgramPropertiesHiddenClinics)
            {
                if (!propNew.ProgramPropertyNum.In(listHiddenForUserOld.Select(x => x.ProgramPropertyNum))) //Clinic was Added to List
                {
                    ProgramProperties.Insert(propNew);                                                      //Insert ProgramProperty
                }
            }
        }
 private void FormRpTreatPlanPresenter_Load(object sender, EventArgs e)
 {
     date1.SelectionStart = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddMonths(-1);
     date2.SelectionStart = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddDays(-1);
     _listUsers           = Userods.GetDeepCopy(true);
     listUser.Items.AddRange(_listUsers.Select(x => x.UserName).ToArray());
     checkAllUsers.Checked = true;
     if (PrefC.HasClinicsEnabled)
     {
         if (!Security.CurUser.ClinicIsRestricted)
         {
             listClin.Items.Add(Lan.g(this, "Unassigned"));
         }
         _listClinics = Clinics.GetForUserod(Security.CurUser);
         listClin.Items.AddRange(_listClinics.Select(x => x.Abbr).ToArray());
         checkAllClinics.Checked = true;
     }
     else
     {
         listClin.Visible        = false;
         checkAllClinics.Visible = false;
         labelClin.Visible       = false;
         groupGrossNet.Location  = new Point(185, 225);
         groupOrder.Location     = new Point(185, 295);
         groupUser.Location      = new Point(185, 365);
         listUser.Width         += 30;
     }
 }
Пример #3
0
 private void FormUnsched_Load(object sender, System.EventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     comboOrder.Items.Add(Lan.g(this, "UnschedStatus"));
     comboOrder.Items.Add(Lan.g(this, "Alphabetical"));
     comboOrder.Items.Add(Lan.g(this, "Date"));
     comboOrder.SelectedIndex = 0;
     comboProv.Items.Add(Lan.g(this, "All"));
     comboProv.SelectedIndex = 0;
     _listProviders          = Providers.GetDeepCopy(true);
     for (int i = 0; i < _listProviders.Count; i++)
     {
         comboProv.Items.Add(_listProviders[i].GetLongDesc());
     }
     if (PrefC.GetBool(PrefName.EasyHidePublicHealth))
     {
         comboSite.Visible = false;
         labelSite.Visible = false;
     }
     else
     {
         comboSite.Items.Add(Lan.g(this, "All"));
         comboSite.SelectedIndex = 0;
         _listSites = Sites.GetDeepCopy();
         for (int i = 0; i < _listSites.Count; i++)
         {
             comboSite.Items.Add(_listSites[i].Description);
         }
     }
     if (PrefC.GetBool(PrefName.EasyNoClinics))
     {
         comboClinic.Visible = false;
         labelClinic.Visible = false;
     }
     else
     {
         if (!Security.CurUser.ClinicIsRestricted)
         {
             comboClinic.Items.Add(Lan.g(this, "All"));
             comboClinic.SelectedIndex = 0;
         }
         _listUserClinics = Clinics.GetForUserod(Security.CurUser);
         for (int i = 0; i < _listUserClinics.Count; i++)
         {
             comboClinic.Items.Add(_listUserClinics[i].Abbr);
             if (_listUserClinics[i].ClinicNum == Clinics.ClinicNum)
             {
                 comboClinic.SelectedIndex = i;
                 if (!Security.CurUser.ClinicIsRestricted)
                 {
                     comboClinic.SelectedIndex++;                            //add 1 for "All"
                 }
             }
         }
     }
     _listAptSelected = new List <long>();
     InitDateRange();
     FillGrid();
     Cursor = Cursors.Default;
 }
Пример #4
0
        ///<summary>Fills both the Specialty and Clinic combo boxes according to the available clinics to the user and the unused specialties for the patient.
        ///Only fills the combo box of clinics with clinics that are associated to specialties that have not been used for this patient yet.
        ///E.g. Even if the user has access to Clinic X, if there is already a clone of this patient for Clinic X, it will no longer show.
        ///Throws exceptions that should be shown to the user which should then be followed by closing the window.</summary>
        private void FillClinicComboBoxes()
        {
            _dictSpecialtyClinics = new Dictionary <long, List <Clinic> >();
            //Fill the list of clinics for this user.
            List <Clinic> listClinicsForUser = Clinics.GetForUserod(Security.CurUser);
            //Make a deep copy of the list of clinics so that we can filter down to the clinics that have no specialty specified if all are hidden.
            List <Clinic> listClinicsNoSpecialty = listClinicsForUser.Select(x => x.Copy()).ToList();
            //Fill the list of defLinks used by clones of this patient.
            List <long>    listClonePatNum    = PatientLinks.GetPatNumsLinkedFrom(_patientMaster.PatNum, PatientLinkType.Clone);
            List <DefLink> listPatCurDefLinks = DefLinks.GetListByFKeys(listClonePatNum, DefLinkType.Patient);
            //Fill the list of clinics defLink
            List <DefLink> listClinicDefLinks = DefLinks.GetDefLinksByType(DefLinkType.Clinic);

            //Filter out any specialties that are currently in use by clones of this patient.
            if (listPatCurDefLinks.Count > 0)
            {
                listClinicDefLinks.RemoveAll(x => x.DefNum.In(listPatCurDefLinks.Select(y => y.DefNum).ToList()));
            }
            //Get all non-hidden specialties
            List <Def> listSpecialtyDefs = Defs.GetDefsForCategory(DefCat.ClinicSpecialty, true);

            //If there are specialties present, we need to know which clinics have no specialty set so that the user can always make clones for that specialty.
            if (listSpecialtyDefs.Count > 0)
            {
                listClinicsNoSpecialty.RemoveAll(x => x.ClinicNum.In(listClinicDefLinks.Select(y => y.FKey).ToList()));
            }
            //Remove all clinics that do not have any specialties from the original list of clinics for the user.
            listClinicsForUser.RemoveAll(x => !x.ClinicNum.In(listClinicDefLinks.Select(y => y.FKey).ToList()));
            //Filter out any specialties that are not associated to any available clinics for this user.
            listSpecialtyDefs.RemoveAll(x => !x.DefNum.In(listClinicDefLinks.Select(y => y.DefNum).ToList()));
            //Lump all of the left over specialties into a dictionary and slap the associated clinics to them.
            comboSpecialty.Items.Clear();
            //Create a dummy specialty of 0 if there are any clinics that do not have a specialty.
            if (listClinicsNoSpecialty != null && listClinicsNoSpecialty.Count > 0)
            {
                comboSpecialty.Items.Add(new ODBoxItem <Def>(Lan.g(this, "Unspecified"), new Def()
                {
                    DefNum = 0
                }));
                _dictSpecialtyClinics[0] = listClinicsNoSpecialty;
            }
            foreach (Def specialty in listSpecialtyDefs)
            {
                comboSpecialty.Items.Add(new ODBoxItem <Def>(specialty.ItemName, specialty));
                //Get a list of all deflinks for the def
                List <DefLink> listLinkForDef = listClinicDefLinks.FindAll(x => x.DefNum == specialty.DefNum).ToList();
                _dictSpecialtyClinics[specialty.DefNum] = listClinicsForUser.FindAll(x => x.ClinicNum.In(listLinkForDef.Select(y => y.FKey).ToList()));
            }
            //If there are no specialties to show, we need to let the user know that they need to associate at least one clinic to a specialty.
            if (_dictSpecialtyClinics.Count < 1)
            {
                MsgBox.Show(this, "This patient already has a clone for every Clinic Specialty available.\r\n"
                            + "In the main menu, click Setup, Definitions, Clinic Specialties category to add new specialties.\r\n"
                            + "In the main menu, click Lists, Clinics, and double click a clinic to set a Specialty.");
                DialogResult = DialogResult.Abort;
                return;
            }
            comboSpecialty.SelectedIndex = 0;
            FillComboClinic();
        }
Пример #5
0
 private void FillClinics()
 {
     if (!PrefC.HasClinicsEnabled)
     {
         _listClinics = new List <Clinic>();             //Just in case.
         return;
     }
     _listClinics = Clinics.GetForUserod(Security.CurUser);
     if (!Security.CurUser.ClinicIsRestricted)
     {
         _listClinics.Insert(0, new Clinic()
         {
             ClinicNum = 0, Abbr = "Unassigned", Description = "Unassigned"
         });
     }
     labelClinic.Visible   = true;
     comboClinics.Visible  = true;
     butPickClinic.Visible = true;
     //ClinicNum: -1 for All
     comboClinics.Items.Add(new ODBoxItem <Clinic>(Lan.g(this, "All"), new Clinic()
     {
         ClinicNum = -1, Abbr = "All", Description = "All"
     }));
     comboClinics.SelectedIndex = 0;           //select 'All' by default
     foreach (Clinic clinic in _listClinics)
     {
         int index = comboClinics.Items.Add(new ODBoxItem <Clinic>(clinic.Abbr, clinic));
         if (clinic.ClinicNum == Clinics.ClinicNum)
         {
             comboClinics.SelectedIndex = index;
         }
     }
 }
Пример #6
0
 private void FormEtrans835s_Load(object sender, EventArgs e)
 {
     textDateFrom.Text = DateTimeOD.Today.AddDays(-7).ToShortDateString();
     textDateTo.Text   = DateTimeOD.Today.ToShortDateString();
     #region User Clinics
     if (PrefC.HasClinicsEnabled)
     {
         comboClinics.Visible = true;
         labelClinic.Visible  = true;
         comboClinics.Items.Clear();
         comboClinics.Items.Add(Lan.g(this, "All"));
         comboClinics.Items.Add(Lan.g(this, "Unassigned"));
         _listUserClinics = Clinics.GetForUserod(Security.CurUser);
         _listUserClinics.ForEach(x => comboClinics.Items.Add(x.Abbr));
         comboClinics.SetSelected(0, true);               //Defaults to 'All' so that 835s with missing clinic will show.
     }
     #endregion
     #region Statuses
     listStatus.Items.Add(Lans.g(this, "Unprocessed"));       //Claims are either not found or not recieved or a combination.
     listStatus.SetSelected(listStatus.Items.Count - 1, true);
     listStatus.Items.Add(Lans.g(this, "Partial"));           //Some claims found and marked recieved. Others are either not found or not recieved.
     listStatus.SetSelected(listStatus.Items.Count - 1, true);
     listStatus.Items.Add(Lans.g(this, "NotFinalized"));      //All claims found and marked recieved but no ins payment.
     listStatus.SetSelected(listStatus.Items.Count - 1, true);
     listStatus.Items.Add(Lans.g(this, "Finalized"));         //All claims found, recieved and all have existing ins payment.
     listStatus.SetSelected(listStatus.Items.Count - 1, false);
     #endregion
     _listClinics = Clinics.GetDeepCopy(true);
     RefreshAndFillGrid();            //Will not run query, simply initilizes the grid.
     gridMain.AllowSortingByColumn = true;
 }
Пример #7
0
        private void FillComboClinic()
        {
            //Not using ComboBoxClinicPicker because we need to add a blank "" for no selection logic when procedures have different clinics.
            comboClinic.Items.Clear();
            comboClinic.Items.Add("", null);
            comboClinic.SelectedIndex = 0;          //Selection is not changed if isAllProcsForSameClinic is false.
            bool isAllProcsForSameClinic = ProcList.Select(x => x.ClinicNum).Distinct().ToList().Count == 1;
            bool isListAlpha             = PrefC.GetBool(PrefName.ClinicListIsAlphabetical);

            _listClinics = Clinics.GetForUserod(Security.CurUser);
            if (isListAlpha)
            {
                _listClinics = _listClinics.OrderBy(x => x.Abbr).ToList();
            }
            else
            {
                _listClinics = _listClinics.OrderBy(x => x.ItemOrder).ToList();
            }
            _listClinics.Insert(0, Clinics.GetPracticeAsClinicZero(Lan.g(this, "None")));
            for (int i = 0; i < _listClinics.Count; i++)       //None mimics FormProcEdit
            {
                comboClinic.Items.Add(_listClinics[i].Abbr, _listClinics[i]);
                if (isAllProcsForSameClinic && _listClinics[i].ClinicNum == ProcList[0].ClinicNum)
                {
                    comboClinic.SetSelected(i + 1);
                }
            }
            if (isAllProcsForSameClinic && !_listClinics.Any(x => x.ClinicNum == ProcList[0].ClinicNum))
            {
                //All procedure clinics are the same but value is missing from our list.
                //We might eventaully check to see how many clincs from proc list do not exists in listClinics.
                comboClinic.SetSelectedKey <Clinic>(ProcList[0].ClinicNum, x => x.ClinicNum, x => Clinics.GetAbbr(x));         //selectedIndex -1
            }
        }
Пример #8
0
 private void FormRpRouting_Load(object sender, System.EventArgs e)
 {
     _listProviders = Providers.GetListReports();
     if (IsAutoRunForDateSelected)
     {
         //Creates routing slips for the defined DateSelected, currently selected clinic (if Clinics is enabled), not filtered by providers.
         List <long> emptyProvNumList = new List <long>();
         List <long> listClinicNums   = new List <long>();
         if (PrefC.HasClinicsEnabled)
         {
             listClinicNums.Add(Clinics.ClinicNum);
         }
         //Run for all providers and the currently selected day
         List <long> aptNums = RpRouting.GetRouting(DateSelected, emptyProvNumList, listClinicNums);
         PrintRoutingSlipsForAppts(aptNums);
         DialogResult = DialogResult.OK;
         return;
     }
     if (IsAutoRunForListAptNums)
     {
         //Creates routing slips for the entire view in ContrAppt
         PrintRoutingSlipsForAppts(ListAptNums);
         DialogResult = DialogResult.OK;
         return;
     }
     if (AptNum != 0)
     {
         List <long> aptNums = new List <long>();
         aptNums.Add(AptNum);
         PrintRoutingSlips(aptNums, SheetDefNum);
         DialogResult = DialogResult.OK;
         return;
     }
     for (int i = 0; i < _listProviders.Count; i++)
     {
         listProv.Items.Add(_listProviders[i].GetLongDesc());
     }
     checkProvAll.Checked = true;
     textDate.Text        = DateTime.Today.ToShortDateString();
     if (!PrefC.HasClinicsEnabled)
     {
         listClin.Visible     = false;
         listClin.Visible     = false;
         checkClinAll.Visible = false;
         labelClin.Visible    = false;
     }
     else
     {
         _listClinics = Clinics.GetForUserod(Security.CurUser, true, Lan.g(this, "Unassigned"));
         foreach (Clinic clinic in _listClinics)
         {
             listClin.Items.Add(clinic.Abbr);
             listClin.SetSelected(listClin.Items.Count - 1, (Clinics.ClinicNum != 0 && Clinics.ClinicNum == clinic.ClinicNum));
         }
         if (Clinics.ClinicNum == 0)
         {
             checkClinAll.Checked = true;
         }
     }
 }
Пример #9
0
        private void FillClinics()
        {
            List <int> listSelectedItems = new List <int>();

            _listClinics = Clinics.GetForUserod(Security.CurUser);
            comboBoxMultiClinics.Items.Add(Lan.g(this, "All"));
            if (!Security.CurUser.ClinicIsRestricted)
            {
                comboBoxMultiClinics.Items.Add(Lan.g(this, "Unassigned"));
                listSelectedItems.Add(1);
            }
            for (int i = 0; i < _listClinics.Count; i++)
            {
                int curIndex = comboBoxMultiClinics.Items.Add(_listClinics[i].Abbr);
                if (Clinics.ClinicNum == 0)
                {
                    listSelectedItems.Add(curIndex);
                }
                if (_listClinics[i].ClinicNum == Clinics.ClinicNum)
                {
                    listSelectedItems.Clear();
                    listSelectedItems.Add(curIndex);
                }
            }
            foreach (int index in listSelectedItems)
            {
                comboBoxMultiClinics.SetSelected(index, true);
            }
        }
Пример #10
0
 private void FormPaymentSheet_Load(object sender, System.EventArgs e)
 {
     date1.SelectionStart = DateTime.Today;
     date2.SelectionStart = DateTime.Today;
     if (!PrefC.HasClinicsEnabled)
     {
         listClin.Visible     = false;
         labelClin.Visible    = false;
         checkAllClin.Visible = false;
     }
     else
     {
         _listClinics = Clinics.GetForUserod(Security.CurUser);
         if (!Security.CurUser.ClinicIsRestricted)
         {
             listClin.Items.Add(Lan.g(this, "Unassigned"));
             listClin.SetSelected(0, true);
         }
         for (int i = 0; i < _listClinics.Count; i++)
         {
             int curIndex = listClin.Items.Add(_listClinics[i].Abbr);
             if (Clinics.ClinicNum == 0)
             {
                 listClin.SetSelected(curIndex, true);
                 checkAllClin.Checked = true;
             }
             if (_listClinics[i].ClinicNum == Clinics.ClinicNum)
             {
                 listClin.SelectedIndices.Clear();
                 listClin.SetSelected(curIndex, true);
             }
         }
     }
 }
Пример #11
0
        ///<summary>Save template changes made in WebSchedVerify.</summary>
        private void SaveTabWebSchedVerify()
        {
            List <long> listClinics = Clinics.GetForUserod(Security.CurUser).Select(x => x.ClinicNum).ToList();

            foreach (PrefName prefName in _listWebSchedVerifyPrefNames)
            {
                foreach (long clinicNum in listClinics)
                {
                    ClinicPref newClinicPref = _listWebSchedVerifyClinicPrefs.FirstOrDefault(x => x.PrefName == prefName && x.ClinicNum == clinicNum);
                    ClinicPref oldClinicPref = _listWebSchedVerifyClinicPrefs_Old.FirstOrDefault(x => x.PrefName == prefName && x.ClinicNum == clinicNum);
                    if (oldClinicPref == null && newClinicPref == null)                  //skip items not in either list
                    {
                        continue;
                    }
                    else if (oldClinicPref == null && newClinicPref != null)                  //insert items in the new list and not the old list
                    {
                        ClinicPrefs.Insert(newClinicPref);
                    }
                    else if (oldClinicPref != null && newClinicPref == null)                  //delete items in the old list and not the new list
                    {
                        ClinicPrefs.Delete(oldClinicPref.ClinicPrefNum);
                    }
                    else                       //update items that have changed
                    {
                        ClinicPrefs.Update(newClinicPref, oldClinicPref);
                    }
                }
                ClinicPref newPref = _listWebSchedVerifyClinicPrefs.FirstOrDefault(x => x.PrefName == prefName && x.ClinicNum == CLINIC_NUM_DEFAULT);
                if (newPref != null)
                {
                    Prefs.UpdateString(prefName, newPref.ValueString);
                }
            }
        }
Пример #12
0
 private void FormProcBroken_Load(object sender, EventArgs e)
 {
     textDateEntry.Text      = _procCur.DateEntryC.ToShortDateString();
     textProcDate.Text       = _procCur.ProcDate.ToShortDateString();
     textAmount.Text         = _procCur.ProcFee.ToString("f");
     _selectedProvNum        = _procCur.ProvNum;
     comboProv.SelectedIndex = -1;          //initializes to 0; must be -1 for fillComboProv
     if (PrefC.HasClinicsEnabled)
     {
         _listClinics = new List <Clinic>()
         {
             new Clinic()
             {
                 Abbr = Lan.g(this, "None")
             }
         };                                                                                       //Seed with "None"
         Clinics.GetForUserod(Security.CurUser).ForEach(x => _listClinics.Add(x));                //do not re-organize from cache. They could either be alphabetizeded or sorted by item order.
         _listClinics.ForEach(x => comboClinic.Items.Add(x.Abbr));
         _selectedClinicNum = _procCur.ClinicNum;
         comboClinic.IndexSelectOrSetText(_listClinics.FindIndex(x => x.ClinicNum == _selectedClinicNum), () => { return(Clinics.GetAbbr(_selectedClinicNum)); });
     }
     else
     {
         labelClinic.Visible = false;
         comboClinic.Visible = false;
         fillComboProv();
     }
     textUser.Text         = Userods.GetName(_procCur.UserNum);
     textChartNotes.Text   = _procCur.Note;
     textAccountNotes.Text = _procCur.BillingNote;
 }
Пример #13
0
 private void FormRpTpPreAllocation_Load(object sender, EventArgs e)
 {
     odDateRangePicker.SetDateTimeFrom(DateTime.Today.AddMonths(-1));
     odDateRangePicker.SetDateTimeTo(DateTime.Today);
     if (PrefC.HasClinicsEnabled)
     {
         labelClinic.Visible     = true;
         checkAllClinics.Visible = true;
         checkAllClinics.Checked = true;
         listBoxClinic.Visible   = true;
         listBoxClinic.SelectedIndices.Clear();
         _listClinics = Clinics.GetForUserod(Security.CurUser, (!Security.CurUser.ClinicIsRestricted), "Unassigned");
         foreach (Clinic clinic in _listClinics)
         {
             ODBoxItem <Clinic> boxClinic = new ODBoxItem <Clinic>(clinic.Abbr, clinic);
             listBoxClinic.Items.Add(boxClinic);
         }
     }
     else
     {
         _listClinics = new List <Clinic>();
     }
     _listProviders = Providers.GetListReports();
     _listProviders.Insert(0, Providers.GetUnearnedProv());
     checkAllProv.Checked = true;
     listBoxProv.SetItems(_listProviders, x => x.Abbr);
     _listUnearnedTypes            = Defs.GetDefsForCategory(DefCat.PaySplitUnearnedType).Where(x => !string.IsNullOrEmpty(x.ItemValue)).ToList();
     checkAllUnearnedTypes.Checked = true;
     listBoxUnearnedTypes.SetItems(_listUnearnedTypes, x => x.ItemName);
 }
Пример #14
0
 private void FormPayConnectSetup_Load(object sender, EventArgs e)
 {
     _progCur = Programs.GetCur(ProgramName.PayConnect);
     if (_progCur == null)
     {
         MsgBox.Show(this, "The PayConnect entry is missing from the database.");               //should never happen
         return;
     }
     checkEnabled.Checked = _progCur.Enabled;
     if (!PrefC.HasClinicsEnabled)             //clinics are not enabled, use ClinicNum 0 to indicate 'Headquarters' or practice level program properties
     {
         checkEnabled.Text         = Lan.g(this, "Enabled");
         groupPaySettings.Text     = Lan.g(this, "Payment Settings");
         comboClinic.Visible       = false;
         labelClinic.Visible       = false;
         labelClinicEnable.Visible = false;
         _listUserClinicNums       = new List <long>()
         {
             0
         };            //if clinics are disabled, programproperty.ClinicNum will be set to 0
     }
     else              //Using clinics
     {
         groupPaySettings.Text = Lan.g(this, "Clinic Payment Settings");
         _listUserClinicNums   = new List <long>();
         comboClinic.Items.Clear();
         //if PayConnect is enabled and the user is restricted to a clinic, don't allow the user to disable for all clinics
         if (Security.CurUser.ClinicIsRestricted)
         {
             if (checkEnabled.Checked)
             {
                 checkEnabled.Enabled = false;
             }
         }
         else
         {
             comboClinic.Items.Add(Lan.g(this, "Headquarters"));
             //this way both lists have the same number of items in it and if 'Headquarters' is selected the programproperty.ClinicNum will be set to 0
             _listUserClinicNums.Add(0);
             comboClinic.SelectedIndex = 0;
         }
         List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser);
         for (int i = 0; i < listClinics.Count; i++)
         {
             comboClinic.Items.Add(listClinics[i].Abbr);
             _listUserClinicNums.Add(listClinics[i].ClinicNum);
             if (Clinics.ClinicNum == listClinics[i].ClinicNum)
             {
                 comboClinic.SelectedIndex = i;
                 if (!Security.CurUser.ClinicIsRestricted)
                 {
                     comboClinic.SelectedIndex++;                            //increment the SelectedIndex to account for 'Headquarters' in the list at position 0 if the user is not restricted.
                 }
             }
         }
         _indexClinicRevert = comboClinic.SelectedIndex;
     }
     _listProgProps = ProgramProperties.GetForProgram(_progCur.ProgramNum);
     FillFields();
 }
Пример #15
0
 private void FormAutoOrtho_Load(object sender, EventArgs e)
 {
     _tableOutstandingAutoClaims = PatPlans.GetOutstandingOrtho();
     if (!PrefC.HasClinicsEnabled)
     {
         labelClinic.Visible  = false;
         comboClinics.Visible = false;
     }
     else
     {
         if (!Security.CurUser.ClinicIsRestricted)
         {
             comboClinics.Items.Add(Lan.g(this, "All"));
             comboClinics.SelectedIndex = 0;
         }
         _listClinics = Clinics.GetForUserod(Security.CurUser);
         for (int i = 0; i < _listClinics.Count; i++)
         {
             comboClinics.Items.Add(_listClinics[i].Abbr);
             if (_listClinics[i].ClinicNum == Clinics.ClinicNum)
             {
                 comboClinics.SelectedIndex = i;
                 if (!Security.CurUser.ClinicIsRestricted)
                 {
                     comboClinics.SelectedIndex++;                            //add 1 for "All"
                 }
             }
         }
     }
     FillGrid();
 }
Пример #16
0
 private void FormWebFormSetup_Load(object sender, EventArgs e)
 {
     if (!PrefC.HasClinicsEnabled)
     {
         comboClinic.Visible   = false;
         labelClinic.Visible   = false;
         butPickClinic.Visible = false;
     }
     else
     {
         List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser);
         comboClinic.Items.Add(new ODBoxItem <long>(Lan.g(this, "None"), 0));
         comboClinic.SelectedIndex = 0;
         foreach (Clinic cl in listClinics)
         {
             comboClinic.Items.Add(new ODBoxItem <long>(cl.Description, cl.ClinicNum));
             if ((cl.ClinicNum == Clinics.ClinicNum && !_isWebSchedNewPatSetup) ||               //if in WebSchedNewPat setup, we want to use the passed in clinic num instead
                 cl.ClinicNum == _defaultClinicNum)
             {
                 comboClinic.SetSelectedItem <long>(x => x == cl.ClinicNum, "None");
             }
         }
     }
     checkAutoFillNameAndBirthdate.Checked = PrefC.GetBool(PrefName.WebFormsAutoFillNameAndBirthdate);
 }
Пример #17
0
 private void FormLabCases_Load(object sender, EventArgs e)
 {
     //ListClinics can be called even when Clinics is not turned on, therefore it needs to be set to something to avoid a null reference.
     _listClinics = new List <Clinic>();
     if (PrefC.HasClinicsEnabled)
     {
         labelClinic.Visible = true;
         comboClinic.Visible = true;
         comboClinic.Items.Add(Lan.g(this, "All"));               //"All", or "All" of the clinics the user can access if user is clinic restricted.
         comboClinic.SelectedIndex = 0;
         _listClinics = Clinics.GetForUserod(Security.CurUser);
         for (int i = 0; i < _listClinics.Count; i++)
         {
             comboClinic.Items.Add(_listClinics[i].Abbr);
             if (_listClinics[i].ClinicNum == Clinics.ClinicNum)
             {
                 comboClinic.SelectedIndex = i + 1;
             }
         }
     }
     gridMain.ContextMenu = contextMenu1;
     textDateFrom.Text    = "";     //DateViewing.ToShortDateString();
     textDateTo.Text      = "";     //DateViewing.AddDays(5).ToShortDateString();
     //checkShowAll.Checked=false
     FillGrid();
 }
Пример #18
0
 private void FormDailyAdjustment_Load(object sender, System.EventArgs e)
 {
     date1.SelectionStart = DateTime.Today;
     date2.SelectionStart = DateTime.Today;
     _listProviders       = Providers.GetListReports();
     if (!Security.IsAuthorized(Permissions.ReportDailyAllProviders, true))
     {
         //They either have permission or have a provider at this point.  If they don't have permission they must have a provider.
         _listProviders       = _listProviders.FindAll(x => x.ProvNum == Security.CurUser.ProvNum);
         checkAllProv.Checked = false;
         checkAllProv.Enabled = false;
     }
     for (int i = 0; i < _listProviders.Count; i++)
     {
         listProv.Items.Add(_listProviders[i].GetLongDesc());
     }
     if (checkAllProv.Enabled == false && _listProviders.Count > 0)
     {
         listProv.SetSelected(0, true);
     }
     if (PrefC.GetBool(PrefName.EasyNoClinics))
     {
         listClin.Visible     = false;
         labelClin.Visible    = false;
         checkAllClin.Visible = false;
         _hasClinicsEnabled   = false;
     }
     else
     {
         _listClinics       = Clinics.GetForUserod(Security.CurUser);
         _hasClinicsEnabled = true;
         if (!Security.CurUser.ClinicIsRestricted)
         {
             listClin.Items.Add(Lan.g(this, "Unassigned"));
             listClin.SetSelected(0, true);
         }
         for (int i = 0; i < _listClinics.Count; i++)
         {
             int curIndex = listClin.Items.Add(_listClinics[i].Abbr);
             if (Clinics.ClinicNum == 0)
             {
                 listClin.SetSelected(curIndex, true);
                 checkAllClin.Checked = true;
             }
             if (_listClinics[i].ClinicNum == Clinics.ClinicNum)
             {
                 listClin.SelectedIndices.Clear();
                 listClin.SetSelected(curIndex, true);
             }
         }
     }
     _listAdjTypeDefs = Defs.GetDefsForCategory(DefCat.AdjTypes, true);
     for (int i = 0; i < _listAdjTypeDefs.Count; i++)
     {
         listType.Items.Add(_listAdjTypeDefs[i].ItemName);
         listType.SetSelected(i, true);
     }
 }
Пример #19
0
        private void FormClaimNotSent_Load(object sender, System.EventArgs e)
        {
            odDateRangePicker.SetDateTimeTo(DateTime.Now.Date);
            odDateRangePicker.SetDateTimeFrom(odDateRangePicker.GetDateTimeTo().AddDays(-7));             //default to the previous week
            _listClaimSentEditUsers = Userods.GetUsersByPermission(Permissions.ClaimSentEdit, false);
            _listOldClaimTrackings  = ClaimTrackings.RefreshForUsers(ClaimTrackingType.ClaimUser, _listClaimSentEditUsers.Select(x => x.UserNum).ToList());
            _listNewClaimTrackings  = _listOldClaimTrackings.Select(x => x.Copy()).ToList();
            //Fill the clinics combobox
            if (PrefC.HasClinicsEnabled)
            {
                _listClinics = Clinics.GetForUserod(Security.CurUser);
                comboBoxClinics.Items.Add(Lan.g(this, "All"));
                int curIndex = 0;              //start at 0 since we are adding an item
                if (!Security.CurUser.ClinicIsRestricted)
                {
                    comboBoxClinics.Items.Add(Lan.g(this, "Unassigned"));
                    curIndex++;                    //increment index after adding this option
                }
                for (int i = 0; i < _listClinics.Count; i++)
                {
                    curIndex++;
                    comboBoxClinics.Items.Add(_listClinics[i].Abbr);
                    if (Clinics.ClinicNum == 0)
                    {
                        comboBoxClinics.SelectedIndices.Clear();
                        comboBoxClinics.SetSelected(0, true);
                    }
                    if (_listClinics[i].ClinicNum == Clinics.ClinicNum)
                    {
                        comboBoxClinics.SelectedIndices.Clear();
                        comboBoxClinics.SetSelected(curIndex, true);
                    }
                }
            }
            else
            {
                labelClinics.Visible    = false;
                comboBoxClinics.Visible = false;
            }
            //Fill the Ins Filter box
            //comboBoxInsFilter.Items.Add(Lan.g(this,"All"));//always adding an 'All' option first
            foreach (ClaimNotSentStatuses claimStat in Enum.GetValues(typeof(ClaimNotSentStatuses)))
            {
                comboBoxInsFilter.Items.Add(claimStat);
            }
            comboBoxInsFilter.SelectedIndex = 0;          //Pre-select 'All' for the user
            //Fill the right-click menu for the grid
            List <MenuItem> listMenuItems = new List <MenuItem>();

            //The first item in the list will always exists, but we toggle it's visibility to only show when 1 row is selected.
            listMenuItems.Add(new MenuItem(Lan.g(this, "Go to Account"), new EventHandler(gridMain_RightClickHelper)));
            listMenuItems[0].Tag = 0;          //Tags are used to identify what to do in gridMain_RightClickHelper.
            Menu.MenuItemCollection menuItemCollection = new Menu.MenuItemCollection(rightClickMenu);
            menuItemCollection.AddRange(listMenuItems.ToArray());
            rightClickMenu.Popup += new EventHandler((o, ea) => {
                rightClickMenu.MenuItems[0].Visible = (gridMain.SelectedIndices.Count() == 1);            //Only show 'Go to Account' when there is exactly 1 row selected.
            });
        }
Пример #20
0
        private void ButUpdateProvs_Click(object sender, EventArgs e)
        {
            if (IsNew)
            {
                MsgBox.Show(this, "Not for new operatories.");
                return;
            }
            //Check against cache. Instead of saving changes, make them get out and reopen. Safer and simpler.
            Operatory op = Operatories.GetOperatory(OpCur.OperatoryNum);

            if (op.OpName != textOpName.Text ||
                op.Abbrev != textAbbrev.Text ||
                op.IsHidden != checkIsHidden.Checked ||
                op.ClinicNum != comboClinic.SelectedClinicNum ||
                op.ProvDentist != comboProv.GetSelectedProvNum() ||
                op.ProvHygienist != comboHyg.GetSelectedProvNum() ||
                op.IsHygiene != checkIsHygiene.Checked ||
                op.SetProspective != checkSetProspective.Checked ||
                op.IsWebSched != checkIsWebSched.Checked)
            {
                MsgBox.Show(this, "Changes were detected above.  Save all changes, get completely out of the operatories window, and then re-enter.");
                return;
            }
            if (!Security.IsAuthorized(Permissions.Setup) || !Security.IsAuthorized(Permissions.AppointmentEdit))
            {
                return;
            }
            //Operatory operatory=Operatories.GetOperatory(contrApptPanel.OpNumClicked);
            if (Security.CurUser.ClinicIsRestricted && !Clinics.GetForUserod(Security.CurUser).Exists(x => x.ClinicNum == OpCur.ClinicNum))
            {
                MsgBox.Show(this, "You are restricted from accessing the clinic belonging to the selected operatory.  No changes will be made.");
                return;
            }
            if (!MsgBox.Show(this, MsgBoxButtons.YesNo,
                             "WARNING: We recommend backing up your database before running this tool.  "
                             + "This tool may take a very long time to run and should be run after hours.  "
                             + "In addition, this tool could potentially change hundreds of appointments.  "
                             + "The changes made by this tool can only be manually reversed.  "
                             + "Are you sure you want to continue?"))
            {
                return;
            }
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, Lan.g(this, "Update Provs on Future Appts tool run on operatory ") + OpCur.Abbrev + ".");
            List <Appointment> listAppts = Appointments.GetAppointmentsForOpsByPeriod(new List <long>()
            {
                OpCur.OperatoryNum
            }, DateTime.Now);                                                                                                                      //no end date, so all future
            List <Appointment> listApptsOld = new List <Appointment>();

            foreach (Appointment appt in listAppts)
            {
                listApptsOld.Add(appt.Copy());
            }
            ContrApptRef.MoveAppointments(listAppts, listApptsOld, OpCur);
            MsgBox.Show(this, "Done");
        }
Пример #21
0
 private void FormProduction_Load(object sender, System.EventArgs e)
 {
     checkAllProv.Checked = false;
     _listProviders       = Providers.GetListReports();
     textToday.Text       = DateTime.Today.ToShortDateString();
     for (int i = 0; i < _listProviders.Count; i++)
     {
         listProv.Items.Add(_listProviders[i].GetLongDesc());
     }
     if (PrefC.HasClinicsEnabled)
     {
         _listClinics = Clinics.GetForUserod(Security.CurUser);
         if (!Security.CurUser.ClinicIsRestricted)
         {
             listClin.Items.Add(Lan.g(this, "Unassigned"));
             listClin.SetSelected(0, true);
         }
         for (int i = 0; i < _listClinics.Count; i++)
         {
             int curIndex = listClin.Items.Add(_listClinics[i].Abbr);
             if (Clinics.ClinicNum == 0)
             {
                 listClin.SetSelected(curIndex, true);
                 checkAllClin.Checked = true;
             }
             if (_listClinics[i].ClinicNum == Clinics.ClinicNum)
             {
                 listClin.SelectedIndices.Clear();
                 listClin.SetSelected(curIndex, true);
             }
         }
     }
     else
     {
         listClin.Visible     = false;
         labelClin.Visible    = false;
         checkAllClin.Visible = false;
     }
     _listPayPeriods       = PayPeriods.GetDeepCopy();
     _selectedPayPeriodIdx = PayPeriods.GetForDate(DateTime.Today);
     if (_selectedPayPeriodIdx < 0)
     {
         dtPickerFrom.Value = DateTime.Today.AddDays(-7);
         dtPickerTo.Value   = DateTime.Today;
     }
     else
     {
         dtPickerFrom.Value = _listPayPeriods[_selectedPayPeriodIdx].DateStart;
         dtPickerTo.Value   = _listPayPeriods[_selectedPayPeriodIdx].DateStop;
     }
     butThis.Text = Lan.g(this, "This Period");
     SetDates();
 }
Пример #22
0
        private void FormRpInsAging_Load(object sender, System.EventArgs e)
        {
            _listProviders = Providers.GetListReports();
            DateTime lastAgingDate = PrefC.GetDate(PrefName.DateLastAging);

            if (lastAgingDate.Year < 1880)
            {
                textDate.Text = "";
            }
            else if (PrefC.GetBool(PrefName.AgingCalculatedMonthlyInsteadOfDaily))
            {
                textDate.Text = lastAgingDate.ToShortDateString();
            }
            else
            {
                textDate.Text = DateTime.Today.ToShortDateString();
            }
            _listBillingTypeDefs = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
            listBillType.Items.AddRange(_listBillingTypeDefs.Select(x => x.ItemName).ToArray());
            listBillType.SelectedIndex = (listBillType.Items.Count > 0?0:-1);
            checkBillTypesAll.Checked  = true;          //all billing types by default, event handler will set visibility
            listProv.Items.AddRange(_listProviders.Select(x => x.GetLongDesc()).ToArray());
            listProv.SelectedIndex = (listProv.Items.Count > 0?0:-1);
            checkProvAll.Checked   = true;         //all provs by default, event handler will set visibility
            if (!PrefC.HasClinicsEnabled)
            {
                checkAllClin.Visible = false;              //event handler may set listClin to visible, so hide explicitly after setting unchecked just in case
                listClin.Visible     = false;
                labelClin.Visible    = false;
            }
            else
            {
                List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser, true, "Unassigned").ToList();
                if (!listClinics.Exists(x => x.ClinicNum == Clinics.ClinicNum))               //Could have a hidden clinic selected
                {
                    listClinics.Add(Clinics.GetClinic(Clinics.ClinicNum));
                }
                listClin.Items.AddRange(listClinics.Select(x => new ODBoxItem <Clinic>(x.Abbr + (x.IsHidden?(" " + Lan.g(this, "(hidden)")):""), x)).ToArray());
                listClin.SelectedIndex = listClinics.FindIndex(x => x.ClinicNum == Clinics.ClinicNum); //FindIndex could return -1, which is fine
                checkAllClin.Checked   = (Clinics.ClinicNum == 0);                                     //event handler will set visibility
            }
            if (PrefC.GetBool(PrefName.FutureTransDatesAllowed) || PrefC.GetBool(PrefName.AccountAllowFutureDebits) ||
                PrefC.GetBool(PrefName.AllowFutureInsPayments))
            {
                labelFutureTrans.Visible = true;              //Set to false in designer
            }
            if (!checkOnlyShowPatsOutstandingClaims.Checked)
            {
                groupFilter.Visible = false;
            }
        }
Пример #23
0
 private void FillClinics()
 {
     _listClinics = Clinics.GetForUserod(Security.CurUser);
     comboBoxMultiClinics.Items.Add(Lan.g(this, "All"));
     comboBoxMultiClinics.SetSelected(0, true);
     if (!Security.CurUser.ClinicIsRestricted)
     {
         comboBoxMultiClinics.Items.Add(Lan.g(this, "Unassigned"));
     }
     for (int i = 0; i < _listClinics.Count; i++)
     {
         comboBoxMultiClinics.Items.Add(_listClinics[i].Abbr);
     }
 }
Пример #24
0
        private void FormSheetDefDefaults_Load(object sender, EventArgs e)
        {
            List <long> listClinicNums = new List <long>();

            if (PrefC.HasClinicsEnabled)
            {
                labelClinic.Visible        = true;
                comboClinicDefault.Visible = true;
                FillClinicsComboBox();
                listClinicNums = Clinics.GetForUserod(Security.CurUser).Select(x => x.ClinicNum).ToList();
            }
            FillSheetDefComboBoxes();
            _dictSheetsOld = SheetDefs.GetAllSheetDefDefaults(listClinicNums);
            _dictSheetsCur = SheetDefs.GetAllSheetDefDefaults(listClinicNums);          //Call GetAllSheetDefDefaults a second time to avoid shallow copies.
        }
        private void FormDoseSpotAssignUserId_Load(object sender, EventArgs e)
        {
            _listClinicsInComboBox = Clinics.GetForUserod(Security.CurUser, true, "Headquarters");
            List <ProgramProperty> listProgramProperties = ProgramProperties.GetForProgram(Programs.GetCur(ProgramName.eRx).ProgramNum);

            _listClinicIDs  = listProgramProperties.FindAll(x => x.PropertyDesc == Erx.PropertyDescs.ClinicID);
            _listClinicKeys = listProgramProperties.FindAll(x => x.PropertyDesc == Erx.PropertyDescs.ClinicKey);
            _listClinicsInComboBox.RemoveAll(x =>//Remove all clinics that already have a DoseSpot Clinic ID OR Clinic Key entered
                                             _listClinicIDs.FindAll(y => !string.IsNullOrWhiteSpace(y.PropertyValue)).Select(y => y.ClinicNum).Contains(x.ClinicNum) ||
                                             _listClinicKeys.FindAll(y => !string.IsNullOrWhiteSpace(y.PropertyValue)).Select(y => y.ClinicNum).Contains(x.ClinicNum)
                                             );
            FillComboBox();
            textClinicId.Text   = _clinicErxCur.ClinicId;   //ClinicID passed from Alert
            textClinicKey.Text  = _clinicErxCur.ClinicKey;  //ClinicKey passed from Alert
            textClinicDesc.Text = _clinicErxCur.ClinicDesc; //ClinicDesc passed from Alert
        }
Пример #26
0
        private void FillGrid()
        {
            Cursor = Cursors.WaitCursor;
            gridUserProperties.BeginUpdate();
            gridUserProperties.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TableUserPrefProperties", "Clinic"), 120);

            gridUserProperties.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableUserPrefProperties", "DoseSpot User ID"), 120, true);
            gridUserProperties.ListGridColumns.Add(col);
            gridUserProperties.ListGridRows.Clear();
            GridRow    row;
            UserOdPref userPrefDefault = _listUserPref.Find(x => x.ClinicNum == 0);

            //Doesn't exist in Db, create one
            if (userPrefDefault == null)
            {
                userPrefDefault = UserOdPrefs.GetByCompositeKey(_userCur.UserNum, Programs.GetCur(ProgramName.eRx).ProgramNum, UserOdFkeyType.Program, 0);
                //Doesn't exist in db, add to list to be synced later
                _listUserPref.Add(userPrefDefault);
            }
            row = new GridRow();
            row.Cells.Add("Default");
            row.Cells.Add(userPrefDefault.ValueString);
            row.Tag = userPrefDefault;
            gridUserProperties.ListGridRows.Add(row);
            foreach (Clinic clinicCur in Clinics.GetForUserod(Security.CurUser))
            {
                row = new GridRow();
                UserOdPref userPrefCur = _listUserPref.Find(x => x.ClinicNum == clinicCur.ClinicNum);
                //wasn't in list, check Db and create a new one if needed
                if (userPrefCur == null)
                {
                    userPrefCur = UserOdPrefs.GetByCompositeKey(_userCur.UserNum, Programs.GetCur(ProgramName.eRx).ProgramNum, UserOdFkeyType.Program, clinicCur.ClinicNum);
                    //Doesn't exist in db, add to list to be synced later
                    _listUserPref.Add(userPrefCur);
                }
                row.Cells.Add(clinicCur.Abbr);
                row.Cells.Add(userPrefCur.ValueString);
                row.Tag = userPrefCur;
                gridUserProperties.ListGridRows.Add(row);
            }
            gridUserProperties.EndUpdate();
            Cursor = Cursors.Default;
        }
        ///<summary>Called when user clicks on use defaults for clinic, AuthorizeTab, clinicPicker.SelectedIndexChanged, and CheckEClipboardCreateMissingForms_Click.  It sets various areas enabled or disabled.  Doesn't change the checked values.</summary>
        private void SetUIEClipboardEnabled()
        {
            //bool isClinicSignedUp=EClipboardDisplayAsEnabled();
            bool isClinicSignedUp = MobileAppDevices.IsClinicSignedUpForEClipboard(_clinicNumEClipboardTab);

            if (PrefC.HasClinicsEnabled && _clinicNumEClipboardTab == 0)
            {
                isClinicSignedUp = Clinics.GetForUserod(Security.CurUser).Any(x => MobileAppDevices.IsClinicSignedUpForEClipboard(x.ClinicNum));
            }
            bool notUsingDefaults = _clinicNumEClipboardTab == 0 || !checkEClipboardUseDefaults.Checked;
            bool enableSheets     = checkEClipboardCreateMissingForms.Checked;

            checkEClipboardUseDefaults.Enabled = _clinicNumEClipboardTab != 0 && isClinicSignedUp && _eClipboardAllowEdit;
            groupEClipboardRules.Enabled       = isClinicSignedUp && _eClipboardAllowEdit && notUsingDefaults;
            groupEClipboardSheets.Enabled      = isClinicSignedUp && _eClipboardAllowEdit && notUsingDefaults && enableSheets;
            gridMobileAppDevices.Enabled       = isClinicSignedUp;
            labelEClipboardNotSignedUp.Visible = !isClinicSignedUp;
        }
Пример #28
0
        private void FillClinics()
        {
            if (!PrefC.HasClinicsEnabled)
            {
                listBoxClins.Visible = false;
                labelClinic.Visible  = false;
                checkAllClin.Visible = false;
                return;
            }
            listBoxClins.Items.Clear();
            List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser, true);

            for (int i = 0; i < listClinics.Count; i++)
            {
                listBoxClins.Items.Add(new ODBoxItem <Clinic>(listClinics[i].Abbr, listClinics[i]));
                listBoxClins.SetSelected(i, true);
            }
        }
Пример #29
0
 private void FillClinics()
 {
     if (PrefC.HasClinicsEnabled)             //fill clinic list
     {
         List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser, true, Lan.g(this, "Unassigned"));
         foreach (Clinic clinCur in listClinics)
         {
             ODBoxItem <Clinic> boxItemCur = new ODBoxItem <Clinic>(clinCur.Abbr, clinCur);
             listUnearnedAllocationClins.Items.Add(boxItemCur);
             listNetUnearnedClins.Items.Add(boxItemCur);
             listLineItemClins.Items.Add(boxItemCur);
             listUnearnedAcctClins.Items.Add(boxItemCur);
             if (clinCur.ClinicNum == Clinics.ClinicNum)
             {
                 listUnearnedAllocationClins.SelectedItem = boxItemCur;
                 listNetUnearnedClins.SelectedItem        = boxItemCur;
                 listLineItemClins.SelectedItem           = boxItemCur;
                 listUnearnedAcctClins.SelectedItem       = boxItemCur;
             }
         }
         if (Clinics.ClinicNum == 0)
         {
             checkUnearnedAllocationAllClins.Checked = true;
             checkNetUnearnedAllClins.Checked        = true;
             checkLineItemAllClins.Checked           = true;
             checkUnearnedAcctAllClins.Checked       = true;
         }
     }
     else              //hide label,list,and check box if clinics are not enabled
     {
         listUnearnedAllocationClins.Visible     = false;
         labelUnearnedAllocationClins.Visible    = false;
         checkUnearnedAllocationAllClins.Visible = false;
         listNetUnearnedClins.Visible            = false;
         labelNetUnearnedClins.Visible           = false;
         checkNetUnearnedAllClins.Visible        = false;
         listLineItemClins.Visible         = false;
         labelLineItemClins.Visible        = false;
         checkLineItemAllClins.Visible     = false;
         listUnearnedAcctClins.Visible     = false;
         labelUnearnedAcctClins.Visible    = false;
         checkUnearnedAcctAllClins.Visible = false;
     }
 }
Пример #30
0
        public void FillClinics()
        {
            _listClinics = Clinics.GetForUserod(Security.CurUser);
            comboClinic.Items.Add(Lan.g(this, "All"));
            comboClinic.SelectedIndex = 0;
            int offset = 1;

            if (!Security.CurUser.ClinicIsRestricted)
            {
                comboClinic.Items.Add(Lan.g(this, "Unassigned"));
                offset++;
            }
            _listClinics.ForEach(x => comboClinic.Items.Add(x.Abbr));
            comboClinic.SelectedIndex = _listClinics.FindIndex(x => x.ClinicNum == Clinics.ClinicNum) + offset;
            if (comboClinic.SelectedIndex - offset == -1)
            {
                comboClinic.SelectedIndex = 0;
            }
        }