コード例 #1
0
        public System.Collections.Generic.List<BusinessLayer.Anfrage>    GetAnfragen (string lieferantenId, string deviceLanguage , ref BusinessLayer.User user)
        {
            // First check for the network status
            if (user.NetworkStatus == NetworkState.Disconnected)
                return GetAnfragen (lieferantenId, deviceLanguage, ref 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 = sm.CommitPost ();                                                  

            if (dataStream == null)
                return null;

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

            string jsonText = reader.ReadToEnd ();

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

        }
コード例 #2
0
        public static System.Collections.Generic.List<BusinessLayer.TaskTyp>    GetTaskTyps( ref BusinessLayer.User user)
        {
            // First check for the network status
            if (user.NetworkStatus == NetworkState.Disconnected)
                return GetTaskTyps ( ref 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 + "/tasktyp.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                    


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

            if (dataStream == null)
                return null;

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

            string jsonText = reader.ReadToEnd ();

            return  Newtonsoft.Json.JsonConvert.DeserializeObject<List<BusinessLayer.TaskTyp>> (jsonText);
        }
コード例 #3
0
		public string GetUmsatz(string id, ref BusinessLayer.User user)
		{
			// First we test if the networkstatus is disconnected or not
			if (user.NetworkStatus == NetworkState.Disconnected)
				return GetUmsatz (id, ref 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", "6");

            // Now it's show time   
            dataStream = sm.CommitPost();
            if (dataStream == null)
                return "0";
            
            StreamReader reader = new StreamReader(dataStream);
            string jsonText = reader.ReadToEnd();


            return  jsonText.Trim();

		}
コード例 #4
0
        public static string GetTownViaPLZ (string PLZ, ref 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 = sm.CommitPost ();													

            if (dataStream == null)
                return "";
            
            StreamReader reader = new StreamReader(dataStream);
			string jsonText = reader.ReadToEnd ();		

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

			return   jsonText.Trim ();
		}
コード例 #5
0
		public async Task<BusinessLayer.Session>   GetSessionAsync (string name ,string password, string mandant, NetworkState networkstate)
		{

			if (networkstate == NetworkState.Disconnected) 
			{
				return await GetSessionAsync (name, password,mandant, true);

			}


			Stream dataStream;
			DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(BusinessLayer.Session)); 

			// 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							
			//SOAServiceManager sm = new SOAServiceManager ("https://92.79.164.245:443/authenticationsession.json","", DataAccessLayer.HTTPMethod.POST);					
			SOAServiceManager sm = new SOAServiceManager ( DataAccessLayer.Utilities.ServerIP + "/authenticationsession.json","", DataAccessLayer.HTTPMethod.POST);					

            // https://92.79.164.245
			// Add the Values 																
			sm.AddCriteriaValue ("name",name);												
			sm.AddCriteriaValue ("password",password);	
			sm.AddCriteriaValue ("mandant", mandant);


			// Now it's show time	
//			dataStream =await sm.CommitPostAsync ();													
            dataStream = await System.Threading.Tasks.Task.Run(() => sm.CommitPost());

			if (dataStream == null)
			{
				// Then there is a connection failure
				BusinessLayer.Session temp = BusinessLayer.Session.Create ();
				temp.Success = SOAResult.Disconnected;
				return temp;
			}
            Console.WriteLine("Disposed 5");

			var mySession = (BusinessLayer.Session)ser.ReadObject(dataStream);		

			return mySession;

		}
コード例 #6
0
		public SOAResult   GetSession (ref   BusinessLayer.Session mySession, string name ,string password, string mandant, NetworkState networkstate)
		{

			if (networkstate == NetworkState.Disconnected) 
			{
				return GetSession (ref mySession, name, password,mandant, true);

			}

			Stream dataStream;
			DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(BusinessLayer.Session)); 

			// 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							
			//SOAServiceManager sm = new SOAServiceManager ("https://92.79.164.245:443/authenticationsession.json","", DataAccessLayer.HTTPMethod.POST);					
			SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/authenticationsession.json","", DataAccessLayer.HTTPMethod.POST);					
			// https://92.79.164.245
			// Add the Values 																
			sm.AddCriteriaValue ("name",name);												
			sm.AddCriteriaValue ("password",password);	
			sm.AddCriteriaValue ("mandant", mandant);


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

			if (dataStream == null)
			{
				// Then there is a connection failure
				return SOAResult.Disconnected;
			}

			mySession = (BusinessLayer.Session)ser.ReadObject(dataStream);		

			return mySession.Success;
					
		}
コード例 #7
0
        public BusinessLayer.Artikel    GetArtikel(string artikelID, string version, string deviceLanguage, ref BusinessLayer.User user)
        {
            // First check for the network status
            if (user.NetworkStatus == NetworkState.Disconnected)
                return null;

            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 + "/artikel.json", user.IdSession, DataAccessLayer.HTTPMethod.POST);                  

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

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

            if (dataStream == null)
                return null;

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

            string jsonText = reader.ReadToEnd();

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

        }
コード例 #8
0
        public List<BusinessLayer.Anschrift> GetLieferAnschriften(BusinessLayer.Lieferant lieferant ,string deviceLanguage ,ref 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 = sm.CommitPost ();                                                  

            if (dataStream == null)
                return null;

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

            string jsonText = reader.ReadToEnd ();

            return Newtonsoft.Json.JsonConvert.DeserializeObject<List<BusinessLayer.Anschrift>> (jsonText);
        }
コード例 #9
0
		public  DataAccessLayer.SOAResult DeleteLieferant (BusinessLayer.Lieferant lieferant , ref 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 + "/DeleteLieferant.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);					

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

			// Now it's show time	
            dataStream = sm.CommitPost ();													
            if (dataStream == null)
                return SOAResult.FALSE;
            
			StreamReader reader = new StreamReader(dataStream);
			string jsonText = reader.ReadToEnd ();
			Success =  Newtonsoft.Json.JsonConvert.DeserializeObject<ReturnValue> (jsonText);

			return Success.Success;
		}
コード例 #10
0
        public  DataAccessLayer.SOAResult UpdateKpf ( BusinessLayer.Transaction transaction, ref BusinessLayer.User user)
        {

            // First test if the network status is disconnected
            if (user.NetworkStatus == NetworkState.Disconnected) 
            {
                return 0;
//                return this.UpdateKunde (kunde, ref 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 + "/UpdateKpf.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                    

            // Add the Values
            sm.AddCriteriaValue ("ID", transaction.ID);
            sm.AddCriteriaValue("Datum", transaction.Datum);
            sm.AddCriteriaValue("KundeId", transaction.KundeID);
            sm.AddCriteriaValue("AdrVersId", transaction.LieferAnschriftID);
            sm.AddCriteriaValue("AdrRchgID", transaction.RechnungsAnschriftID);
            sm.AddCriteriaValue("Kundenbestellnummer", transaction.Projekt);


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

            StreamReader reader = new StreamReader(dataStream);
            string jsonText = reader.ReadToEnd ();

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

            return Success.Success;

        }
コード例 #11
0
ファイル: DAL_User.cs プロジェクト: MbProg/TestApolloAndroid
        public void SetUserPermissions ( ref 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 = sm.CommitPost ();                                                  
            if (dataStream == null)
                return ;

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

            string jsonText = reader.ReadToEnd ();

            user = Newtonsoft.Json.JsonConvert.DeserializeObject<BusinessLayer.User> (jsonText);
        }
コード例 #12
0
ファイル: DAL_User.cs プロジェクト: MbProg/TestApolloAndroid
        public void SetUserData (ref BusinessLayer.User user,string session)
        {
            if (user.NetworkStatus == NetworkState.Disconnected)
            {
                SetUserData (ref user, session, false);
                return;
            }

            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 + "/user.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);                   

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

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

            if (dataStream == null)
                return ;

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

            string jsonText = reader.ReadToEnd ();

            /*  JavaScriptSerializer js = new JavaScriptSerializer();
            Person [] persons =  js.Deserialize<Person[]>(json);
*/
            user = Newtonsoft.Json.JsonConvert.DeserializeObject<BusinessLayer.User> (jsonText);

        }
コード例 #13
0
        public BusinessLayer.Position GetAnfragePreisBeforeCommit(BusinessLayer.Transaction transaction, BusinessLayer.Position position, string kundeId, BusinessLayer.Artikel artikel, string datum, string menge, string deviceLanguage, ref 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 + "/GetAnfragePreisBeforeCommit.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 = sm.CommitPost();                                                  

            if (dataStream == null)
                return null;

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

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


        }
コード例 #14
0
        public  string GetArtikelLetzterVK_Kunde(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  GetArtikelLetzterVK_Kunde(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);

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




            // Now it's show time   

            dataStream = sm.CommitPost();                                                   
            if (dataStream == null)
                return "";
            
            StreamReader reader = new StreamReader(dataStream);
            if (reader == null)
                return null;

            string jsonText = reader.ReadToEnd();       


            return  jsonText.Trim();

        }
コード例 #15
0
        public System.Collections.Generic.List<BusinessLayer.PersonUmsatz> GetLieferantTimeUmsatz(string ID, string interval, ref BusinessLayer.User user)
        {
            // First test if the network status is disconnected
            if (user.NetworkStatus == NetworkState.Disconnected)
            {
                return this.GetKundeTimeUmsatz(ID, interval, ref 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 ("ID", ID);
            sm.AddCriteriaValue ("Mandant", user.Mandant);*/
            sm.AddCriteriaValue("Interval", interval);

            // Now it's show time	
            dataStream = sm.CommitPost();
            if (dataStream == null)
                return null;
            
            StreamReader reader = new StreamReader(dataStream);
            string jsonText = reader.ReadToEnd();

            return Newtonsoft.Json.JsonConvert.DeserializeObject<List<BusinessLayer.PersonUmsatz>>(jsonText);
        }
コード例 #16
0
        public  DataAccessLayer.SOAResult UpdateAnsprechpartner ( BusinessLayer.Ansprechpartner ansprechpartner, ref 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 = sm.CommitPost ();													
            if (dataStream == null)
                return SOAResult.FALSE;
            
			StreamReader reader = new StreamReader(dataStream);
			string jsonText = reader.ReadToEnd ();

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

		}
コード例 #17
0
		public SOAResult InsertAnsprechpartner ( BusinessLayer.Ansprechpartner ansprechpartner, ref BusinessLayer.User user)
		{

            // First test if the network status is disconnected
            if (user.NetworkStatus == NetworkState.Disconnected) 
            {
                return this.InsertAnsprechpartner (ansprechpartner,  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 + "/InsertAnsprechpartner.json",user.IdSession, DataAccessLayer.HTTPMethod.POST);					

			// Add the Values 	
			sm.AddCriteriaValue ("IdParent",ansprechpartner.IDParent);
			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 = sm.CommitPost ();	
            if (dataStream == null)
                return SOAResult.FALSE;
            
			StreamReader reader = new StreamReader(dataStream);
			string jsonText = reader.ReadToEnd ();


			/*	JavaScriptSerializer js = new JavaScriptSerializer();
			Person [] persons =  js.Deserialize<Person[]>(json);
*/
			Success =  Newtonsoft.Json.JsonConvert.DeserializeObject<ReturnValue> (jsonText);
			ansprechpartner.ID = Success.ID;
			ansprechpartner.Nummer = Success.Nummer;


			return Success.Success;

		}
コード例 #18
0
        public ReturnValue InsertTask ( 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 =  sm.CommitPost ();                                                   

            if (dataStream == null)
                return null;
            StreamReader reader = new StreamReader(dataStream);
            string jsonText =  reader.ReadToEnd ();

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

            return Success;

        }
コード例 #19
0
        public  List<BusinessLayer.Artikel> GetArtikelCrossSelling(string artikelId, BusinessLayer.User user)
        {
            // First we test if the networkstatus is disconnected or not
            if (user.NetworkStatus == NetworkState.Disconnected)
                return  GetArtikelCrossSelling(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);
            //// RELEASE CHANGE:             sm.AddCriteriaValue("Mandant", user.Mandant);

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


            // Now it's show time   

            dataStream = sm.CommitPost();                                                   
            if (dataStream == null)
                return null;
            
            StreamReader reader = new StreamReader(dataStream);
            if (reader == null)
                return null;

            string jsonText = reader.ReadToEnd();       

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


        }
コード例 #20
0
		public  DataAccessLayer.SOAResult UpdateLieferant ( BusinessLayer.Lieferant Lieferant, ref BusinessLayer.User user)
		{

			// First test if the network status is disconnected
			if (user.NetworkStatus == NetworkState.Disconnected) 
			{
				return this.UpdateLieferant (Lieferant, ref 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 + "/UpdateLieferant.json", user.IdSession, DataAccessLayer.HTTPMethod.POST);					

			// Add the Values
			sm.AddCriteriaValue ("ID", Lieferant.ID);
			sm.AddCriteriaValue ("Name", Lieferant.Name);
			sm.AddCriteriaValue ("Nummer", Lieferant.Nummer);
			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 = sm.CommitPost ();													
            if (dataStream == null)
                return SOAResult.FALSE;
            
            StreamReader reader = new StreamReader (dataStream);
			string jsonText = reader.ReadToEnd ();

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

			return Success.Success;

        }
コード例 #21
0
        async public Task<bool> ValidateLicenseAsync(string LicenseKey, 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                         
            SOAServiceManager sm = new SOAServiceManager ( DataAccessLayer.Utilities.ServerIP + "/mobilelicense.json","", DataAccessLayer.HTTPMethod.POST);                 

            // Now it's show time   
            // Add the Values                                                               
            sm.AddCriteriaValue ("LicenseKey",LicenseKey);                                              

            dataStream = await System.Threading.Tasks.Task.Run(() => sm.CommitPost());

            if (dataStream == null)
            {
                return false;
            }

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

            string jsonText = await reader.ReadToEndAsync();



            if (jsonText.Trim() =="1")
                return true;
            else
                return false;
           

        }
コード例 #22
0
        public BusinessLayer.Position UpdatePosition(BusinessLayer.Transaction transaction,  BusinessLayer.Position pos, string deviceLanguage,ref 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 = sm.CommitPost ();                                                  

            if (dataStream == null)
                return null;

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

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

        }
コード例 #23
0
        public bool ValidateLicense(string LicenseKey, 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                         
            SOAServiceManager sm = new SOAServiceManager ( DataAccessLayer.Utilities.ServerIP + "/mobilelicense.json","", DataAccessLayer.HTTPMethod.POST);                 

            // https://92.79.164.245
            // Add the Values                                                               
            sm.AddCriteriaValue ("LicenseKey",LicenseKey);                                              


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

            if (dataStream == null)
            {
                // Then there is a connection failure
                return false;
            }

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

            string jsonText =  reader.ReadToEnd();

            if (jsonText.Trim() =="1")
                return true;
            else
                return false;


        }
コード例 #24
0
        public ReturnValue DeletePosition(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 =  sm.CommitPost ();                                                  

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

            if (dataStream == null)
                return result;

            StreamReader reader = new StreamReader(dataStream);
            string jsonText =  reader.ReadToEnd ();

            // 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;


        }
コード例 #25
0
        public  string GetArtikelBestandDatum(string artikelId, string version, string datum, BusinessLayer.User user)
        {
            // First we test if the networkstatus is disconnected or not
            if (user.NetworkStatus == NetworkState.Disconnected)
                return  GetArtikelBestandDatum(artikelId, version, datum, 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 + "/artikelbestanddatum.json", user.IdSession, DataAccessLayer.HTTPMethod.POST);                    

            // Add the Values                           
            sm.AddCriteriaValue("ArtikelId", artikelId);
            sm.AddCriteriaValue("Version", version);
            sm.AddCriteriaValue("Datum", datum);


            //// RELEASE CHANGE:             sm.AddCriteriaValue("Mandant", user.Mandant);

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

            // Now it's show time   

            dataStream = sm.CommitPost();                                                   

            if (dataStream == null)
                return null;

            StreamReader reader = new StreamReader(dataStream);
            string jsonText = reader.ReadToEnd();       


            return  jsonText.Trim();

        }