Beispiel #1
0
        public XDocument CreateFileDataXML()
        {
            XDocument xDoc = new XDocument(
                new XDeclaration("1.0", "utf-8", "yes"),
                new XElement("HN_TTBN", new XAttribute("Id", Id.ToString()), new XAttribute("MaBN", MaBN),
                             new XElement("ThongTinCoBan",
                                          new XElement("HoVaTen", HoVaTen),
                                          new XElement("NgaySinh", NgaySinh.ToString("dd-MM-yyyy")),
                                          new XElement("SoDienThoai", SoDienThoai),
                                          new XElement("Email", Email),
                                          new XElement("QuocTichID", QuocTichID),
                                          new XElement("DanToc", DanToc),
                                          new XElement("Tinh_ThanhPho", Tinh_ThanhPho),
                                          new XElement("Quan_Huyen", Quan_Huyen),
                                          new XElement("SoCMND", SoCMND),
                                          new XElement("NgayCap", NgayCap.ToString("dd-MM-yyyy")),
                                          new XElement("DiaChiNoiCap", DiaChiNoiCap),
                                          new XElement("NguyenQuan", NguyenQuan)),
                             new XElement("FPBlob",
                                          new XElement("VT_CaiPhai", VT_CaiPhai),
                                          new XElement("VT_CaiTrai", VT_CaiTrai),
                                          new XElement("VT_TroPhai", VT_TroPhai),
                                          new XElement("VT_TroTrai", VT_TroTrai)),
                             new XElement("FPIma",
                                          new XElement("VT_CaiPhai_HinhAnh", VT_CaiPhai_HinhAnh),
                                          new XElement("VT_CaiTrai_HinhAnh", VT_CaiTrai_HinhAnh),
                                          new XElement("VT_TroPhai_HinhAnh", VT_TroPhai_HinhAnh),
                                          new XElement("VT_TroTrai_HinhAnh", VT_TroTrai_HinhAnh)),
                             new XElement("FlagAllowAddPattern", FlagAllowAddPattern),
                             new XElement("NgayTao", NgayTao.ToString("dd-MM-yyyy"))
                             ));

            return(xDoc);
        }
 public BenhNhan(DataRow row)
 {
     this.MaBN     = (int)row["MABN"];
     this.HoTen    = row["HOTEN"].ToString();
     GioiTinh      = (bool)row["GIOITINH"] ? "Nam" : "Nữ";
     DanToc        = row["DANTOC"].ToString();
     this.NgaySinh = (DateTime)row["NGAYSINH"];
     NgaySinh      = DateTime.ParseExact(NgaySinh.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture);
     this.SoCMND   = row["SOCMND"].ToString();
     this.DiaChi   = row["DIACHI"].ToString();
     this.SoDT     = row["SODT"].ToString();
     TienSu        = row["TIENSU"].ToString();
 }
Beispiel #3
0
        public XDocument CreateFileDataXML()
        {
            XDocument xDoc = new XDocument(
                new XDeclaration("1.0", "utf-8", "yes"),
                new XElement("HT_TTBN", new XAttribute("Id", Id.ToString()), new XAttribute("MaBN", MaBN),
                             new XElement("ThongTinCoBan",
                                          new XElement("HoVaTen", HoVaTen),
                                          new XElement("NgaySinh", NgaySinh.ToString("dd-MM-yyyy")),
                                          new XElement("SoDienThoai", SoDienThoai),
                                          new XElement("Email", Email),
                                          new XElement("TrinhDoHocVan", TrinhDoHocVan),
                                          new XElement("CongViec", CongViec),
                                          new XElement("QuocTichID", QuocTichID),
                                          new XElement("DanToc", DanToc),
                                          new XElement("Tinh_ThanhPho", Tinh_ThanhPho),
                                          new XElement("Quan_Huyen", Quan_Huyen),
                                          new XElement("SoCMND", SoCMND),
                                          new XElement("NgayCap", NgayCap.ToString("dd-MM-yyyy")),
                                          new XElement("DiaChiNoiCap", DiaChiNoiCap),
                                          new XElement("NguyenQuan", NguyenQuan)),
                             new XElement("ThongTinKetHon",
                                          new XElement("DaLapGiaDinh", DaLapGiaDinh),
                                          new XElement("DaCoCon", DaCoCon),
                                          new XElement("SoCon", SoCon),
                                          new XElement("ThoiDiemVoMangThai", ThoiDiemVoMangThai),
                                          new XElement("TuoiCoConGanNhat", TuoiCoConGanNhat)),
                             new XElement("ThongTinSucKhoe",
                                          new XElement("TrangThaiSucKhoe", TrangThaiSucKhoe),
                                          new XElement("TieuSuBenh", TieuSuBenh),
                                          new XElement("TieuSuBenhGiaDinh", TieuSuBenhGiaDinh)),
                             new XElement("FPBlob",
                                          new XElement("VT_CaiPhai", VT_CaiPhai),
                                          new XElement("VT_CaiTrai", VT_CaiTrai),
                                          new XElement("VT_TroPhai", VT_TroPhai),
                                          new XElement("VT_TroTrai", VT_TroTrai)),
                             new XElement("FPIma",
                                          new XElement("VT_CaiPhai_HinhAnh", VT_CaiPhai_HinhAnh),
                                          new XElement("VT_CaiTrai_HinhAnh", VT_CaiTrai_HinhAnh),
                                          new XElement("VT_TroPhai_HinhAnh", VT_TroPhai_HinhAnh),
                                          new XElement("VT_TroTrai_HinhAnh", VT_TroTrai_HinhAnh)),
                             new XElement("FlagAllowAddPattern", FlagAllowAddPattern),
                             new XElement("NgayTao", NgayTao.ToString("dd-MM-yyyy"))
                             ));

            return(xDoc);
        }
Beispiel #4
0
        public XDocument CreateFileDataXML()
        {
            XDocument xDoc = new XDocument(
                new XDeclaration("1.0", "utf-8", "yes"),
                new XElement("HT_NQH", new XAttribute("Id", Id.ToString()), new XAttribute("MaBN", MaBN),
                             new XElement("HoVaTen", HoVaTen),
                             new XElement("NgaySinh", NgaySinh.ToString("dd-MM-yyyy")),
                             new XElement("Email", Email),
                             new XElement("SoCMND", SoCMND),
                             new XElement("NgayCap", NgayCap.ToString("dd-MM-yyyy")),
                             new XElement("NguyenQuan", NguyenQuan),
                             new XElement("DiaChiNoiCap", DiaChiNoiCap),
                             new XElement("SoDienThoai", SoDienThoai),
                             new XElement("NgayTao", NgayTao.ToString("dd-MM-yyyy"))));

            return(xDoc);
        }
Beispiel #5
0
        public virtual XDocument CreateFileDataXML()
        {
            XDocument xDoc = new XDocument(
                new XDeclaration("1.0", "utf-8", "yes"),
                new XElement("HT_NVD", new XAttribute("Id", Id.ToString()), new XAttribute("MaBN", MaBN),
                             new XElement("HoVaTen", HoVaTen),
                             new XElement("NgaySinh", NgaySinh.ToString("dd-MM-yyyy")),
                             new XElement("Email", Email),
                             new XElement("SoCMND", SoCMND),
                             new XElement("NgayCap", NgayCap.ToString("dd-MM-yyyy")),
                             new XElement("NguyenQuan", NguyenQuan),
                             new XElement("DiaChiNoiCap", DiaChiNoiCap),
                             new XElement("SoDienThoai", SoDienThoai),
                             new XElement("Tinh_ThanhPho", Tinh_ThanhPho),
                             new XElement("Quan_Huyen", Quan_Huyen),
                             new XElement("QuanHeVoiNguoiHien", QuanHeVoiNguoiHien),
                             new XElement("GhiChu", GhiChu),
                             new XElement("NgayTao", NgayTao.ToString("dd-MM-yyyy"))));

            return(xDoc);
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            string   MaNV, HoVaTen, DiaChi, Email, DienThoai;
            DateTime NgaySinh;

            // Input
            Console.Write("Ma Nhan Vien:");
            MaNV = Console.ReadLine();

            Console.Write("Ho Va Ten:");
            HoVaTen = Console.ReadLine();

            Console.Write("Email:");
            Email = Console.ReadLine();

            Console.Write("Dia chi:");
            DiaChi = Console.ReadLine();

            Console.Write("Dien thoai:");
            DienThoai = Console.ReadLine();

            Console.Write("Ngay sinh:");
            NgaySinh = DateTime.Parse(Console.ReadLine());

            //Xuất
            Console.WriteLine(MaNV);
            Console.WriteLine(HoVaTen);
            Console.WriteLine(DiaChi);
            Console.WriteLine(Email);
            Console.WriteLine(DienThoai);
            Console.WriteLine(NgaySinh);

            Console.WriteLine(NgaySinh.ToShortDateString());

            Console.WriteLine(NgaySinh.ToString("dd-MM-yyyy"));
            Console.ReadLine();
        }
        protected void btnDangNhap_Click(object sender, EventArgs e)
        {
            //Cách 2: string builder
            StringBuilder SoThich = new StringBuilder();

            foreach (Control ct in panelSoThich.Controls)
            {
                if (ct.GetType().Name == "CheckBox")
                {
                    CheckBox chk = (CheckBox)ct;
                    if (chk.Checked)
                    {
                        SoThich.AppendFormat(",{0}", chk.Text);
                    }
                }
            }
            string sothich = SoThich.ToString().Trim(',');

            string[] st = sothich.Split(',');
            Array.Sort(st);
            sothich = string.Join(",", st);

            //C1: sử dụng toán tử điều kiện
            //string SoThich = "";
            //if (ckbAmNhac.Checked)
            //    SoThich += ckbAmNhac.Text;
            string GioiTinh = rbtNam.Checked == true?"Nam":"Nữ";
            int    nam = 0, thang = 0, ngay = 0;

            int.TryParse(ddlNam.SelectedValue, out nam);
            int.TryParse(ddlThang.SelectedValue, out thang);
            int.TryParse(ddlNgay.SelectedValue, out ngay);

            DateTime NgaySinh;

            if (nam > 0 && thang > 0 && ngay > 0)
            {
                try
                {
                    NgaySinh = new DateTime(nam, thang, ngay);
                }
                catch
                {
                    lbThongBao.Text = "không hợp lệ ";
                    return;// thoát khỏi chương trình
                }
            }
            else
            {
                lbThongBao.Text = "bạn chưa nhập đủ thông tin ";
                return;// thoát khỏi chương trình
            }

            string NoiDung = string.Format(@"<b>Tên đăng nhập: </b>{0}<br/>
                                                <b>Mật Khẩu:</b>{1}<br/>
                                                <b>Họ Tên </b>{2}<br/>
                                                <b>Giới Tính</b>{3}<br/>
                                                <b>Sở Thích</b>{4}<br/>
                                                <b>Ngày Sinh</b>{5}<br/>"
                                           , txtDangNhap.Text, txtMatKhau.Text, txtHoTen.Text, GioiTinh, sothich, NgaySinh.ToString("dd-MM-yyyy"));

            lbThongBao.Text            = NoiDung;
            MultiView1.ActiveViewIndex = 1;
        }
 public override string ToString()
 {
     return(string.Format("HV{0} - {1} - Ngày sinh: {2} - {3} - Địa chỉ: {4}", MaHV.ToString(), HoTen, NgaySinh.ToString(), GioiTinh, DiaChi));
 }
Beispiel #9
0
 public void XemThongTin()
 {
     System.Console.WriteLine($"{MaSV, -10}{HoTen, -20}{NgaySinh.ToString("dd/MM/yyyy"), -15}{DiaChi, -10}{DienThoai, -15}");
 }