コード例 #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (idDL != -1 && arrIdLDL[cbLoaiDL.SelectedIndex] >= 0 && arrIdQuan[cbQuan.SelectedIndex] >= 0 &&
         txtTienNo.Text.Equals("") == false && txtTenDaiLy.Text.Equals("") == false &&
         txtSdt.Text.Equals("") == false && txtDiaChi.Text.Equals("") == false)
     {
         DTO_DaiLy dl = new DTO_DaiLy();
         dl.IdDL     = 1;
         dl.IdLoaiDL = arrIdLDL[cbLoaiDL.SelectedIndex];
         dl.IdQuan   = arrIdQuan[cbQuan.SelectedIndex];
         dl.TenDaiLy = txtTenDaiLy.Text;
         dl.Sdt      = txtSdt.Text;
         dl.Cmnd     = nhanVien.Cmnd;
         dl.DiaChi   = txtDiaChi.Text;
         dl.NgayNhan = DateTime.Now;
         dl.TienNo   = 0;
         if (BUS_DaiLy.Themdaily(dl) == 0)
         {
         }
         else
         {
             dsDaiLy = BUS_DaiLy.DsDaiLy();
             UpdateGvDaiLy();
         }
     }
 }