Example #1
0
 /// <summary>
 /// 向导初始化
 /// </summary>
 /// <returns></returns>
 public Att InitGuid()
 {
     GuidAtt guid = new GuidAtt();
     guid.Name = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     _AttList.Add(guid);
     return guid;
 }
Example #2
0
        /// <summary>
        /// 数据展示
        /// </summary>
        /// <param name="att"></param>
        /// <returns></returns>
        public bool ShowData(Att att)
        {
            _GuidAtt = (GuidAtt)att;

            cbName.ItemsSource = _SafeModel.LibKey;

            string libId = _GuidAtt.GetSpec(GuidAtt.SPEC_GUID_TPLT);
            LibHeader lib;
            foreach (var item in cbName.Items)
            {
                lib = item as LibHeader;
                if (lib.Id == libId)
                {
                    cbName.SelectedItem = item;
                }
            }
            cbName.Focus();
            return true;
        }
Example #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public void Decode(string key)
        {
            // 查询数据是否为空
            if (key.Length < 1)
            {
                return;
            }
            key = _UserModel.Decode(key);

            _AttList.Clear();

            // Guid
            GuidAtt guid = new GuidAtt();
            guid.Name = Key.RegDate;
            guid.Data = Key.CatId;
            guid.SetSpec(GuidAtt.SPEC_GUID_TPLT, Key.LibId);
            _AttList.Add(guid);

            // MetaItem
            MetaAtt meta = new MetaAtt();
            meta.Name = Key.Title;
            meta.Data = Key.MetaKey;
            _AttList.Add(meta);

            // LogoItem
            LogoAtt logo = new LogoAtt();
            logo.Name = Key.IcoName;
            logo.Data = Key.IcoMemo;
            logo.setPath(Key.IcoPath);
            _AttList.Add(logo);

            // HintItem
            HintAtt hint = new HintAtt();
            hint.Data = Key.GtdId;
            hint.Name = Key.GtdMemo;
            hint.GtdHeader = Key.GtdHeader;
            _AttList.Add(hint);

            // 处理每一个数据
            string[] arr = key.Split(Att.SP_SQL_EE);
            int o = 1;
            for (int i = 0, j = arr.Length - 1; i < j; i += 1)
            {
                string s = arr[i] + Att.SP_SQL_KV;
                int dn = s.IndexOf(Att.SP_SQL_KV);
                int dd = s.IndexOf(Att.SP_SQL_KV, dn + 1);
                int ds = s.IndexOf(Att.SP_SQL_KV, dd + 1);

                int type = int.Parse(s.Substring(0, dn));
                string name = s.Substring(dn + 1, dd - dn - 1);
                string data = s.Substring(dd + 1, ds - dd - 1);
                string spec = s.Substring(ds + 1);
                Att item = Att.GetInstance(type, name, data);
                item.Order = (o++).ToString();
                if (spec.Length > 0)
                {
                    item.DecodeSpec(spec, Att.SP_SQL_KV);
                }
                _AttList.Add(item);
            }
        }