Example #1
0
 public DaiLyDTO this[string id]
 {
     get
     {
         DaiLyDTO people = list.Find(x => x.Madl == id);
         if (people is null)
         {
             people          = new DaiLyDTO();
             people.Tendaily = "<Không tìm thấy>";
         }
         return(people);
     }
 }
Example #2
0
 public void SetData(DaiLyDTO x)
 {
     try
     {
         // lấy dữ liệu từ đối tượng và set vào các textbox
         madl                = x.Madl;
         TxtTenDaiLy.Text    = x.Tendaily;
         txtMaDL.Text        = x.Madl.ToString();
         txtPhone.Text       = x.Sdt;
         txtDiaChi.Text      = x.Diachi;
         txCHuDAiLy.Text     = x.Tenchudaily.ToString();
         txtTenNhanVien.Text = x.Tennv;
     }
     catch { }
 }
Example #3
0
        public void GetFullInfo(string danhsach = "DaiLy_NhanVien")
        {
            list.Clear();
            DataTable ds = DataProvider.Instance.ExecuteQuery(danhsach);

            for (int i = 0; i < ds.Rows.Count; i++)
            {
                DaiLyDTO people;

                //DateTime ngaysinh = Convert.ToDateTime(ds.Rows[i]["NgaySinh"]);

                people = new DaiLyDTO((int)ds.Rows[i]["MaDaL"], ds.Rows[i]["MaNV"].ToString(), ds.Rows[i]["TenNV"].ToString(), ds.Rows[i]["DiaChi"].ToString(), ds.Rows[i]["TenChuDaiLy"].ToString(), ds.Rows[i]["TenDaiLy"].ToString(), ds.Rows[i]["SDT"].ToString(), ds.Rows[i]["MaDL"].ToString());

                Add(people);
            }
        }
Example #4
0
 private bool SaveObj()
 {
     // Khởi tạo đối tượng NhanVien nếu chưa có
     nhan = new DaiLyDTO();
     // Lấy họ tên đã được tách ra
     // Lưu vào obj
     nhan.Madl = txtMaDL.Text;
     nhan.Sdt  = txtPhone.Text;
     //nhan.Email = txtEmail.Text;
     nhan.Diachi      = txtDiaChi.Text;
     nhan.Tenchudaily = txCHuDAiLy.Text;
     nhan.Tendaily    = TxtTenDaiLy.Text;
     nhan.Tennv       = txtTenNhanVien.Text;
     //data.NV.Add(nhan);
     return(true);
 }
Example #5
0
 public void Add(DaiLyDTO x)
 {
     list.Add(x);
 }