public static SAPConnectionInfo GetSAPConnectionInfo()
        {
            // bağlantı bilgileri json'a deserilize edilerek nesne oluşturulur
            SAPConnectionInfo result = new SAPConnectionInfo();

            string info = "";

            string fileName = ConfigurationManager.AppSettings["SAPConnectionInfoSavingFileNameAndPath"];

            // ishak.kulekci 25.12.2014 17.00
            // server 2008'de task manager ile log path ve dosyasına erişim hatası almamak için
            // when running as a scheduled task the working directory of your application can be different, such as running under system means the working directory is C:\Windows\System32
            // Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),"NLog.txt");
            fileName =
                Path.Combine(
                    System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
                    fileName);

            using (StreamReader sw = new StreamReader(fileName))
            {
                info = sw.ReadToEnd();
                sw.Close();
            }

            result = JsonConvert.DeserializeObject<SAPConnectionInfo>(info);

            return result;
        }
Beispiel #2
0
        public static void SaveSAPConnectionInfo(SAPConnectionInfo sapConnectionInfo)
        {
            // bağlantı bilgileri json'a serilize edilerek kaydedilir

            string info = JsonConvert.SerializeObject(sapConnectionInfo);


            string fileName = ConfigurationManager.AppSettings["SAPConnectionInfoSavingFileNameAndPath"];

            // ishak.kulekci 25.12.2014 17.00
            // server 2008'de task manager ile log path ve dosyasına erişim hatası almamak için
            // when running as a scheduled task the working directory of your application can be different, such as running under system means the working directory is C:\Windows\System32
            // Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),"NLog.txt");
            fileName =
                Path.Combine(
                    System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
                    fileName);

            using (StreamWriter sw = new StreamWriter(fileName, false))
            {
                sw.Write(info);
                sw.Flush();
                sw.Close();
            }
        }
Beispiel #3
0
        public static SAPConnectionInfo GetSAPConnectionInfo()
        {
            // bağlantı bilgileri json'a deserilize edilerek nesne oluşturulur
            SAPConnectionInfo result = new SAPConnectionInfo();


            string info = "";


            string fileName = ConfigurationManager.AppSettings["SAPConnectionInfoSavingFileNameAndPath"];

            // ishak.kulekci 25.12.2014 17.00
            // server 2008'de task manager ile log path ve dosyasına erişim hatası almamak için
            // when running as a scheduled task the working directory of your application can be different, such as running under system means the working directory is C:\Windows\System32
            // Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),"NLog.txt");
            fileName =
                Path.Combine(
                    System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
                    fileName);

            using (StreamReader sw = new StreamReader(fileName))
            {
                info = sw.ReadToEnd();
                sw.Close();
            }

            result = JsonConvert.DeserializeObject <SAPConnectionInfo>(info);

            return(result);
        }
Beispiel #4
0
        public RfcConfigParameters GetParameters(string destinationName)
        {
            //throw new NotImplementedException();

            // ishak.kulekci 06.06.2013
            // destinationname boş olmaması gerekiyor, yoksa "ERROR no symbolic destination specified" şeklinde hata veriyor

            //SAPConnectionInfo sapConnectionInfo = ConfigHelper.ParseSAPConnectionInfo();
            SAPConnectionInfo sapConnectionInfo = ConfigHelper.ParseSAPConnectionInfoFromUI();

            RfcConfigParameters rfcConfigParameters = new RfcConfigParameters();

            rfcConfigParameters[RfcConfigParameters.AppServerHost] = sapConnectionInfo.ASHOST;
            rfcConfigParameters[RfcConfigParameters.SystemNumber]  = sapConnectionInfo.SYSNR;
            rfcConfigParameters[RfcConfigParameters.Client]        = sapConnectionInfo.CLIENT;
            rfcConfigParameters[RfcConfigParameters.User]          = sapConnectionInfo.USER;
            rfcConfigParameters[RfcConfigParameters.Password]      = sapConnectionInfo.PASSWD;
            rfcConfigParameters[RfcConfigParameters.Language]      = sapConnectionInfo.LANG;
            rfcConfigParameters[RfcConfigParameters.PoolSize]      = sapConnectionInfo.POOL_SIZE;
            //rfcConfigParameters[RfcConfigParameters.MaxPoolSize]
            rfcConfigParameters[RfcConfigParameters.PeakConnectionsLimit] = sapConnectionInfo.MAX_POOL_SIZE;
            // ishak.kulekci 06.06.2013
            // Name değeri üstte belirtilen destinationName ile aynı olmalı yoksa "Inconsistency in destination name: does not match ..." şeklinde hata veriyor
            rfcConfigParameters[RfcConfigParameters.Name] = destinationName; //sapConnectionInfo.NAME;


            return(rfcConfigParameters);
        }
        public static SAPConnectionInfo ParseSAPConnectionInfo()
        {
            string appSettingSAPConnectionInfo = GetSAPConnectionInfo();
            string[] subStringsOfAppSettingSAPConnectionInfo = appSettingSAPConnectionInfo.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);

            SAPConnectionInfo sapConnectionInfo = new SAPConnectionInfo();
            foreach (var s in subStringsOfAppSettingSAPConnectionInfo)
            {
                if (s.StartsWith("ASHOST="))
                    sapConnectionInfo.ASHOST = GetRightOfEqualOperator(s);
                else if (s.StartsWith("SYSNR="))
                    sapConnectionInfo.SYSNR = GetRightOfEqualOperator(s);
                else if (s.StartsWith("CLIENT="))
                    sapConnectionInfo.CLIENT = GetRightOfEqualOperator(s);
                else if (s.StartsWith("USER="******"PASSWD="))
                    sapConnectionInfo.PASSWD = GetRightOfEqualOperator(s);
                else if (s.StartsWith("LANG="))
                    sapConnectionInfo.LANG = GetRightOfEqualOperator(s);
                else if (s.StartsWith("POOL_SIZE="))
                    sapConnectionInfo.POOL_SIZE = GetRightOfEqualOperator(s);
                else if (s.StartsWith("MAX_POOL_SIZE="))
                    sapConnectionInfo.MAX_POOL_SIZE = GetRightOfEqualOperator(s);
                else if (s.StartsWith("NAME="))
                    sapConnectionInfo.NAME = GetRightOfEqualOperator(s);

            }

            return sapConnectionInfo;
        }
Beispiel #6
0
        //public static string prmASHOST { get; set; }
        //public static string prmSYSNR { get; set; }
        //public static string prmCLIENT { get; set; }
        //public static string prmUSER { get; set; }
        //public static string prmPASSWD { get; set; }
        //public static string prmLANG { get; set; }
        //public static string prmPOOL_SIZE { get; set; }
        //public static string prmMAX_POOL_SIZE { get; set; }



        private void FormMain_Load(object sender, EventArgs e)
        {
            lblTestConnectionResult.Text = String.Empty;

            // önceden girilen sap bağlantı bilgileri dosyadan alınıp, bağlantı bilgileri ekranında doldurulur
            // bağlantı bilgileri static değişkene doldurulur
            sapConnectionInfo = FileHelper.GetSAPConnectionInfo();
            LoadUIFromSAPConnectionStaticParameters();

            txtRFCName.Text = FileHelper.GetRFCName();
        }
        public static SAPConnectionInfo ParseSAPConnectionInfo()
        {
            string appSettingSAPConnectionInfo = GetSAPConnectionInfo();

            string[] subStringsOfAppSettingSAPConnectionInfo = appSettingSAPConnectionInfo.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);

            SAPConnectionInfo sapConnectionInfo = new SAPConnectionInfo();

            foreach (var s in subStringsOfAppSettingSAPConnectionInfo)
            {
                if (s.StartsWith("ASHOST="))
                {
                    sapConnectionInfo.ASHOST = GetRightOfEqualOperator(s);
                }
                else if (s.StartsWith("SYSNR="))
                {
                    sapConnectionInfo.SYSNR = GetRightOfEqualOperator(s);
                }
                else if (s.StartsWith("CLIENT="))
                {
                    sapConnectionInfo.CLIENT = GetRightOfEqualOperator(s);
                }
                else if (s.StartsWith("USER="******"PASSWD="))
                {
                    sapConnectionInfo.PASSWD = GetRightOfEqualOperator(s);
                }
                else if (s.StartsWith("LANG="))
                {
                    sapConnectionInfo.LANG = GetRightOfEqualOperator(s);
                }
                else if (s.StartsWith("POOL_SIZE="))
                {
                    sapConnectionInfo.POOL_SIZE = GetRightOfEqualOperator(s);
                }
                else if (s.StartsWith("MAX_POOL_SIZE="))
                {
                    sapConnectionInfo.MAX_POOL_SIZE = GetRightOfEqualOperator(s);
                }
                else if (s.StartsWith("NAME="))
                {
                    sapConnectionInfo.NAME = GetRightOfEqualOperator(s);
                }
            }


            return(sapConnectionInfo);
        }
        public static void SaveSAPConnectionInfo(SAPConnectionInfo sapConnectionInfo)
        {
            // bağlantı bilgileri json'a serilize edilerek kaydedilir

            string info = JsonConvert.SerializeObject(sapConnectionInfo);

            string fileName = ConfigurationManager.AppSettings["SAPConnectionInfoSavingFileNameAndPath"];

            // ishak.kulekci 25.12.2014 17.00
            // server 2008'de task manager ile log path ve dosyasına erişim hatası almamak için
            // when running as a scheduled task the working directory of your application can be different, such as running under system means the working directory is C:\Windows\System32
            // Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),"NLog.txt");
            fileName =
                Path.Combine(
                    System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
                    fileName);

            using (StreamWriter sw = new StreamWriter(fileName, false))
            {
                sw.Write(info);
                sw.Flush();
                sw.Close();
            }
        }
        //public static string prmASHOST { get; set; }
        //public static string prmSYSNR { get; set; }
        //public static string prmCLIENT { get; set; }
        //public static string prmUSER { get; set; }
        //public static string prmPASSWD { get; set; }
        //public static string prmLANG { get; set; }
        //public static string prmPOOL_SIZE { get; set; }
        //public static string prmMAX_POOL_SIZE { get; set; }
        private void FormMain_Load(object sender, EventArgs e)
        {
            lblTestConnectionResult.Text=String.Empty;

            // önceden girilen sap bağlantı bilgileri dosyadan alınıp, bağlantı bilgileri ekranında doldurulur
            // bağlantı bilgileri static değişkene doldurulur
            sapConnectionInfo = FileHelper.GetSAPConnectionInfo();
            LoadUIFromSAPConnectionStaticParameters();

            txtRFCName.Text = FileHelper.GetRFCName();
        }
        public FormMain()
        {
            InitializeComponent();

            sapConnectionInfo = new SAPConnectionInfo();
        }
Beispiel #11
0
        public FormMain()
        {
            InitializeComponent();

            sapConnectionInfo = new SAPConnectionInfo();
        }