示例#1
0
        public static long CreateTask(Patient pat, BugSubmission sub)
        {
            //Button is only enabled if _patCur is not null (user has 1 row selected).
            //Mimics FormOpenDental.OnTask_Click()
            FormTaskListSelect FormT = new FormTaskListSelect(TaskObjectType.Patient);

            //FormT.Location=new Point(50,50);
            FormT.Text = Lan.g(FormT, "Add Task") + " - " + FormT.Text;
            FormT.ShowDialog();
            if (FormT.DialogResult != DialogResult.OK)
            {
                return(0);
            }
            Task task = new Task();

            task.TaskListNum = -1;          //don't show it in any list yet.
            Tasks.Insert(task);
            Task taskOld = task.Copy();

            if (pat.PatNum != 0)
            {
                task.KeyNum     = pat.PatNum;
                task.ObjectType = TaskObjectType.Patient;
            }
            task.TaskListNum = FormT.ListSelectedLists[0];
            task.UserNum     = Security.CurUser.UserNum;
            //Mimics the ?bug quick note at HQ.
            task.Descript       = BugSubmissions.GetSubmissionDescription(pat, sub);
            task.PriorityDefNum = Defs.GetDefsForCategory(DefCat.TaskPriorities).FirstOrDefault(x => x.ItemName.ToLower().Contains("yellow"))?.DefNum ?? 0;
            FormTaskEdit FormTE = new FormTaskEdit(task, taskOld);

            FormTE.IsNew = true;
            FormTE.ShowDialog();
            return(task.TaskNum);
        }
        private void butWebSchedRecallBlockouts_Click(object sender, EventArgs e)
        {
            string[]    arrayDefNums      = PrefC.GetString(PrefName.WebSchedRecallIgnoreBlockoutTypes).Split(new char[] { ',' }); //comma-delimited list.
            List <long> listBlockoutTypes = new List <long>();

            foreach (string strDefNum in arrayDefNums)
            {
                listBlockoutTypes.Add(PIn.Long(strDefNum));
            }
            List <Def>           listBlockoutTypeDefs = Defs.GetDefs(DefCat.BlockoutTypes, listBlockoutTypes);
            FormDefinitionPicker FormDP = new FormDefinitionPicker(DefCat.BlockoutTypes, listBlockoutTypeDefs);

            FormDP.HasShowHiddenOption  = true;
            FormDP.IsMultiSelectionMode = true;
            FormDP.ShowDialog();
            if (FormDP.DialogResult == DialogResult.OK)
            {
                listboxWebSchedRecallIgnoreBlockoutTypes.Items.Clear();
                foreach (Def defCur in FormDP.ListSelectedDefs)
                {
                    listboxWebSchedRecallIgnoreBlockoutTypes.Items.Add(defCur.ItemName);
                }
                string strListWebSChedRecallIgnoreBlockoutTypes = String.Join(",", FormDP.ListSelectedDefs.Select(x => x.DefNum));
                Prefs.UpdateString(PrefName.WebSchedRecallIgnoreBlockoutTypes, strListWebSChedRecallIgnoreBlockoutTypes);
            }
        }
示例#3
0
        private void FormLetterMerges_Load(object sender, System.EventArgs e)
        {
            mergePath = PrefC.GetString(PrefName.LetterMergePath);
            FillCats();
            if (listCategories.Items.Count > 0)
            {
                listCategories.SelectedIndex = 0;
            }
            FillLetters();
            if (listLetters.Items.Count > 0)
            {
                listLetters.SelectedIndex = 0;
            }
            List <Def> listImageCatDefs = Defs.GetDefsForCategory(DefCat.ImageCats, true);

            comboImageCategory.Items.Clear();
            //Create None image category
            comboImageCategory.Items.Add(new ODBoxItem <Def>(Lan.g(this, "None"), new Def()
            {
                DefNum = 0
            }));
            foreach (Def imageCat in listImageCatDefs)
            {
                comboImageCategory.Items.Add(new ODBoxItem <Def>(imageCat.ItemName, imageCat));
            }
            SelectImageCat();
        }
示例#4
0
        ///<summary>Used by FormUpdate to check whether codes starting with T exist and are in a visible category.  If so, it moves them to the Obsolete category.</summary>
        public static void TcodesMove()
        {
            string    command = @"SELECT DISTINCT ProcCat FROM procedurecode,definition 
				WHERE procedurecode.ADACode LIKE 'T%'
				AND definition.IsHidden=0
				AND procedurecode.ProcCat=definition.DefNum"                ;
            DataTable table   = General.GetTable(command);

            if (table.Rows.Count == 0)
            {
                return;
            }
            int catNum = DefB.GetByExactName(DefCat.ProcCodeCats, "Obsolete");         //check to make sure an Obsolete category exists.

            if (catNum == 0)
            {
                Def def = new Def();
                def.Category  = DefCat.ProcCodeCats;
                def.ItemName  = "Obsolete";
                def.ItemOrder = DefB.Long[(int)DefCat.ProcCodeCats].Length;
                Defs.Insert(def);
                catNum = def.DefNum;
            }
            for (int i = 0; i < table.Rows.Count; i++)
            {
                command = "UPDATE procedurecode SET ProcCat=" + POut.PInt(catNum)
                          + " WHERE ProcCat=" + table.Rows[i][0].ToString();
                General.NonQ(command);
            }
        }
        ///<summary>Fills the Global Task filter combobox with options.  Only visible if Clinics are enabled, or if previous selection no is longer
        ///available, example: Clinics have been turned off, Clinic filter no longer available.</summary>
        private void FillComboGlobalFilter()
        {
            GlobalTaskFilterType globalPref = (GlobalTaskFilterType)PrefC.GetInt(PrefName.TasksGlobalFilterType);

            comboGlobalFilter.Items.Add(Lan.g(this, GlobalTaskFilterType.Disabled.GetDescription()), GlobalTaskFilterType.Disabled);
            comboGlobalFilter.Items.Add(Lan.g(this, GlobalTaskFilterType.None.GetDescription()), GlobalTaskFilterType.None);
            if (PrefC.HasClinicsEnabled)
            {
                labelGlobalFilter.Visible = true;
                comboGlobalFilter.Visible = true;
                comboGlobalFilter.Items.Add(Lan.g(this, GlobalTaskFilterType.Clinic.GetDescription()), GlobalTaskFilterType.Clinic);
                if (Defs.GetDefsForCategory(DefCat.Regions).Count > 0)
                {
                    comboGlobalFilter.Items.Add(Lan.g(this, GlobalTaskFilterType.Region.GetDescription()), GlobalTaskFilterType.Region);
                }
            }
            comboGlobalFilter.SetSelectedEnum(globalPref);
            if (comboGlobalFilter.SelectedIndex == -1)
            {
                labelGlobalFilter.Visible = true;
                comboGlobalFilter.Visible = true;
                errorProvider1.SetError(comboGlobalFilter, $"Previous selection \"{globalPref.GetDescription()}\" is no longer available.  "
                                        + "Saving will overwrite previous setting.");
                comboGlobalFilter.SelectedIndex = 0;
            }
        }
		private void FillCount(List<Job> listJobs) {
			textConceptJobs.Text=listJobs.Count(x => x.PhaseCur==JobPhase.Concept).ToString();
			textWriteupJobs.Text=listJobs.Count(x => x.OwnerAction==JobAction.WriteConcept || x.OwnerAction==JobAction.WriteJob).ToString();
			textDevelopmentJobs.Text=listJobs.Count(x => x.PhaseCur==JobPhase.Development).ToString();
			textActiveAdvisorJobs.Text=listJobs.Count(x => x.OwnerAction==JobAction.Advise).ToString();
			textJobsOnHold.Text=listJobs.Count(x => x.Priority==Defs.GetDefsForCategory(DefCat.JobPriorities,true).FirstOrDefault(y => y.ItemValue.Contains("OnHold")).DefNum).ToString();
		}
示例#7
0
 private void FormRpFinanceCharge_Load(object sender, System.EventArgs e)
 {
     textDateFrom.Text    = PrefC.GetDate(PrefName.FinanceChargeLastRun).ToShortDateString();
     textDateTo.Text      = PrefC.GetDate(PrefName.FinanceChargeLastRun).ToShortDateString();
     _listProviders       = Providers.GetListReports();
     _listBillingTypeDefs = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
     foreach (Def billingType in _listBillingTypeDefs)
     {
         listBillingType.Items.Add(billingType.ItemName);
     }
     if (listBillingType.Items.Count > 0)
     {
         listBillingType.SelectedIndex = 0;
     }
     foreach (Provider prov in _listProviders)
     {
         listProv.Items.Add(prov.GetLongDesc());
     }
     if (listProv.Items.Count > 0)
     {
         listProv.SelectedIndex = 0;
     }
     checkAllProv.Checked    = true;
     checkAllBilling.Checked = true;
     listProv.Visible        = false;
     listBillingType.Visible = false;
 }
示例#8
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();
        }
示例#9
0
 ///<summary>Opens the appropriate form to edit the program property.</summary>
 private void PropertyTypeDirector(ProgramProperty prop)
 {
     if (ProgramCur.ProgName == ProgramName.XVWeb.ToString() && prop.PropertyDesc == XVWeb.ProgramProps.ImageCategory)         //imageCategory
     {
         List <Def> listDefs = Defs.GetDefsForCategory(DefCat.ImageCats, true);
         int        idxDef   = listDefs.FindIndex(x => x.DefNum == PIn.Long(prop.PropertyValue));
         InputBox   inputBox = new InputBox("Choose an Image Category", listDefs.Select(x => x.ItemName).ToList(), idxDef);
         inputBox.ShowDialog();
         if (inputBox.DialogResult != DialogResult.OK || inputBox.SelectedIndex == -1)
         {
             return;
         }
         prop.PropertyValue = POut.Long(listDefs[inputBox.SelectedIndex].DefNum);
         ProgramProperties.Update(prop);
     }
     else
     {
         bool propIsPassword        = ProgramCur.ProgName == ProgramName.XVWeb.ToString() && prop.PropertyDesc == XVWeb.ProgramProps.Password;
         FormProgramProperty FormPP = new FormProgramProperty(propIsPassword);
         FormPP.ProgramPropertyCur = prop;
         FormPP.ShowDialog();
         if (FormPP.DialogResult != DialogResult.OK)
         {
             return;
         }
     }
     ProgramProperties.RefreshCache();
     FillGrid();
 }
示例#10
0
        private void FillTabWebSchedNewPat()
        {
            int newPatApptDays = PrefC.GetInt(PrefName.WebSchedNewPatApptSearchAfterDays);

            textWebSchedNewPatApptMessage.Text              = PrefC.GetString(PrefName.WebSchedNewPatApptMessage);
            textWebSchedNewPatApptSearchDays.Text           = newPatApptDays > 0 ? newPatApptDays.ToString() : "";
            checkWebSchedNewPatForcePhoneFormatting.Checked = PrefC.GetBool(PrefName.WebSchedNewPatApptForcePhoneFormatting);
            DateTime dateWebSchedNewPatSearch = DateTime.Now;

            dateWebSchedNewPatSearch = dateWebSchedNewPatSearch.AddDays(newPatApptDays);
            textWebSchedNewPatApptsDateStart.Text = dateWebSchedNewPatSearch.ToShortDateString();
            FillListBoxWebSchedBlockoutTypes(PrefC.GetString(PrefName.WebSchedNewPatApptIgnoreBlockoutTypes).Split(new char[] { ',' }), listboxWebSchedNewPatIgnoreBlockoutTypes);
            FillGridWebSchedNewPatApptHostedURLs();
            FillGridWSNPAReasons();
            FillGridWebSchedNewPatApptOps();
            //This needs to happen after all of the previous fills because it's asynchronous.
            FillGridWebSchedNewPatApptTimeSlotsThreaded();
            long defaultStatus = PrefC.GetLong(PrefName.WebSchedNewPatConfirmStatus);

            comboWSNPConfirmStatuses.Items.AddDefs(Defs.GetDefsForCategory(DefCat.ApptConfirmed, true));
            comboWSNPConfirmStatuses.SetSelectedDefNum(defaultStatus);
            checkNewPatAllowProvSelection.Checked = PrefC.GetBool(PrefName.WebSchedNewPatAllowProvSelection);
            if (!PrefC.HasClinicsEnabled)
            {
                labelWSNPClinic.Visible    = false;
                comboWSNPClinics.Visible   = false;
                labelWSNPTimeSlots.Visible = false;
            }
            checkWSNPDoubleBooking.Checked = PrefC.GetInt(PrefName.WebSchedNewPatApptDoubleBooking) > 0;        //0 = Allow double booking, 1 = prevent
        }
示例#11
0
        ///<summary>Used in the case when clinics are disabled. Requires special logic that doesn't use clinics.</summary>
        private void FillComboSpecialtyNoClinics()
        {
            //Get all non-hidden specialties
            List <Def> listSpecialtyDefs = Defs.GetDefsForCategory(DefCat.ClinicSpecialty, true);
            //Fill the list of defLinks used by clones of this patient.
            List <long>    listClonePatNums   = PatientLinks.GetPatNumsLinkedFrom(_patientMaster.PatNum, PatientLinkType.Clone);
            List <DefLink> listPatCurDefLinks = DefLinks.GetListByFKeys(listClonePatNums, DefLinkType.Patient);

            //Filter out any specialties that are currently in use by clones of this patient.
            if (listPatCurDefLinks.Count > 0)
            {
                listSpecialtyDefs.RemoveAll(x => x.DefNum.In(listPatCurDefLinks.Select(y => y.DefNum).ToList()));
            }
            comboSpecialty.Items.Clear();
            //Create a dummy specialty of 0.  Always allow the user to make Unspecified clones.
            comboSpecialty.Items.Add(new ODBoxItem <Def>(Lan.g(this, "Unspecified"), new Def()
            {
                DefNum = 0
            }));
            foreach (Def specialty in listSpecialtyDefs)
            {
                comboSpecialty.Items.Add(new ODBoxItem <Def>(specialty.ItemName, specialty));
            }
            comboSpecialty.SelectedIndex = 0;
        }
        private void FillTabWebSchedNewPat()
        {
            int newPatApptDays = PrefC.GetInt(PrefName.WebSchedNewPatApptSearchAfterDays);

            textWebSchedNewPatApptMessage.Text              = PrefC.GetString(PrefName.WebSchedNewPatApptMessage);
            textWebSchedNewPatApptSearchDays.Text           = newPatApptDays > 0 ? newPatApptDays.ToString() : "";
            checkWebSchedNewPatForcePhoneFormatting.Checked = PrefC.GetBool(PrefName.WebSchedNewPatApptForcePhoneFormatting);
            DateTime dateWebSchedNewPatSearch = DateTime.Now;

            dateWebSchedNewPatSearch = dateWebSchedNewPatSearch.AddDays(newPatApptDays);
            textWebSchedNewPatApptsDateStart.Text = dateWebSchedNewPatSearch.ToShortDateString();
            FillListBoxWebSchedBlockoutTypes(PrefC.GetString(PrefName.WebSchedNewPatApptIgnoreBlockoutTypes).Split(new char[] { ',' }), listboxWebSchedNewPatIgnoreBlockoutTypes);
            FillGridWebSchedNewPatApptHostedURLs();
            FillGridWSNPAReasons();
            FillGridWebSchedNewPatApptOps();
            //This needs to happen after all of the previous fills because it's asynchronous.
            FillGridWebSchedNewPatApptTimeSlotsThreaded();
            long       defaultStatus = PrefC.GetLong(PrefName.WebSchedNewPatConfirmStatus);
            List <Def> listDefs      = Defs.GetDefsForCategory(DefCat.ApptConfirmed, true);

            for (int i = 0; i < listDefs.Count; i++)
            {
                int idx = comboWSNPConfirmStatuses.Items.Add(listDefs[i].ItemName);
                if (listDefs[i].DefNum == defaultStatus)
                {
                    comboWSNPConfirmStatuses.SelectedIndex = idx;
                }
            }
            comboWSNPConfirmStatuses.IndexSelectOrSetText(listDefs.ToList().FindIndex(x => x.DefNum == defaultStatus),
                                                          () => { return(defaultStatus == 0 ? "" : Defs.GetName(DefCat.ApptConfirmed, defaultStatus) + " (" + Lan.g(this, "hidden") + ")"); });
            checkNewPatAllowProvSelection.Checked = PrefC.GetBool(PrefName.WebSchedNewPatAllowProvSelection);
        }
示例#13
0
        private void FormClaimCustomTrackingUpdate_Load(object sender, EventArgs e)
        {
            if (!PrefC.GetBool(PrefName.ClaimTrackingStatusExcludesNone))
            {
                //None is allowed as an option
                comboCustomTracking.Items.AddDefNone();
                comboCustomTracking.SelectedIndex = 0;
            }
            comboCustomTracking.Items.AddDefs(Defs.GetDefsForCategory(DefCat.ClaimCustomTracking, true));
            ClaimTracking claimTrack = ListNewClaimTracks.FirstOrDefault();

            if (claimTrack == null)          //Creating a new ClaimTracking
            {
                comboCustomTracking.SelectedIndex = 0;
            }
            else
            {
                comboCustomTracking.SetSelectedDefNum(claimTrack.TrackingDefNum);
                //An existing ClaimTracking could still have a TrackingDefNum of 0='None'.
                //Even if the new pref blocks "None" from showing.
                //In that case, the setter above, will show "None", but selectedIndex will be -1,
                //preventing user from saving down below.
            }
            textNotes.Text = claimTrack?.Note ?? "";
            FillComboErrorCode();
        }
示例#14
0
        private void FillGridCustomers()
        {
            gridCustomers.BeginUpdate();
            gridCustomers.Columns.Clear();
            gridCustomers.Columns.Add(new ODGridColumn("PatNum", -1));
            gridCustomers.Columns.Add(new ODGridColumn("Name", -1));
            gridCustomers.Columns.Add(new ODGridColumn("BillType", -1));
            gridCustomers.Columns.Add(new ODGridColumn("Unlink", 40, HorizontalAlignment.Center));
            gridCustomers.Rows.Clear();
            List <Patient> listPatients = Patients.GetMultPats(_listJobLinks.FindAll(x => x.LinkType == JobLinkType.Customer)
                                                               .Select(x => x.FKey).ToList()).ToList();

            foreach (Patient pat in listPatients)
            {
                ODGridRow row = new ODGridRow()
                {
                    Tag = pat
                };
                row.Cells.Add(pat.PatNum.ToString());
                row.Cells.Add(pat.GetNameFL());
                row.Cells.Add(Defs.GetDef(DefCat.BillingTypes, pat.BillingType).ItemName);
                row.Cells.Add("X");
                gridCustomers.Rows.Add(row);
            }
            gridCustomers.EndUpdate();
        }
示例#15
0
 private void FormAutoNoteCompose_Load(object sender, EventArgs e)
 {
     _listAutoNoteCatDefs = Defs.GetDefsForCategory(DefCat.AutoNoteCats, true);
     _listAutoNotePrompts = new List <AutoNoteListItem>();
     _userOdCurPref       = UserOdPrefs.GetByUserAndFkeyType(Security.CurUser.UserNum, UserOdFkeyType.AutoNoteExpandedCats).FirstOrDefault();
     FillListTree();
 }
示例#16
0
        private void FormScheduleBlockEdit_Load(object sender, System.EventArgs e)
        {
            listType.Items.Clear();
            //This list will be null if there isn't a passed in list.  We pass in lists if we want to show a special modified list.
            if (_listBlockoutCatDefs == null)
            {
                _listBlockoutCatDefs = Defs.GetDefsForCategory(DefCat.BlockoutTypes, true);
            }
            for (int i = 0; i < _listBlockoutCatDefs.Count; i++)
            {
                listType.Items.Add(_listBlockoutCatDefs[i].ItemName);
                if (_schedCur.BlockoutType == _listBlockoutCatDefs[i].DefNum)
                {
                    listType.SelectedIndex = i;
                }
            }
            if (listType.Items.Count == 0)
            {
                MsgBox.Show(this, "You must setup blockout types first in Setup-Definitions.");
                DialogResult = DialogResult.Cancel;
                return;
            }
            if (listType.SelectedIndex == -1)
            {
                listType.SelectedIndex = 0;
            }
            listOp.Items.Clear();
            //Filter clinics by the clinic passed in.
            List <Operatory> listOpsShort = Operatories.GetDeepCopy(true);

            _listOps = new List <Operatory>();
            for (int i = 0; i < listOpsShort.Count; i++)
            {
                if (!PrefC.GetBool(PrefName.EasyNoClinics) && _clinicNum != 0)               //Using clinics and a clinic filter was passed in.
                {
                    if (listOpsShort[i].ClinicNum != _clinicNum)
                    {
                        continue;
                    }
                }
                listOp.Items.Add(listOpsShort[i].OpName);
                _listOps.Add(listOpsShort[i]);
                if (_schedCur.Ops.Contains(listOpsShort[i].OperatoryNum))
                {
                    listOp.SetSelected(listOp.Items.Count - 1, true);                 //Select the item that was just added.
                }
            }
            DateTime time;

            for (int i = 0; i < 24; i++)
            {
                time = DateTime.Today + TimeSpan.FromHours(7) + TimeSpan.FromMinutes(30 * i);
                comboStart.Items.Add(time.ToShortTimeString());
                comboStop.Items.Add(time.ToShortTimeString());
            }
            comboStart.Text = _schedCur.StartTime.ToShortTimeString();
            comboStop.Text  = _schedCur.StopTime.ToShortTimeString();
            textNote.Text   = _schedCur.Note;
            comboStart.Select();
        }
        private void FillComboErrorCode()
        {
            Def[] arrayErrorCodeDefs = Defs.GetDefsForCategory(DefCat.ClaimErrorCode, true).ToArray();
            comboErrorCode.Items.Clear();
            //Add "none" option.
            comboErrorCode.Items.Add(new ODBoxItem <Def>(Lan.g(this, "None"), new Def()
            {
                ItemValue = "", DefNum = 0
            }));
            comboErrorCode.SelectedIndex = 0;
            if (arrayErrorCodeDefs.Length == 0)
            {
                //if the list is empty, then disable the comboBox.
                comboErrorCode.Enabled = false;
                return;
            }
            //Fill comboErrorCode.
            ClaimTracking claimTrack = ListNewClaimTracks.FirstOrDefault();

            for (int i = 0; i < arrayErrorCodeDefs.Length; i++)
            {
                //hooray for using new ODBoxItems!
                comboErrorCode.Items.Add(new ODBoxItem <Def>(arrayErrorCodeDefs[i].ItemName, arrayErrorCodeDefs[i]));
                if (claimTrack?.TrackingErrorDefNum == arrayErrorCodeDefs[i].DefNum)
                {
                    comboErrorCode.SelectedIndex = i + 1;                //adding 1 to the index because we have added a 'none' option above
                }
            }
        }
示例#18
0
 private void FormSupplyEdit_Load(object sender, EventArgs e)
 {
     textSupplier.Text  = Suppliers.GetName(ListSupplier, Supp.SupplierNum);
     SuppOriginal       = Supp.Copy();
     _listSupplyCatDefs = Defs.GetDefsForCategory(DefCat.SupplyCats, true);
     for (int i = 0; i < _listSupplyCatDefs.Count; i++)
     {
         comboCategory.Items.Add(_listSupplyCatDefs[i].ItemName);
         if (Supp.Category == _listSupplyCatDefs[i].DefNum)
         {
             comboCategory.SelectedIndex = i;
         }
     }
     if (comboCategory.SelectedIndex == -1)
     {
         comboCategory.SelectedIndex = 0;              //There are no hidden cats, and presence of cats is checked before allowing user to add new.
     }
     categoryInitialVal     = Supp.Category;
     textCatalogNumber.Text = Supp.CatalogNumber;
     textDescript.Text      = Supp.Descript;
     if (Supp.LevelDesired != 0)
     {
         textLevelDesired.Text = Supp.LevelDesired.ToString();
     }
     if (Supp.LevelOnHand != 0)
     {
         textLevelOnHand.Text = Supp.LevelOnHand.ToString();
     }
     if (Supp.Price != 0)
     {
         textPrice.Text = Supp.Price.ToString("n");
     }
     checkIsHidden.Checked = Supp.IsHidden;
     isHiddenInitialVal    = Supp.IsHidden;
 }
示例#19
0
        /// <summary>Chooses which type of form to open based on current program and selected property.</summary>
        private void gridMain_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e)
        {
            ProgramProperty programProperty = (ProgramProperty)gridMain.ListGridRows[e.Row].Tag;

            switch (ProgramCur.ProgName)
            {
            case nameof(ProgramName.XVWeb):
                switch (programProperty.PropertyDesc)
                {
                case XVWeb.ProgramProps.ImageCategory:
                    List <string> listDefNums   = Defs.GetDefsForCategory(DefCat.ImageCats, true).Select(x => POut.Long(x.DefNum)).ToList();
                    List <string> listItemNames = Defs.GetDefsForCategory(DefCat.ImageCats, true).Select(x => x.ItemName).ToList();
                    ShowComboBoxForProgramProperty(programProperty, listDefNums, listItemNames, Lans.g(this, "Choose an Image Category"));
                    return;

                case XVWeb.ProgramProps.ImageQuality:
                    List <string> listOptions = Enum.GetValues(typeof(XVWebImageQuality)).Cast <XVWebImageQuality>().Select(x => x.ToString()).ToList();
                    List <string> listDisplay = listOptions.Select(x => Lans.g(this, x)).ToList();
                    ShowComboBoxForProgramProperty(programProperty, listOptions, listDisplay, Lans.g(this, "Choose an Image Quality"));
                    return;
                }
                break;
            }
            ShowFormProgramProperty(programProperty);
        }
示例#20
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();
        }
示例#21
0
        public static GridRow CreateRowForPaySplit(DataRow rowBundlePayment, PaySplit paySplit, bool isDynamic = false)
        {
            string descript = Defs.GetName(DefCat.PaymentTypes, PIn.Long(rowBundlePayment["PayType"].ToString()));

            if (rowBundlePayment["CheckNum"].ToString() != "")
            {
                descript += " #" + rowBundlePayment["CheckNum"].ToString();
            }
            descript += " " + paySplit.SplitAmt.ToString("c");
            if (PIn.Double(rowBundlePayment["PayAmt"].ToString()) != paySplit.SplitAmt)
            {
                descript += Lans.g("PayPlanL", "(split)");
            }
            GridRow row = new GridRow();

            row.Cells.Add(paySplit.DatePay.ToShortDateString());                                //0 Date
            row.Cells.Add(Providers.GetAbbr(PIn.Long(rowBundlePayment["ProvNum"].ToString()))); //1 Prov Abbr
            row.Cells.Add(descript);                                                            //2 Descript
            row.Cells.Add("");                                                                  //3 Principal
            row.Cells.Add("");                                                                  //4 Interest
            row.Cells.Add("");                                                                  //5 Due
            row.Cells.Add(paySplit.SplitAmt.ToString("n"));                                     //6 Payment
            if (!isDynamic)
            {
                row.Cells.Add("");        //7 Adjustment - Does not exist for dynamic payment plans
            }
            row.Cells.Add("");            //8 Balance (filled later)
            row.Tag       = paySplit;
            row.ColorText = Defs.GetDefByExactName(DefCat.AccountColors, "Payment").ItemColor;
            return(row);
        }
示例#22
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);
 }
示例#23
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textName.Text == "")
            {
                MsgBox.Show(this, "Name required.");
                return;
            }
            DefCur.ItemName = textName.Text;
            List <string> itemVal = new List <string>();

            if (checkCutCopyPaste.Checked)
            {
                itemVal.Add(BlockoutType.DontCopy.GetDescription());
            }
            if (checkOverlap.Checked)
            {
                itemVal.Add(BlockoutType.NoSchedule.GetDescription());
            }
            DefCur.ItemValue = string.Join(",", itemVal);
            DefCur.IsHidden  = checkHidden.Checked;
            DefCur.ItemColor = butColor.BackColor;
            if (IsNew)
            {
                Defs.Insert(DefCur);
            }
            else
            {
                Defs.Update(DefCur);
            }
            DialogResult = DialogResult.OK;
        }
示例#24
0
 private void FillCategories()
 {
     ProcButtonQuicks.ValidateAll();
     listCategories.Items.Clear();
     listCategories.Items.Add("Quick Buttons");            //hardcoded category.
     _listProcButtonCatDefs = Defs.GetDefsForCategory(DefCat.ProcButtonCats, true);
     if (_listProcButtonCatDefs.Count == 0)
     {
         selectedCat = 0;
         listCategories.SelectedIndex = 0;
         return;
     }
     for (int i = 0; i < _listProcButtonCatDefs.Count; i++)
     {
         listCategories.Items.Add(_listProcButtonCatDefs[i].ItemName);
         if (selectedCat == _listProcButtonCatDefs[i].DefNum)
         {
             listCategories.SelectedIndex = i + 1;
         }
     }
     if (listCategories.SelectedIndex == -1)          //category was hidden, or just openning the form
     {
         listCategories.SelectedIndex = 0;
         selectedCat = 0;
     }
     if (listCategories.SelectedIndex > 0)           //hardcoded category doesn't have a DefNum.
     {
         selectedCat = _listProcButtonCatDefs[listCategories.SelectedIndex - 1].DefNum;
     }
 }
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g(this, "Date"), 100);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Category"), 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Description"), 300);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            Docs = Documents.GetAllWithPat(PatNum);
            for (int i = 0; i < Docs.Length; i++)
            {
                row = new GridRow();
                row.Cells.Add(Docs[i].DateCreated.ToString());
                row.Cells.Add(Defs.GetName(DefCat.ImageCats, Docs[i].DocCategory));
                row.Cells.Add(Docs[i].Description);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
示例#26
0
 private void FormAccountingAutoPayEdit_Load(object sender, EventArgs e)
 {
     if (AutoPayCur == null)
     {
         MessageBox.Show("Autopay cannot be null.");                //just for debugging
     }
     _listPaymentTypeDefs = Defs.GetDefsForCategory(DefCat.PaymentTypes, true);
     for (int i = 0; i < _listPaymentTypeDefs.Count; i++)
     {
         comboPayType.Items.Add(_listPaymentTypeDefs[i].ItemName);
         if (_listPaymentTypeDefs[i].DefNum == AutoPayCur.PayType)
         {
             comboPayType.SelectedIndex = i;
         }
     }
     if (AutoPayCur.PickList == null)
     {
         AutoPayCur.PickList = "";
     }
     string[] strArray = AutoPayCur.PickList.Split(new char[] { ',' });
     accountAL = new ArrayList();
     for (int i = 0; i < strArray.Length; i++)
     {
         if (strArray[i] == "")
         {
             continue;
         }
         accountAL.Add(PIn.Long(strArray[i]));
     }
     FillList();
 }
示例#27
0
        private void FormTaskSearch_Load(object sender, EventArgs e)
        {
            if (IsSelectionMode)
            {
                butClose.Text = "Cancel";
            }
            //Note: DateTime strings that are empty actually are " " due to how the empty datetime control behaves.
            _listTaskPriorities = Defs.GetDefsForCategory(DefCat.TaskPriorities);
            long userNum = 0;

            comboUsers.Items.Add(Lan.g(this, "All"));
            comboUsers.Items.Add(Lan.g(this, "Me"));
            comboUsers.SelectedIndex = 0;          //Always default to All.
            _listUsers = Userods.GetDeepCopy();    //List of all users for searching.  I figure we don't want to exclude hidden ones for searching.
            _listUsers.ForEach(x => comboUsers.Items.Add(x.UserName));
            comboPriority.Items.Add(Lan.g(this, "All"));
            for (int i = 0; i < _listTaskPriorities.Count; i++)
            {
                comboPriority.Items.Add(_listTaskPriorities[i].ItemName);
            }
            comboPriority.SelectedIndex = 0;
            checkLimit.Checked          = true;
            if (PrefC.HasReportServer)
            {
                checkReportServer.Checked = true;
            }
            else
            {
                checkReportServer.Visible = false;
            }
            _tableTasks = Tasks.GetDataSet(userNum, new List <long>(), 0, " ", " ", " ", " ", textDescription.Text, 0, 0, checkBoxIncludesTaskNotes.Checked,
                                           checkBoxIncludeCompleted.Checked, true, checkReportServer.Checked);
            FillGrid();
        }
示例#28
0
 private void radioAdj_CheckedChanged(object sender, EventArgs e)
 {
     if (radioAdj.Checked)
     {
         labelDescr.Text = Lan.g(this, "Broken appointments based on broken appointment adjustments");
         listOptions.Items.Clear();
         _listPosAdjTypes.Clear();
         listOptions.SelectionMode = SelectionMode.MultiSimple;
         _listPosAdjTypes          = Defs.GetPositiveAdjTypes();
         long brokenApptAdjDefNum = PrefC.GetLong(PrefName.BrokenAppointmentAdjustmentType);
         for (int i = 0; i < _listPosAdjTypes.Count; i++)
         {
             listOptions.Items.Add(_listPosAdjTypes[i].ItemName);
             if (_listPosAdjTypes[i].DefNum == brokenApptAdjDefNum)
             {
                 listOptions.SelectedIndices.Add(i);
             }
         }
         listOptions.Visible = true;
     }
     else
     {
         listOptions.Visible = false;
     }
 }
示例#29
0
 private void FormSupplies_Load(object sender,EventArgs e)
 {
     this.Height=SystemInformation.WorkingArea.Height;//Resize height
     this.Location=new Point(Location.X,0);//Move window to compensate for changed height
     _listSuppliers=Suppliers.GetAll();
     comboSuppliers.Items.Clear();
     comboSuppliers.IncludeAll=true;
     comboSuppliers.IsAllSelected=true;
     comboSuppliers.Items.AddList(_listSuppliers,x=>x.Name);
     if(IsSelectMode){
         butAdd.Visible=false;
         labelSuppliers.Visible=false;
         comboSuppliers.Visible=false;
         //comboSupplier.SetSelectedKey<Supply>(SelectedSupplierNum,x=>x.SupplierNum,x=>Suppliers.GetName(_listSuppliers,x));
         //comboSupplier.Enabled=false;
         checkEnterQty.Visible=false;
         butUp.Visible=false;
         butDown.Visible=false;
         groupCreateOrders.Visible=false;
         labelCreateOrder.Visible=false;
         butPrint.Visible=false;
         labelPrint.Visible=false;
     }
     else{
         butOK.Visible=false;
         butCancel.Text="Close";
     }
     comboCategories.IncludeAll=true;
     comboCategories.Items.AddDefs(Defs.GetDefsForCategory(DefCat.SupplyCats,true));//not showing hidden categories
     comboCategories.IsAllSelected=true;
     FillGrid();
 }
示例#30
0
        private void FillGrid()
        {
            InsFilingCodes.RefreshCache();
            _listInsFilingCodes = InsFilingCodes.GetDeepCopy();
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TableInsFilingCodes", "Description"), 250);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsFilingCodes", "Group"), 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsFilingCodes", "EclaimCode"), 100);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < _listInsFilingCodes.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(_listInsFilingCodes[i].Descript);
                string group = "";
                if (_listInsFilingCodes[i].GroupType > 0)
                {
                    group = Defs.GetDef(DefCat.InsuranceFilingCodeGroup, _listInsFilingCodes[i].GroupType)?.ItemName ?? "";
                }
                row.Cells.Add(group);
                row.Cells.Add(_listInsFilingCodes[i].EclaimCode);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }