protected void OnButtonBottleDelFineClicked(object sender, EventArgs e) { OrmMain.DeleteObject <Fine>(Entity.BottleFine.Id, UoW); Entity.BottleFine = null; CalculateTotal(); UpdateButtonState(); }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { if (OrmMain.DeleteObject <ServiceClaim>(tableServiceClaims.GetSelectedObject <ServiceClaimVMNode>().Id)) { tableServiceClaims.RepresentationModel.UpdateNodes(); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { if (OrmMain.DeleteObject(typeof(Proxy), datatreeviewProxies.GetSelectedId())) { datatreeviewProxies.RepresentationModel.UpdateNodes(); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { if (OrmMain.DeleteObject(typeof(DeliveryPoint), treeDeliveryPoints.GetSelectedId())) { treeDeliveryPoints.RepresentationModel.UpdateNodes(); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { if (OrmMain.DeleteObject(typeof(CounterpartyContract), treeCounterpartyContracts.GetSelectedId())) { treeCounterpartyContracts.RepresentationModel.UpdateNodes(); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { var item = tableDocuments.GetSelectedObject <ProxyDocumentsVMNode>(); if (OrmMain.DeleteObject(ProxyDocument.GetProxyDocumentClass(item.Type), item.Id)) { tableDocuments.RepresentationModel.UpdateNodes(); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { var deliveryPoint = treeDeliveryPoints.GetSelectedObject <DeliveryPoint>(); if (OrmMain.DeleteObject(typeof(DeliveryPoint), deliveryPoint.Id)) { UpdateNodes(); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { var item = tableWarehouses.GetSelectedObject <SubdivisionWithWarehousesVMNode>(); if (item.WarehouseId.HasValue && OrmMain.DeleteObject <Warehouse>(item.WarehouseId.Value)) { tableWarehouses.RepresentationModel.UpdateNodes(); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { var item = tableWarehouses.GetSelectedObject <SubdivisionWithWarehousesVMNode>(); if (item.WarehouseId.HasValue && OrmMain.DeleteObject <Warehouse>(item.WarehouseId.Value)) { DisposeUowAndUpdate(); } }
private void ConfigureActions() { MenuButton addDocumentButton = new MenuButton(); addDocumentButton.Label = "Добавить"; Menu addDocumentActions = new Menu(); foreach (var item in RepresentationModel.NewEntityActionsConfigs) { var menuItem = new MenuItem(item.Title); menuItem.Activated += (sender, e) => { TabParent.OpenTab(DialogHelper.GenerateDialogHashName(item.EntityType, 0), item.GetNewEntityDlg, this ); }; SetCreateActionsSensitiveFunc(menuItem, item.EntityType); addDocumentActions.Add(menuItem); } addDocumentButton.Menu = addDocumentActions; addDocumentActions.ShowAll(); hboxButtonActions.Add(addDocumentButton); Box.BoxChild addDocumentButtonBox = (Box.BoxChild)hboxButtonActions[addDocumentButton]; addDocumentButtonBox.Expand = false; addDocumentButtonBox.Fill = false; Button editDocumentbutton = new Button(); editDocumentbutton.Label = "Редактировать"; editDocumentbutton.Clicked += (sender, e) => { OpenDocument(); }; SetOpenActionSensitiveFunc(editDocumentbutton); hboxButtonActions.Add(editDocumentbutton); Box.BoxChild editDocumentbuttonBox = (Box.BoxChild)hboxButtonActions[editDocumentbutton]; editDocumentbuttonBox.Expand = false; editDocumentbuttonBox.Fill = false; Button deleteDocumentbutton = new Button(); deleteDocumentbutton.Label = "Удалить"; deleteDocumentbutton.Clicked += (sender, e) => { var selectedObject = tableview.GetSelectedObject(); if (OrmMain.DeleteObject(RepresentationModel.GetEntityType(selectedObject), RepresentationModel.GetDocumentId(selectedObject))) { RepresentationModel.UpdateNodes(); } }; SetDeleteActionSensitiveFunc(deleteDocumentbutton); hboxButtonActions.Add(deleteDocumentbutton); Box.BoxChild deleteDocumentbuttonBox = (Box.BoxChild)hboxButtonActions[deleteDocumentbutton]; deleteDocumentbuttonBox.Expand = false; deleteDocumentbuttonBox.Fill = false; hboxButtonActions.ShowAll(); }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { var node = (ViewModel.AccountingVMNode)tableAccountingOperations.GetSelectedNode(); Type operationType = node.Expense == 0 ? typeof(AccountIncome) : typeof(AccountExpense); if (OrmMain.DeleteObject(operationType, tableAccountingOperations.GetSelectedId())) { tableAccountingOperations.RepresentationModel.UpdateNodes(); } }
protected void OnButtonRemoveItemClicked(object sender, EventArgs e) { var annex = ytreeAnnexes.GetSelectedObject <RegulationDocAnnex>(); if (annex.Id > 0) { OrmMain.DeleteObject(annex, UoW, () => Entity.RemoveAnnex(annex)); } else { Entity.RemoveAnnex(annex); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { ITdiTab mytab = DialogHelper.FindParentTab(this); if (mytab == null) { return; } if (OrmMain.DeleteObject(typeof(Account), (datatreeviewAccounts.GetSelectedObjects() [0] as Account).Id)) { accountOwner.ObservableAccounts.Remove(datatreeviewAccounts.GetSelectedObjects() [0] as Account); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { var item = tableDocuments.GetSelectedObject <DocumentVMNode>(); var permissionResult = ServicesConfig.CommonServices.PermissionService.ValidateUserPermission(Document.GetDocClass(item.DocTypeEnum), ServicesConfig.UserService.CurrentUserId); if (!permissionResult.CanDelete) { return; } if (OrmMain.DeleteObject(Document.GetDocClass(item.DocTypeEnum), item.Id)) { tableDocuments.RepresentationModel.UpdateNodes(); } }
public bool DeleteObject <TEntity>(int id, IUnitOfWork uow = null) { return(OrmMain.DeleteObject <TEntity>(id, uow)); }