private void DangThucDon_Load(object sender, EventArgs e) { lv_dsketqua.Items.Clear(); client = new ServiceReference1.Service1Client(); client.TimnguoidangCompleted += new EventHandler<ServiceReference1.TimnguoidangCompletedEventArgs>(TimnguoidangCallBack); client.TimnguoidangAsync(Form1.username); }
private void bt_dangbai_Click(object sender, EventArgs e) { if (ds_Quan.SelectedIndex > 0 && ds_TP.SelectedIndex > 0 && tb_ten.Text != "" && tb_sonha.Text != "" && tb_phuong.Text != "" && tb_duong.Text != "" && tb_dienthoai.Text != "") { NHCF nhg = new NHCF(); int IdQuan; int IdThanhPho; nhg.TenNhaHang = tb_ten.Text; nhg.LoaiHinh = tb_loaihinh.Text; nhg.SoNha=tb_sonha.Text; nhg.Duong = tb_duong.Text; nhg.Phuong = tb_phuong.Text; IdQuan = ds_Quan.SelectedIndex; IdThanhPho = ds_TP.SelectedIndex; nhg.DienThoai = tb_dienthoai.Text; nhg.Fax = tb_fax.Text; nhg.WebSite = tb_website.Text; nhg.Email = tb_email.Text; nhg.DatChoTruoc = tb_datchotruoc.Text; nhg.SoCho= int.Parse(tb_socho.Text); nhg.GioPhucVu = tb_giophucvu.Text; nhg.MucDich = tb_mucdich.Text; nhg.KhongGian = tb_khonggian.Text; nhg.BaiDoXe = tb_baidoxe.Text; nhg.ThanhToan = tb_thanhtoan.Text; nhg.NgonNgu = tb_ngonngu.Text; try { ServiceReference1.Service1Client client = new ServiceReference1.Service1Client(); client.DangNHCFCompleted += new EventHandler<ServiceReference1.DangNHCFCompletedEventArgs>(DangNHCFCallBack); client.DangNHCFAsync(nhg,IdQuan,IdThanhPho,Form1.username); client.TimnguoidangCompleted += new EventHandler<ServiceReference1.TimnguoidangCompletedEventArgs>(TimnguoidangCallBack); client.TimnguoidangAsync(Form1.username); } catch { MessageBox.Show("Lỗi Dịch Vụ !", "Warning: ", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Bạn phải nhập tên, địa chỉ và số điện thoại của nhà hàng"); } }
private void ThongTinNHCF_Load(object sender, EventArgs e) { client = new ServiceReference1.Service1Client(); client.LoadTPCompleted += new EventHandler<ServiceReference1.LoadTPCompletedEventArgs>(LoadTPCallBack); client.LoadTPAsync(); client.TimnguoidangCompleted += new EventHandler<ServiceReference1.TimnguoidangCompletedEventArgs>(TimnguoidangCallBack); client.TimnguoidangAsync(Form1.username); }