示例#1
0
        public static NhomTrachVu_DTO TraCuuNhomTrachVuTheoMa(string sMa)
        {
            try
            {
                XmlNodeList list_Temp = XMLConnection.CreateXmlDocNTV_TV("NhomTrachVu");
                NhomTrachVu_DTO dto = new NhomTrachVu_DTO();

                for (int i = 0; i < list_Temp.Count; i++)
                {
                    if (list_Temp[i].Attributes["Ma"].InnerText == sMa)
                    {
                        NhomTrachVu_DTO dto_Temp = new NhomTrachVu_DTO();

                        dto_Temp.Ma = list_Temp[i].Attributes["Ma"].InnerText;
                        dto_Temp.Ten = list_Temp[i]["Ten"].InnerText;

                        dto = dto_Temp;
                        break;
                    }
                }

                return dto;
            }
            catch (System.Exception ex)
            {
                return null;
            }
        }
示例#2
0
        public static List<NhomTrachVu_DTO> LayDSNhomTrachVu()
        {
            try
            {
                XmlNodeList list_Temp = XMLConnection.CreateXmlDocNTV_TV("NhomTrachVu");
                List<NhomTrachVu_DTO> list_dto = new List<NhomTrachVu_DTO>();

                for (int i = 0; i < list_Temp.Count; i++)
                {
                    NhomTrachVu_DTO dto_Temp = new NhomTrachVu_DTO();

                    dto_Temp.Ma = list_Temp[i].Attributes["Ma"].InnerText;
                    dto_Temp.Ten = list_Temp[i]["Ten"].InnerText;

                    list_dto.Add(dto_Temp);
                }

                return list_dto;
            }
            catch (System.Exception ex)
            {
                return null;
            }
        }