Example #1
0
 private void TipSetupResult(RegFileSetupResult setupResult)
 {
     if (setupResult != null)
     {
         string str = "";
         if ((setupResult.NormalRegFiles != null) && (setupResult.NormalRegFiles.Count > 0))
         {
             str = str + string.Format("已成功安装版本 {0}个:\n", setupResult.NormalRegFiles.Count);
             foreach (RegFileInfo info in setupResult.NormalRegFiles)
             {
                 if ((info != null) && (info.VerFlag != null))
                 {
                     str = str + this.GetVersionName(info.VerFlag) + "\n";
                 }
             }
             str = str + "\n已安装的功能将在系统下次启动之后可用。";
         }
         if ((setupResult.OutOfDateRegFiles != null) && (setupResult.OutOfDateRegFiles.Count > 0))
         {
             str = str + string.Format("过期版本 {0}个:\n", setupResult.OutOfDateRegFiles.Count);
             foreach (RegFileInfo info2 in setupResult.OutOfDateRegFiles)
             {
                 if ((info2 != null) && (info2.VerFlag != null))
                 {
                     str = str + this.GetVersionName(info2.VerFlag) + "\n";
                 }
             }
         }
         if (str == "")
         {
             str = "注册文件无效";
         }
         MessageManager.ShowMsgBox("INP-111001", "提示", new string[] { str });
     }
 }
Example #2
0
        private List <RegFileWrapper> GetRegFileWrappers(RegFileSetupResult fileSetup)
        {
            List <RegFileWrapper> list = new List <RegFileWrapper>();

            if (fileSetup != null)
            {
                if (fileSetup.NormalRegFiles != null)
                {
                    foreach (RegFileInfo info in fileSetup.NormalRegFiles)
                    {
                        RegFileWrapper item = this.NewFileWrapper(info, RegFileType.Normal);
                        if (item != null)
                        {
                            list.Add(item);
                        }
                    }
                }
                if (fileSetup.OutOfDateRegFiles == null)
                {
                    return(list);
                }
                foreach (RegFileInfo info2 in fileSetup.OutOfDateRegFiles)
                {
                    RegFileWrapper wrapper2 = this.NewFileWrapper(info2, RegFileType.OutOfDate);
                    if (wrapper2 != null)
                    {
                        list.Add(wrapper2);
                    }
                }
            }
            return(list);
        }
Example #3
0
 private void method_1()
 {
     try
     {
         RegFileSetupResult result = RegisterManager.SetupRegFile(this.taxCard_0);
         if ((result != null) && ((result.NormalRegFiles.Count + result.OutOfDateRegFiles.Count) >= 1))
         {
             DateTime cardClock = this.taxCard_0.GetCardClock();
             DateTime time2     = new DateTime(cardClock.Year, cardClock.Month, cardClock.Day);
             foreach (RegFileInfo info in result.NormalRegFiles)
             {
                 string s = "";
                 foreach (char ch in info.FileContent.StopDate)
                 {
                     s = s + ch;
                 }
                 DateTime time3 = DateTime.ParseExact(s, "yyyyMMdd", null);
                 if (this.bool_1 && (time3 < time2))
                 {
                     this.list_1.Add(this.method_4(info.VerFlag));
                 }
                 else if (this.bool_0 && (time2.AddDays((double)this.int_0) >= time3))
                 {
                     Dictionary <string, string> item = new Dictionary <string, string>();
                     item.Add("MC", this.method_4(info.VerFlag));
                     TimeSpan span = (TimeSpan)(time3 - time2);
                     item.Add("DAYS", span.Days.ToString());
                     this.list_0.Add(item);
                 }
             }
             foreach (RegFileInfo info2 in result.OutOfDateRegFiles)
             {
                 string str2 = "";
                 foreach (char ch2 in info2.FileContent.StopDate)
                 {
                     str2 = str2 + ch2;
                 }
                 DateTime time5 = DateTime.ParseExact(str2, "yyyyMMdd", null);
                 if (this.bool_1 && (time5 < time2))
                 {
                     this.list_1.Add(this.method_4(info2.VerFlag));
                 }
                 else if (this.bool_0 && (DateTime.Now.AddDays((double)this.int_0) >= time5))
                 {
                     Dictionary <string, string> dictionary2 = new Dictionary <string, string>();
                     dictionary2.Add("MC", this.method_4(info2.VerFlag));
                     TimeSpan span2 = (TimeSpan)(time5 - time2);
                     dictionary2.Add("DAYS", span2.Days.ToString());
                     this.list_0.Add(dictionary2);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.ilog_0.Error("classifyRegFile异常:" + exception.ToString());
     }
 }
Example #4
0
 private static void UpdateVersionInfo(RegFileSetupResult setupResult)
 {
     if ((setupResult != null) && (setupResult.NormalRegFiles != null))
     {
         RegistInfoDAL odal = new RegistInfoDAL();
         foreach (RegFileInfo info in setupResult.NormalRegFiles)
         {
             string str = info.FileName;
             if (string.IsNullOrEmpty(str) && string.IsNullOrEmpty(info.VerFlag))
             {
                 odal.UpdateRegFileName(info.VerFlag, str.Substring(str.LastIndexOf('\\') + 1));
             }
         }
     }
 }
Example #5
0
        private void SetupNewRegFiles(List <string> regFiles)
        {
            RegFileSetupResult    fileSetup       = RegisterManager.SetupRegFile(regFiles, base.TaxCardInstance);
            List <RegFileWrapper> regFileWrappers = this.GetRegFileWrappers(fileSetup);

            this.tvRegVersion.BeginUpdate();
            foreach (RegFileWrapper wrapper in regFileWrappers)
            {
                this.AddRegFileNode(wrapper);
            }
            this.tvRegVersion.EndUpdate();
            this.tvRegVersion.ExpandAll();
            this.TipSetupResult(fileSetup);
            UpdateVersionInfo(fileSetup);
        }
Example #6
0
        private void InitTreeData()
        {
            this.versionList.AddRange(new RegistInfoDAL().SelectRegistFileName());
            RegFileSetupResult    fileSetup       = RegisterManager.SetupRegFile(base.TaxCardInstance);
            List <RegFileWrapper> regFileWrappers = this.GetRegFileWrappers(fileSetup);

            this.tvRegVersion.BeginUpdate();
            this.tvRegVersion.Nodes.Clear();
            this.rootNode                    = new TreeNode();
            this.rootNode.Text               = "防伪开票";
            this.rootNode.ImageIndex         = 0;
            this.rootNode.SelectedImageIndex = 0;
            this.tvRegVersion.Nodes.Add(this.rootNode);
            foreach (RegFileWrapper wrapper in regFileWrappers)
            {
                this.AddRegFileNode(wrapper);
            }
            this.tvRegVersion.EndUpdate();
            this.tvRegVersion.ExpandAll();
        }