protected void context_ParameterChanged(object sender, EventArgs e) { if (context != null) { List <StoreWorldDetail> list = context.TakeWorldDetail.GetDetailList(); if (list != null) { repWorld.Items.Clear(); m_forReposit.Clear(); foreach (StoreWorldDetail var in list) { int imageindex = 2; Domain.World item = context.TakeStoreWorld.GetWorld(var.StoreWorldId); switch (item.WorldTypeID) { case WorldType.Administration: imageindex = 0; break; case WorldType.CashDesk: imageindex = 1; break; default: imageindex = 2; break; } repWorld.Items.Add(new DevExpress.XtraEditors.Controls. ImageComboBoxItem(item.Name, item, imageindex)); m_forReposit.Add(var.StoreWorldId, item); } BaseRow row = vGrid.FocusedRow; vGrid.DataSource = list; vGrid.FocusedRow = row; } } }
public void FireDeleteEntity(Domain.World world) { if (ReadOnly) { return; } Domain.World entity = world; if (entity == null) { entity = FocusedEntity; } if (entity != null) { if (QuestionMessageYes(GetLocalized("Are you sure?"))) { try { ClientEnvironment.WorldService.DeleteByID(entity.ID); _bindingEntities.Remove(entity); } catch (Exception ex) { ErrorMessage(ex.Message); } } } }
public override void Delete() { Domain.World entity = FocusedEntity; if (entity != null) { FireDeleteEntity(entity); } }
public override void Edit() { Domain.World entity = FocusedEntity; if (entity != null) { FireEditEntity(entity); } }
private void tsDeleteWorldClick(object sender, EventArgs e) { Domain.World entity = FocusedEntity; if (entity != null) { FireDeleteEntity(entity); } }
private void DoubleClick(object sender, MouseEventArgs e) { DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo info = gridViewWorld.CalcHitInfo(e.X, e.Y); if (info.InRowCell && gridViewWorld.IsDataRow(info.RowHandle)) { Domain.World entity = GetEntityByRowHandle(info.RowHandle); if (entity != null) { FireEditEntity(entity); } } }
public void FireNewEntity() { if (ReadOnly) { return; } Domain.World entity = new Domain.World(); FormWorldAdd form = new FormWorldAdd(); form.World = entity; if (form.ShowDialog() == DialogResult.OK) { _bindingEntities.Add(form.World); } }
public void FireEditEntity(Domain.World world) { if (ReadOnly) { return; } Domain.World entity = world; if (entity == null) { entity = FocusedEntity; } if (entity != null) { FormWorldAdd form = new FormWorldAdd(); form.World = entity; if (form.ShowDialog() == DialogResult.OK) { _bindingEntities.SetEntity(form.World); } } }
private void cmsOpening(object sender, CancelEventArgs e) { Domain.World world = FocusedEntity; ts_DeleteWorld.Enabled = world != null; ts_EditWorld.Enabled = world != null; }
private Domain.World GetEntityByRowHandle(int rowHandle) { Domain.World entity = null; entity = (Domain.World)gridViewWorld.GetRow(rowHandle); return(entity); }