예제 #1
0
        private void UpdateFile()
        {
            try
            {
                if (Config == null)
                {
                    Config = vmSys.LoadSystemConfig();
                }
                if (Config.IS_UPDATE_AUTOUPDATE)
                {
                    string AutoUpdateFilePath    = Path.Combine("C:\\", ConfigurationManager.AppSettings["AutoUpdateFilePath"]);
                    string DeployPath_AutoUpdate = Path.Combine(ConfigurationManager.AppSettings["DeployPath_AutoUpdate"]);

                    //Now Create all of the directories
                    foreach (string dirPath in Directory.GetDirectories(DeployPath_AutoUpdate, "*", SearchOption.AllDirectories))
                    {
                        Directory.CreateDirectory(dirPath.Replace(DeployPath_AutoUpdate, AutoUpdateFilePath));
                    }

                    //Copy all the files & Replaces any files with the same name
                    foreach (string newPath in Directory.GetFiles(DeployPath_AutoUpdate, "*.*", SearchOption.AllDirectories))
                    {
                        File.Copy(newPath, newPath.Replace(DeployPath_AutoUpdate, AutoUpdateFilePath), true);
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #2
0
 public TBS_SYSTEM_CONFIG LoadSystemConfig()
 {
     try
     {
         using (OIS_SYSEntities ct = new OIS_SYSEntities())
         {
             TBS_SYSTEM_CONFIG result = ct.TBS_SYSTEM_CONFIG.FirstOrDefault();
             return(result);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
        public void SaveSystemConfig(TBS_SYSTEM_CONFIG data)
        {
            try
            {
                using (OIS_SYSEntities ct = new OIS_SYSEntities())
                    using (TransactionScope trans = new TransactionScope())
                    {
                        TBS_SYSTEM_CONFIG result = ct.TBS_SYSTEM_CONFIG.FirstOrDefault();

                        result.IS_UPDATE_AUTOUPDATE = data.IS_UPDATE_AUTOUPDATE;

                        result.UPD_ID      = OISDataInfo.UserInfomation.USER_ID;
                        result.UPD_DATE    = GetCurDateTime();
                        result.UPD_MACHINE = OISDataInfo.UserInfomation.MACHINE;

                        ct.SaveChanges();
                        trans.Complete();
                    }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #4
0
 public void SaveSystemConfig(TBS_SYSTEM_CONFIG data)
 {
     service.SaveSystemConfig(data);
 }