Ejemplo n.º 1
0
        private void GridWGR_MouseMove(object sender, MouseEventArgs e)
        {
            if (hitInfo == null)
            {
                return;
            }
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            Rectangle dragRect = new Rectangle(new Point(
                                                   hitInfo.HitPoint.X - SystemInformation.DragSize.Width / 2,
                                                   hitInfo.HitPoint.Y - SystemInformation.DragSize.Height / 2), SystemInformation.DragSize);

            if (!dragRect.Contains(new Point(e.X, e.Y)))
            {
                if (hitInfo.InRowCell)
                {
                    gridControl1.DoDragDrop(gridWGR.GetRow(hitInfo.RowHandle), DragDropEffects.Copy);
                }
                if (hitInfo.HitTest == GridHitTest.RowIndicator)
                {
                    ViceWGR data = (ViceWGR)gridWGR.GetRow(hitInfo.RowHandle);
                    gridControl1.DoDragDrop(data, DragDropEffects.Copy);
                }
            }
        }
Ejemplo n.º 2
0
 private void GridWGR_MouseDown(object sender, MouseEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView active = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     if (active != null)
     {
         hitInfo = active.CalcHitInfo(e.X, e.Y);
         dragWgr = (ViceWGR)active.GetRow(hitInfo.RowHandle);
         SelectEntity(dragWgr, null);
     }
 }
Ejemplo n.º 3
0
        private void Storeselected(object sender, EventArgs e)
        {
            ViceWorld viceWorld = null;
            ViceHWGR  viceHwgr  = null;
            ViceWGR   viceWgr   = null;

            m_wgrs.Clear();
            m_hwgrs.Clear();
            m_worlds.Clear();

            Dictionary <long, string> nameCapsule = new Dictionary <long, string>();
            List <Domain.WGR>         wgrs        = ClientEnvironment.WGRService.FindAll();
            List <Domain.HWGR>        hwgrs       = ClientEnvironment.HWGRService.FindAll();
            List <Domain.World>       worlds      = ClientEnvironment.WorldService.FindAll();

            List <long> dWgr = ClientEnvironment.HwgrToWgrService.GetHwgrToWgrFiltered(edBeginDate.DateTime)
                               .ConvertAll <long>(new Converter <HwgrToWgr, long>(delegate(HwgrToWgr w)
            {
                return(w.ID);
            }));
            List <long> dHwgr = ClientEnvironment.WorldToHWGRService.GetWorldToHwgrFiltered(edBeginDate.DateTime)
                                .ConvertAll <long>(new Converter <WorldToHwgr, long>(delegate(WorldToHwgr w)
            {
                return(w.ID);
            }));

            if (wgrs != null)
            {
                foreach (Domain.WGR var in wgrs)
                {
                    nameCapsule.Add(var.ID, var.Name);
                }
            }
            if (hwgrs != null)
            {
                foreach (Domain.HWGR var in hwgrs)
                {
                    nameCapsule.Add(var.ID, var.Name);
                }
            }
            if (worlds != null)
            {
                foreach (Domain.World var in worlds)
                {
                    nameCapsule.Add(var.ID, var.Name);
                }
            }
            string name = string.Empty;

            long selected = (long)edStore.EditValue;

            if (selected != null)
            {
                System.Collections.IList storeStruct = ClientEnvironment.StoreService
                                                       .GetStoreStructure(selected);

                if (storeStruct != null)
                {
                    foreach (Dao.QueryResult.StoreStructure str in storeStruct)
                    {
                        string s = String.Empty;
                        nameCapsule.TryGetValue(str.WorldID, out s);
                        str.WorldName = s;
                        s             = String.Empty;
                        nameCapsule.TryGetValue(str.HWGR_ID, out s);
                        str.HWGR_Name = s;
                        s             = String.Empty;
                        nameCapsule.TryGetValue(str.WGR_ID, out s);
                        str.WGR_Name = s;
                    }
                }
                StoreStructureItems items = new StoreStructureItems();
                items.ProcessStoreStructure(storeStruct);

                if (storeStruct != null)
                {
                    foreach (Dao.QueryResult.StoreStructure str in storeStruct)
                    {
                        if (!m_worlds.ContainsKey(str.Store_WorldID))
                        {
                            nameCapsule.TryGetValue(str.WorldID, out name);
                            viceWorld = new ViceWorld(name,
                                                      str.Store_WorldID,
                                                      str.WorldID);
                            m_worlds.Add(str.Store_WorldID, viceWorld);
                        }
                        if (!m_hwgrs.ContainsKey(str.World_HWGR_ID) &&
                            dHwgr.Contains(str.World_HWGR_ID) &&
                            viceWorld != null)
                        {
                            nameCapsule.TryGetValue(str.HWGR_ID, out name);
                            viceHwgr = new ViceHWGR(name,
                                                    str.World_HWGR_ID,
                                                    str.HWGR_BeginTime,
                                                    str.HWGR_EndTime,
                                                    str.HWGR_ID);
                            viceWorld.HWGRs.Add(viceHwgr);
                        }
                        nameCapsule.TryGetValue(str.WGR_ID, out name);
                        viceWgr = new ViceWGR(name,
                                              str.HWGR_WGR_ID,
                                              str.WGR_BeginTime,
                                              str.WGR_EndTime,
                                              str.WGR_ID);
                        if (!m_wgrs.ContainsKey(str.HWGR_WGR_ID) &&
                            dWgr.Contains(str.HWGR_WGR_ID) &&
                            viceHwgr != null)
                        {
                            m_wgrs.Add(str.HWGR_WGR_ID, viceWgr);
                            viceHwgr.WGRs.Add(viceWgr);
                        }
                    }
                }
                List <ViceWorld> t = new List <ViceWorld>();
                t.AddRange(m_worlds.Values);
                edWorld.Properties.DataSource = t;
                edWorld.Visible = true;
            }
        }
Ejemplo n.º 4
0
 private void GridWGR_MouseDown(object sender, MouseEventArgs e)
 {   
     DevExpress.XtraGrid.Views.Grid.GridView active = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     if (active != null)
     {
         hitInfo = active.CalcHitInfo(e.X, e.Y);
         dragWgr = (ViceWGR)active.GetRow(hitInfo.RowHandle);
         SelectEntity (dragWgr, null);
     }
 }
Ejemplo n.º 5
0
 private void wgrDragStart(object sender, DevExpress.XtraGrid.Views.Base.DragObjectStartEventArgs e)
 {
     dragWgr = e.DragObject as ViceWGR;
 }
Ejemplo n.º 6
0
        private void Storeselected(object sender, EventArgs e)
        {
            ViceWorld viceWorld = null;
            ViceHWGR viceHwgr = null;
            ViceWGR viceWgr = null;

            m_wgrs.Clear();
            m_hwgrs.Clear();
            m_worlds.Clear();

            Dictionary<long, string> nameCapsule = new Dictionary<long, string>();
            List<Domain.WGR> wgrs = ClientEnvironment.WGRService.FindAll();
            List<Domain.HWGR> hwgrs = ClientEnvironment.HWGRService.FindAll();
            List<Domain.World> worlds = ClientEnvironment.WorldService.FindAll();
            
            List<long> dWgr = ClientEnvironment.HwgrToWgrService.GetHwgrToWgrFiltered(edBeginDate.DateTime)
                .ConvertAll<long>(new Converter<HwgrToWgr, long>(delegate(HwgrToWgr w)
                {
                    return w.ID;
                }));
            List<long> dHwgr = ClientEnvironment.WorldToHWGRService.GetWorldToHwgrFiltered(edBeginDate.DateTime)
                .ConvertAll<long>(new Converter<WorldToHwgr, long>(delegate(WorldToHwgr w)
                {
                    return w.ID;
                }));

            if (wgrs != null)
                foreach (Domain.WGR var in wgrs)
                    nameCapsule.Add(var.ID, var.Name);
            if (hwgrs != null)
                foreach (Domain.HWGR var in hwgrs)
                    nameCapsule.Add(var.ID, var.Name);
            if (worlds != null)
                foreach (Domain.World var in worlds)
                    nameCapsule.Add(var.ID, var.Name);
            string name = string.Empty;

            Domain.Store selected = edStore.EditValue as Domain.Store;

            if (selected != null)
            {
                System.Collections.IList storeStruct = ClientEnvironment.StoreService
                    .GetStoreStructure(selected.ID);

                if (storeStruct != null)
                {
                    foreach (Dao.QueryResult.StoreStructure str in storeStruct)
                    {
                        string s = String.Empty;
                        nameCapsule.TryGetValue(str.WorldID, out s);
                        str.WorldName = s;
                        s = String.Empty;
                        nameCapsule.TryGetValue(str.HWGR_ID, out s);
                        str.HWGR_Name = s;
                        s = String.Empty;
                        nameCapsule.TryGetValue(str.WGR_ID, out s);
                        str.WGR_Name = s;

                    }
                }
                StoreStructureItems items = new StoreStructureItems();
                items.ProcessStoreStructure(storeStruct);

                if (storeStruct != null)
                    foreach (Dao.QueryResult.StoreStructure str in storeStruct)
                    {
                        if (!m_worlds.ContainsKey(str.Store_WorldID))
                        {
                            nameCapsule.TryGetValue(str.WorldID, out name);
                            viceWorld = new ViceWorld(name,
                                str.Store_WorldID,
                                str.WorldID);
                            m_worlds.Add(str.Store_WorldID, viceWorld);
                        }
                        if (!m_hwgrs.ContainsKey(str.World_HWGR_ID)
                            && dHwgr.Contains(str.World_HWGR_ID)
                            && viceWorld != null)
                        {
                            nameCapsule.TryGetValue(str.HWGR_ID, out name);
                            viceHwgr = new ViceHWGR(name,
                                str.World_HWGR_ID,
                                str.HWGR_BeginTime,
                                str.HWGR_EndTime,
                                str.HWGR_ID);
                            viceWorld.HWGRs.Add(viceHwgr);
                        }
                        nameCapsule.TryGetValue(str.WGR_ID, out name);
                        viceWgr = new ViceWGR(name,
                            str.HWGR_WGR_ID,
                            str.WGR_BeginTime,
                            str.WGR_EndTime,
                            str.WGR_ID);
                        if (!m_wgrs.ContainsKey(str.HWGR_WGR_ID)
                            && dWgr.Contains(str.HWGR_WGR_ID)
                            && viceHwgr != null)
                        {
                            m_wgrs.Add(str.HWGR_WGR_ID, viceWgr);
                            viceHwgr.WGRs.Add(viceWgr);
                        }
                    }
                List<ViceWorld> t = new List<ViceWorld>();
                t.AddRange(m_worlds.Values);
                edWorld.Properties.DataSource = t;
                edWorld.Visible = true;
            }
        }
Ejemplo n.º 7
0
 private void wgrDragStart(object sender, DevExpress.XtraGrid.Views.Base.DragObjectStartEventArgs e)
 {
     dragWgr = e.DragObject as ViceWGR;
 }