public void GetRoomAsync(int id) { if (id == -1) { Vlu_PhongHoc obj = new Vlu_PhongHoc(); obj.PhongID = id; obj.MaPhong = string.Empty; obj.TenPhong = string.Empty; obj.CoSo = -1; obj.NgayTao = DateTime.Now; obj.NguoiTao = SystemConfig.UserName; List <Vlu_PhongHoc> lst = new List <Vlu_PhongHoc>(); lst.Add(obj); if (GetRoomComplete != null) { GetRoomComplete(this, new EntityResultsArgs <Vlu_PhongHoc>(lst.ToArray())); } } else { var query = from c in Model.GetVlu_PhongHocQuery() where c.PhongID == id select c; PerformQuery(query, GetRoomComplete, false); } }
public void SaveRoomAsync(Vlu_PhongHoc obj) { if (obj.PhongID == -1) { Model.Vlu_PhongHocs.Add(obj); } PerformSubmitChanged(SaveRoomComplete); }
public override void Cleanup() { if (_modelTrain != null) { _modelTrain.GetListAuthenticationFormComplete -= new EventHandler <ComplexResultsArgs <Authentication> >(_model_GetListAuthenticationFormComplete); _modelTrain.GetListRoomComplete -= new EventHandler <EntityResultsArgs <Vlu_PhongHoc> >(_modelTrain_GetListRoomComplete); _modelTrain.DeleteRoomComplete -= new EventHandler <SubmitOperationEventArgs>(_modelTrain_DeleteRoomComplete); _modelTrain = null; } _listData = null; _selectedItem = null; if (DialogSended != null) { DialogSended = null; } base.Cleanup(); }
public void DeleteRoomAsync(Vlu_PhongHoc obj) { Model.Vlu_PhongHocs.Remove(obj); PerformSubmitChanged(DeleteRoomComplete); }