예제 #1
0
        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;
                }
            }
        }
예제 #2
0
 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);
             }
         }
     }
 }
예제 #3
0
 public override void Delete()
 {
     Domain.World entity = FocusedEntity;
     if (entity != null)
     {
         FireDeleteEntity(entity);
     }
 }
예제 #4
0
 public override void Edit()
 {
     Domain.World entity = FocusedEntity;
     if (entity != null)
     {
         FireEditEntity(entity);
     }
 }
예제 #5
0
 private void tsDeleteWorldClick(object sender, EventArgs e)
 {
     Domain.World entity = FocusedEntity;
     if (entity != null)
     {
         FireDeleteEntity(entity);
     }
 }
예제 #6
0
        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);
                }
            }
        }
예제 #7
0
        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);
            }
        }
예제 #8
0
 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);
         }
     }
 }
예제 #9
0
 private void cmsOpening(object sender, CancelEventArgs e)
 {
     Domain.World world = FocusedEntity;
     ts_DeleteWorld.Enabled = world != null;
     ts_EditWorld.Enabled   = world != null;
 }
예제 #10
0
 private Domain.World GetEntityByRowHandle(int rowHandle)
 {
     Domain.World entity = null;
     entity = (Domain.World)gridViewWorld.GetRow(rowHandle);
     return(entity);
 }