Пример #1
0
        public bool CheckExeUpData()
        {
            String messageInfo = String.Empty;

            bflag = CheckLogicalDish();

            if (!Directory.Exists(sourceFilePath) || bflag == false)
            {
                messageInfo = "没有找到U盘!";
            }
            else if (!File.Exists(sourceFilePath + @"\ShouldPadMachine.exe"))
            {
                messageInfo = "U盘内没有找到屏升级文件";
            }
            else
            {
                MachineInfoDAO machineInfoDAO = new MachineInfoDAO();
                machineInfoDAO.SetDataBaseValue(MachineInfoEnum.ScreenLoadTime, SystemTimeManager.SystemTimerEx.NowDate);
                machineInfoDAO.SetDataBaseValue(MachineInfoEnum.ScreenModifyTime, SystemTimeManager.SystemTimerEx.GetFileModifyTime(sourceFilePath + @"\ShouldPadMachine.exe"));
                machineInfoDAO.SetDataBaseValue(MachineInfoEnum.CreateImageEnable, true);
                return(true);
            }

            ErrorMessage.SetErrorMessage(PromptMessageType.PromptMessageType, messageInfo);
            return(false);
        }
Пример #2
0
        public bool CheckEcoUpData()
        {
            String messageInfo = String.Empty;

            bflag = bflag = CheckLogicalDish();

            if (!Directory.Exists(sourceFilePath) || bflag == false)
            {
                messageInfo = "没有找到U盘!";
            }
            else
            {
                String[] fileNames = Directory.GetFiles(sourceFilePath, "*.eco");
                if (fileNames.Length > 1)
                {
                    messageInfo = "U盘内ECO文件过多!";
                }
                else if (fileNames.Length == 0)
                {
                    messageInfo = "U盘内ECO升级文件没找到!";
                }
                else
                {
                    MachineInfoDAO machineInfoDAO = new MachineInfoDAO();
                    machineInfoDAO.SetDataBaseValue(MachineInfoEnum.BoardLoadTime, SystemTimeManager.SystemTimerEx.NowDate);
                    machineInfoDAO.SetDataBaseValue(MachineInfoEnum.BoardModifyTime, SystemTimeManager.SystemTimerEx.GetFileModifyTime(fileNames[0]));
                    machineInfoDAO.SetDataBaseValue(MachineInfoEnum.CreateImageEnable, true);
                    return(true);
                }
            }

            ErrorMessage.SetErrorMessage(PromptMessageType.PromptMessageType, messageInfo);
            return(false);
        }
Пример #3
0
 public void ChangeVerifyDate(int code)//code:0~12,若为0,关闭到期时间检测,其他的数字让到期时间延长相应的月数
 {
     if (code == 0)
     {
         CloseVerify();
     }
     else
     {
         MachineInfoDAO machineInfoDAO = new MachineInfoDAO();
         String         expiratData    = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.ExpiratDate);
         String[]       exirats        = expiratData.Split('-');
         if (exirats.Length > 2)
         {
             String year       = exirats[0];
             String month      = exirats[1];
             int    monthValue = Convert.ToInt32(month) + code;
             int    yearValue  = Convert.ToInt32(year);
             if (monthValue > 12)
             {
                 monthValue -= 12;
                 yearValue++;
             }
             expiratData = yearValue.ToString() + "-" + monthValue.ToString().PadLeft(2, '0') + "-" + exirats[2];
             machineInfoDAO.SetDataBaseValue(MachineInfoEnum.ExpiratDate, expiratData);  //待
         }
     }
 }
Пример #4
0
        public void UpdataMachineInfoImage()
        {
            MachineInfoDAO machineInfoDAO           = new MachineInfoDAO();
            String         sqlScreenCodeVersion     = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.ScreenCodeVersion);
            bool           shouldCreatBootLoadImage = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.CreateImageEnable) == "1" ?true:false;

            if (screenCodeVersion != sqlScreenCodeVersion)
            {
                shouldCreatBootLoadImage = true;
                machineInfoDAO.SetDataBaseValue(MachineInfoEnum.ScreenCodeVersion, screenCodeVersion);
            }
            if (shouldCreatBootLoadImage)
            {
                CreateBootLoadImage();
            }
        }
Пример #5
0
        public void CreateBootLoadImage()
        {
            MachineInfoDAO machineInfoDAO = new MachineInfoDAO();

            machineInfoDAO.SetDataBaseValue(MachineInfoEnum.CreateImageEnable, false);
            String sourceImagePath = DefaultPath.DefaultPathEx.ImagePath + "BootLoader.jpg";
            String destImagePath   = @"\ResidentFlash\BootLoader.jpg";

            FileOperManager.DeleteFile(destImagePath);
            FileOperManager.CopyFile(sourceImagePath, destImagePath, true);
            MachineInfoModel machineInfoModel = new MachineInfoModel();

            machineInfoModel.BoardCodeVersion  = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.BoardCodeVersion);
            machineInfoModel.BoardID           = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.BoardID);
            machineInfoModel.BoardLoadTime     = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.BoardLoadTime);
            machineInfoModel.BoardModifyTime   = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.BoardModifyTime);
            machineInfoModel.MachineID         = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.MachineID);
            machineInfoModel.ScreenCodeVersion = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.ScreenCodeVersion);
            machineInfoModel.ScreenLoadTime    = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.ScreenLoadTime);
            machineInfoModel.ScreenModifyTime  = machineInfoDAO.GetDataBaseValue(MachineInfoEnum.ScreenModifyTime);
            CreateMachineImage createMachineImage = new CreateMachineImage();

            createMachineImage.CreateMachineInfoImage(destImagePath, machineInfoModel);
        }
Пример #6
0
        public void SetMachineInfoValue(MachineInfoEnum machineInfoEnum, String value)
        {
            MachineInfoDAO machineInfoDAO = new MachineInfoDAO();

            machineInfoDAO.SetDataBaseValue(machineInfoEnum.ToString(), value);
        }
Пример #7
0
        public void CloseVerify()
        {
            MachineInfoDAO machineInfoDAO = new MachineInfoDAO();

            machineInfoDAO.SetDataBaseValue(MachineInfoEnum.OpenVerifyEnable, false);
        }