コード例 #1
0
ファイル: Utility.cs プロジェクト: Muruganalagesan/AMT
        public static DBConnectionInfo LoadDbConnectionInfo()
        {
            DBConnectionInfo connectioninfo = new DBConnectionInfo();

            try
            {
                DBProfileInfo dbProfileInfo = new DBProfileInfo();


                if (File.Exists(ApplicationInfo.DBProfileName))
                {
                    XMLSerializer <DBProfileInfo> .DeSerializeInputs <DBProfileInfo>(ApplicationInfo.DBProfileName, ref dbProfileInfo);

                    connectioninfo.AuthenticationType = dbProfileInfo.AuthenticationType;
                    connectioninfo.DatabaseName       = ApplicationInfo.DatabaseName;
                    connectioninfo.DatabaseType       = dbProfileInfo.DatabaseType;
                    connectioninfo.DBPath             = ApplicationInfo.ApplicationDocumentPath;
                    connectioninfo.Password           = dbProfileInfo.Password;
                    connectioninfo.UserName           = dbProfileInfo.UserName;
                    connectioninfo.ServerName         = dbProfileInfo.ServerName;
                }
            }
            catch (Exception ex)
            {
                AMTLogger.WriteToLog(ex.Message, MethodBase.GetCurrentMethod().Name, 0, AMTLogger.LogInfo.Error);
            }
            return(connectioninfo);
        }
コード例 #2
0
ファイル: Utility.cs プロジェクト: Muruganalagesan/AMT
        public static Boolean RemoveRemoteAction(String ActionName)
        {
            Boolean result = false;
            List <RemoteActionInfo> remoteActionList = new List <RemoteActionInfo>();

            try
            {
                remoteActionList = LoadRemoteActions();
                RemoteActionInfo remoteAction = remoteActionList.Where(t => t.ActionName == ActionName).FirstOrDefault();
                if (remoteAction != null)
                {
                    remoteActionList.Remove(remoteAction);

                    if (File.Exists(ApplicationInfo.RemoteActionFile))
                    {
                        XMLSerializer <List <RemoteActionInfo> > .SerializeInputs(ApplicationInfo.RemoteActionFile, remoteActionList);
                    }
                }

                result = true;
            }
            catch (Exception ex)
            {
                AMTLogger.WriteToLog(ex.Message, MethodBase.GetCurrentMethod().Name, 0, AMTLogger.LogInfo.Error);
            }

            return(result);
        }
コード例 #3
0
ファイル: Utility.cs プロジェクト: Muruganalagesan/AMT
        public static DBProfileInfo GetDBProfileInfo()
        {
            DBProfileInfo dbProfileInfo = new DBProfileInfo();

            try
            {
                if (File.Exists(ApplicationInfo.DBProfileName))
                {
                    XMLSerializer <DBProfileInfo> .DeSerializeInputs <DBProfileInfo>(ApplicationInfo.DBProfileName, ref dbProfileInfo);
                }
            }
            catch (Exception ex)
            {
                AMTLogger.WriteToLog(ex.Message, MethodBase.GetCurrentMethod().Name, 0, AMTLogger.LogInfo.Error);
            }
            return(dbProfileInfo);
        }
コード例 #4
0
ファイル: Utility.cs プロジェクト: Muruganalagesan/AMT
        public static List <RemoteActionInfo> LoadRemoteActions()
        {
            List <RemoteActionInfo> remoteActionInfo = new List <RemoteActionInfo>();

            try
            {
                if (File.Exists(ApplicationInfo.RemoteActionFile))
                {
                    XMLSerializer <List <RemoteActionInfo> > .DeSerializeInputs(ApplicationInfo.RemoteActionFile, ref remoteActionInfo);
                }
            }
            catch (Exception ex)
            {
                AMTLogger.WriteToLog(ex.Message, MethodBase.GetCurrentMethod().Name, 0, AMTLogger.LogInfo.Error);
            }

            return(remoteActionInfo);
        }