public XmlDocument GetProfile(string regId) { XmlDocument xmlDocument = new XmlDocument(); RegistrationDAL registrationDal = new RegistrationDAL(); try { string[] uregid = regId.Split('$'); string substr = uregid[0].Substring(0, 3); string ump = uregid[0].ToString(); int len = ump.Length; len = len - 3; ump = ump.Substring(3, len); regId = objenc.DecryptInteger(ump, uregid[1]); regId = substr + regId; registrationDal.UserProfileData(regId); if (registrationDal.isError == CommonCode.OK) { if (registrationDal.userData != null && registrationDal.userData.Tables[0].Rows.Count != 0) { registrationDal.userData.Tables[0].TableName = "UserProfile"; XmlDataDocument xmlDataDocument = new XmlDataDocument(registrationDal.userData); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else if (registrationDal.userData.Tables[0].Rows.Count == 0) { XmlDocument doc = new XmlDocument(); XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null); doc.AppendChild(docNode); XmlNode errrorNode = doc.CreateElement("ErrorMainNode"); doc.AppendChild(errrorNode); XmlNode nameNode = doc.CreateElement("Error"); nameNode.AppendChild(doc.CreateTextNode(CommonCode.DATA_NOT_FOUND.ToString())); errrorNode.AppendChild(nameNode); return(doc); } } else { XmlDocument doc = new XmlDocument(); XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null); doc.AppendChild(docNode); XmlNode errrorNode = doc.CreateElement("ErrorMainNode"); doc.AppendChild(errrorNode); XmlNode nameNode = doc.CreateElement("Error"); nameNode.AppendChild(doc.CreateTextNode(Convert.ToString(registrationDal.isError))); errrorNode.AppendChild(nameNode); } return(xmlDocument); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }