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(); } }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { Clinic clinCur = (Clinic)gridMain.ListGridRows[e.Row].Tag; Clinic clinOld = clinCur.Copy(); FormClinicEdit FormCE = new FormClinicEdit(clinCur); FormCE.ShowDialog(); if (FormCE.DialogResult == DialogResult.OK) { Clinics.Update(FormCE.ClinicCur, clinOld); DataValid.SetInvalid(InvalidType.Providers); FillGrid(); } }
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(); }
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(); }