/// <summary>
        /// 更新分组信息到数据库 先删除数据库该记录再增加
        /// </summary>
        /// <param name="groupInfomatioin"></param>
        /// <returns></returns>
        private bool WriteDbUpdateGrpPara(GroupItemsInfo.GroupItem groupInfomatioin)
        {

            string strLstTml = "";
            string strLstGrp = "";
            foreach (int i in groupInfomatioin.LstTml)
            {
                strLstTml += i + "#";
            }
            //foreach (int i in groupInfomatioin.LstGrp)
            //{
            //    strLstGrp += i + "#";
            //}
            if (strLstTml.Length > 1)
                strLstTml = strLstTml.Substring(0, strLstTml.Length - 1);
            if (strLstGrp.Length > 1)
                strLstGrp = strLstGrp.Substring(0, strLstGrp.Length - 1);

            var strSql = new string[2];
            strSql[0] = "delete from grp_para where grp_id= " + groupInfomatioin.GroupId;

            strSql[1] = "insert into grp_para(grp_id,grp_name,status,tml_list,grp_list)";
            strSql[1] += " values(" + groupInfomatioin.GroupId + ",'" + groupInfomatioin.GroupName + "',";
            strSql[1] += 0 + ",'" + strLstTml + "','";
            strSql[1] += strLstGrp + "')";

            SqlLiteHelper.ExecuteTransactionInThread(strSql);
            return true;
            //return SQLiteHelper.ExecuteTransaction(strSql);
        }
 public GroupInformation(GroupItemsInfo.GroupItem item)
 {
     //如果为本地分组  则区域地址为  -1
     this.AreaId    = item.AreaId;
     this.GroupId   = item.GroupId;
     this.GroupName = item.GroupName;
     this.LstTml    = item.LstTml;
 }
Esempio n. 3
0
            public void AddChild(GroupItemsInfo.GroupItem gi)
            {
                if (CurrentSelectArea == null)
                {
                    return;
                }
                var t = new TreeItemViewModel(null, CurrentSelectArea.Value, gi, true);

                ChildTreeItems.Add(t);
            }
Esempio n. 4
0
        public TreeNodeItemMulitGroupViewModel(TreeNodeBaseNode mvvmFather, GroupItemsInfo.GroupItem groupInfomatioin)
        {
            this.NodeType = TypeOfTabTreeNode.IsGrp;
            //Visi = Visibility.Visible;
            this._father = mvvmFather;
            //TreeSingleViewModel.RegisterNodeToControl(this);


            if (groupInfomatioin == null)
            {
                this.NodeName = "GroupInfo Error";
                return;
            }
            this.NodeName   = groupInfomatioin.GroupName;
            this.ImagesIcon = ImageResources.GroupIcon; // ImageSource.GrpBitmapImage;
            this.NodeId     = groupInfomatioin.GroupId;
            this.AddChild();
        }