private void gridMain_CellDoubleClicked(object sender, OpenDental.CellEventArgs e) { FormClearinghouseEdit FormCE = new FormClearinghouseEdit(); FormCE.ClearinghouseCur = Clearinghouses.Listt[e.Row]; FormCE.ShowDialog(); if (FormCE.DialogResult != DialogResult.OK) { return; } listHasChanged = true; FillGrid(); }
private void butAdd_Click(object sender, System.EventArgs e) { FormClearinghouseEdit FormCE = new FormClearinghouseEdit(); FormCE.ClearinghouseCur = new Clearinghouse(); FormCE.IsNew = true; FormCE.ShowDialog(); if (FormCE.DialogResult != DialogResult.OK) { return; } listHasChanged = true; FillGrid(); }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { Clearinghouse clearinghouseHq = ((Clearinghouse[])(gridMain.Rows[e.Row].Tag))[0].Copy(); //cannot be null FormClearinghouseEdit FormCE = new FormClearinghouseEdit(); FormCE.ClearinghouseHq = clearinghouseHq; FormCE.ClearinghouseHqOld = clearinghouseHq.Copy(); //cannot be null FormCE.ClinicNum = _selectedClinicNum; FormCE.ListClinics = _listClinics; FormCE.ListClearinghousesClinCur = new List <Clearinghouse>(); FormCE.ListClearinghousesClinOld = new List <Clearinghouse>(); for (int i = 0; i < _listClearinghousesClinicAll.Count; i++) { if (_listClearinghousesClinicAll[i].HqClearinghouseNum == clearinghouseHq.ClearinghouseNum) { FormCE.ListClearinghousesClinCur.Add(_listClearinghousesClinicAll[i].Copy()); FormCE.ListClearinghousesClinOld.Add(_listClearinghousesClinicAll[i].Copy()); } } FormCE.ShowDialog(); if (FormCE.DialogResult != DialogResult.OK) { return; } if (FormCE.ClearinghouseCur == null) //Clearinghouse was deleted. Can only be deleted when HQ selected. { _listClearinghousesHq.RemoveAt(e.Row); //no need to update the nonHq list. } else //Not deleted. Both the non-HQ and HQ lists need to be updated. { _listClearinghousesHq[e.Row] = FormCE.ClearinghouseHq; //update Hq Clearinghouse. //Update the clinical clearinghouse list by deleting all of the entries for the selected clearinghouse, _listClearinghousesClinicAll.RemoveAll(x => x.HqClearinghouseNum == clearinghouseHq.ClearinghouseNum); //then adding the updated versions back to the list. _listClearinghousesClinicAll.AddRange(FormCE.ListClearinghousesClinCur); } listHasChanged = true; FillGrid(); }
private void butAdd_Click(object sender, System.EventArgs e) { FormClearinghouseEdit FormCE = new FormClearinghouseEdit(); FormCE.ClearinghouseHq = new Clearinghouse(); FormCE.ClearinghouseHqOld = new Clearinghouse(); FormCE.ListClinics = _listClinics; FormCE.ClinicNum = 0; FormCE.ListClearinghousesClinCur = new List <Clearinghouse>(); FormCE.ListClearinghousesClinOld = new List <Clearinghouse>(); FormCE.IsNew = true; FormCE.ShowDialog(); if (FormCE.DialogResult != DialogResult.OK) { return; } if (FormCE.ClearinghouseCur != null) //clearinghouse was not deleted { _listClearinghousesHq.Add(FormCE.ClearinghouseHq.Copy()); _listClearinghousesClinicAll.AddRange(FormCE.ListClearinghousesClinCur); } listHasChanged = true; FillGrid(); }
private void butAdd_Click(object sender, System.EventArgs e) { FormClearinghouseEdit FormCE=new FormClearinghouseEdit(); FormCE.ClearinghouseCur=new Clearinghouse(); FormCE.IsNew=true; FormCE.ShowDialog(); if(FormCE.DialogResult!=DialogResult.OK) return; listHasChanged=true; FillGrid(); }
private void gridMain_CellDoubleClicked(object sender, OpenDental.CellEventArgs e) { FormClearinghouseEdit FormCE=new FormClearinghouseEdit(); FormCE.ClearinghouseCur=Clearinghouses.Listt[e.Row]; FormCE.ShowDialog(); if(FormCE.DialogResult!=DialogResult.OK){ return; } listHasChanged=true; FillGrid(); }