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); }
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(); }
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 (); }
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; }
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; }
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); }
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); }
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; }
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; }
public async Task< BusinessLayer.Interessent> GetInteressentAsync (string id , string deviceLanguage, BusinessLayer.User user) { // First check for the network status if (user.NetworkStatus == NetworkState.Disconnected) return await GetInteressentAsync (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 + "/Interessent.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); // Add the Values sm.AddCriteriaValue ("ID", 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 (); /* JavaScriptSerializer js = new JavaScriptSerializer(); Person [] persons = js.Deserialize<Person[]>(json); */ return await Task.Run(() => Newtonsoft.Json.JsonConvert.DeserializeObject<BusinessLayer.Interessent> (jsonText)); }
public SOAResult CommitTransaction(BusinessLayer.Transaction transaction, 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 + "/committransaction.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); // Add the Values sm.AddCriteriaValue ("KpfID", transaction.ID); // Now it's show time dataStream = sm.CommitPost (); if (dataStream == null) return SOAResult.Disconnected; StreamReader reader = new StreamReader(dataStream); string jsonText = reader.ReadToEnd (); // if the return value is null then we have no connection if (jsonText == null) return SOAResult.Disconnected; Success = Newtonsoft.Json.JsonConvert.DeserializeObject<ReturnValue> (jsonText); return Success.Success; }
public BusinessLayer.Position InsertPosition(BusinessLayer.Transaction transaction, BusinessLayer.Position pos, string deviceLanguage,TransactionTyp type, 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; switch (type) { case TransactionTyp.Anfrage: sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/insertAnfrage.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); break; case TransactionTyp.Angebot: sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/insertAngebot.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); break; case TransactionTyp.Auftrag: sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/insertAuftrag.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); break; case TransactionTyp.Bestellung: sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/insertBestellung.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); break; default: sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/insertAnfrage.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); break; } // Add the Values 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", pos.KundenBestellNummer); sm.AddCriteriaValue("ArtikelId", pos.ArtID); sm.AddCriteriaValue("Menge", pos.Menge); sm.AddCriteriaValue("MengeEinheit", pos.Einheit); 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); }
public BusinessLayer.Position GetAnfragePositionPreis(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 + "/getanfragepreis.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); // Add the Values 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); // 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); }
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< System.Collections.Generic.List<BusinessLayer.Ansprechpartner>> GetAnsprechpartnernAsync (string kundeId , string deviceLanguage , BusinessLayer.User user) { // First check for the network status if (user.NetworkStatus == NetworkState.Disconnected) return await GetAnsprechpartnernAsync (kundeId, 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 SOAServiceManager sm = new SOAServiceManager (DataAccessLayer.Utilities.ServerIP + "/Ansprechpartnern.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); // Add the Values sm.AddCriteriaValue ("KundeID", kundeId); // 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.Ansprechpartner>> (jsonText)); }
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; }
async public Task< DataAccessLayer.SOAResult > InsertKundeAsync ( BusinessLayer.Kunde kunde, BusinessLayer.User user) { // First test if the network status is disconnected if (user.NetworkStatus == NetworkState.Disconnected) { return await this.InsertKundeAsync (kunde, 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 + "/InsertKunde.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); // Add the Values sm.AddCriteriaValue ("Name", kunde.Name); sm.AddCriteriaValue ("Strasse", kunde.Strasse); sm.AddCriteriaValue ("PLZ", kunde.PLZ); sm.AddCriteriaValue ("Ort", kunde.Ort); sm.AddCriteriaValue ("Land", kunde.Land); sm.AddCriteriaValue ("LandNummer", kunde.LandNummer); sm.AddCriteriaValue ("Telefon", kunde.Telefon); sm.AddCriteriaValue ("Email", kunde.Email); sm.AddCriteriaValue ("Geburtsdatum", kunde.Geburtsdatum); sm.AddCriteriaValue ("Mandant", user.Mandant); sm.AddCriteriaValue ("Sperrdatum", kunde.Sperrdatum); sm.AddCriteriaValue ("Sperrgrund", kunde.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); kunde.ID = Success.ID; kunde.Nummer = Success.Nummer; return Success.Success; }
public System.Collections.Generic.List<BusinessLayer.PersonUmsatz> GetKundeTimeUmsatz (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); // RELEASE CHANGE: Delete all the lines // Add the Values 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); }
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 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; }
public async Task< System.Collections.Generic.List<BusinessLayer.Lieferant>> GetLieferantenAsync (string name , string deviceLanguage , BusinessLayer.User user) { // First check for the network status if (user.NetworkStatus == NetworkState.Disconnected) return await GetLieferantenAsync (name,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 + "/Lieferanten.json",user.IdSession, DataAccessLayer.HTTPMethod.POST); // Add the Values sm.AddCriteriaValue ("Name", name); 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.Lieferant>> (jsonText)); }
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; }
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; }
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 ("name",user.Name); sm.AddCriteriaValue ("ID", user.ID); // Now it's show time dataStream = sm.CommitPost (); StreamReader reader = new StreamReader(dataStream); string jsonText = reader.ReadToEnd (); user.Permissions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<BusinessLayer.Permission>> (jsonText); }
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); }
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); }
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 void SetUserData (ref BusinessLayer.User user,string session, bool offline) { if (offline != true) 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 (); user = Newtonsoft.Json.JsonConvert.DeserializeObject<BusinessLayer.User> (jsonText); }
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; }
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; }