private void listRef_DoubleClick(object sender, System.EventArgs e)
        {
            FormReferralEdit FormREdit = new FormReferralEdit(Referrals.List[listRef.SelectedIndex]);

            FormREdit.ShowDialog();
            FillRefs();
        }
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            Referral refCur = new Referral();
            //this will never be a patient; always a dentist
            FormReferralEdit FormREdit = new FormReferralEdit(refCur);

            FormREdit.IsNew = true;
            FormREdit.ShowDialog();
            FillRefs();
        }
Esempio n. 3
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            Referral refCur        = new Referral();
            bool     referralIsNew = true;

            if (MsgBox.Show(this, MsgBoxButtons.YesNo, "Is the referral source an existing patient?"))
            {
                FormPatientSelect FormPS = new FormPatientSelect();
                FormPS.SelectionModeOnly = true;
                FormPS.ShowDialog();
                if (FormPS.DialogResult != DialogResult.OK)
                {
                    return;
                }
                refCur.PatNum = FormPS.SelectedPatNum;
                Referral referral = Referrals.GetFirstOrDefault(x => x.PatNum == FormPS.SelectedPatNum);
                if (referral != null)
                {
                    refCur        = referral;
                    referralIsNew = false;
                }
            }
            FormReferralEdit FormRE2 = new FormReferralEdit(refCur);          //the ReferralNum must be added here

            FormRE2.IsNew = referralIsNew;
            FormRE2.ShowDialog();
            if (FormRE2.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            if (IsSelectionMode)
            {
                if (IsDoctorSelectionMode && !FormRE2.RefCur.IsDoctor)
                {
                    MsgBox.Show(this, "Please select a doctor referral.");
                    gridMain.SetSelected(false);                    //Remove selection to prevent caching issue on OK click.  This line is an attempted fix.
                    FillTable();
                    return;
                }
                SelectedReferral = FormRE2.RefCur;
                DialogResult     = DialogResult.OK;
                return;
            }
            else
            {
                FillTable();
                for (int i = 0; i < listRef.Count; i++)
                {
                    if (listRef[i].ReferralNum == FormRE2.RefCur.ReferralNum)
                    {
                        gridMain.SetSelected(i, true);
                    }
                }
            }
        }
Esempio n. 4
0
        private void butEdit_Click(object sender, System.EventArgs e)
        {
            if (tbRefSelect.SelectedRow == -1)
            {
                return;
            }
            FormReferralEdit FormRE = new FormReferralEdit((Referral)AList[tbRefSelect.SelectedRow]);

            FormRE.ShowDialog();
            FillTable();
        }
        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();
        }
Esempio n. 6
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            Referral refCur        = new Referral();
            bool     referralIsNew = true;

            if (MessageBox.Show(Lan.g(this, "Is the referral source an existing patient?"), ""
                                , MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                FormPatientSelect FormPS = new FormPatientSelect();
                FormPS.SelectionModeOnly = true;
                FormPS.ShowDialog();
                if (FormPS.DialogResult != DialogResult.OK)
                {
                    return;
                }
                refCur.PatNum = FormPS.SelectedPatNum;
                for (int i = 0; i < Referrals.List.Length; i++)
                {
                    if (Referrals.List[i].PatNum == FormPS.SelectedPatNum)                   //referral already existed
                    {
                        refCur        = Referrals.List[i];
                        referralIsNew = false;
                        break;
                    }
                }
            }
            FormReferralEdit FormRE2 = new FormReferralEdit(refCur);          //the ReferralNum must be added here

            FormRE2.IsNew = referralIsNew;
            FormRE2.ShowDialog();
            if (FormRE2.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            if (IsSelectionMode)
            {
                SelectedReferral = FormRE2.RefCur;
                DialogResult     = DialogResult.OK;
                return;
            }
            else
            {
                FillTable();
                for (int i = 0; i < listRef.Count; i++)
                {
                    if (listRef[i].ReferralNum == FormRE2.RefCur.ReferralNum)
                    {
                        gridMain.SetSelected(i, true);
                    }
                }
            }
        }
        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();
        }
Esempio n. 8
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            //This does not automatically select a referral when in selection mode; it just lets user edit.
            if (gridMain.GetSelectedIndex() == -1)
            {
                MsgBox.Show(this, "Please select a referral first");
                return;
            }
            FormReferralEdit FormRE = new FormReferralEdit(listRef[e.Row]);

            FormRE.ShowDialog();
            if (FormRE.DialogResult != DialogResult.OK)
            {
                return;
            }
            //int selectedIndex=gridMain.GetSelectedIndex();
            FillTable();
            //gridMain.SetSelected(selectedIndex,true);
        }
Esempio n. 9
0
 private void butAdd_Click(object sender,System.EventArgs e)
 {
     Referral refCur=new Referral();
     bool referralIsNew=true;
     if(MessageBox.Show(Lan.g(this,"Is the referral source an existing patient?"),""
         ,MessageBoxButtons.YesNo)==DialogResult.Yes) {
         FormPatientSelect FormPS=new FormPatientSelect();
         FormPS.SelectionModeOnly=true;
         FormPS.ShowDialog();
         if(FormPS.DialogResult!=DialogResult.OK) {
             return;
         }
         refCur.PatNum=FormPS.SelectedPatNum;
         for(int i=0;i<Referrals.List.Length;i++) {
             if(Referrals.List[i].PatNum==FormPS.SelectedPatNum) {//referral already existed
                 refCur=Referrals.List[i];
                 referralIsNew=false;
                 break;
             }
         }
     }
     FormReferralEdit FormRE2=new FormReferralEdit(refCur);//the ReferralNum must be added here
     FormRE2.IsNew=referralIsNew;
     FormRE2.ShowDialog();
     if(FormRE2.DialogResult==DialogResult.Cancel) {
         return;
     }
     if(IsSelectionMode) {
         SelectedReferral=FormRE2.RefCur;
         DialogResult=DialogResult.OK;
         return;
     }
     else {
         FillTable();
         for(int i=0;i<listRef.Count;i++) {
             if(listRef[i].ReferralNum==FormRE2.RefCur.ReferralNum) {
                 gridMain.SetSelected(i,true);
             }
         }
     }
 }
Esempio n. 10
0
        private void butEditReferral_Click(object sender, EventArgs e)
        {
            try{
                DataToCur();
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            Referral referral = ReferralL.GetReferral(RefAttachCur.ReferralNum);

            if (referral == null)
            {
                return;
            }
            FormReferralEdit FormRE = new FormReferralEdit(referral);

            FormRE.ShowDialog();
            Referrals.RefreshCache();
            FillData();
        }
Esempio n. 11
0
		private void butReferralEdit_Click(object sender,EventArgs e) {
			//only enabled if ClaimCur.ReferringProv!=0
			Referral refer=null;
			try {
				refer=Referrals.GetReferral(ClaimCur.ReferringProv);
			}
			catch { }
			if(refer==null){
				MsgBox.Show(this,"Referral not found.");
				textRefProv.Text="";
				ClaimCur.ReferringProv=0;
				butReferralEdit.Enabled=false;
			}
			FormReferralEdit FormR=new FormReferralEdit(refer);
			FormR.ShowDialog();
			if(FormR.DialogResult==DialogResult.OK){
				//it's impossible to delete referral from that window.
				Referrals.RefreshCache();
				textRefProv.Text=Referrals.GetNameLF(refer.ReferralNum);
			}
		}
Esempio n. 12
0
 private void butEdit_Click(object sender, System.EventArgs e)
 {
     try{
         DataToCur();
     }
     catch(ApplicationException ex){
         MessageBox.Show(ex.Message);
         return;
     }
     Referral referral=Referrals.GetReferral(RefAttachCur.ReferralNum);
     FormReferralEdit FormRE=new FormReferralEdit(referral);
     FormRE.ShowDialog();
     Referrals.RefreshCache();
     FillData();
 }
Esempio n. 13
0
 private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e)
 {
     //This does not automatically select a referral when in selection mode; it just lets user edit.
     if(gridMain.GetSelectedIndex()==-1) {
         MsgBox.Show(this,"Please select a referral first");
         return;
     }
     FormReferralEdit FormRE = new FormReferralEdit(listRef[e.Row]);
     FormRE.ShowDialog();
     if(FormRE.DialogResult!=DialogResult.OK) {
         return;
     }
     //int selectedIndex=gridMain.GetSelectedIndex();
     FillTable();
     //gridMain.SetSelected(selectedIndex,true);
 }