public XmlDocument getDistrict(int stateId) { try { XmlDocument xmlDocument = new XmlDocument(); OthersDAL othersDal = new OthersDAL(); othersDal.getDistrict(stateId); if (othersDal.isError == CommonCode.OK) { if (othersDal.Data != null && othersDal.Data.Tables[0].Rows.Count != 0) { othersDal.Data.Tables[0].TableName = "District"; XmlDataDocument xmlDataDocument = new XmlDataDocument(othersDal.Data); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.DATA_NOT_FOUND)); } } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.FAIL)); } } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }