void Gio_PhongClient_Gio_Phong_GetItemByPhongIDCompleted(object sender, Gio_Phong_GetItemByPhongIDCompletedEventArgs e) { if (e.Result.Count > 0) { grvTheoGio.ItemsSource = e.Result; List<Gio_PhongInfo> Gio_Phong = e.Result; List<Gio_PhongInfo> Gio_PhongNew = new List<Gio_PhongInfo>(); Gio_PhongInfo Item = null; if (Gio_Phong.Count > 0) { for (int i = 0; i < Gio_Phong.Count; i++) { Item = new Gio_PhongInfo(); Item.Gio_PhongID = Gio_Phong[i].Gio_PhongID; Item.GiaTien = Gio_Phong[i].GiaTien; Item.GioPhongName = Gio_Phong[i].GioPhongName; Item.GiaTien = Gio_Phong[i].GiaTien; Item.PhanTram = Gio_Phong[i].PhanTram; if (i == 0) Item.ImageUrl = "Thêm"; else Item.ImageUrl = "Xóa"; Gio_PhongNew.Add(Item); } grvTheoGio.ItemsSource = Gio_PhongNew; } } else Gio_Phong_Load(); }
void Gio_PhongClient_Gio_Phong_GetItemByPhongIDCompleted(object sender, Gio_Phong_GetItemByPhongIDCompletedEventArgs e) { listGio_Phong = e.Result; //Lấy giá tiền theo ngày Ngay_PhongSVCClient Ngay_PhongClient = new Ngay_PhongSVCClient(); Ngay_PhongClient.Ngay_Phong_GetItemByPhongIDCompleted+=new EventHandler<Ngay_Phong_GetItemByPhongIDCompletedEventArgs>(Ngay_PhongClient_Ngay_Phong_GetItemByPhongIDCompleted); Ngay_PhongClient.Ngay_Phong_GetItemByPhongIDAsync(PhongID); }