private string SerializeCustomerParent(taUpdateCreateCustomerRcd rmcustomer, taCreateParentID rmparent) { try { RMCustomerMasterType customerMasterType = new RMCustomerMasterType(); eConnectType eConnect = new eConnectType(); customerMasterType.taUpdateCreateCustomerRcd = rmcustomer; customerMasterType.taCreateParentID = rmparent; RMCustomerMasterType[] Customers = { customerMasterType }; eConnect.RMCustomerMasterType = Customers; MemoryStream ms = new MemoryStream(); XmlSerializer serializer = new XmlSerializer(eConnect.GetType()); serializer.Serialize(ms, eConnect); ms.Position = 0; XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(ms); string CustomerEntity = xmldoc.OuterXml; return(CustomerEntity); } catch (XmlException) { throw; } catch (Exception) { throw; } }
private taCreateParentID SetParentValues(RMParentID parent) { var rmparent = new taCreateParentID(); try { rmparent.CPRCSTNM = parent.CPRCSTNM; rmparent.NAALLOWRECEIPTS = parent.NAALLOWRECEIPTS.GetValueOrDefault(); rmparent.NACREDITCHECK = parent.NACREDITCHECK.GetValueOrDefault(); rmparent.NAFINANCECHARGE = parent.NAFINANCECHARGE.GetValueOrDefault(); rmparent.NAHOLDINACTIVE = parent.NAHOLDINACTIVE.GetValueOrDefault(); rmparent.NADEFPARENTVEN = parent.NADEFPARENTVEN.GetValueOrDefault(); rmparent.UpdateIfExists = parent.UpdateIfExists.GetValueOrDefault(); rmparent.RequesterTrx = parent.RequesterTrx.GetValueOrDefault(); return(rmparent); } catch (Exception) { throw; } }