protected virtual void OnPlaceOpenLessee(object o, EventArgs args) { int result, itemid; TreeIter iter; treeviewPlaces.Selection.GetSelected(out iter); itemid = Convert.ToInt32(PlaceSort.GetValue(iter, (int)PlaceCol.lessee_id)); LesseeDlg winLessee = new LesseeDlg(); winLessee.Fill(itemid); winLessee.Show(); result = winLessee.Run(); winLessee.Destroy(); if((ResponseType)result == ResponseType.Ok) { UpdatePlaces(); } }
protected virtual void OnButtonViewClicked(object sender, System.EventArgs e) { TreeIter iter; int type, itemid; string place; ResponseType result; switch (notebookMain.CurrentPage) { case 0: treeviewPlaces.Selection.GetSelected (out iter); place = PlaceSort.GetValue (iter, (int)PlaceCol.place_no).ToString (); type = Convert.ToInt32 (PlaceSort.GetValue (iter, (int)PlaceCol.type_place_id)); int id = Convert.ToInt32 (PlaceSort.GetValue (iter, (int)PlaceCol.id)); PlaceDlg winPlace = new PlaceDlg (id); winPlace.Show (); result = (ResponseType)winPlace.Run (); winPlace.Destroy (); if (result == ResponseType.Ok) UpdatePlaces (); break; case 1: treeviewLessees.Selection.GetSelected (out iter); itemid = Convert.ToInt32 (LesseesSort.GetValue (iter, (int)LesseesCol.id)); LesseeDlg winLessee = new LesseeDlg (); winLessee.Fill (itemid); winLessee.Show (); result = (ResponseType)winLessee.Run (); winLessee.Destroy (); if (result == ResponseType.Ok) UpdateLessees (); break; case 2: treeviewContract.Selection.GetSelected (out iter); itemid = (int)ContractSort.GetValue (iter, (int)ContractCol.id); ContractDlg winContract = new ContractDlg (itemid); winContract.Show (); result = (ResponseType)winContract.Run (); winContract.Destroy (); if (result == ResponseType.Ok) UpdateContract (); break; default: break; } }
protected void OnRunReferenceItemDialog(object sender, Reference.RunReferenceItemDlgEventArgs e) { ResponseType Result; switch (e.TableName) { case "lessees": LesseeDlg LesseeEdit = new LesseeDlg (); if (!e.NewItem) LesseeEdit.Fill (e.ItemId); LesseeEdit.Show (); Result = (ResponseType)LesseeEdit.Run (); LesseeEdit.Destroy (); break; case "organizations": OrganizationDlg OrgEdit = new OrganizationDlg (); if (!e.NewItem) OrgEdit.Fill (e.ItemId); OrgEdit.Show (); Result = (ResponseType)OrgEdit.Run (); OrgEdit.Destroy (); break; case "stead": SteadDlg SteadEdit = new SteadDlg (); if (!e.NewItem) SteadEdit.Fill (e.ItemId); SteadEdit.Show (); Result = (ResponseType)SteadEdit.Run (); SteadEdit.Destroy (); break; case "contract_types": ContractTypeDlg contractTypeEdit = new ContractTypeDlg (); if (!e.NewItem) contractTypeEdit.Fill (e.ItemId); contractTypeEdit.Show (); Result = (ResponseType)contractTypeEdit.Run (); contractTypeEdit.Destroy (); break; case "plans": PlanDialog dialog = (e.NewItem)? new PlanDialog ():new PlanDialog(e.ItemId); dialog.Show (); Result = (ResponseType)dialog.Run (); dialog.Destroy (); break; default: Result = ResponseType.None; break; } e.Result = Result; }
protected virtual void OnButtonAddClicked(object sender, System.EventArgs e) { switch (notebookMain.CurrentPage) { case 0: PlaceDlg winPlace = new PlaceDlg (); winPlace.Show (); winPlace.Run (); winPlace.Destroy (); UpdatePlaces (); break; case 1: LesseeDlg winLessee = new LesseeDlg (); winLessee.Show (); winLessee.Run (); winLessee.Destroy (); UpdateLessees (); break; case 2: ContractDlg winContract = new ContractDlg (); winContract.Show (); winContract.Run (); winContract.Destroy (); UpdateContract (); break; default: break; } }