本文整理汇总了C#中DataAccessLayer.SOAServiceManager类的典型用法代码示例。如果您正苦于以下问题:C# SOAServiceManager类的具体用法?C# SOAServiceManager怎么用?C# SOAServiceManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SOAServiceManager类属于DataAccessLayer命名空间,在下文中一共展示了SOAServiceManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetUmsatz
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", "8");
// 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();
}
示例2: GetAnfragen
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);
}
示例3: GetTaskTyps
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);
}
示例4: GetTownViaPLZ
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: GetSessionAsync
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: GetSession
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: GetArtikel
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: GetLieferAnschriftenAsync
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);
}
示例9: ValidateLicense
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;
}
示例10: UpdateKpf
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: DeleteLieferant
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;
}
示例12: CommitTransaction
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;
}
示例13: GetAnsprechpartnernAsync
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));
}
示例14: GetAnfragePositionPreis
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);
}
示例15: InsertAnsprechpartner
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;
}