Пример #1
0
 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);
     }
 }
Пример #2
0
 public void SaveRoomAsync(Vlu_PhongHoc obj)
 {
     if (obj.PhongID == -1)
     {
         Model.Vlu_PhongHocs.Add(obj);
     }
     PerformSubmitChanged(SaveRoomComplete);
 }
Пример #3
0
 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();
 }
Пример #4
0
 public void DeleteRoomAsync(Vlu_PhongHoc obj)
 {
     Model.Vlu_PhongHocs.Remove(obj);
     PerformSubmitChanged(DeleteRoomComplete);
 }