public static CustomerGroup FromXmlDocument(XmlDocument xmlDocument) { Hashtable item; CustomerGroup result = new CustomerGroup (); try { item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (xmlDocument.SelectSingleNode ("(//didius.customergroup)[1]"))); } catch { item = (Hashtable)SNDK.Convert.FromXmlDocument (xmlDocument); } if (item.ContainsKey ("id")) { result._id = new Guid ((string)item["id"]); } else { throw new Exception (string.Format (Strings.Exception.CustomerGroupFromXmlDocument, "ID")); } if (item.ContainsKey ("createtimestamp")) { result._createtimestamp = int.Parse ((string)item["createtimestamp"]); } if (item.ContainsKey ("updatetimestamp")) { result._updatetimestamp = int.Parse ((string)item["updatetimestamp"]); } if (item.ContainsKey ("name")) { result._name = (string)item["name"]; } return result; }
public static CustomerGroup Load(Guid Id) { CustomerGroup result; try { Hashtable item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (SorentoLib.Services.Datastore.Get<XmlDocument> (DatastoreAisle, Id.ToString ()).SelectSingleNode ("(//didius.customergroup)[1]"))); result = new CustomerGroup (); result._id = new Guid ((string)item["id"]); if (item.ContainsKey ("createtimestamp")) { result._createtimestamp = int.Parse ((string)item["createtimestamp"]); } if (item.ContainsKey ("updatetimestamp")) { result._updatetimestamp = int.Parse ((string)item["updatetimestamp"]); } if (item.ContainsKey ("name")) { result._name = (string)item["name"]; } } catch (Exception exception) { // LOG: LogDebug.ExceptionUnknown SorentoLib.Services.Logging.LogDebug (string.Format (SorentoLib.Strings.LogDebug.ExceptionUnknown, "DIDIUS.CUSTOMERGROUP", exception.Message)); // EXCEPTION: Excpetion.PageLoadName throw new Exception (string.Format (Strings.Exception.CustomerGroupLoadGuid, Id)); } return result; }
public static List<Customer> List(CustomerGroup CustomerGroup) { return List (CustomerGroup.Id); }