Пример #1
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            string phone = textPhone1.Text + textPhone2.Text + textPhone3.Text;

            if (phone.Length > 0 && phone.Length < 10)
            {
                MessageBox.Show(Lan.g(this, "Invalid phone"));
                return;
            }
            RefCur.IsHidden       = checkHidden.Checked;
            RefCur.NotPerson      = checkNotPerson.Checked;
            RefCur.LName          = textLName.Text;
            RefCur.FName          = textFName.Text;
            RefCur.MName          = textMName.Text;
            RefCur.Title          = textTitle.Text;
            RefCur.Address        = textAddress.Text;
            RefCur.Address2       = textAddress2.Text;
            RefCur.City           = textCity.Text;
            RefCur.ST             = textST.Text;
            RefCur.Zip            = textZip.Text;
            RefCur.Telephone      = phone;
            RefCur.Phone2         = textOtherPhone.Text;
            RefCur.SSN            = textSSN.Text;
            RefCur.NationalProvID = textNationalProvID.Text;
            RefCur.EMail          = textEmail.Text;
            RefCur.Note           = textNotes.Text;
            //RefCur.UsingTIN already taken care of
            if (!IsPatient)
            {
                RefCur.Specialty = (DentalSpecialty)listSpecialty.SelectedIndex;
            }
            if (IsNew)
            {
                for (int i = 0; i < Referrals.List.Length; i++)
                {
                    if ((RefCur.LName + RefCur.FName)
                        == (Referrals.List[i].LName + Referrals.List[i].FName))
                    {
                        if (MessageBox.Show(Lan.g(this, "Referral of same name exists. Add anyway?"), ""
                                            , MessageBoxButtons.YesNo) != DialogResult.Yes)
                        {
                            DialogResult = DialogResult.Cancel;
                            return;
                        }
                        break;
                    }
                }
                Referrals.Insert(RefCur);
            }
            else
            {
                Referrals.Update(RefCur);
            }
            //
            Referrals.Refresh();
            //MessageBox.Show(RefCur.ReferralNum.ToString());
            DialogResult = DialogResult.OK;
        }
Пример #2
0
 private void FillTable()
 {
     Referrals.Refresh();
     AList = new ArrayList();
     if (!checkHidden.Checked)
     {
         for (int i = 0; i < Referrals.List.Length; i++)
         {
             if (!Referrals.List[i].IsHidden)
             {
                 AList.Add(Referrals.List[i]);
             }
         }
     }
     else
     {
         for (int i = 0; i < Referrals.List.Length; i++)
         {
             AList.Add(Referrals.List[i]);
         }
     }
     tbRefSelect.ResetRows(AList.Count);
     tbRefSelect.SetGridColor(Color.Gray);
     tbRefSelect.SetBackGColor(Color.White);
     for (int i = 0; i < AList.Count; i++)
     {
         tbRefSelect.Cell[0, i] = ((Referral)(AList[i])).LName;
         tbRefSelect.Cell[1, i] = ((Referral)(AList[i])).FName;
         if (((Referral)(AList[i])).MName != "")
         {
             tbRefSelect.Cell[2, i] = ((Referral)(AList[i])).MName.Substring(0, 1).ToUpper();
         }
         tbRefSelect.Cell[3, i] = ((Referral)(AList[i])).Title;
         if (((Referral)(AList[i])).PatNum == 0 && !((Referral)(AList[i])).NotPerson)
         {
             tbRefSelect.Cell[4, i]
                 = Lan.g("enumDentalSpecialty", ((DentalSpecialty)(((Referral)(AList[i])).Specialty)).ToString());
         }
         if (((Referral)(AList[i])).PatNum > 0)
         {
             tbRefSelect.Cell[5, i] = "X";
         }
         else
         {
             tbRefSelect.Cell[5, i] = "";
         }
         tbRefSelect.Cell[6, i] = ((Referral)(AList[i])).Note;
         if (((Referral)(AList[i])).IsHidden)
         {
             tbRefSelect.SetTextColorRow(i, SystemColors.GrayText);
         }
     }
     tbRefSelect.LayoutTables();
     //if(tbRefSelect.SelectedRow!=-1){
     //  tbRefSelect.ColorRow(tbRefSelect.SelectedRow,Color.Silver);
     //}
 }
Пример #3
0
        private void butEdit_Click(object sender, System.EventArgs e)
        {
            Referral referral = Referrals.GetReferral(RefAttachCur.ReferralNum);
            //if(referral.PatNum > 0){//moved to inside the class
            //	FormRE.IsPatient=true;
            //}
            FormReferralEdit FormRE = new FormReferralEdit(referral);

            FormRE.ShowDialog();
            Referrals.Refresh();
            FillData();
        }
 private void FillRefs()
 {
     Referrals.Refresh();
     listRef.Items.Clear();
     for (int i = 0; i < Referrals.List.Length; i++)
     {
         listRef.Items.Add(Referrals.List[i].LName + ", " + Referrals.List[i].FName);
         if (ClaimCur.ReferringProv == Referrals.List[i].ReferralNum)
         {
             listRef.SelectedIndex = i;
         }
     }
 }
Пример #5
0
        private void butEdit_Click(object sender, System.EventArgs e)
        {
            try{
                SaveData();
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            Referral         referral = Referrals.GetReferral(RefAttachCur.ReferralNum);
            FormReferralEdit FormRE   = new FormReferralEdit(referral);

            FormRE.ShowDialog();
            Referrals.Refresh();
            FillData();
        }