Example #1
0
        public void UnBindItem()
        {
            IsPaired = false;
            if (T_Organization.TempData != null)
            {
                T_Organization.GetTempData();
            }
            if (T_Item.TempData != null)
            {
                T_Item.TempData = null;
                //T_Item.GetTempData();
            }
            item_init(Parent as DeviceTreeItemViewModel);

            //T_Item.SlaveIdentifier = null;
            //T_Item.CardNum = -1;
            //T_Item.SlotNum = -1;
            //T_Item.CHNum = -1;
            //T_Item.ItemType = -1;
            //T_Item.IP = null;
            //T_Item.Identifier = null;
            //T_Item.ServerIP = null;
            //T_Organization.Guid = Guid.NewGuid();
            //T_Item.ChannelHDID = null;
            BreakDivFre();
            BaseAlarmSignal = null;
        }
Example #2
0
 public void BindItem()
 {
     IsPaired = true;
     if (T_Item.TempData != null)
     {
         T_Item.GetTempData();
     }
     if (T_Organization.TempData != null)
     {
         T_Organization.GetTempData();
     }
     //InitSignal();
 }
Example #3
0
        //从回收站取出
        public ItemTreeItemViewModel RestoredItemTreeItem(ItemTreeItemViewModel recycle)
        {
            if (T_Organization == null || T_Item == null)
            {
                return(this);
            }
            T_Organization.GetTempData();

            /*
             * T_Organization.Name = recycle.T_Organization.Name;
             * T_Organization.Code = recycle.T_Organization.Code;
             * T_Organization.Guid = recycle.T_Organization.Guid;
             * //T_Organization.Level = recycle.T_Organization.Level;
             * //T_Organization.Sort_No = recycle.T_Organization.Sort_No;
             * T_Organization.Create_Time = recycle.T_Organization.Create_Time;
             * T_Organization.Modify_Time = DateTime.Now;
             * T_Organization.Is_Disabled = false;
             * //T_Organization.Parent_Code = recycle.T_Organization.Parent_Code;
             * //T_Organization.Parent_Guid = recycle.T_Organization.Parent_Guid;
             * //T_Organization.Parent_Level = recycle.T_Organization.Parent_Level;
             * T_Organization.Remarks = recycle.T_Organization.Remarks;
             * //T_Organization.NodeType = recycle.T_Organization.NodeType;*/

            recycle.T_Item.GetTempData();
            T_Item.id            = recycle.T_Item.id;
            T_Item.CardNum       = recycle.T_Item.CardNum;
            T_Item.SlotNum       = recycle.T_Item.SlotNum;
            T_Item.CHNum         = recycle.T_Item.CHNum;
            T_Item.Guid          = recycle.T_Item.Guid;
            T_Item.Name          = recycle.T_Item.Name;
            T_Item.Code          = recycle.T_Item.Code;
            T_Item.T_Device_Guid = this.T_Organization.Parent_Guid.Value; // recycle.T_Item.T_Device_Guid;
            T_Item.T_Device_Code = this.T_Organization.Parent_Code;       //recycle.T_Item.T_Device_Code;
            T_Item.Remarks       = recycle.T_Item.Remarks;
            T_Item.Create_Time   = recycle.T_Item.Create_Time;
            T_Item.Modify_Time   = recycle.T_Item.Modify_Time;
            //T_Item.Sort_No = recycle.T_Item.Sort_No;
            T_Item.Is_Disabled     = false;
            T_Item.IP              = recycle.T_Item.IP;
            T_Item.Identifier      = recycle.T_Item.Identifier;
            T_Item.ServerIP        = recycle.T_Item.ServerIP;//废弃ServerIP,但数据库不允许为空,依旧填充//改为初始化时候填充,覆盖数据库的ServerIP。
            T_Item.ItemType        = recycle.T_Item.ItemType;
            T_Item.SlaveIdentifier = recycle.T_Item.SlaveIdentifier;
            T_Item.ChannelHDID     = recycle.T_Item.ChannelHDID;

            IsPaired   = true;
            IsExpanded = true;

            return(this);
        }