Exemplo n.º 1
0
 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);
             }
         }
     }
 }
Exemplo n.º 2
0
 public override void Delete()
 {
     Domain.WGR entity = FocusedEntity;
     if (entity != null)
     {
         FireDeleteEntity(entity);
     }
 }
Exemplo n.º 3
0
 public override void Edit()
 {
     Domain.WGR entity = FocusedEntity;
     if (entity != null)
     {
         FireEditEntity(entity);
     }
 }
Exemplo n.º 4
0
 private void tsDeleteWGRClick(object sender, EventArgs e)
 {
     Domain.WGR entity = FocusedEntity;
     if (entity != null)
     {
         FireDeleteEntity(entity);
     }
 }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
        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);
                }
            }
        }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
        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);
            }
        }
Exemplo n.º 9
0
 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);
         }
     }
 }
Exemplo n.º 10
0
 public static Domain.WGR GetWGRByID(long id)
 {
     Domain.WGR h = null;
     Instance.m_diction.TryGetValue(id, out h);
     return(h);
 }
Exemplo n.º 11
0
 private Domain.WGR GetEntityByRowHandle(int rowHandle)
 {
     Domain.WGR entity = null;
     entity = (Domain.WGR)gridViewWGR.GetRow(rowHandle);
     return(entity);
 }
Exemplo n.º 12
0
 private void cmsOpening(object sender, CancelEventArgs e)
 {
     Domain.WGR wgr = FocusedEntity;
     ts_DeleteWGR.Enabled = wgr != null;
     ts_EditWGR.Enabled   = wgr != null;
 }