Esempio n. 1
0
        public static void BackuData(string folder, string name)
        {
            var list = new BaseBllImpl <T>().SelectAll();

            if (list != null && list.Count > 0)
            {
                FormatterSerializerBll <T> .ExportData(Path.Combine(folder, name + ".wdb"), list);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 导入数据
        /// </summary>
        /// <param name="fullName"></param>
        public static void DaoRuData(string fullName)
        {
            var imps = FormatterSerializerBll <T> .ImportData(fullName);

            var dataBll = new BaseBllImpl <T>();

            foreach (var imp in imps)
            {
                imp.Id = "";
                dataBll.Add(imp);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="fullName"></param>
        public static void InsertData(string fullName)
        {
            var imps = FormatterSerializerBll <T> .ImportData(fullName);

            var dataBll = new BaseBllImpl <T>();

            foreach (var imp in imps)
            {
                dataBll.Delete(p => p.Id == imp.Id);
                dataBll.Add(imp);
            }
        }