Beispiel #1
0
        public DepartmentTreeItemViewModel(T1_Organization t_organization, OrganizationTreeItemViewModel parent)//插入子节点
        {
            T_Organization          = t_organization;
            T_Organization.NodeType = 0;

            IsExpanded = true;
        }
Beispiel #2
0
        public DepartmentTreeItemViewModel(string name, int sort_no, OrganizationTreeItemViewModel parent)//插入子节点
        {
            T_Organization      = new T1_Organization();
            T_Organization.Name = name;
            //T_Organization.Code;
            T_Organization.Guid  = Guid.NewGuid();
            T_Organization.Level = parent.T_Organization.Level + 1;
            //if (sort_no > 0)
            //{
            //    for (int i = 0; i < parent.Children.Count; i++)
            //    {
            //        if ((parent.Children[i] as OrganizationTreeItemViewModel).T_Organization.Sort_No >= sort_no)
            //        {
            //            (parent.Children[i] as OrganizationTreeItemViewModel).T_Organization.Sort_No++;
            //        }
            //    }
            //}
            T_Organization.Sort_No      = sort_no;
            T_Organization.Create_Time  = DateTime.Now;
            T_Organization.Modify_Time  = DateTime.Now;
            T_Organization.Is_Disabled  = false;
            T_Organization.Parent_Code  = parent.T_Organization.Code;
            T_Organization.Parent_Guid  = parent.T_Organization.Guid;
            T_Organization.Parent_Level = parent.T_Organization.Level;
            //T_Organization.Remarks
            T_Organization.NodeType = 0;

            IsExpanded = true;
        }
Beispiel #3
0
        public DepartmentTreeItemViewModel(string name, int sort_no, string serverip)//添加根节点
        {
            ServerIP = serverip;

            T_Organization = new T1_Organization();
            if (name == "")
            {
                T_Organization.Name = "新建机构" + (sort_no + 1).ToString();
            }
            else
            {
                T_Organization.Name = name;
            }
            //T_Organization.Code;
            T_Organization.Guid        = Guid.NewGuid();
            T_Organization.Level       = 0;
            T_Organization.Sort_No     = sort_no;
            T_Organization.Create_Time = DateTime.Now;
            T_Organization.Modify_Time = DateTime.Now;
            T_Organization.Is_Disabled = false;
            //T_Organization.Parent_Code
            //T_Organization.Parent_Guid
            T_Organization.Parent_Level = -1;
            //T_Organization.Remarks
            T_Organization.NodeType = 0;

            IsExpanded = true;
        }
        public DivFreTreeItemViewModel(T1_Organization t_organization, ItemTreeItemViewModel parent) : base(t_organization.Name, t_organization.Sort_No, parent)
        {
            T_Organization          = t_organization;
            T_Organization.NodeType = 3;

            InitSignal();
        }
Beispiel #5
0
        public DepartmentTreeItemViewModel(T1_Organization t_organziation, string serverip)//添加根节点
        {
            ServerIP = serverip;

            T_Organization          = t_organziation;
            T_Organization.NodeType = 0;

            IsExpanded = true;
        }
Beispiel #6
0
 public ItemTreeItemViewModel(T1_Item item)
 {
     T_Item         = item;
     T_Organization = new T1_Organization();
     if (item != null)
     {
         T_Organization.Name        = item.Name;
         T_Organization.Guid        = item.Guid;
         T_Organization.Code        = item.Code;
         T_Organization.Parent_Guid = item.T_Device_Guid;
         T_Organization.Parent_Code = item.T_Device_Code;
     }
 }
Beispiel #7
0
        //组织机构转换
        public Organization OrganizationConvert(T1_Organization t_organization)
        {
            Organization organization = new Organization();

            organization.Name         = t_organization.Name;
            organization.Code         = t_organization.Code;
            organization.Guid         = t_organization.Guid.ToString();
            organization.Level        = t_organization.Level;
            organization.Create_Time  = t_organization.Create_Time.GetValueOrDefault().ToString("yyyy-MM-dd HH:mm:ss");
            organization.Modify_Time  = t_organization.Modify_Time.GetValueOrDefault().ToString("yyyy-MM-dd HH:mm:ss");
            organization.Parent_Code  = t_organization.Code;
            organization.Parent_Guid  = t_organization.Guid.ToString();
            organization.Parent_Level = t_organization.Level;
            return(organization);
        }
Beispiel #8
0
        //复制到回收站
        public ItemTreeItemViewModel RecycledItemTreeItem(ItemTreeItemViewModel old)
        {
            T_Organization              = new T1_Organization();
            T_Organization.id           = old.T_Organization.id;
            T_Organization.Name         = old.T_Item.TempData.Name;
            T_Organization.Code         = old.T_Organization.Code;
            T_Organization.Guid         = old.T_Organization.Guid;
            T_Organization.Level        = old.T_Organization.Level;
            T_Organization.Sort_No      = old.T_Organization.Sort_No;
            T_Organization.Create_Time  = old.T_Organization.Create_Time;
            T_Organization.Modify_Time  = old.T_Item.TempData.Modify_Time;
            T_Organization.Is_Disabled  = true;
            T_Organization.Parent_Code  = old.T_Organization.Parent_Code;
            T_Organization.Parent_Guid  = old.T_Organization.Parent_Guid;
            T_Organization.Parent_Level = old.T_Organization.Parent_Level;
            T_Organization.Remarks      = old.T_Organization.Remarks;
            T_Organization.NodeType     = old.T_Organization.NodeType;

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

            IsPaired   = false;
            IsExpanded = true;
            return(this);
        }
Beispiel #9
0
        public OrganizationTreeItemViewModel(string name, int sort_no, OrganizationTreeItemViewModel parent)//插入子节点
        {
            T_Organization      = new T1_Organization();
            T_Organization.Name = name;
            //T_Organization.Code;
            T_Organization.Guid         = Guid.NewGuid();
            T_Organization.Level        = parent.T_Organization.Level + 1;
            T_Organization.Sort_No      = sort_no;
            T_Organization.Create_Time  = DateTime.Now;
            T_Organization.Modify_Time  = DateTime.Now;
            T_Organization.Is_Disabled  = false;
            T_Organization.Parent_Code  = parent.T_Organization.Code;
            T_Organization.Parent_Guid  = parent.T_Organization.Guid;
            T_Organization.Parent_Level = parent.T_Organization.Level;
            //T_Organization.Remarks
            T_Organization.NodeType = 0;

            IsExpanded = true;
        }
 public DeviceTreeItemViewModel(T1_Organization t_organzation, OrganizationTreeItemViewModel parent) : base(t_organzation.Name, t_organzation.Sort_No, parent)
 {
     T_Organization = t_organzation;
     device_init();
 }
Beispiel #11
0
 public void BindTemp(ChannelTreeItemViewModel channel, string ip, string identifier, string serverip, T1_Organization organization)
 {
     T_Item.BindTemp(channel, ip, identifier, serverip, organization);
 }
Beispiel #12
0
 public ItemTreeItemViewModel(T1_Organization organization, DeviceTreeItemViewModel parent) : base(organization.Name, organization.Sort_No, parent)
 {
     T_Organization = organization;
     item_init(parent);
 }
Beispiel #13
0
 public ItemTreeItemViewModel(T1_Organization organization)
 {
     T_Organization = organization;
 }
 public DivFreTreeItemViewModel(ItemTreeItemViewModel parent, T1_DivFreInfo t_divfreinfo, bool auto, T1_Organization organization, int sort_no) : this(parent, t_divfreinfo, auto)
 {
     T_Organization.Parent_Code  = organization.Code;
     T_Organization.Parent_Guid  = organization.Guid;
     T_Organization.Parent_Level = organization.Level;
     T_Organization.Sort_No      = sort_no;
 }