Пример #1
0
        public async static Task<String> GetTownViaPLZAsync (string PLZ, BusinessLayer.User user)
        {
            Stream dataStream;

            // Use the ServiceManager to build send the data to the SOA services            
            // The ServiceManager is responsible to send the data to the SOA services       
            // Run the service and return the value as a Datastream 
            // EXECUSERPERMISSION.JSON

            SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/GetTownViaPLZ.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                  

            // Add the Values                           
            sm.AddCriteriaValue ("PLZ", PLZ);

            // Now it's show time   
            dataStream = await sm.CommitPostAsync();
            if (dataStream == null)
                return "";

            StreamReader reader = new StreamReader(dataStream);
            string jsonText = await reader.ReadToEndAsync();

            /*  JavaScriptSerializer js = new JavaScriptSerializer();
            Person [] persons =  js.Deserialize<Person[]>(json);
*/

            return   jsonText.Trim ();
        }
Пример #2
0
        async public Task<BusinessLayer.Position> GetAnfragePreisBeforeCommitAsync(BusinessLayer.Transaction transaction, BusinessLayer.Position position, string kundeId, BusinessLayer.Artikel artikel, string datum, string menge, string deviceLanguage, BusinessLayer.User user)
        {
            Stream dataStream;
            // The ServiceManager is responsible to send the data to the SOA services       
            // Run the service and return the value as a Datastream 
            // EXECUSERPERMISSION.JSON

            SOAServiceManager sm = new SOAServiceManager(DataAccessLayer.Utilities.ServerIP + "/GetAngebotPreisBeforeCommit.json", user.IdSession, DataAccessLayer.HTTPMethod.POST);                  

            // Add the Values                           
            sm.AddCriteriaValue("PosID", position.ID);
            sm.AddCriteriaValue("KpfID", transaction.ID);
            sm.AddCriteriaValue("ArtikelID", artikel.ID);
            sm.AddCriteriaValue("KundeID", kundeId);
            sm.AddCriteriaValue("VersionId", artikel.VersionID);
            sm.AddCriteriaValue("Datum", datum);
            sm.AddCriteriaValue("Mandant", user.Mandant);
            sm.AddCriteriaValue("User", user.Name);
            sm.AddCriteriaValue("Menge", menge);
            sm.AddCriteriaValue("Preis", position.Preis);
            sm.AddCriteriaValue("Rabatt", position.Rabatt1);
            sm.AddCriteriaValue("PreisMenge", position.PreisMenge);
            sm.AddCriteriaValue("EinheitID", position.EinheitID);


            // Now it's show time   
            dataStream = await sm.CommitPostAsync();                                                  

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            if (reader == null)
                return null;

            string jsonText = await reader.ReadToEndAsync();
            return  Newtonsoft.Json.JsonConvert.DeserializeObject<BusinessLayer.Position>(jsonText);


        }
Пример #3
0
        public async  Task< System.Collections.Generic.List<BusinessLayer.Anfrage>>   GetAnfragenAsync (string lieferantenId, string deviceLanguage ,  BusinessLayer.User user)
        {
            // First check for the network status
            if (user.NetworkStatus == NetworkState.Disconnected)
                return await GetAnfragenAsync (lieferantenId, deviceLanguage,  user, true);

            Stream dataStream;

            // Use the ServiceManager to build send the data to the SOA services            
            // The ServiceManager is responsible to send the data to the SOA services       
            // Run the service and return the value as a Datastream 
            // EXECUSERPERMISSION.JSON

            SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/anfragen.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                  

            // Add the Values                           
            sm.AddCriteriaValue ("KundeID", lieferantenId);
            sm.AddCriteriaValue ("Mandant", user.Mandant);
            sm.AddCriteriaValue ("Sprache", deviceLanguage);

            // Now it's show time   
            dataStream = await sm.CommitPostAsync ();                                                   

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            if (reader == null)
                return null;

            string jsonText = await reader.ReadToEndAsync ();



            return  await Task.Run(() =>Newtonsoft.Json.JsonConvert.DeserializeObject<List<BusinessLayer.Anfrage>> (jsonText));

        }
		async public  Task<DataAccessLayer.SOAResult> InsertLieferantAsync ( BusinessLayer.Lieferant Lieferant,  BusinessLayer.User user)
		{

			// First test if the network status is disconnected
			if (user.NetworkStatus == NetworkState.Disconnected) 
			{
				return await this.InsertLieferantAsync (Lieferant,  user, true);
			}

			Stream dataStream;
			ReturnValue Success;

			// Use the ServiceManager to build send the data to the SOA services			
			// The ServiceManager is responsible to send the data to the SOA services 		
			// Run the service and return the value as a Datastream	
			// EXECUSERPERMISSION.JSON

			SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/InsertLieferant.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);					

			// Add the Values 							
			sm.AddCriteriaValue ("Name", Lieferant.Name);
			sm.AddCriteriaValue ("Strasse", Lieferant.Strasse);
			sm.AddCriteriaValue ("PLZ", Lieferant.PLZ);
			sm.AddCriteriaValue ("Ort", Lieferant.Ort);
			sm.AddCriteriaValue ("Land", Lieferant.Land);
            sm.AddCriteriaValue ("LandNummer", Lieferant.LandNummer);
			sm.AddCriteriaValue ("Telefon", Lieferant.Telefon);
			sm.AddCriteriaValue ("Email", Lieferant.Email);
			sm.AddCriteriaValue ("Geburtsdatum", Lieferant.Geburtsdatum);
			sm.AddCriteriaValue ("Mandant", user.Mandant);
            sm.AddCriteriaValue ("Sperrdatum", Lieferant.Sperrdatum);
            sm.AddCriteriaValue ("Sperrgrund", Lieferant.Sperrgrund);

			// Now it's show time	
            dataStream = await sm.CommitPostAsync ();													

            if (dataStream == null)
                return SOAResult.Disconnected;

            StreamReader reader = new StreamReader(dataStream);
			string jsonText = await reader.ReadToEndAsync ();


			Success =  Newtonsoft.Json.JsonConvert.DeserializeObject<ReturnValue> (jsonText);
			Lieferant.ID = Success.ID;
			Lieferant.Nummer = Success.Nummer;


			return Success.Success;

		}
        public async Task<System.Collections.Generic.List<BusinessLayer.PersonUmsatz>> GetLieferantTimeUmsatzAsync(string ID, string interval, BusinessLayer.User user)
        {
            // First test if the network status is disconnected
            if (user.NetworkStatus == NetworkState.Disconnected)
            {
                return await this.GetLieferantTimeUmsatzAsync(ID, interval, user, true);
            }

            Stream dataStream;

            SOAServiceManager sm = new SOAServiceManager(DataAccessLayer.Utilities.ServerIP + "/Getpersontimeumsatz.json", user.IdSession, DataAccessLayer.HTTPMethod.POST);




            Console.WriteLine("Searching ID : " + ID);
            sm.AddCriteriaValue("ID", ID);
            sm.AddCriteriaValue("Mandant", "1");
            sm.AddCriteriaValue("Interval", interval);

            // Now it's show time   
            dataStream = await sm.CommitPostAsync();

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            string jsonText = await reader.ReadToEndAsync();

            return Newtonsoft.Json.JsonConvert.DeserializeObject<List<BusinessLayer.PersonUmsatz>>(jsonText);
        }
        public	async  Task< BusinessLayer.Lieferant>    GetLieferantAsync (string id ,string deviceLanguage,  BusinessLayer.User user)
		{
			// First check for the network status
			if (user.NetworkStatus == NetworkState.Disconnected)
                return await GetLieferantAsync (id, deviceLanguage, user, true);

			Stream dataStream;

			// Use the ServiceManager to build send the data to the SOA services			
			// The ServiceManager is responsible to send the data to the SOA services 		
			// Run the service and return the value as a Datastream	
			// EXECUSERPERMISSION.JSON

			SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/Lieferant.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);					

			// Add the Values 							
			sm.AddCriteriaValue ("ID", id);
            sm.AddCriteriaValue ("Sprache", deviceLanguage);

			// Now it's show time	
            dataStream = await sm.CommitPostAsync ();	

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
			if (reader == null)
				return null;

			string jsonText = await reader.ReadToEndAsync ();


			/*	JavaScriptSerializer js = new JavaScriptSerializer();
			Person [] persons =  js.Deserialize<Person[]>(json);
*/

			return await Task.Run(() => Newtonsoft.Json.JsonConvert.DeserializeObject<BusinessLayer.Lieferant> (jsonText));

		}
        async public Task<List<BusinessLayer.Anschrift>> GetLieferAnschriftenAsync(BusinessLayer.Lieferant lieferant ,string deviceLanguage , BusinessLayer.User user)
        {

            if (user.NetworkStatus == NetworkState.Disconnected)
                return null;

            Stream dataStream;
            // The ServiceManager is responsible to send the data to the SOA services       
            // Run the service and return the value as a Datastream 
            // EXECUSERPERMISSION.JSON

            SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/Lieferanschriften.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                  

            // Add the Values                           
            sm.AddCriteriaValue ("Mandant", user.Mandant);
            sm.AddCriteriaValue ("ID", lieferant.ID);
            sm.AddCriteriaValue ("Sprache", deviceLanguage);



            // Now it's show time   
            dataStream = await sm.CommitPostAsync ();                                                  

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            if (reader == null)
                return null;

            string  jsonText = await reader.ReadToEndAsync ();

            return Newtonsoft.Json.JsonConvert.DeserializeObject<List<BusinessLayer.Anschrift>> (jsonText);
        }
Пример #8
0
        public async System.Threading.Tasks.Task< List<BusinessLayer.Artikel>> GetArtikelCrossSellingAsync(string artikelId, BusinessLayer.User user)
        {
            // First we test if the networkstatus is disconnected or not
            if (user.NetworkStatus == NetworkState.Disconnected)
                return await GetArtikelCrossSellingAsync(artikelId, user, true);

            Stream dataStream;

            // Use the ServiceManager to build send the data to the SOA services            
            // The ServiceManager is responsible to send the data to the SOA services       
            // Run the service and return the value as a Datastream 
            // EXECUSERPERMISSION.JSON

            SOAServiceManager sm = new SOAServiceManager(DataAccessLayer.Utilities.ServerIP + "/artikelcrossselling.json", user.IdSession, DataAccessLayer.HTTPMethod.POST);                    

            // Add the Values                           
            sm.AddCriteriaValue("ArtikelId", artikelId);
            sm.AddCriteriaValue("Mandant", user.Mandant);

            // Now it's show time   

            dataStream = await sm.CommitPostAsync();                                                   

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            if (reader == null)
                return null;

            string jsonText = await reader.ReadToEndAsync();       

            return  Newtonsoft.Json.JsonConvert.DeserializeObject<List<BusinessLayer.Artikel>>(jsonText);

        }
Пример #9
0
        public  async Task<BusinessLayer.User> SetUserPermissionsAsync (  BusinessLayer.User user)
        {
            Stream dataStream;

            // Use the ServiceManager to build send the data to the SOA services            
            // The ServiceManager is responsible to send the data to the SOA services       
            // Run the service and return the value as a Datastream 
            // EXECUSERPERMISSION.JSON
            SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/execuserpermission.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                 

            // Add the Values                                                                                                       
            sm.AddCriteriaValue ("ID", user.ID);

            // Now it's show time   
            dataStream =await sm.CommitPostAsync ();                                                    

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            if (reader == null)
                return null;

            string jsonText = await reader.ReadToEndAsync ();

            user = Newtonsoft.Json.JsonConvert.DeserializeObject<BusinessLayer.User> (jsonText);
            return user;
        }
		async public Task< DataAccessLayer.SOAResult> UpdateAnsprechpartnerAsync ( BusinessLayer.Ansprechpartner ansprechpartner,  BusinessLayer.User user)
		{
			Stream dataStream;
			ReturnValue Success;

			// Use the ServiceManager to build send the data to the SOA services			
			// The ServiceManager is responsible to send the data to the SOA services 		
			// Run the service and return the value as a Datastream	
			// EXECUSERPERMISSION.JSON

			SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/UpdateAnsprechpartner.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);					

			// Add the Values
			sm.AddCriteriaValue ("ID", ansprechpartner.ID);
			sm.AddCriteriaValue ("Name", ansprechpartner.Name);
			sm.AddCriteriaValue ("Vorname", ansprechpartner.Vorname);
			sm.AddCriteriaValue ("Nummer", ansprechpartner.Nummer);
			sm.AddCriteriaValue ("Strasse", ansprechpartner.Strasse);
			sm.AddCriteriaValue ("PLZ", ansprechpartner.PLZ);
			sm.AddCriteriaValue ("Ort", ansprechpartner.Ort);
			sm.AddCriteriaValue ("Land", ansprechpartner.Land);
            sm.AddCriteriaValue ("LandNummer", ansprechpartner.LandNummer);
            sm.AddCriteriaValue ("Telefon", ansprechpartner.Telefon);
			sm.AddCriteriaValue ("Email", ansprechpartner.Email);
			sm.AddCriteriaValue ("Geburtsdatum", ansprechpartner.Geburtsdatum);
			sm.AddCriteriaValue ("Mandant", user.Mandant);
            sm.AddCriteriaValue ("Sperrdatum", ansprechpartner.Sperrdatum);
            sm.AddCriteriaValue ("Sperrgrund", ansprechpartner.Sperrgrund);

			// Now it's show time	
			dataStream =await sm.CommitPostAsync ();													

            if (dataStream == null)
                return SOAResult.Disconnected;

			StreamReader reader = new StreamReader(dataStream);
			string jsonText = await reader.ReadToEndAsync ();

			Success =  Newtonsoft.Json.JsonConvert.DeserializeObject<ReturnValue> (jsonText);
			return Success.Success;

		}
        public async Task<ReturnValue> InsertTaskAsync ( BusinessLayer.Task task,  BusinessLayer.User user)
		{

			Stream dataStream;
			ReturnValue Success;

			// Use the ServiceManager to build send the data to the SOA services			
			// The ServiceManager is responsible to send the data to the SOA services 		
			// Run the service and return the value as a Datastream	
			// EXECUSERPERMISSION.JSON

			SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/InsertTask.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);					

			// Add the Values 	
			sm.AddCriteriaValue ("Typ",task.Typ);
			sm.AddCriteriaValue ("Art",task.Art);
			sm.AddCriteriaValue ("Status",task.Status);
			sm.AddCriteriaValue ("Adr_id", task.Adr_Id);
			sm.AddCriteriaValue ("Datum",task.Datum);
			sm.AddCriteriaValue ("Zeit", task.Zeit);
			sm.AddCriteriaValue ("Mitarbeiter",task.Mitarbeiter);
			sm.AddCriteriaValue ("Abteilung", task.Abteilung);
			sm.AddCriteriaValue ("Ansprechpartner", task.Ansprechpartner);
			sm.AddCriteriaValue ("Memo", task.Memo);
			sm.AddCriteriaValue ("AnsprechpartnerId", task.AnsprechpartnerID);
			sm.AddCriteriaValue ("Datum_Save",task.Datum_Save);
			sm.AddCriteriaValue ("User_Save",task.User_Save);
			sm.AddCriteriaValue ("Datum_Edit",task.Datum_Edit);
			sm.AddCriteriaValue ("Datum_Close",task.Datum_Close);
			sm.AddCriteriaValue ("Time_Close",task.Time_Close);
			sm.AddCriteriaValue ("Time_TelStart",task.Time_TelStart);
			sm.AddCriteriaValue ("Time_TelDauer",task.Time_TelDauer);
			sm.AddCriteriaValue ("Mandant", user.Mandant);

			// Now it's show time	
            dataStream = await sm.CommitPostAsync ();													

            if (dataStream == null)
                return null;

			StreamReader reader = new StreamReader(dataStream);
			string jsonText = await reader.ReadToEndAsync ();


			Success =  Newtonsoft.Json.JsonConvert.DeserializeObject<ReturnValue> (jsonText);

			return Success;

		}
        public static async Task<System.Collections.Generic.List<BusinessLayer.TaskArt>> GetTaskArtsAsync(  BusinessLayer.User user)
		{
			// First check for the network status
			if (user.NetworkStatus == NetworkState.Disconnected)
                return await GetTaskArtsAsync (  user, true);

			Stream dataStream;

			// Use the ServiceManager to build send the data to the SOA services			
			// The ServiceManager is responsible to send the data to the SOA services 		
			// Run the service and return the value as a Datastream	
			// EXECUSERPERMISSION.JSON

			SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/taskart.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);					


			// Now it's show time	
            dataStream = await sm.CommitPostAsync ();													

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
			if (reader == null)
				return null;

			string jsonText = await reader.ReadToEndAsync ();

			return   await Task.Run(() =>Newtonsoft.Json.JsonConvert.DeserializeObject<List<BusinessLayer.TaskArt>> (jsonText));
		}
		async public  Task<DataAccessLayer.SOAResult> DeleteTaskAsync (BusinessLayer.Task task, BusinessLayer.User user)
		{			
			Stream dataStream;
			ReturnValue Success;

			// Use the ServiceManager to build send the data to the SOA services			
			// The ServiceManager is responsible to send the data to the SOA services 		
			// Run the service and return the value as a Datastream	
			// EXECUSERPERMISSION.JSON

			SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/DeleteTask.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);					

			// Add the Values
			sm.AddCriteriaValue ("ID", task.ID);

			// Now it's show time	
            dataStream = await sm.CommitPostAsync ();													

            if (dataStream == null)
                return SOAResult.Disconnected;

			StreamReader reader = new StreamReader(dataStream);
			string jsonText =await  reader.ReadToEndAsync ();
			Success =  Newtonsoft.Json.JsonConvert.DeserializeObject<ReturnValue> (jsonText);
            return Success.Success;
		}
Пример #14
0
        async public Task< BusinessLayer.Position> UpdatePositionAsync(BusinessLayer.Transaction transaction,  BusinessLayer.Position pos, string deviceLanguage, BusinessLayer.User user)
        {
            Stream dataStream;
            // The ServiceManager is responsible to send the data to the SOA services       
            // Run the service and return the value as a Datastream 
            // EXECUSERPERMISSION.JSON

            SOAServiceManager sm;
            sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/insertAnfrage.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                  

            // Add the Values  
            if (String.IsNullOrEmpty(pos.ID))
                sm.AddCriteriaValue("PosID", "0");
            else
                sm.AddCriteriaValue("PosID", pos.ID);
            sm.AddCriteriaValue("KpfID",transaction.ID);
            sm.AddCriteriaValue ("Mandant", user.Mandant);            
            sm.AddCriteriaValue("User", user.Name);
            sm.AddCriteriaValue("Datum", transaction.Datum);
            sm.AddCriteriaValue("KundeId", transaction.KundeID);
            sm.AddCriteriaValue("AdrVersId", transaction.LieferAnschriftID);
            sm.AddCriteriaValue("AdrRchgID", transaction.RechnungsAnschriftID);
            sm.AddCriteriaValue("LieferDatum", pos.Liefdatum);
            sm.AddCriteriaValue("Kundenbestellnummer", transaction.Projekt);
            sm.AddCriteriaValue("ArtikelId", pos.ArtID);
            sm.AddCriteriaValue("Menge", pos.Menge);
            sm.AddCriteriaValue("MengeEinheit", pos.EinheitID);
            sm.AddCriteriaValue("Preis", pos.Preis);
            sm.AddCriteriaValue("PreisMenge", pos.PreisMenge);
            sm.AddCriteriaValue("Rabatt1", pos.Rabatt1);
            sm.AddCriteriaValue("Rabatt2", pos.Rabatt2);
            sm.AddCriteriaValue("Rabatt3", pos.Rabatt3);
            sm.AddCriteriaValue("Rabatt4", pos.Rabatt4);
            sm.AddCriteriaValue("Vertreter", pos.Vertreter);
            sm.AddCriteriaValue("Provision", pos.Provision);
            sm.AddCriteriaValue("Sprache", deviceLanguage);


            // Now it's show time   
            dataStream = await sm.CommitPostAsync ();                                                  

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            if (reader == null)
                return null;

            string jsonText = await reader.ReadToEndAsync ();
            return  Newtonsoft.Json.JsonConvert.DeserializeObject<BusinessLayer.Position> (jsonText);

        }
        public async System.Threading.Tasks.Task< string> GetUmsatzAsync(string id, BusinessLayer.User user)
        {
            // First we test if the networkstatus is disconnected or not
            if (user.NetworkStatus == NetworkState.Disconnected)
                return await GetUmsatzAsync(id,user,true);

            Stream dataStream;

            // Use the ServiceManager to build send the data to the SOA services			
            // The ServiceManager is responsible to send the data to the SOA services 		
            // Run the service and return the value as a Datastream	
            // EXECUSERPERMISSION.JSON

            SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/getpersonumsatz.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                    

            // Add the Values                           
            sm.AddCriteriaValue ("ID", id);
            sm.AddCriteriaValue ("Mandant", user.Mandant);
            sm.AddCriteriaValue("Bereich", "8");

            // Now it's show time	
            dataStream = await sm.CommitPostAsync();

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            string jsonText = await reader.ReadToEndAsync();


            return  jsonText.Trim();

        }
Пример #16
0
        async public Task<ReturnValue> DeletePositionAsync(BusinessLayer.Position pos,  BusinessLayer.User user)
        {

            Stream dataStream;
            ReturnValue Success;

            // The ServiceManager is responsible to send the data to the SOA services       
            // Run the service and return the value as a Datastream 
            // EXECUSERPERMISSION.JSON

            SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/deletePosition.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                  

            // Add the Values                           
            sm.AddCriteriaValue ("PosID", pos.ID);


            // Now it's show time   
            dataStream = await sm.CommitPostAsync ();                                                  

            ReturnValue result = new ReturnValue();
            result.Success = SOAResult.Disconnected;

            if (dataStream == null)
                return result;

            StreamReader reader = new StreamReader(dataStream);
            string jsonText =  await reader.ReadToEndAsync ();

            // if the return value is null then we have no connection
            if (jsonText == null)
                return result;

            Success =  Newtonsoft.Json.JsonConvert.DeserializeObject<ReturnValue> (jsonText);
            return Success;


        }
Пример #17
0
        public async System.Threading.Tasks.Task< string> GetArtikelLetzterVK_KundeAsync(string artikelId, string kundeId, string sprache, BusinessLayer.User user)
        {
            // First we test if the networkstatus is disconnected or not
            if (user.NetworkStatus == NetworkState.Disconnected)
                return await GetArtikelLetzterVK_KundeAsync(artikelId, kundeId, sprache, user, true);

            Stream dataStream;

            // Use the ServiceManager to build send the data to the SOA services            
            // The ServiceManager is responsible to send the data to the SOA services       
            // Run the service and return the value as a Datastream 
            // EXECUSERPERMISSION.JSON

            SOAServiceManager sm = new SOAServiceManager(DataAccessLayer.Utilities.ServerIP + "/artikelletztervkkunde.json", user.IdSession, DataAccessLayer.HTTPMethod.POST);                    

            // Add the Values                           
            sm.AddCriteriaValue("ArtikelId", artikelId);
            sm.AddCriteriaValue("KundeId", kundeId);
            //// RELEASE CHANGE:             sm.AddCriteriaValue("Mandant", user.Mandant);

            sm.AddCriteriaValue("Mandant", user.Mandant);
            sm.AddCriteriaValue("Sprache", sprache);

            // Now it's show time   

            dataStream = await sm.CommitPostAsync();                                                   

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            if (reader == null)
                return null;

            string jsonText = await reader.ReadToEndAsync();       


            return  jsonText.Trim();

        }