Exemplo n.º 1
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);
 }
Exemplo n.º 2
0
        ///<summary>Fills listUserTabUsers. Public so that it can be called from the Form that implements this control.</summary>
        public void FillUserTabUsers()
        {
            _isFillingList = true;
            Userod selectedUser = SelectedUser;            //preserve user selection.

            listUserTabUserGroups.Enabled = true;
            listUserTabUsers.Items.Clear();
            foreach (Userod userCur in GetFilteredUsersHelper())
            {
                ODBoxItem <Userod> boxItemCur = new ODBoxItem <Userod>(userCur.UserName, userCur);
                listUserTabUsers.Items.Add(boxItemCur);
                if (selectedUser != null && userCur.UserNum == selectedUser.UserNum)
                {
                    listUserTabUsers.SelectedItem = boxItemCur;
                }
            }
            if (listUserTabUsers.Items.Count == 0)
            {
                listUserTabUserGroups.Enabled = false;
                listUserTabUserGroups.ClearSelected();
                RefreshUserTree();
            }
            else if (SelectedUser == null)
            {
                _isFillingList = false;               //We want the listUsers_SelectedIndexChanged method to get called to refresh the tree.
                listUserTabUsers.SelectedIndex = 0;
            }
            _isFillingList = false;
        }
Exemplo n.º 3
0
 private void FormQuickPasteCat_Load(object sender, System.EventArgs e)
 {
     listType.Items.Clear();
     string[] types;
     if (QuickCat.DefaultForTypes == null ||
         QuickCat.DefaultForTypes == "")
     {
         types = new string[0];
     }
     else
     {
         types = QuickCat.DefaultForTypes.Split(',');
     }
     for (int i = 0; i < Enum.GetNames(typeof(QuickPasteType)).Length; i++)
     {
         ODBoxItem <int> item = new ODBoxItem <int>(Enum.GetNames(typeof(QuickPasteType))[i], i);
         if (i == (int)QuickPasteType.WebChat && !PrefC.IsODHQ)
         {
             continue;
         }
         listType.Items.Add(item);
     }
     for (int j = 0; j < types.Length; j++)
     {
         listType.SetSelectedItem <int>(x => x == PIn.Int(types[j]));
     }
     textDescription.Text = QuickCat.Description;
 }
Exemplo n.º 4
0
        ///<summary>Fills comboBox with providers.  Optionally pass in a list of providers to set prov box with specific provs.</summary>
        private void FillProviders(List <Provider> listProvsForClinic, List <long> listProvNumsToSelect = null)
        {
            if (listProvNumsToSelect == null || listProvNumsToSelect.Count == 0)
            {
                listProvNumsToSelect = new List <long>();
            }
            List <int> listSelectedIndices = new List <int>();

            comboBoxMultiProv.Items.Clear();
            comboBoxMultiProv.Items.Add(new ODBoxItem <Provider>(Lan.g(this, "None"), null));         //tag=null
            foreach (Provider prov in listProvsForClinic)
            {
                int index = comboBoxMultiProv.Items.Count;
                ODBoxItem <Provider> boxProvItem = new ODBoxItem <Provider>(prov.GetLongDesc(), prov);
                comboBoxMultiProv.Items.Add(boxProvItem);
                if (prov.ProvNum.In(listProvNumsToSelect))
                {
                    listSelectedIndices.Add(index);
                }
            }
            if (listSelectedIndices.Count == 0)           //no providers coming in, set default to 'none'
            {
                comboBoxMultiProv.SetSelected(0, true);
            }
            else
            {
                comboBoxMultiProv.SetSelected(true, listSelectedIndices.ToArray());
            }
        }
Exemplo n.º 5
0
        ///<summary></summary>
        private void FormWebSchedAppts_Load(object sender, System.EventArgs e)
        {
            //Set the initial date
            datePicker.SetDateTimeFrom(DateTime.Today);
            datePicker.SetDateTimeTo(DateTime.Today.AddDays(7));
            //Add the appointment confirmation types
            comboBoxMultiConfStatus.Items.Clear();
            long defaultStatus = PrefC.GetLong(PrefName.WebSchedNewPatConfirmStatus);

            if (!checkWebSchedNewPat.Checked && checkWebSchedRecall.Checked)
            {
                defaultStatus = PrefC.GetLong(PrefName.WebSchedRecallConfirmStatus);
            }
            List <Def> listDefs = Defs.GetDefsForCategory(DefCat.ApptConfirmed, true);

            foreach (Def defCur in listDefs)
            {
                ODBoxItem <long> defItem = new ODBoxItem <long>(defCur.ItemName, defCur.DefNum);
                int idx = comboBoxMultiConfStatus.Items.Add(defItem);
                if ((checkWebSchedNewPat.Checked || checkWebSchedRecall.Checked) && defCur.DefNum == defaultStatus)
                {
                    comboBoxMultiConfStatus.SetSelected(idx, true);
                }
            }
            FillGrid();
        }
Exemplo n.º 6
0
 private void RefreshListBoxProcs()
 {
     listboxOrthoPlacementProcs.Items.Clear();
     foreach (long orthoProcCodeNum in _listOrthoPlacementCodeNums)
     {
         ProcedureCode             procCodeCur = ProcedureCodes.GetProcCode(orthoProcCodeNum);
         ODBoxItem <ProcedureCode> listBoxItem = new ODBoxItem <ProcedureCode>(procCodeCur.ProcCode, procCodeCur);
         listboxOrthoPlacementProcs.Items.Add(listBoxItem);
     }
 }
Exemplo n.º 7
0
        private void FillProviders()
        {
            List <Provider> listProvs = Providers.GetListReports();

            foreach (Provider provCur in listProvs)
            {
                ODBoxItem <Provider> boxItemCur = new ODBoxItem <Provider>(provCur.Abbr, provCur);
                listUnearnedAllocationProvs.Items.Add(boxItemCur);
                listNetUnearnedProvs.Items.Add(boxItemCur);
            }
            checkUnearnedAllocationAllProvs.Checked = true;
            checkNetUnearnedAllProvs.Checked        = true;
        }
Exemplo n.º 8
0
 private void FillComboBox(long selectedClinicNum = -1)
 {
     comboClinics.Items.Clear();
     foreach (Clinic clinicCur in _listClinicsInComboBox)
     {
         ODBoxItem <Clinic> boxItemCur = new ODBoxItem <Clinic>(clinicCur.Description, clinicCur);
         comboClinics.Items.Add(boxItemCur);
         if (clinicCur.ClinicNum == selectedClinicNum)
         {
             comboClinics.SelectedIndex = comboClinics.Items.Count - 1;                //Select The item that was just added if it is the selected num.
         }
     }
 }
Exemplo n.º 9
0
 private void FillComboFeeScheds()
 {
     comboFeeSched.Items.Clear();
     foreach (FeeSched sched in _listFeeScheds)
     {
         ODBoxItem <FeeSched> boxItemFeeSched = new ODBoxItem <FeeSched>(sched.Description + (sched.IsHidden?" (Hidden)":""), sched);
         comboFeeSched.Items.Add(boxItemFeeSched);
         if (_feeSchedGroupCur.FeeSchedNum == sched.FeeSchedNum)
         {
             comboFeeSched.SelectedItem = boxItemFeeSched;
         }
     }
 }
Exemplo n.º 10
0
        private void FillUnearnedTypes()
        {
            List <Def> listDefs = Defs.GetDefsForCategory(DefCat.PaySplitUnearnedType, true);

            foreach (Def defCur in listDefs)
            {
                ODBoxItem <Def> boxItemCur = new ODBoxItem <Def>(defCur.ItemName, defCur);
                listUnearnedAllocationTypes.Items.Add(boxItemCur);
                listNetUnearnedTypes.Items.Add(boxItemCur);
            }
            checkUnearnedAllocationAllTypes.Checked = true;
            checkNetUnearnedAllTypes.Checked        = true;
        }
Exemplo n.º 11
0
 private void FillComboBox()
 {
     comboDoseUsers.Items.Clear();
     comboDoseUsers.Items.Add(new ODBoxItem <Userod>(Lan.g(this, "None")));
     comboDoseUsers.SelectedIndex = 0;
     foreach (Userod userCur in _listUsersInComboBox)
     {
         ODBoxItem <Userod> boxItemCur = new ODBoxItem <Userod>(userCur.UserName, userCur);
         comboDoseUsers.Items.Add(boxItemCur);
         if (userCur.UserNum == _selectedUserNum)
         {
             comboDoseUsers.SelectedIndex = comboDoseUsers.Items.Count - 1;                //Select The item that was just added if it is the selected num.
         }
     }
 }
Exemplo n.º 12
0
 ///<summary>Sets the selected item(s) that match the func passed in. Will only work if Items are ODBoxItems.</summary>
 ///<param name="fSelectItem">A func that takes an object that is the same type as the ODBoxItems Tags and returns a bool, i.e.
 ///x => x.ClinicNum==0.</param>
 public void SetSelectedItem <T>(Func <T, bool> fSelectItem)
 {
     for (int i = 0; i < Items.Count; i++)
     {
         ODBoxItem <T> odBoxItem = Items[i] as ODBoxItem <T>;
         if (odBoxItem == null)
         {
             continue;
         }
         if (fSelectItem(odBoxItem.Tag))
         {
             SetSelected(i, true);
         }
     }
 }
Exemplo n.º 13
0
 ///<summary>Fill both listboxes with the states that are taxed and non-taxed based on the current bridge settings.</summary>
 private void FillListStates()
 {
     foreach (USlocale locale in USlocales.ListAll)
     {
         ODBoxItem <string> boxItem = new ODBoxItem <string>(locale.Name, locale.PostalAbbr);
         if (AvaTax.ListTaxableStates.Contains(locale.PostalAbbr))
         {
             listBoxTaxedStates.Items.Add(boxItem);
         }
         else
         {
             listBoxNonTaxedStates.Items.Add(boxItem);
         }
     }
 }
Exemplo n.º 14
0
        private void LoadListDefCats()
        {
            List <DefCatOptions> listDefCatsOrdered = new List <DefCatOptions>();

            listDefCatsOrdered = DefL.GetOptionsForDefCats(Enum.GetValues(typeof(DefCat)));
            listDefCatsOrdered = listDefCatsOrdered.OrderBy(x => x.DefCat.GetDescription()).ToList();             //orders alphabetically.
            ODBoxItem <DefCatOptions> defCatItem;

            foreach (DefCatOptions defCOpt in listDefCatsOrdered)
            {
                defCatItem = new ODBoxItem <DefCatOptions>(Lan.g(this, defCOpt.DefCat.GetDescription()), defCOpt);
                listCategory.Items.Add(defCatItem);
                if (_initialCat == defCOpt.DefCat)
                {
                    listCategory.SelectedItem = defCatItem;
                }
            }
        }
Exemplo n.º 15
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;
     }
 }
Exemplo n.º 16
0
 ///<summary>Fill the rest of the UI with the current bridge settings.</summary>
 private void FillSettings()
 {
     //Set Enabled
     checkEnabled.Checked = Programs.IsEnabled(ProgramName.AvaTax);
     //Set radio buttons
     if (AvaTax.IsProduction)
     {
         radioProdEnv.Checked = true;
     }
     else
     {
         radioTestEnv.Checked = true;
     }
     //Set username and password
     textUsername.Text = ProgramProperties.GetPropVal(ProgramName.AvaTax, ProgramProperties.PropertyDescs.Username);
     textPassword.Text = ProgramProperties.GetPropVal(ProgramName.AvaTax, ProgramProperties.PropertyDescs.Password);
     //Fill Log Level options
     listBoxLogLevel.Items.Clear();
     foreach (LogLevel lv in Enum.GetValues(typeof(LogLevel)))
     {
         ODBoxItem <LogLevel> currentItem = new ODBoxItem <LogLevel>(lv.ToString(), lv);
         listBoxLogLevel.Items.Add(currentItem);
         if (currentItem.Tag == AvaTax.LogDetailLevel)
         {
             listBoxLogLevel.SelectedItem = currentItem;
         }
     }
     //Set company code and sales tax def
     textCompanyCode.Text             = AvaTax.CompanyCode;
     _defCurrentSalesTaxAdjType       = Defs.GetDef(DefCat.AdjTypes, AvaTax.SalesTaxAdjType);
     textAdjType.Text                 = _defCurrentSalesTaxAdjType.ItemName;
     _defCurrentSalesTaxReturnAdjType = Defs.GetDef(DefCat.AdjTypes, AvaTax.SalesTaxReturnAdjType) ?? new Def();
     textReturnAdjType.Text           = _defCurrentSalesTaxReturnAdjType.ItemName;
     _patFieldDefCurrentTaxExempt     = AvaTax.TaxExemptPatField;
     textTaxExempt.Text               = (_patFieldDefCurrentTaxExempt != null) ? _patFieldDefCurrentTaxExempt.FieldName : "";
     validTaxLockDate.Text            = AvaTax.TaxLockDate.ToShortDateString();
     //Set list of procCodes
     textPrePayCodes.Text   = ProgramProperties.GetPropVal(ProgramName.AvaTax, "Prepay Proc Codes");
     textDiscountCodes.Text = ProgramProperties.GetPropVal(ProgramName.AvaTax, "Discount Proc Codes");
     //Set the list of overrides
     textOverrides.Text = ProgramProperties.GetPropVal(ProgramName.AvaTax, "Tax Code Overrides");
 }
Exemplo n.º 17
0
        private void FormCentralUserEdit_Load(object sender, EventArgs e)
        {
            checkIsHidden.Checked = UserCur.IsHidden;
            textUserName.Text     = UserCur.UserName;
            List <UserGroup> listUserGroups = UserGroups.GetDeepCopy();

            _isFillingList = true;
            for (int i = 0; i < listUserGroups.Count; i++)
            {
                UserGroup             groupCur     = listUserGroups[i];
                ODBoxItem <UserGroup> boxItemGroup = new ODBoxItem <UserGroup>(groupCur.Description, groupCur);
                listUserGroup.Items.Add(boxItemGroup);
                if (UserCur.IsInUserGroup(groupCur.UserGroupNum))
                {
                    listUserGroup.SetSelected(i, true);
                }
            }
            if (listUserGroup.SelectedIndex == -1)          //never allowed to delete last group, so this won't fail
            {
                listUserGroup.SelectedIndex = 0;
            }
            _isFillingList = false;
            securityTreeUser.FillTreePermissionsInitial();
            RefreshUserTree();
            if (UserCur.PasswordHash == "")
            {
                butPassword.Text = "Create Password";
            }
            _listAlertSubsOld = AlertSubs.GetAllForUser(Security.CurUser.UserNum);
            listAlertSubMulti.Items.Clear();
            string[] arrayAlertTypes = Enum.GetNames(typeof(AlertType));
            for (int i = 0; i < arrayAlertTypes.Length; i++)
            {
                listAlertSubMulti.Items.Add(arrayAlertTypes[i]);
                listAlertSubMulti.SetSelected(i, _listAlertSubsOld.Exists(x => x.Type == (AlertType)i));
            }
            if (UserCur.IsNew)
            {
                butUnlock.Visible = false;
            }
        }
        ///<summary>Fills listUserGroupTabUserGroups. Public so that it can be called from the Form that implements this control.</summary>
        public void FillListUserGroupTabUserGroups()
        {
            _isFillingList = true;
            UserGroup selectedGroup = SelectedUserGroup;             //Preserve Usergroup selection.

            listUserGroupTabUserGroups.Items.Clear();
            foreach (UserGroup groupCur in UserGroups.GetList(IsForCEMT))
            {
                ODBoxItem <UserGroup> boxItemCur = new ODBoxItem <UserGroup>(groupCur.Description, groupCur);
                listUserGroupTabUserGroups.Items.Add(boxItemCur);
                if (selectedGroup != null && groupCur.UserGroupNum == selectedGroup.UserGroupNum)
                {
                    listUserGroupTabUserGroups.SelectedItem = boxItemCur;
                }
            }
            _isFillingList = false;
            if (listUserGroupTabUserGroups.SelectedItem == null)
            {
                listUserGroupTabUserGroups.SetSelected(0, true);
            }
        }
        private void UserControlSetupWizDefinitions_Load(object sender, EventArgs e)
        {
            IsDone = true;          //this is optional, so the user is done whenever they choose
            List <DefCat> listDefCats = new List <DefCat>();

            //Only including the most important categories so the user is not intimidated with all the options.
            listDefCats.Add(DefCat.AccountColors);
            listDefCats.Add(DefCat.AdjTypes);
            listDefCats.Add(DefCat.AppointmentColors);
            listDefCats.Add(DefCat.ApptConfirmed);
            listDefCats.Add(DefCat.ApptProcsQuickAdd);
            listDefCats.Add(DefCat.AutoNoteCats);
            listDefCats.Add(DefCat.BillingTypes);
            listDefCats.Add(DefCat.BlockoutTypes);
            listDefCats.Add(DefCat.ChartGraphicColors);
            listDefCats.Add(DefCat.CommLogTypes);
            listDefCats.Add(DefCat.ImageCats);
            listDefCats.Add(DefCat.PaymentTypes);
            listDefCats.Add(DefCat.ProcCodeCats);
            listDefCats.Add(DefCat.RecallUnschedStatus);
            listDefCats.Add(DefCat.TxPriorities);
            List <DefCatOptions> listDefCatsOrdered = new List <DefCatOptions>();

            listDefCatsOrdered = DefL.GetOptionsForDefCats(listDefCats.ToArray());
            listDefCatsOrdered = listDefCatsOrdered.OrderBy(x => x.DefCat.GetDescription()).ToList();             //orders alphabetically.
            ODBoxItem <DefCatOptions> defCatItem;

            foreach (DefCatOptions defCOpt in listDefCatsOrdered)
            {
                defCatItem = new ODBoxItem <DefCatOptions>(Lans.g(this, defCOpt.DefCat.GetDescription()), defCOpt);
                listCategory.Items.Add(defCatItem);
                if (defCOpt.DefCat == listDefCatsOrdered[0].DefCat)
                {
                    listCategory.SelectedItem = defCatItem;
                }
            }
        }
Exemplo n.º 20
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            try {
                DateTime.Parse(textTimeEntry.Text);
            }
            catch {
                MsgBox.Show(this, "Please enter a valid Date/Time.");
                return;
            }
            TimeSpan hoursEntered = TimeSpan.FromHours(0);

            try {
                if (textHours.Text.Contains(":"))
                {
                    hoursEntered = ClockEvents.ParseHours(textHours.Text);
                }
                else
                {
                    hoursEntered = TimeSpan.FromHours(Double.Parse(textHours.Text));
                }
                if (hoursEntered == TimeSpan.FromHours(0))
                {
                    throw new ApplicationException("Invalid hoursEntered");
                }
            }
            catch {
                MsgBox.Show(this, "Please enter valid Hours and Minutes.");
                return;
            }
            if (checkOvertime.Checked && comboPTO.SelectedIndex != 0)
            {
                MsgBox.Show(this, "Overtime Adjustments must have PTO Type set to 'None'.\r\n"
                            + "Please select 'None' for PTO Type or uncheck Overtime Adjustment.");
                return;
            }
            //end of validation
            TimeAdjustCur.IsAuto    = radioAuto.Checked;
            TimeAdjustCur.TimeEntry = DateTime.Parse(textTimeEntry.Text);
            if (checkOvertime.Checked)
            {
                TimeAdjustCur.RegHours   = -hoursEntered;
                TimeAdjustCur.OTimeHours = hoursEntered;
                TimeAdjustCur.PtoHours   = TimeSpan.FromHours(0);
                TimeAdjustCur.PtoDefNum  = 0;
            }
            else if (comboPTO.SelectedIndex == 0)
            {
                TimeAdjustCur.RegHours   = hoursEntered;
                TimeAdjustCur.OTimeHours = TimeSpan.FromHours(0);
                TimeAdjustCur.PtoHours   = TimeSpan.FromHours(0);
                TimeAdjustCur.PtoDefNum  = 0;
            }
            else              //Is PTO
            {
                ODBoxItem <Def> item = (ODBoxItem <Def>)comboPTO.Items[comboPTO.SelectedIndex];
                TimeAdjustCur.RegHours   = TimeSpan.FromHours(0);
                TimeAdjustCur.OTimeHours = TimeSpan.FromHours(0);
                TimeAdjustCur.PtoHours   = hoursEntered;
                TimeAdjustCur.PtoDefNum  = ((Def)item.Tag).DefNum;
            }
            TimeAdjustCur.Note = textNote.Text;
            if (IsNew)
            {
                TimeAdjusts.Insert(TimeAdjustCur);
            }
            else
            {
                TimeAdjusts.Update(TimeAdjustCur);
            }
            DialogResult = DialogResult.OK;
        }
Exemplo n.º 21
0
        private void FormAging_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);
            for (int i = 0; i < _listBillingTypeDefs.Count; i++)
            {
                listBillType.Items.Add(_listBillingTypeDefs[i].ItemName);
            }
            if (listBillType.Items.Count > 0)
            {
                listBillType.SelectedIndex = 0;
            }
            listBillType.Visible      = false;
            checkBillTypesAll.Checked = true;
            for (int i = 0; i < _listProviders.Count; i++)
            {
                listProv.Items.Add(_listProviders[i].GetLongDesc());
            }
            if (listProv.Items.Count > 0)
            {
                listProv.SelectedIndex = 0;
            }
            checkProvAll.Checked = true;
            listProv.Visible     = false;
            if (!PrefC.HasClinicsEnabled)
            {
                listClin.Visible     = false;
                labelClin.Visible    = false;
                checkAllClin.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));
                }
                foreach (Clinic clin in listClinics)
                {
                    ODBoxItem <Clinic> boxItemCur;
                    if (clin.IsHidden)
                    {
                        boxItemCur = new ODBoxItem <Clinic>(clin.Abbr + " " + Lan.g(this, "(hidden)"), clin);
                    }
                    else
                    {
                        boxItemCur = new ODBoxItem <Clinic>(clin.Abbr, clin);
                    }
                    listClin.Items.Add(boxItemCur);
                    if (clin.ClinicNum == Clinics.ClinicNum)
                    {
                        listClin.SelectedItem = boxItemCur;
                    }
                }
                if (Clinics.ClinicNum == 0)
                {
                    checkAllClin.Checked = true;
                    listClin.Visible     = false;
                }
            }
            checkAgeNegAdjs.Checked = PrefC.GetBool(PrefName.AgingNegativeAdjsByAdjDate);
            if (PrefC.GetBool(PrefName.AgingReportShowAgePatPayplanPayments))
            {
                //Visibility set to false in designer, only set to visible here.  No UI for pref, only set true via query for specific customer.
                checkAgePatPayPlanPayments.Visible = true;
            }
            if (PrefC.GetBool(PrefName.FutureTransDatesAllowed) || PrefC.GetBool(PrefName.AccountAllowFutureDebits) ||
                PrefC.GetBool(PrefName.AllowFutureInsPayments))
            {
                labelFutureTrans.Visible = true;              //Set to false in designer
            }
        }
Exemplo n.º 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);
            for (int i = 0; i < _listBillingTypeDefs.Count; i++)
            {
                listBillType.Items.Add(_listBillingTypeDefs[i].ItemName);
            }
            if (listBillType.Items.Count > 0)
            {
                listBillType.SelectedIndex = 0;
            }
            listBillType.Visible      = false;
            checkBillTypesAll.Checked = true;           //all billing types by default
            for (int i = 0; i < _listProviders.Count; i++)
            {
                listProv.Items.Add(_listProviders[i].GetLongDesc());
            }
            if (listProv.Items.Count > 0)
            {
                listProv.SelectedIndex = 0;
            }
            checkProvAll.Checked = true;           //all provs by default
            listProv.Visible     = false;
            if (!PrefC.HasClinicsEnabled)
            {
                listClin.Visible     = false;
                labelClin.Visible    = false;
                checkAllClin.Visible = false;
            }
            else
            {
                _listClinics = new List <Clinic>();
                if (!Security.CurUser.ClinicIsRestricted)
                {
                    listClin.Items.Add(new ODBoxItem <Clinic>(Lan.g(this, "Unassigned"), new Clinic()
                    {
                        ClinicNum = 0, Description = "Unassigned", Abbr = "Unassigned"
                    }));
                }
                _listClinics = Clinics.GetForUserod(Security.CurUser);
                foreach (Clinic clinic in _listClinics)
                {
                    ODBoxItem <Clinic> boxItemCur = new ODBoxItem <Clinic>(clinic.Abbr, clinic);
                    listClin.Items.Add(boxItemCur);
                    if (clinic.ClinicNum == Clinics.ClinicNum)
                    {
                        listClin.SelectedItem = boxItemCur;
                    }
                }
                if (Clinics.ClinicNum == 0)
                {
                    checkAllClin.Checked = true;                  //event handler will select all indices
                    listClin.Visible     = false;
                }
            }
        }