Beispiel #1
0
        public SOAPSAP.REVE_AGGREGATION_KUNWEResponse PobierzObrotKUNWE(string vtweg, string KNDNR_FROM, string KNDNR_TO, string period_from_month, string period_from_year, string period_to_month, string period_to_year, string uri, string vkorg)
        {
            BasicHttpBinding binding = new BasicHttpBinding();

            binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
            binding.Name = "MyBinding";
            binding.MaxReceivedMessageSize = Int32.MaxValue;


            EndpointAddress endpoint = new EndpointAddress(uri);

            //SI_SEND_ORG_DATAClient client = new SI_SEND_ORG_DATAClient(binding, endpoint);



            SOAPSAP.ZPK_CRM_RAPORTYClient client = new SOAPSAP.ZPK_CRM_RAPORTYClient(binding, endpoint);

            // SOAPSAP.REVE_AGGREGATIONRequest



            sap_soa_obroty.SOAPSAP.REVE_AGGREGATION_KUNWE fn = new sap_soa_obroty.SOAPSAP.REVE_AGGREGATION_KUNWE();
            fn.IV_VKORG      = vkorg;
            fn.IV_VTWEG      = vtweg;
            fn.IV_KUNWE_FROM = KNDNR_FROM;
            fn.IV_KUNWE_TO   = KNDNR_TO;

            sap_soa_obroty.SOAPSAP.ZPK_S_PERIOD period = new sap_soa_obroty.SOAPSAP.ZPK_S_PERIOD();
            period.MONTH = "001";
            period.YEAR  = "2018";

            fn.IV_PERIOD_FROM = new SOAPSAP.ZPK_S_PERIOD {
                MONTH = period_from_month, YEAR = period_from_year
            };
            //fn.IV_PERIOD_FROM.MONTH = "001";
            //fn.IV_PERIOD_TO.YEAR = "2018";
            //fn.IV_PERIOD_TO.MONTH = "002";
            fn.IV_PERIOD_TO = new SOAPSAP.ZPK_S_PERIOD {
                MONTH = period_to_month, YEAR = period_to_year
            };
            List <string> sapauth = auth.PodajAutoryzacje();

            client.ClientCredentials.UserName.UserName = sapauth[0];
            client.ClientCredentials.UserName.Password = sapauth[1];

            SOAPSAP.REVE_AGGREGATION_KUNWEResponse res = client.REVE_AGGREGATION_KUNWE(fn);


            return(res);
        }
Beispiel #2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            sap_soa_obroty.SOAPSAP.REVE_AGGREGATION_KUNWE lista_obrotow = new SOAPSAP.REVE_AGGREGATION_KUNWE();
            string url = "http://er1.aquael.pl:8000/sap/bc/srt/rfc/sap/zpk_crm_raporty/001/zpk_crm_raporty/zpk_crm_raporty";
            // tutaj pobieramy założenia - z combo boxów

            string okrod  = okresod.Text;
            string okrdo  = okresdo.Text;
            string rod    = rokod.Text;
            string rdo    = rokdo.Text;
            string dzsprz = działsprzedaży.Text;
            string kd     = kanałdystrybucji.Text;
            string klod   = Klienciod.Text;
            string kldo   = KlienciDO.Text;

            odp_we = model.PobierzObrotKUNWE(kd, klod, kldo, okrod, rod, okrdo, rdo, url, dzsprz);

            dataGridWE.ItemsSource = odp_we.ET_AQ10;
        }