public void FireDeleteEntity(Domain.WGR wgr) { if (ReadOnly) { return; } Domain.WGR entity = wgr; if (entity == null) { entity = FocusedEntity; } if (entity != null) { if (QuestionMessageYes(GetLocalized("Are you sure?"))) { try { ClientEnvironment.WGRService.DeleteByID(entity.ID); _bindingEntities.Remove(entity); } catch (Exception ex) { ErrorMessage(ex.Message); } } } }
public override void Delete() { Domain.WGR entity = FocusedEntity; if (entity != null) { FireDeleteEntity(entity); } }
public override void Edit() { Domain.WGR entity = FocusedEntity; if (entity != null) { FireEditEntity(entity); } }
private void tsDeleteWGRClick(object sender, EventArgs e) { Domain.WGR entity = FocusedEntity; if (entity != null) { FireDeleteEntity(entity); } }
public WgrTreeItem(Domain.WGR entity, long parentID) : base(new BaseEntity(), parentID) { this.Wgr = new HwgrToWgr(); this.Wgr.WGR_ID = entity.ID; base.ParentID = parentID; ID = _nextID++; _ishwgr = false; }
private void DoubliClick(object sender, MouseEventArgs e) { GridHitInfo info = gridViewWGR.CalcHitInfo(e.X, e.Y); if (info.InRowCell && gridViewWGR.IsDataRow(info.RowHandle)) { Domain.WGR entity = GetEntityByRowHandle(info.RowHandle); if (entity != null) { FireEditEntity(entity); } } }
internal static Domain.WGR GetWgrEntity(HwgrToWgr hwgr_wgr) { Domain.WGR entity = GetWGRByID(hwgr_wgr.ID); if (entity == null) { foreach (Domain.WGR var in Instance.m_diction.Values) { if (var.ID == hwgr_wgr.WGR_ID) { return(var); } } } return(entity); }
public void FireNewEntity() { if (ReadOnly) { return; } Domain.WGR entity = new Domain.WGR(); FormWgrAdd formWGR = new FormWgrAdd(); formWGR.WGR = entity; if (formWGR.ShowDialog() == DialogResult.OK) { _bindingEntities.Add(formWGR.WGR); } }
public void FireEditEntity(Domain.WGR wgr) { if (ReadOnly) { return; } Domain.WGR entity = wgr; if (entity == null) { entity = FocusedEntity; } if (entity != null) { FormWgrAdd formWGR = new FormWgrAdd(); formWGR.WGR = entity; if (formWGR.ShowDialog() == DialogResult.OK) { _bindingEntities.SetEntity(formWGR.WGR); } } }
public static Domain.WGR GetWGRByID(long id) { Domain.WGR h = null; Instance.m_diction.TryGetValue(id, out h); return(h); }
private Domain.WGR GetEntityByRowHandle(int rowHandle) { Domain.WGR entity = null; entity = (Domain.WGR)gridViewWGR.GetRow(rowHandle); return(entity); }
private void cmsOpening(object sender, CancelEventArgs e) { Domain.WGR wgr = FocusedEntity; ts_DeleteWGR.Enabled = wgr != null; ts_EditWGR.Enabled = wgr != null; }