コード例 #1
0
        private TreeViewItemViewModel(BaseTreeItem treeItem, TreeViewItemViewModel parent)
        {
            _treeItem = treeItem;
            _parent   = parent;

            _children = new ReadOnlyCollection <TreeViewItemViewModel>(_treeItem.Children.Select(child => new TreeViewItemViewModel(child, this)).ToList());
        }
コード例 #2
0
        private void FireChangedFocusedTreeNode()
        {
            BaseTreeItem item = treeList.GetDataRecordByNode(treeList.FocusedNode) as BaseTreeItem;

            if (item != null)
            {
                HwgrTreeItem hw = item as HwgrTreeItem;
                if (hw != null)
                {
                    m_context.WorldToHwgr = hw.Hwgr;
                }
                else
                {
                    WgrTreeItem w = item as WgrTreeItem;
                    if (w != null)
                    {
                        foreach (BaseTreeItem parent in treeList.DataSource as BindingTemplate <BaseTreeItem> )
                        {
                            if (parent.ID == w.ParentID)
                            {
                                m_context.WorldToHwgr = (parent as HwgrTreeItem).Hwgr;
                                break;
                            }
                        }
                        m_context.HwgrToWgr = w.Wgr;
                    }
                }
            }
        }
コード例 #3
0
        public void Bind(BaseTreeItem entity, long storeID)
        {
            m_vice    = entity;
            m_storeID = storeID;

            edParent.Properties.DataSource = new BaseTreeItem[] { entity };
            edParent.EditValue             = entity;
        }
コード例 #4
0
ファイル: UCChangeTime.cs プロジェクト: 5509850/baumax
        public void Bind(BaseTreeItem entity, long storeID)
        {
            m_vice = entity;
            m_storeID = storeID;

            edParent.Properties.DataSource = new BaseTreeItem[] { entity};
            edParent.EditValue = entity;
        }
コード例 #5
0
        private TreeListNode GetNodeByEntity(BaseTreeItem entity)
        {
            TreeListNode ret_node = null;

            foreach (TreeListNode node in treeList.Nodes)
            {
                if (entity == GetEntityByNode(node))
                {
                    ret_node = node;
                    break;
                }
            }
            return(ret_node);
        }
コード例 #6
0
ファイル: UCAssign.cs プロジェクト: 5509850/baumax
        public override bool Commit()
        {
            try
            {
                DateTime begin = BeginTime, end = EndTime;
                Utility.AssignWeek(ref begin, ref end);
                BeginTime = begin;
                EndTime   = end;
                switch (m_assignEnum)
                {
                case AssignEnum.ThisHwgrToWgr:
                case AssignEnum.ThisWgrToHWGR:
                    HwgrToWgr assign = ClientEnvironment.HwgrToWgrService.CreateEntity();
                    assign.BeginTime = BeginTime;
                    assign.EndTime   = EndTime;
                    assign.HWGR_ID   = (long)edParent.EditValue;
                    assign.Import    = false;
                    assign.StoreID   = m_storeID;
                    assign.WGR_ID    = (long)edChild.EditValue;
                    ClientEnvironment.HwgrToWgrService.Save(assign);
                    m_assigned = new WgrTreeItem(assign, assign.HWGR_ID);
                    break;

                case AssignEnum.ThisHwgrToWorld:
                    WorldToHwgr assign2 = ClientEnvironment.WorldToHWGRService.CreateEntity();
                    assign2.BeginTime = BeginTime;
                    assign2.EndTime   = EndTime;
                    assign2.HWGR_ID   = (long)edChild.EditValue;
                    assign2.Import    = false;
                    assign2.StoreID   = m_storeID;
                    assign2.WorldID   = (Entity as WorldToHwgr).WorldID;
                    ClientEnvironment.WorldToHWGRService.Save(assign2);
                    m_assigned = new HwgrTreeItem(assign2, 0);
                    break;

                case AssignEnum.WorldHwgrDisable:
                    DateTime t1 = timeRange.BeginTime,
                             t2 = timeRange.EndTime;
                    Utility.AssignWeek(ref begin, ref end);
                    timeRange.BeginTime = t1;
                    timeRange.EndTime   = t2;

                    WorldToHwgr vice  = Entity as WorldToHwgr;
                    WorldToHwgr first = ClientEnvironment.WorldToHWGRService.FindById(vice.ID);
                    first.BeginTime = timeRange.BeginTime;
                    first.EndTime   = timeRange.EndTime;

                    ClientEnvironment.WorldToHWGRService.Update(first);
                    break;

                case AssignEnum.HwgrWgrDisable:
                    HwgrToWgr        vice2  = Entity as HwgrToWgr;
                    Domain.HwgrToWgr first2 = ClientEnvironment.HwgrToWgrService.FindById(vice2.ID);
                    first2.EndTime   = timeRange.EndTime;
                    first2.BeginTime = timeRange.BeginTime;

                    ClientEnvironment.HwgrToWgrService.Update(first2);
                    break;
                }
            }
            catch (ValidationException)
            {
                XtraMessageBox.Show(Baumax.Localization.Localizer.GetLocalized("InvalidTimeRange"));
                return(false);
            }/*
              * catch (Exception ex)
              * {
              * XtraMessageBox.Show (ex.Message);
              * return false;
              * }*/
            return(true);
        }
コード例 #7
0
ファイル: UCAssign.cs プロジェクト: 5509850/baumax
        public override bool Commit ()
        {
            try
            {
                DateTime begin = BeginTime, end = EndTime;
                Utility.AssignWeek (ref begin, ref end);
                BeginTime = begin;
                EndTime = end; 
                switch (m_assignEnum)
                { 
                    case AssignEnum.ThisHwgrToWgr :
                    case AssignEnum.ThisWgrToHWGR :
                        HwgrToWgr assign = ClientEnvironment.HwgrToWgrService.CreateEntity();
                        assign.BeginTime = BeginTime;
                        assign.EndTime = EndTime;
                        assign.HWGR_ID = (long)edParent.EditValue;
                        assign.Import = false;
                        assign.StoreID = m_storeID;
                        assign.WGR_ID = (long)edChild.EditValue;
                        ClientEnvironment.HwgrToWgrService.Save (assign);
                        m_assigned = new WgrTreeItem(assign, assign.HWGR_ID);
                        break;

                    case AssignEnum.ThisHwgrToWorld :
                        WorldToHwgr assign2 = ClientEnvironment.WorldToHWGRService.CreateEntity();
                        assign2.BeginTime = BeginTime;
                        assign2.EndTime = EndTime;
                        assign2.HWGR_ID = (long)edChild.EditValue;
                        assign2.Import = false;
                        assign2.StoreID = m_storeID;
                        assign2.WorldID = (Entity as WorldToHwgr).WorldID;
                        ClientEnvironment.WorldToHWGRService.Save(assign2);
                        m_assigned = new HwgrTreeItem(assign2, 0);
                        break;

                    case AssignEnum.WorldHwgrDisable:
                            DateTime t1 = timeRange.BeginTime,
                                     t2 = timeRange.EndTime;
                            Utility.AssignWeek(ref begin, ref end);
                            timeRange.BeginTime = t1;
                            timeRange.EndTime = t2;

                               WorldToHwgr vice = Entity as WorldToHwgr;
                             WorldToHwgr first = ClientEnvironment.WorldToHWGRService.FindById(vice.ID);
                                    first.BeginTime = timeRange.BeginTime;
                                    first.EndTime = timeRange.EndTime;

                                    ClientEnvironment.WorldToHWGRService.Update(first);
                        break;
                    case AssignEnum.HwgrWgrDisable:
                        HwgrToWgr vice2 = Entity as HwgrToWgr;
                        Domain.HwgrToWgr first2 = ClientEnvironment.HwgrToWgrService.FindById(vice2.ID);
                         first2.EndTime = timeRange.EndTime;
                            first2.BeginTime = timeRange.BeginTime;
                        
                        ClientEnvironment.HwgrToWgrService.Update(first2);
                        break;
                } 
            }
            catch(ValidationException)
            {
                XtraMessageBox.Show(Baumax.Localization.Localizer.GetLocalized("InvalidTimeRange"));
                return false;
            }/*
            catch (Exception ex)
            {
                XtraMessageBox.Show (ex.Message);
                return false;
            }*/
            return true;
        }
コード例 #8
0
 public TreeViewItemViewModel(BaseTreeItem treeItem)
     : this(treeItem, null)
 {
 }
コード例 #9
0
ファイル: UCStoreTree.cs プロジェクト: 5509850/baumax
 private TreeListNode GetNodeByEntity(BaseTreeItem entity)
 { 
     TreeListNode ret_node = null;
     foreach(TreeListNode node in treeList.Nodes)
         if (entity == GetEntityByNode(node))
         {
             ret_node = node;
             break;
         }
     return ret_node;
 }