Ejemplo n.º 1
0
 private void OnChooseClickCommand()
 {
     try
     {
         if (SelectedItem != null)
         {
             if (DialogSended != null)
             {
                 if (CheckSelected())
                 {
                     if (DialogSended.Sender is EditDepartmentViewModel)
                     {
                         EditDepartmentViewModel view = DialogSended.Sender as EditDepartmentViewModel;
                         view.ParentID   = SelectedItem.KhoaID;
                         view.ItemParent = SelectedItem;
                     }
                     DialogSended.ProcessCallback(MessageBoxResult.OK);
                 }
             }
             if (CloseWindow != null)
             {
                 CloseWindow(this, null);
             }
         }
     }
     catch (Exception ex)
     {
         MessageCustomize.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
 private bool CheckSelected()
 {
     if (DialogSended.Sender is EditDepartmentViewModel)
     {
         EditDepartmentViewModel view = DialogSended.Sender as EditDepartmentViewModel;
         if (view.ParentID > 0)
         {
             if (view.ParentID == SelectedItem.KhoaID)
             {
                 MessageCustomize.Show("Không được chọn chính nhóm đó", "Lỗi", MessageImage.Alert);
                 return(false);
             }
         }
     }
     return(true);
 }