Example #1
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            Clinic         ClinicCur = new Clinic();
            FormClinicEdit FormCE    = new FormClinicEdit(ClinicCur);

            FormCE.IsNew = true;
            FormCE.ShowDialog();
            FillList();
            changed = true;
        }
Example #2
0
        private void menuItemSetup_Click(object sender, EventArgs e)
        {
            FormClinicEdit form = new FormClinicEdit(_clinicCur.Copy());

            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                Clinics.Update(form.ClinicCur, _clinicCur);
                DataValid.SetInvalid(InvalidType.Providers);
                _clinicCur = form.ClinicCur.Copy();
            }
        }
Example #3
0
        private void listMain_DoubleClick(object sender, System.EventArgs e)
        {
            if (listMain.SelectedIndex == -1)
            {
                return;
            }
            FormClinicEdit FormCE = new FormClinicEdit(Clinics.List[listMain.SelectedIndex]);

            FormCE.ShowDialog();
            FillList();
            changed = true;
        }
Example #4
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            if (gridMain.Rows.Count == 0)
            {
                return;
            }
            if (IsSelectionMode)
            {
                SelectedClinicNum = ((Clinic)gridMain.Rows[e.Row].Tag).ClinicNum;
                DialogResult      = DialogResult.OK;
                return;
            }
            if (IncludeHQInList && e.Row == 0)
            {
                return;
            }
            Clinic         clinic        = (Clinic)gridMain.Rows[e.Row].Tag;
            DefLinkClinic  defLinkClinic = _listDefLinkClinicSpecialties.Find(x => x.Clinic.Equals(clinic));
            FormClinicEdit FormCE        = new FormClinicEdit(((Clinic)gridMain.Rows[e.Row].Tag).Copy(), defLinkClinic);

            if (FormCE.ShowDialog() == DialogResult.OK)
            {
                if (FormCE.ClinicCur == null)               //Clinic was deleted
                //Fix ItemOrders
                {
                    for (int i = 0; i < ListClinics.Count; i++)
                    {
                        if (ListClinics[i].ItemOrder > (clinic.ItemOrder))
                        {
                            ListClinics[i].ItemOrder--;                            //Fix item orders
                        }
                    }
                    ListClinics.Remove(clinic);
                    //ListDefLinkClinic.Remove()
                }
                else
                {
                    ListClinics[ListClinics.IndexOf(clinic)] = FormCE.ClinicCur;
                    defLinkClinic = _listDefLinkClinicSpecialties.Find(x => x.Clinic.Equals(clinic));
                    if (defLinkClinic != null)
                    {
                        defLinkClinic = FormCE.DefLinkClinicSpecialties;
                    }
                }
            }
            FillGrid();
        }
Example #5
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            Clinic ClinicCur = new Clinic();

            ClinicCur.IsNew = true;
            DefLinkClinic defLinkClinic = new DefLinkClinic(ClinicCur, new List <DefLink>());

            if (PrefC.GetBool(PrefName.PracticeIsMedicalOnly))
            {
                ClinicCur.IsMedicalOnly = true;
            }
            ClinicCur.ItemOrder = gridMain.Rows.Count;          //Set it last in the last position.
            FormClinicEdit FormCE = new FormClinicEdit(ClinicCur, defLinkClinic);

            FormCE.IsNew = true;
            if (FormCE.ShowDialog() == DialogResult.OK)
            {
                ListClinics.Add(ClinicCur);
                _listDefLinkClinicSpecialties.Add(FormCE.DefLinkClinicSpecialties);
            }
            FillGrid();
        }
Example #6
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            Clinic clinicCur = new Clinic();

            clinicCur.IsNew = true;
            if (PrefC.GetBool(PrefName.PracticeIsMedicalOnly))
            {
                clinicCur.IsMedicalOnly = true;
            }
            clinicCur.ItemOrder = gridMain.ListGridRows.Count - (IncludeHQInList?1:0);        //Set it last in the last position (minus 1 for HQ)
            FormClinicEdit FormCE = new FormClinicEdit(clinicCur);

            if (FormCE.ShowDialog() == DialogResult.OK)
            {
                clinicCur.ClinicNum = Clinics.Insert(clinicCur);              //inserting this here so we have a ClinicNum; the user cannot cancel and undo this anyway
                //ClinicCur.ListClinicSpecialtyDefLinks FKeys are set in FormClosing to ClinicCur.ClinicNum
                ListClinics.Add(clinicCur);
                _listClinicsOld.Add(clinicCur.Copy());                //add to both lists so the sync doesn't try to insert it again or delete it.
                _dictClinicalCounts[clinicCur.ClinicNum] = 0;
                ListClinics.Sort(ClinicSort);
            }
            FillGrid();
        }
Example #7
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            if (gridMain.ListGridRows.Count == 0)
            {
                return;
            }
            if (IsSelectionMode)
            {
                SelectedClinicNum = ((Clinic)gridMain.ListGridRows[e.Row].Tag).ClinicNum;
                DialogResult      = DialogResult.OK;
                return;
            }
            if (IncludeHQInList && e.Row == 0)
            {
                return;
            }
            Clinic         clinicOld = (Clinic)gridMain.ListGridRows[e.Row].Tag;
            FormClinicEdit FormCE    = new FormClinicEdit(clinicOld.Copy());

            if (FormCE.ShowDialog() == DialogResult.OK)
            {
                Clinic clinicNew = FormCE.ClinicCur;
                if (clinicNew == null)               //Clinic was deleted
                //Fix ItemOrders
                {
                    ListClinics.FindAll(x => x.ItemOrder > clinicOld.ItemOrder)
                    .ForEach(x => x.ItemOrder--);
                    ListClinics.Remove(clinicOld);
                }
                else
                {
                    ListClinics[ListClinics.IndexOf(clinicOld)] = clinicNew;
                }
            }
            FillGrid();
        }
Example #8
0
		private void listMain_DoubleClick(object sender, System.EventArgs e) {
			if(listMain.SelectedIndex==-1){
				return;
			}
			FormClinicEdit FormCE=new FormClinicEdit(Clinics.List[listMain.SelectedIndex]);
			FormCE.ShowDialog();
			FillList();
			changed=true;
		}
Example #9
0
		private void butAdd_Click(object sender, System.EventArgs e) {
			Clinic ClinicCur=new Clinic();
			FormClinicEdit FormCE=new FormClinicEdit(ClinicCur);
			FormCE.IsNew=true;
			FormCE.ShowDialog();
			FillList();
			changed=true;
		}