Beispiel #1
0
        private void butClone_Click(object sender, EventArgs e)
        {
            if (!IsValid())
            {
                return;                //A message should have already shown to the user.
            }
            long clinicNum = 0;
            long defNum    = 0;

            if (PrefC.HasClinicsEnabled)
            {
                clinicNum = ((ODBoxItem <Clinic>)comboClinic.SelectedItem).Tag.ClinicNum;
            }
            defNum = ((ODBoxItem <Def>)comboSpecialty.SelectedItem).Tag.DefNum;
            Patient clone = Patients.CreateCloneAndSynch(_patientMaster, _familyCur, _listInsPlans, _listInsSubs, _listBenefits, _provNumSelected, clinicNum);

            if (clone != null)
            {
                PatNumClone = clone.PatNum;
                if (defNum != 0)
                {
                    DefLinks.Insert(new DefLink()
                    {
                        DefNum   = defNum,
                        FKey     = PatNumClone,
                        LinkType = DefLinkType.Patient,
                    });
                }
            }
            DialogResult = DialogResult.OK;
        }
Beispiel #2
0
        public static DefLink CreateDefLink(long defNum, long fKey, DefLinkType linkType)
        {
            DefLink defLink = new DefLink()
            {
                DefNum   = defNum,
                FKey     = fKey,
                LinkType = linkType,
            };

            DefLinks.Insert(defLink);
            return(defLink);
        }