public override void Cleanup()
 {
     if (_modelTrain != null)
     {
         _modelTrain.GetListAuthenticationFormComplete -= new EventHandler<ComplexResultsArgs<Authentication>>(_model_GetListAuthenticationFormComplete);
         _modelTrain.GetListClassComplete -= new EventHandler<EntityResultsArgs<Vlu_LopHoc>>(_modelTrain_GetListClassComplete);
         _modelTrain.DeleteClassComplete -= new EventHandler<SubmitOperationEventArgs>(_modelTrain_DeleteClassComplete);
         _modelTrain.GetListDepartmentComplete -= new EventHandler<EntityResultsArgs<Vlu_Khoa>>(_modelTrain_GetListDepartmentComplete);
         _modelTrain = null;
     }
     _listData = null;
     _selectedItem = null;
     if (DialogSended != null)
         DialogSended = null;
     base.Cleanup();
 }
 private void DetachVlu_LopHoc(Vlu_LopHoc entity)
 {
     entity.Vlu_Khoa = null;
 }
 private bool FilterVlu_LopHoc(Vlu_LopHoc entity)
 {
     return (entity.KhoaID == this.KhoaID);
 }
 private bool FilterVlu_LopHocParent(Vlu_LopHoc entity)
 {
     return (entity.LopID == this.ParentID);
 }
 private void AttachVlu_LopHoc(Vlu_LopHoc entity)
 {
     entity.Vlu_Khoa = this;
 }
 private void DetachVlu_LopHocChilds(Vlu_LopHoc entity)
 {
     entity.Vlu_LopHocParent = null;
 }
 private bool FilterVlu_LopHocChilds(Vlu_LopHoc entity)
 {
     return (entity.ParentID == this.LopID);
 }
 /// <summary>
 /// Create a new Vlu_LopHoc object.
 /// </summary>
 /// <param name="lopID">Initial value of the LopID property.</param>
 /// <param name="maLop">Initial value of the MaLop property.</param>
 /// <param name="tenLop">Initial value of the TenLop property.</param>
 /// <param name="ngayTao">Initial value of the NgayTao property.</param>
 /// <param name="nguoiTao">Initial value of the NguoiTao property.</param>
 public static Vlu_LopHoc CreateVlu_LopHoc(global::System.Int32 lopID, global::System.String maLop, global::System.String tenLop, global::System.DateTime ngayTao, global::System.String nguoiTao)
 {
     Vlu_LopHoc vlu_LopHoc = new Vlu_LopHoc();
     vlu_LopHoc.LopID = lopID;
     vlu_LopHoc.MaLop = maLop;
     vlu_LopHoc.TenLop = tenLop;
     vlu_LopHoc.NgayTao = ngayTao;
     vlu_LopHoc.NguoiTao = nguoiTao;
     return vlu_LopHoc;
 }
 private void AttachVlu_LopHocChilds(Vlu_LopHoc entity)
 {
     entity.Vlu_LopHocParent = this;
 }
 public override void Cleanup()
 {
     if (_modelTrain != null)
     {
         _modelTrain.GetListClassComplete -= new EventHandler<EntityResultsArgs<Vlu_LopHoc>>(_modelTrain_GetListClassComplete);
         _modelTrain = null;
     }
     _listData = null;
     _selectedItem = null;
     if (DialogSended != null)
         DialogSended = null;
     base.Cleanup();
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Vlu_LopHoc EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToVlu_LopHoc(Vlu_LopHoc vlu_LopHoc)
 {
     base.AddObject("Vlu_LopHoc", vlu_LopHoc);
 }
        private void _modelTrain_GetListClassComplete(object sender, EntityResultsArgs<Vlu_LopHoc> e)
        {
            try
            {
                if (e.HasError)
                {
                    MessageCustomize.Show(e.Error.Message);
                    ErrorProcess();
                }
                else
                {
                    List<Vlu_LopHoc> lst = e.Results.Where(c => c.ParentID == null).ToList();
                    Vlu_LopHoc obj = new Vlu_LopHoc();
                    obj.KhoaID = -1;
                    obj.MaLop = "< Nhóm chính >";
                    obj.TenLop = "< Nhóm chính >";

                    lst.Insert(0, obj);
                    ListData = lst;
                    LoadInitComplete();
                }
            }
            catch (Exception ex)
            {
                MessageCustomize.Show(ex.Message);
                ErrorProcess();
            }
        }
Exemple #13
0
 public void DeleteClassAsync(Vlu_LopHoc obj)
 {
     Model.Vlu_LopHocs.Remove(obj);
     PerformSubmitChanged(DeleteClassComplete);
 }
Exemple #14
0
 public void SaveClassAsync(Vlu_LopHoc obj)
 {
     if (obj.LopID == -1)
         Model.Vlu_LopHocs.Add(obj);
     PerformSubmitChanged(SaveClassComplete);
 }
Exemple #15
0
 public void GetClassAsync(int id, int handlerType)
 {
     if (id == -1)
     {
         Vlu_LopHoc obj = new Vlu_LopHoc();
         obj.LopID = id;
         obj.MaLop = string.Empty;
         obj.TenLop = string.Empty;
         obj.NgayTao = DateTime.Now;
         obj.NguoiTao = SystemConfig.UserName;                
         List<Vlu_LopHoc> lst = new List<Vlu_LopHoc>();
         lst.Add(obj);
         switch (handlerType)
         {
             case 0: GetClassComplete(this, new EntityResultsArgs<Vlu_LopHoc>(lst.ToArray()));
                 break;
             case 1: GetClassParentComplete(this, new EntityResultsArgs<Vlu_LopHoc>(lst.ToArray()));
                 break;
         }
     }
     else
     {
         var query = from c in Model.GetVlu_LopHocQuery()
                     where c.KhoaID == id
                     select c;
         switch (handlerType)
         {
             case 0: PerformQuery(query, GetClassComplete, false);
                 break;
             case 1: PerformQuery(query, GetClassParentComplete, false);
                 break;
         }
     }
 }
Exemple #16
0
 public void ImportClassAsync(List<Vlu_LopHoc> lstData, List<CustomizeClass> lstImport)
 {
     foreach (var item in lstImport)
     {
         Vlu_LopHoc obj = lstData.FirstOrDefault(c => c.MaLop == item.MaLop);
         if (obj == null)
         {
             obj = new Vlu_LopHoc();
             obj.LopID = -1;
             obj.NgayTao = DateTime.Now;
             obj.NguoiTao = SystemConfig.UserName;
         }
         else
         {
             obj.NgayCapNhat = DateTime.Now;
             obj.NguoiCapNhat = SystemConfig.UserName;
         }
         obj.MaLop = item.MaLop;
         obj.TenLop = item.TenLop;
         obj.ParentID = item.ParentID;
         obj.KhoaID = item.KhoaID;
         if (obj.LopID == -1)
             Model.Vlu_LopHocs.Add(obj);
     }
     PerformSubmitChanged(ImportClassComplete);
 }