From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 09:07:13 +0800 Subject: [PATCH] 新云端Ver1.3 --- ZigbeeApp/Shared/Phone/Common/Logic/HdlBackupLogic.cs | 906 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 846 insertions(+), 60 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Common/Logic/HdlBackupLogic.cs b/ZigbeeApp/Shared/Phone/Common/Logic/HdlBackupLogic.cs index 9c29d50..fce1d85 100644 --- a/ZigbeeApp/Shared/Phone/Common/Logic/HdlBackupLogic.cs +++ b/ZigbeeApp/Shared/Phone/Common/Logic/HdlBackupLogic.cs @@ -1,4 +1,5 @@ -锘縰sing Shared.Common; +锘縰sing Newtonsoft.Json; +using Shared.Common; using System; using System.Collections.Generic; using System.Collections.Specialized; @@ -48,7 +49,7 @@ public List<BackupListNameInfo> GetBackupListNameFromDB(BackUpMode backupDiv, ShowNetCodeMode mode = ShowNetCodeMode.YES, bool getOptionBackup = false) { var pra = new { homeId = Config.Instance.Home.Id }; - var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/backup/folder/findAll", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); + var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/app/backup/folder/findAll", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); //妫�娴嬬姸鎬佺爜 if (HdlCheckLogic.Current.CheckNetCode(result, mode) == false) { @@ -108,7 +109,7 @@ //涓�涓釜鐨勪笅杞芥枃浠� int listFileCount = dicFile.Count; int fileCount = 0; - foreach(string fileName in dicFile.Keys) + foreach (string fileName in dicFile.Keys) { fileCount++; //璐﹀彿宸茬粡閫�鍑� @@ -124,7 +125,7 @@ //鈽呰缃渶瑕佽幏鍙栫殑鏂囦欢鍚嶅瓧鈽� var pra = new { fileId = dicFile[fileName], folderId = i_folderId, homeId = Config.Instance.Home.Id }; - var result = HdlHttpLogic.Current.RequestByteFromZigbeeHttps("home-wisdom/backup/file/downOne", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺, true, 10); + var result = HdlHttpLogic.Current.RequestByteFromZigbeeHttps("home-wisdom/app/backup/file/downOne", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺, true, 10); //妫�娴嬬姸鎬佺爜 if (result == null || result.Length == 0) { @@ -168,7 +169,7 @@ { //鑾峰彇杩欎釜澶囦唤涓嬬殑鏂囦欢鍒楄〃 var pra = new { folderId = i_folderId, homeId = Config.Instance.Home.Id }; - var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/backup/file/findAll", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); + var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/app/backup/file/findAll", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); //妫�娴嬬姸鎬佺爜 if (HdlCheckLogic.Current.CheckNetCode(result, mode) == false) { @@ -208,7 +209,7 @@ folderName = backupName, homeId = Config.Instance.Home.Id }; - var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/backup/folder/create", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); + var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/app/backup/folder/create", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); //妫�娴嬬姸鎬佺爜 if (HdlCheckLogic.Current.CheckNetCode(result, mode) == false) { @@ -216,6 +217,109 @@ } var data = Newtonsoft.Json.JsonConvert.DeserializeObject<AddBackupNameResult>(result.Data.ToString()); return data.Id; + } + + /// <summary> + /// 淇濆瓨鏈湴澶囦唤鍒癆PP(璋冭瘯瀹濅笓鐢�) + /// </summary> + /// <param name="backupName">澶囦唤鍚嶅瓧</param> + /// <param name="finishEvent">瀹屾垚鍚庣殑鍥炶皟浜嬩欢(鍙傛暟涓烘枃浠跺す鍚嶅瓧)</param> + public void SaveBackupDataToApp(string backupName, Action<string> finishEvent = null) + { + //鑾峰彇鏈満淇濆瓨鐨勫叏閮ㄤ綇瀹呭浠芥暟鎹� + var listLocalHouse = HdlResidenceLogic.Current.GetAllLocalResidenceListByDirectory(false); + var directoryName = "BackupResidenceData_" + DateTime.Now.ToString("yyyyMMdd_HHmmss"); + foreach (var house in listLocalHouse) + { + if (house.Id == Config.Instance.Home.Id && house.Name == backupName + && house.HouseDataDiv != 1) + { + //濡傛灉鏈湴鎷ユ湁鐩稿悓鍚嶅瓧鐨勫浠界殑璇�,鍒欑洿鎺ヨ鐩� + directoryName = house.SaveDirctoryName; + //澶囦唤鏁版嵁宸茬粡瀛樺湪,鏄惁瑕嗙洊? + HdlMessageLogic.Current.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.BackUpDataIsEsixtAndPickUp), () => + { + //灏嗘湰鍦版枃浠跺鍒跺埌鎸囧畾鐨勬枃浠跺す涓� + this.CopyLocalFileToDirectory(directoryName, backupName, finishEvent); + }); + return; + } + } + //灏嗘湰鍦版枃浠跺鍒跺埌鎸囧畾鐨勬枃浠跺す涓� + this.CopyLocalFileToDirectory(directoryName, backupName, finishEvent); + } + + /// <summary> + /// 灏嗘湰鍦版枃浠跺鍒跺埌鎸囧畾鐨勬枃浠跺す涓�(璋冭瘯瀹濅笓鐢�) + /// </summary> + /// <param name="directoryName">淇濆瓨鐨勬枃浠跺す鍚嶅瓧</param> + /// <param name="backUpName">澶囦唤鍚嶅瓧</param> + /// <param name="finishEvent">瀹屾垚鍚庣殑鍥炶皟浜嬩欢(鍙傛暟涓烘枃浠跺す鍚嶅瓧)</param> + private void CopyLocalFileToDirectory(string directoryName, string backUpName, Action<string> finishEvent = null) + { + //褰撳墠璺緞 + var localPath = Common.Config.Instance.FullPath; + //闇�瑕佷繚瀛樼殑璺緞 + var savePath = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, directoryName); + + if (System.IO.Directory.Exists(savePath) == false) + { + //鍒涘缓鏂囦欢澶� + System.IO.Directory.CreateDirectory(savePath); + } + else + { + //濡傛灉瀛樺湪锛屽垯娓呯┖鍏ㄩ儴鏂囦欢 + var files = System.IO.Directory.GetFiles(savePath); + foreach (var file in files) + { + HdlFileLogic.Current.DeleteFile(file); + } + } + + //鏈湴鍏ㄩ儴鐨勬枃浠� + var listLocalFile = HdlFileLogic.Current.GetRootPathListFile(); + foreach (var file in listLocalFile) + { + //鍒ゆ柇鎸囧畾鏂囦欢鏄惁闇�瑕佸鍒惰繃鍘� + if (file.StartsWith("House_") == true + || this.IsNotUpLoadFile(file) == true) + { + continue; + } + string localFile = System.IO.Path.Combine(localPath, file); + string newFile = System.IO.Path.Combine(savePath, file); + try + { + //澶嶅埗 + System.IO.File.Copy(localFile, newFile); + } + catch { } + } + //搴忓垪鍖栦綇瀹呭璞� + string oldHomeName = Common.Config.Instance.Home.Name; + Common.Config.Instance.Home.Name = backUpName; + HdlFileLogic.Current.SaveFileContent(System.IO.Path.Combine(savePath, Common.Config.Instance.Home.FileName), Common.Config.Instance.Home); + Common.Config.Instance.Home.Name = oldHomeName; + + //灏嗘ā鏉挎暟鎹繚瀛樺埌鍒版寚瀹氱殑鏂囦欢澶逛腑 + var templateName = HdlTemplateCommonLogic.Current.GetNewTemplateFileName(); + var templateFile = HdlTemplateCommonLogic.Current.SaveTemplateDataToFile(templateName, backUpName); + + //灏嗘ā鏉縝in鏂囦欢绉诲姩鍒板浠芥枃浠跺す涓� + try { System.IO.File.Move(templateFile, System.IO.Path.Combine(savePath, templateName)); } + catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex, "绉诲姩妯℃澘澶辫触"); } + + //鏈湴澶囦唤淇濆瓨鎴愬姛 + if (finishEvent == null) + { + HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.SaveLocalBackDataSuccess)); + } + else + { + //璋冪敤鍥炶皟鍑芥暟 + finishEvent.Invoke(directoryName); + } } #endregion @@ -239,8 +343,8 @@ if (upPath == string.Empty) { //灏嗘ā鏉挎暟鎹繚瀛樺埌鍒版寚瀹氱殑鏂囦欢澶逛腑 - var templateName = TemplateData.TemplateCommonLogic.Current.GetNewTemplateFileName(); - var templateFile = TemplateData.TemplateCommonLogic.Current.SaveTemplateDataToFile(templateName, "HomeTemplate"); + var templateName = HdlTemplateCommonLogic.Current.GetNewTemplateFileName(); + var templateFile = HdlTemplateCommonLogic.Current.SaveTemplateDataToFile(templateName, "HomeTemplate"); //灏嗘ā鏉縝in鏂囦欢绉诲姩鍒板浠芥枃浠跺す涓� localTemplateName = System.IO.Path.Combine(Config.Instance.FullPath, templateName); @@ -355,7 +459,7 @@ dicQuery["fileName"] = i_fileName; dicQuery["homeId"] = Config.Instance.Home.Id; - var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/backup/file/create", RestSharp.Method.POST, i_content, dicQuery, null, CheckMode.A璐﹀彿鏉冮檺, true, 10); + var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/app/backup/file/create", RestSharp.Method.POST, i_content, dicQuery, null, CheckMode.A璐﹀彿鏉冮檺, true, 10); //妫�娴嬬姸鎬佺爜 if (HdlCheckLogic.Current.CheckNetCode(result, mode) == false) { @@ -378,13 +482,598 @@ public bool EditorBackupName(string i_folderId, string i_backName, ShowNetCodeMode mode = ShowNetCodeMode.YES) { var pra = new { folderId = i_folderId, folderName = i_backName, homeId = Config.Instance.Home.Id }; - var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/backup/folder/update", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); + var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/app/backup/folder/update", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); //妫�娴嬬姸鎬佺爜 if (HdlCheckLogic.Current.CheckNetCode(result, mode) == false) { return false; } return true; + } + + #endregion + + #region 鈻� 涓嬭浇澶囦唤___________________________ + + /// <summary> + /// 涓嬭浇APP澶囦唤鏂囨。(鍑芥暟鍐呴儴鏈夎繘搴︽潯,璋冭瘯瀹濅笓鐢�) + /// </summary> + /// <param name="BackupClassId"></param> + /// <param name="BackupName">浜戠鏄剧ず鐨勫悕瀛�</param> + /// <param name="finishEvent">鎴愬姛涔嬪悗鐨勪簨浠�,鍙傛暟涓轰繚瀛樺浠界殑璺緞鏂囦欢澶�(鍏ㄨ矾寰�)</param> + public void DownLoadAppBackupInfo(string BackupClassId, string BackupName, Action<string> finishEvent = null) + { + //鑾峰彇鏈満淇濆瓨鐨勫叏閮ㄤ綇瀹呭浠芥暟鎹� + var listLocalHouse = HdlResidenceLogic.Current.GetAllLocalResidenceListByDirectory(false); + var directoryName = "DownLoadResidenceData_" + DateTime.Now.ToString("yyyyMMdd_HHmmss"); + foreach (var house in listLocalHouse) + { + //濡傛灉鍚嶅瓧鍜屼綇瀹卋ase鏁版嵁鐨勫悕瀛椾竴鏍蜂篃鍙互淇濆瓨 + if (house.Name == BackupName && house.HouseDataDiv != 1) + { + //濡傛灉鏈湴鎷ユ湁鐩稿悓鍚嶅瓧鐨勫浠界殑璇�,鍒欑洿鎺ヨ鐩� + directoryName = house.SaveDirctoryName; + //澶囦唤鏁版嵁宸茬粡瀛樺湪,鏄惁瑕嗙洊? + HdlMessageLogic.Current.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.BackUpDataIsEsixtAndPickUp), () => + { + //涓嬭浇APP澶囦唤鏂囨。,鐒跺悗瀛樺叆鍥哄畾鐨勬枃浠跺す涓� + HdlThreadLogic.Current.RunThread(() => + { + this.DownLoadAppBackupInfoAndSetToDirectory(BackupClassId, directoryName, finishEvent); + }); + }); + return; + } + } + //涓嬭浇APP澶囦唤鏂囨。,鐒跺悗瀛樺叆鍥哄畾鐨勬枃浠跺す涓� + this.DownLoadAppBackupInfoAndSetToDirectory(BackupClassId, directoryName, finishEvent); + } + + /// <summary> + /// 涓嬭浇APP澶囦唤鏂囨。,鐒跺悗瀛樺叆鍥哄畾鐨勬枃浠跺す涓�(璋冭瘯瀹濅笓鐢�) + /// </summary> + /// <param name="BackupClassId"></param> + /// <param name="targetDir">鐩爣鏂囦欢澶�</param> + /// <param name="finishEvent">鎴愬姛涔嬪悗鐨勪簨浠�,鍙傛暟涓轰繚瀛樺浠界殑璺緞鏂囦欢澶�(鍏ㄨ矾寰�)</param> + private void DownLoadAppBackupInfoAndSetToDirectory(string BackupClassId, string targetDir, Action<string> finishEvent = null) + { + //鍏ㄨ矾寰� + targetDir = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, targetDir); + //鎵撳紑杩涘害鏉� 姝e湪鑾峰彇澶囦唤鏂囦欢鍒楄〃 + ProgressFormBar.Current.Start(); + ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uBackupFileListGetting)); + + //浠庝簯绔幏鍙栧浠界殑鏂囦欢锛岀劧鍚庡瓨鍏ユ湰鍦扮殑涓存椂鏂囦欢澶� + string tempDirectory = GetBackFileFromDBAndSetToLocation(BackupClassId); + if (tempDirectory == null) + { + //鍏抽棴杩涘害鏉� + ProgressFormBar.Current.Close(); + return; + } + tempDirectory = System.IO.Path.Combine(Config.Instance.FullPath, tempDirectory); + + if (System.IO.Directory.Exists(targetDir) == false) + { + //鍒涘缓鏂囦欢澶� + System.IO.Directory.CreateDirectory(targetDir); + } + else + { + //濡傛灉瀛樺湪锛屽垯娓呯┖鍏ㄩ儴鏂囦欢 + var files = System.IO.Directory.GetFiles(targetDir); + foreach (var file in files) + { + HdlFileLogic.Current.DeleteFile(file); + } + } + //鑾峰彇涓嬭浇鍒扮殑鍏ㄩ儴鐨勬枃浠� + var listFile = HdlFileLogic.Current.GetFileFromDirectory(tempDirectory); + foreach (var file in listFile) + { + var sourseFile = System.IO.Path.Combine(tempDirectory, file); + var targetFile = System.IO.Path.Combine(targetDir, file); + //绉诲姩鏂囦欢 + try { System.IO.File.Move(sourseFile, targetFile); } + catch { } + } + + //鍏抽棴杩涘害鏉� + ProgressFormBar.Current.Close(); + //璋冪敤鍥炶皟鍑芥暟 + finishEvent?.Invoke(targetDir); + finishEvent = null; + } + + #endregion + + #region 鈻� 璇诲彇澶囦唤___________________________ + + /// <summary> + /// 璇诲彇APP澶囦唤鏂囨。(鍑芥暟鍐呴儴鏈夎繘搴︽潯,Home涓撶敤) + /// </summary> + /// <param name="i_folderId"></param> + /// <param name="mode">澶辫触鏃舵槸鍚︽樉绀簍ip娑堟伅</param> + public bool LoadAppBackupInfo(string i_folderId, ShowNetCodeMode mode = ShowNetCodeMode.YES) + { + //鎵撳紑杩涘害鏉� 姝e湪鑾峰彇澶囦唤鏂囦欢鍒楄〃 + ProgressFormBar.Current.Start(); + ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uBackupFileListGetting)); + + //浠庝簯绔幏鍙栧浠界殑鏂囦欢锛岀劧鍚庡瓨鍏ユ湰鍦扮殑涓存椂鏂囦欢澶� + string tempDirectory = GetBackFileFromDBAndSetToLocation(i_folderId, mode); + if (tempDirectory == null) + { + //鍏抽棴杩涘害鏉� + ProgressFormBar.Current.Close(); + return false; + } + + //娓呯┖鍏ㄩ儴鎴块棿 + HdlRoomLogic.Current.DeleteAllRoom(); + //娓呯┖鏈湴鍏ㄩ儴鐨勫満鏅暟鎹� + HdlSceneLogic.Current.DeleteAllLocalScene(); + //濡傛灉璇诲彇鍒扮殑鏂囦欢瀹屽叏娌℃湁闂锛屽垯娓呯悊鏈湴鐨勬枃浠� + HdlFileLogic.Current.DeleteAllLocationFile(false); + + //娓呯悊鏈湴鐨勬ā鏉挎枃浠� + HdlTemplateCommonLogic.Current.DeleteAllLocalFile(); + + //娌℃湁閿欒鐨勮瘽锛屽垯绉诲姩鍒板綋鍓嶄綇瀹呮枃浠跺す涓嬮潰 + HdlFileLogic.Current.MoveDirectoryFileToHomeDirectory(tempDirectory, true); + + //鍒犻櫎鍏ㄩ儴鐨勮嚜鍔ㄥ浠界殑鏈湴鏂囦欢(姝ゅ嚱鏁扮敤浜庤鍙栬嚜鍔ㄥ浠界殑鏃跺�欎娇鐢�) + this.DeleteAllAutoBackupFile(); + + //鍒锋柊鏈湴缂撳瓨 + HdlUserCenterLogic.Current.RefreshAllMemory(); + + //鍏抽棴杩涘害鏉� + ProgressFormBar.Current.Close(); + + return true; + } + + #endregion + + #region 鈻� 鍔犺浇澶囦唤___________________________ + + /// <summary> + /// 鍔犺浇鏈湴鐨勫浠芥暟鎹�(璋冭瘯瀹濅笓鐢�) + /// </summary> + /// <param name="strDirectory">澶囦唤鏁版嵁鎵�鍦ㄧ殑鏂囦欢澶�(涓嶆槸鍏ㄨ矾寰�)</param> + public void LoadLocalBackupData(string strDirectory) + { + //鍏ㄨ矾寰� + strDirectory = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, strDirectory); + + //娓呯┖鍏ㄩ儴鎴块棿 + HdlRoomLogic.Current.DeleteAllRoom(); + //娓呯┖鏈湴鍏ㄩ儴鐨勫満鏅暟鎹� + HdlSceneLogic.Current.DeleteAllLocalScene(); + //娓呯悊鏈湴鐨勬枃浠� + HdlFileLogic.Current.DeleteAllLocationFile(false); + //娓呯悊鏈湴鐨勬ā鏉挎枃浠� + HdlTemplateCommonLogic.Current.DeleteAllLocalFile(); + + string localDir = Common.Config.Instance.FullPath; + //鑾峰彇鍏ㄩ儴鐨勬枃浠� + var listFile = HdlFileLogic.Current.GetFileFromDirectory(strDirectory); + foreach (var file in listFile) + { + var sourseFile = System.IO.Path.Combine(strDirectory, file); + if (file.StartsWith("ModelData_") == true) + { + //澶嶅埗妯℃澘鏁版嵁鏂囦欢鍒版寚瀹氭枃浠跺す + HdlTemplateCommonLogic.Current.CopyTemplateFileToLocalDirectory2(sourseFile); + continue; + } + //鍏朵粬鏂囦欢閮界Щ鍒版湰鍦� + var targetFile = System.IO.Path.Combine(localDir, file); + //澶嶅埗鏂囦欢 + try { System.IO.File.Copy(sourseFile, targetFile, true); } + catch { } + } + + //鍒锋柊鏈湴缂撳瓨 + HdlUserCenterLogic.Current.RefreshAllMemory(); + } + + #endregion + + #region 鈻� 鎭㈠涓存椂澶囦唤_______________________ + + /// <summary> + /// 鎭㈠涓存椂澶囦唤 + /// </summary> + public void RestoreTemporaryBackupData() + { + //濡傛灉鏈湴瀛樺湪涓存椂澶囦唤鐨勬枃浠跺す鐨勮瘽,鍒欒鏄庣敤鎴峰湪鏌ョ湅妯℃澘鐨勬椂鍊�,寮哄埗鍏抽棴浜咥pp + //杩欎釜鏃跺��,App鍐嶆鍚姩鐨勬椂鍊�,鍒欒繕鍘熸暟鎹� + if (System.IO.Directory.Exists(HdlFileNameResourse.TemporaryBackupLocalFileDirectory) == false) + { + return; + } + + //娓呯┖鍏ㄩ儴鎴块棿 + HdlRoomLogic.Current.DeleteAllRoom(); + //娓呯┖鏈湴鍏ㄩ儴鐨勫満鏅暟鎹� + HdlSceneLogic.Current.DeleteAllLocalScene(); + //娓呯悊鏈湴鐨勬枃浠� + HdlFileLogic.Current.DeleteAllLocationFile(false); + //娓呯悊鏈湴鐨勬ā鏉挎枃浠� + HdlTemplateCommonLogic.Current.DeleteAllLocalFile(); + //灏嗗浠戒腑鐨勬ā鏉挎枃浠跺鍒跺埌妯℃澘鐨勬枃浠跺す + HdlFileLogic.Current.CopyDirectoryFileToDirectory(HdlFileNameResourse.TemporaryBackupTemplateFileDirectory, HdlFileNameResourse.LocalTemplateDirectory); + //灏嗗浠戒腑鐨勬牴鐩綍鏂囦欢澶嶅埗鍒版牴鐩綍 + HdlFileLogic.Current.CopyDirectoryFileToDirectory(HdlFileNameResourse.TemporaryBackupLocalFileDirectory, Common.Config.Instance.FullPath); + //鍒犻櫎鎺夎繖涓复鏃跺浠界殑鏂囦欢澶� + HdlFileLogic.Current.DeleteDirectory(HdlFileNameResourse.TemporaryBackupLocalFileDirectory); + } + + #endregion + + #region 鈻� 鍒犻櫎澶囦唤___________________________ + + /// <summary> + /// 鍒犻櫎浜戠澶囦唤 + /// </summary> + /// <param name="i_folderId">澶囦唤鐨勪富閿�</param> + /// <param name="mode">澶辫触鏃舵槸鍚︽樉绀簍ip娑堟伅</param> + /// <returns></returns> + public bool DeleteDbBackupData(string i_folderId, ShowNetCodeMode mode = ShowNetCodeMode.YES) + { + var pra = new { folderId = i_folderId, homeId = Config.Instance.Home.Id }; + var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/app/backup/folder/delete", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); + //妫�娴嬬姸鎬佺爜 + if (HdlCheckLogic.Current.CheckNetCode(result, mode) == false) + { + return false; + } + return true; + } + + /// <summary> + /// 鍒犻櫎鏈湴澶囦唤 + /// </summary> + /// <param name="dirctoryName">鏂囦欢澶瑰悕瀛�</param> + public void DeleteLocalBackupData(string dirctoryName) + { + string strPath = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, dirctoryName); + if (System.IO.Directory.Exists(strPath) == true) + { + try { System.IO.Directory.Delete(strPath, true); } + catch (Exception ex) + { HdlLogLogic.Current.WriteLog(ex, "鍒犻櫎鏈湴澶囦唤鏂囦欢澶辫触"); } + } + } + + #endregion + + #region 鈻� 涓婁紶鑷姩澶囦唤_______________________ + + /// <summary> + /// 鎵嬪姩鎵ц涓婁紶鑷姩澶囦唤鏁版嵁(0:娌℃湁鍙笂浼犵殑鑷姩澶囦唤鏁版嵁 1:鎴愬姛 -1锛氬け璐�) + /// </summary> + /// <returns></returns> + public int DoUpLoadAutoBackupDataByHand() + { + //缂栬緫鏂囦欢 + List<string> listEditor = this.GetLocalAutoBackupEditorFile(); + //鍒犻櫎鏂囦欢 + List<string> listDelete = this.GetLocalAutoBackupDeleteFile(); + //娌℃湁鏁版嵁 + if (listEditor.Count == 0 && listDelete.Count == 0) + { + return 0; + } + + //寮�鍚繘搴︽潯 姝e湪涓婁紶澶囦唤鏂囦欢 + ProgressFormBar.Current.Start(); + ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uBackupFileUploading)); + + //涓婁紶鏂囦欢鍒颁簯绔� + bool result = UpLoadAutoBackupFileToDB(listEditor); + if (result == false) + { + ProgressFormBar.Current.Close(); + return -1; + } + + //鍒犻櫎鏂囦欢 + result = DoDeleteAutoBackFileFromDB(listDelete); + if (result == false) + { + ProgressFormBar.Current.Close(); + return -1; + } + + ProgressFormBar.Current.Close(); + + return 1; + } + + /// <summary> + /// 涓婁紶鏂囦欢鍒颁簯绔� + /// </summary> + /// <param name="listFile">缂栬緫鎴栬�呮坊鍔犵殑鏂囦欢(鐩墠宸茬粡涓嶆槸涓婁紶瀹冧簡)</param> + /// <returns></returns> + private bool UpLoadAutoBackupFileToDB(List<string> listFile) + { + //鑾峰彇app鐨勮嚜鍔ㄥ浠� + var listBackData = this.GetBackupListNameFromDB(BackUpMode.A鑷姩澶囦唤); + if (listBackData == null) + { + return false; + } + string strBackId = string.Empty; + if (listBackData.Count == 0) + { + //鍒涘缓涓�涓柊鐨勫浠� + strBackId = this.CreatNewBackupNameToDB("AutoBackup", BackUpMode.A鑷姩澶囦唤); + if (strBackId == null) + { + return false; + } + } + else + { + //鑷姩澶囦唤鍙湁涓�涓� + strBackId = listBackData[0].Id; + } + + string localPath = Config.Instance.FullPath; + + //灏嗘ā鏉挎暟鎹繚瀛樺埌鍒版寚瀹氱殑鏂囦欢澶逛腑 + var templateName = HdlTemplateCommonLogic.Current.GetNewTemplateFileName(new DateTime(2000, 12, 31, 12, 59, 57)); + var templateFile = HdlTemplateCommonLogic.Current.SaveTemplateDataToFile(templateName, "HomeTemplate"); + + //灏嗘ā鏉縝in鏂囦欢绉诲姩鍒板浠芥枃浠跺す涓� + var localTemplateName = System.IO.Path.Combine(localPath, templateName); + try { System.IO.File.Move(templateFile, localTemplateName); } + catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex, "绉诲姩妯℃澘澶辫触"); } + + //鑾峰彇鏈湴鏂囦欢 + var listAllFile = HdlFileLogic.Current.GetRootPathListFile(); + var listUpFile = new List<string>(); + foreach (string fileName in listAllFile) + { + //鍒ゆ柇鎸囧畾鏂囦欢鏄惁闇�瑕佷笂浼�(鏍圭洰褰曠殑鎵嶅垽鏂�) + if (this.IsNotUpLoadFile(fileName) == true) + { + continue; + } + //鍏朵粬鍥剧墖鐨勮祫婧愭枃浠�,鍙湁鍦ㄥ彉鏇翠簡鐨勬椂鍊�,鎵嶄笂浼� + if (fileName.EndsWith(".png") == true && listFile.Contains(fileName) == false) + { + continue; + } + listUpFile.Add(fileName); + } + + int listFileCount = listUpFile.Count; + for (int i = 0; i < listUpFile.Count; i++) + { + string file = listUpFile[i]; + //璇诲彇鏂囦欢鍐呭 + var fileContent = HdlFileLogic.Current.ReadFileByteContent(System.IO.Path.Combine(localPath, file)); + if (fileContent == null) + { + continue; + } + //鎵ц涓婁紶 + var falge = this.DoUpLoadInfoToDB(strBackId, file, fileContent); + if (falge == false) + { + return false; + } + //璁剧疆杩涘害鍊� + ProgressFormBar.Current.SetValue(i + 1, listFileCount); + } + + //鍒犻櫎鎺夎繖涓ā鏉挎枃浠� + HdlFileLogic.Current.DeleteFile(localTemplateName); + + //鍒犻櫎鏂囦欢 + var backPath = HdlFileNameResourse.AutoBackupDirectory; + foreach (var file in listFile) + { + string fullName = System.IO.Path.Combine(backPath, file); + HdlFileLogic.Current.DeleteFile(fullName); + } + + return true; + } + + /// <summary> + /// 浜戠鎵ц鍒犻櫎鎸囧畾鏂囦欢 + /// </summary> + /// <param name="listData">鍒犻櫎鐨勬枃浠�</param> + /// <returns></returns> + private bool DoDeleteAutoBackFileFromDB(List<string> listData) + { + if (listData.Count == 0) + { + return true; + } + + //鑾峰彇app鐨勮嚜鍔ㄥ浠� + var data = this.GetBackupListNameFromDB(BackUpMode.A鑷姩澶囦唤); + if (data == null || data.Count == 0) + { + return true; + } + //鑷姩澶囦唤鍙湁涓�涓� + var result = this.DeleteDbBackupData(data[0].Id); + if (result == false) + { + return false; + } + + //鍒犻櫎鏂囦欢 + var backPath = HdlFileNameResourse.AutoBackupdeleteDirectory; + foreach (var file in listData) + { + string fullName = System.IO.Path.Combine(backPath, file); + HdlFileLogic.Current.DeleteFile(fullName); + } + return true; + } + + #endregion + + #region 鈻� 鑾峰彇鏈湴鑷姩澶囦唤鏂囦欢_______________ + + /// <summary> + /// 鑾峰彇鏈湴鑷姩澶囦唤鐩綍涓嬬殑娣诲姞鎴栬�呯紪杈戠殑鏂囦欢 + /// </summary> + /// <returns></returns> + public List<string> GetLocalAutoBackupEditorFile() + { + return HdlFileLogic.Current.GetFileFromDirectory(HdlFileNameResourse.AutoBackupDirectory); + } + + /// <summary> + /// 鑾峰彇鏈湴鑷姩澶囦唤鐩綍涓嬬殑鍒犻櫎鐨勬枃浠� + /// </summary> + /// <returns></returns> + public List<string> GetLocalAutoBackupDeleteFile() + { + return HdlFileLogic.Current.GetFileFromDirectory(HdlFileNameResourse.AutoBackupdeleteDirectory); + } + + #endregion + + #region 鈻� 璁剧疆鑷姩澶囦唤鏂囦欢鐘舵�乢______________ + + /// <summary> + /// 鍙樻洿鑷姩澶囦唤娣诲姞鎴栬�呬慨鏀规枃浠剁殑鐘舵�� + /// </summary> + /// <param name="fileName">鏂囦欢鐨勫悕瀛�,涓嶅惈璺緞</param> + public void AddOrEditorAutoBackFileStatu(string fileName) + { + fileName = System.IO.Path.GetFileName(fileName); + //鑷姩澶囦唤鐩綍 + string strBackPath = HdlFileNameResourse.AutoBackupDirectory; + if (System.IO.Directory.Exists(strBackPath) == false) + { + //棰勫垱寤轰釜浜轰腑蹇冨叏閮ㄧ殑鏂囦欢澶� + HdlFileLogic.Current.CreatAllUserCenterDirectory(); + } + + //鑷姩鍒犻櫎澶囦唤鐩綍 + string strdelBackPath = HdlFileNameResourse.AutoBackupdeleteDirectory; + //濡傛灉鍒犻櫎鍒楄〃閲岄潰鏈夎繖涓笢瑗跨殑璇濓紝绉婚櫎鎺� + string delFile = System.IO.Path.Combine(strdelBackPath, fileName); + HdlFileLogic.Current.DeleteFile(delFile); + + string soureFile = System.IO.Path.Combine(Common.Config.Instance.FullPath, fileName); + string newFile = System.IO.Path.Combine(strBackPath, fileName); + + //鍘熷師鏈湰鐨勫鍒舵枃浠跺埌鎸囧畾鏂囦欢澶� + HdlFileLogic.Current.CopyFile(soureFile, newFile); + } + + /// <summary> + /// 鍙樻洿鑷姩澶囦唤鍒犻櫎鏂囦欢鐨勭姸鎬� + /// </summary> + /// <param name="fileName">鏂囦欢鐨勫悕瀛�,涓嶅惈璺緞</param> + public void DeleteAutoBackFileStatu(string fileName) + { + fileName = System.IO.Path.GetFileName(fileName); + //鑷姩鍒犻櫎澶囦唤鐩綍 + string strBackPath = HdlFileNameResourse.AutoBackupdeleteDirectory; + string newFile = System.IO.Path.Combine(strBackPath, fileName); + + //鍒涘缓涓�涓┖鏂囦欢 + var file = System.IO.File.Create(newFile); + file.Close(); + + //鑷姩澶囦唤鐩綍 + strBackPath = HdlFileNameResourse.AutoBackupDirectory; + //濡傛灉澶囦唤鍒楄〃閲岄潰鏈夎繖涓笢瑗跨殑璇濓紝绉婚櫎鎺� + string delFile = System.IO.Path.Combine(strBackPath, fileName); + + HdlFileLogic.Current.DeleteFile(delFile); + } + + #endregion + + #region 鈻� 鍚屾鏁版嵁___________________________ + + /// <summary> + /// 鍚屾浜戠鏁版嵁(浠呴檺APP鍚姩涔嬪悗) -1锛氬紓甯� 0:宸茬粡鍚屾杩囷紝涓嶉渶瑕佸悓姝� 1锛氭甯稿悓姝� 2:娌℃湁鑷姩澶囦唤鏁版嵁 + /// </summary> + /// <returns></returns> + public int SynchronizeDbAutoBackupData() + { + //鏆傛椂涓嶆敮鎸佹垚鍛� + if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 3) + { + //鍚屾鏈嶅姟鍣ㄧ殑鍒嗕韩鍐呭 + HdlShardLogic.Current.SynchronizeDbSharedContent(); + return 1; + } + //鍒ゆ柇鏄惁鑳藉鍚屾鏁版嵁 + string checkFile = HdlFileNameResourse.AutoDownLoadBackupCheckFile; + //濡傛灉鏈湴宸茬粡鎷ユ湁浜嗚繖涓枃浠讹紝鍒欒鏄庝笉鏄柊鎵嬫満锛屼笉鍐嶈嚜鍔ㄨ繕鍘� + if (System.IO.File.Exists(checkFile) == true) + { + return 0; + } + + //鑾峰彇app鐨勮嚜鍔ㄥ浠� + var listData = HdlBackupLogic.Current.GetBackupListNameFromDB(BackUpMode.A鑷姩澶囦唤); + if (listData == null) + { + return -1; + } + if (listData.Count == 0) + { + //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾) + var file = System.IO.File.Create(checkFile); + file.Close(); + return 2; + } + //鑷姩澶囦唤鍙湁涓�涓� + string backId = listData[0].Id; + + //璐﹀彿鏁版嵁鍚屾涓� + ProgressFormBar.Current.Start(); + ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uAccountDataIsSynchronizing)); + + //浠庝簯绔幏鍙栧浠界殑鏂囦欢锛岀劧鍚庡瓨鍏ユ湰鍦版寚瀹氱殑涓存椂鏂囦欢澶� + string tempDir = HdlBackupLogic.Current.GetBackFileFromDBAndSetToLocation(backId); + if (tempDir == null) + { + //鍒犻櫎妫�娴嬫枃浠� + System.IO.File.Delete(checkFile); + //鍏抽棴杩涘害鏉� + ProgressFormBar.Current.Close(); + //鍚屾澶辫触 + return -1; + } + //濡傛灉璇诲彇鍒扮殑鏂囦欢瀹屽叏娌℃湁闂锛屽垯娓呯悊鏈湴鐨勬枃浠� + HdlFileLogic.Current.DeleteAllLocationFile(false); + + //娌℃湁閿欒鐨勮瘽锛屽垯绉诲姩鍒板綋鍓嶄綇瀹呮枃浠跺す涓嬮潰 + HdlFileLogic.Current.MoveDirectoryFileToHomeDirectory(tempDir, true); + + //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾) + var file2 = System.IO.File.Create(checkFile); + file2.Close(); + + //閲嶆柊鍒锋柊浣忓畢瀵硅薄 + HdlUserCenterLogic.Current.RefreshHomeObject(); + //鏍规嵁妯℃澘鏂囦欢,鎭㈠鏁版嵁 + HdlTemplateCommonLogic.Current.RecoverDataByTemplateBinFile(); + //寮哄埗鐢熸垚璁惧鍜岀綉鍏虫枃浠� + HdlTemplateCommonLogic.Current.CreatDeviceAndGatewayFileFromMemoryByForce(); + + //鍏抽棴杩涘害鏉� + ProgressFormBar.Current.Close(); + + return 1; } #endregion @@ -620,73 +1309,131 @@ #endregion - #region 鈻� 璇诲彇澶囦唤___________________________ + #region 鈻� 澶囦唤鎻愰啋___________________________ /// <summary> - /// 璇诲彇APP澶囦唤鏂囨。(鍑芥暟鍐呴儴鏈夎繘搴︽潯) + /// 淇濆瓨澶囦唤鎻愰啋璁剧疆鍒版湰鍦� /// </summary> - /// <param name="i_folderId"></param> - /// <param name="mode">澶辫触鏃舵槸鍚︽樉绀簍ip娑堟伅</param> - public bool LoadAppBackupInfo(string i_folderId, ShowNetCodeMode mode = ShowNetCodeMode.YES) + /// <param name="notPrompted">涓嶅啀鎻愮ず</param> + /// <param name="day"></param> + public void SaveBackupNotPrompted(bool notPrompted, int day = -1) { - //鎵撳紑杩涘害鏉� 姝e湪鑾峰彇澶囦唤鏂囦欢鍒楄〃 - ProgressFormBar.Current.Start(); - ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uBackupFileListGetting)); - - //浠庝簯绔幏鍙栧浠界殑鏂囦欢锛岀劧鍚庡瓨鍏ユ湰鍦扮殑涓存椂鏂囦欢澶� - string tempDirectory = GetBackFileFromDBAndSetToLocation(i_folderId, mode); - if (tempDirectory == null) + //鏂囦欢鍏ㄨ矾寰� + string fullName = HdlFileNameResourse.AutoBackupNotPromptedFile; + BackupNotPrompted info = null; + if (System.IO.File.Exists(fullName) == true) { - //鍏抽棴杩涘害鏉� - ProgressFormBar.Current.Close(); - return false; + var data = HdlFileLogic.Current.ReadFileByteContent(fullName); + info = JsonConvert.DeserializeObject<BackupNotPrompted>(System.Text.Encoding.UTF8.GetString(data)); + } + if (info == null) + { + info = new BackupNotPrompted(); } - //娓呯┖鍏ㄩ儴鎴块棿 - HdlRoomLogic.Current.DeleteAllRoom(); - //娓呯┖鏈湴鍏ㄩ儴鐨勫満鏅暟鎹� - HdlSceneLogic.Current.DeleteAllLocalScene(); - //濡傛灉璇诲彇鍒扮殑鏂囦欢瀹屽叏娌℃湁闂锛屽垯娓呯悊鏈湴鐨勬枃浠� - HdlFileLogic.Current.DeleteAllLocationFile(false); - - //娓呯悊鏈湴鐨勬ā鏉挎枃浠� - TemplateData.TemplateCommonLogic.Current.DeleteAllLocalFile(); - - //娌℃湁閿欒鐨勮瘽锛屽垯绉诲姩鍒板綋鍓嶄綇瀹呮枃浠跺す涓嬮潰 - HdlFileLogic.Current.MoveDirectoryFileToHomeDirectory(tempDirectory, true); - - //鍒犻櫎鍏ㄩ儴鐨勮嚜鍔ㄥ浠界殑鏈湴鏂囦欢(姝ゅ嚱鏁扮敤浜庤鍙栬嚜鍔ㄥ浠界殑鏃跺�欎娇鐢�) - HdlAutoBackupLogic.DeleteAllAutoBackupFile(); - - //鍒锋柊鏈湴缂撳瓨 - HdlUserCenterLogic.Current.RefreshAllMemory(); - - //鍏抽棴杩涘害鏉� - ProgressFormBar.Current.Close(); - - return true; + info.NotPrompted = notPrompted; + if (day != -1) + { + info.OldDay = DateTime.Now.ToString("yyyy-MM-dd"); + info.Day = day; + } + //淇濆瓨 + HdlFileLogic.Current.SaveFileContent(fullName, info); } - #endregion + /// <summary> + /// 鏄剧ず鑷姩澶囦唤鐨勭晫闈� + /// </summary> + public void ShowAutoBackupPromptedForm() + { + if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 3) + { + //鏆備笉鏀寔鎴愬憳 + return; + } - #region 鈻� 鍒犻櫎澶囦唤___________________________ + //鍒ゆ柇鏄惁鏈夋枃浠跺彉鏇翠簡 + if (CheckAutoBackupFileIsChanged() == false) + { + return; + } + //鍒ゆ柇鑳藉惁鏄剧ず鑷姩澶囦唤鐨勭晫闈� + if (this.CheckCanShowAutoBackupForm() == true) + { + //HdlThreadLogic.Current.RunMain(() => + //{ + // var form = new UserCenter.HdlBackup.HdlAutoBackupForm(); + // form.AddForm(); + //}); + } + } /// <summary> - /// 鍒犻櫎浜戠澶囦唤 + /// 妫�娴嬭嚜鍔ㄥ浠芥枃浠舵槸鍚﹀彉鏇磋繃 /// </summary> - /// <param name="i_folderId">澶囦唤鐨勪富閿�</param> - /// <param name="mode">澶辫触鏃舵槸鍚︽樉绀簍ip娑堟伅</param> /// <returns></returns> - public bool DeleteDbBackupData(string i_folderId, ShowNetCodeMode mode = ShowNetCodeMode.YES) + private bool CheckAutoBackupFileIsChanged() { - var pra = new { folderId = i_folderId, homeId = Config.Instance.Home.Id }; - var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/backup/folder/delete", RestSharp.Method.POST, pra, null, null, CheckMode.A璐﹀彿鏉冮檺); - //妫�娴嬬姸鎬佺爜 - if (HdlCheckLogic.Current.CheckNetCode(result, mode) == false) + List<string> listFile1 = HdlFileLogic.Current.GetFileFromDirectory(HdlFileNameResourse.AutoBackupDirectory); + List<string> listFile2 = this.GetLocalAutoBackupDeleteFile(); + + if (listFile1.Count == 0 && listFile2.Count == 0) { + //娌℃湁鏂囦欢鍙樻洿 return false; } - return true; + if (listFile2.Count > 0) + { + //鏈夋枃浠惰鍒犻櫎 + return true; + } + foreach (var fileName in listFile1) + { + //浣忓畢鍜屾敹钘忔枃浠�,涓嶄綔涓哄垽鏂爣鍑� + if (fileName.StartsWith("House_") == true + || fileName == "Room_Favorite.json") + { + continue; + } + return true; + } + return false; + } + + /// <summary> + /// 妫�娴嬭兘鍚︽樉绀鸿嚜鍔ㄥ浠界殑鐣岄潰 + /// </summary> + /// <returns></returns> + private bool CheckCanShowAutoBackupForm() + { + //鏂囦欢鍏ㄨ矾寰� + string fullName = HdlFileNameResourse.AutoBackupNotPromptedFile; + if (System.IO.File.Exists(fullName) == false) + { + //鏈湴娌℃湁瀛樺湪杩欎釜鏂囦欢 + return true; + } + BackupNotPrompted info = null; + var data = HdlFileLogic.Current.ReadFileByteContent(fullName); + info = JsonConvert.DeserializeObject<BackupNotPrompted>(System.Text.Encoding.UTF8.GetString(data)); + if (info.NotPrompted == true) + { + //涓嶅啀鎻愮ず + return false; + } + if (info.Day == 0) + { + return true; + } + + DateTime oldTime = Convert.ToDateTime(info.OldDay); + int intDay = (DateTime.Now - oldTime).Days; + //鏃堕棿宸茬粡瓒呰繃 + if (intDay >= info.Day) + { + return true; + } + return false; } #endregion @@ -716,7 +1463,7 @@ /// </summary> /// <param name="i_mode"></param> /// <returns></returns> - private string GetBackUpModeText(BackUpMode i_mode) + public string GetBackUpModeText(BackUpMode i_mode) { if (i_mode == BackUpMode.A鑷姩澶囦唤) { @@ -725,6 +1472,45 @@ return "USER_DEFINED_BACKUP"; } + /// <summary> + /// 鍒犻櫎鍏ㄩ儴鐨勮嚜鍔ㄥ浠界殑鏈湴鏂囦欢(姝ゅ嚱鏁扮敤浜庤鍙栬嚜鍔ㄥ浠界殑鏃跺�欎娇鐢�) + /// </summary> + public void DeleteAllAutoBackupFile() + { + //娓呯┖鑷姩澶囦唤銆愭枃浠跺す銆�(缂栬緫,杩藉姞) + string dirPath = HdlFileNameResourse.AutoBackupDirectory; + HdlFileLogic.Current.DeleteDirectory(dirPath); + HdlFileLogic.Current.CreateDirectory(dirPath, true); + + //娓呯┖鑷姩澶囦唤銆愭枃浠跺す銆�(鍒犻櫎) + dirPath = HdlFileNameResourse.AutoBackupdeleteDirectory; + HdlFileLogic.Current.DeleteDirectory(dirPath); + HdlFileLogic.Current.CreateDirectory(dirPath, true); + } + + #endregion + + #region 鈻� 鏁版嵁缁撴瀯___________________________ + + /// <summary> + /// 鑷姩澶囦唤涓嶉渶瑕佸啀娆℃彁閱掔殑缁撴瀯浣� + /// </summary> + private class BackupNotPrompted + { + /// <summary> + /// 涓嶅啀鎻愮ず + /// </summary> + public bool NotPrompted = false; + /// <summary> + /// 鍓嶄竴娆$殑鏃ユ湡锛�2019-01-01(鏍煎紡) + /// </summary> + public string OldDay = string.Empty; + /// <summary> + /// 鐩搁殧鏃ユ湡澶╂暟 + /// </summary> + public int Day = 0; + } + #endregion } } -- Gitblit v1.8.0