private bool IsLookLichHoc(GridView view, int row)
        {
            bool result = false;

            try
            {
                GridColumn col           = view.Columns["XepLichHocId"];
                int        _XepLichHocId = O2S_Common.TypeConvert.Parse.ToInt32(view.GetRowCellValue(row, col).ToString());
                //kiem tra trong DB xem da khoa hay khong
                XEPLICHHOC _lichhoc = XepLichHocLogic.SelectSingle(_XepLichHocId);
                if (_lichhoc != null && _lichhoc.IsLock == true)
                {
                    result = true;
                }
                foreach (var item in this.lstLichHoc)
                {
                    if (item.XepLichHocId == _XepLichHocId && item.IsEdit == true)
                    {
                        result = false;
                    }
                }
            }
            catch (Exception ex)
            {
                O2S_Common.Logging.LogSystem.Warn(ex);
            }
            return(result);
        }
 private void gridViewLichHoc_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     try
     {
         if (e.MenuType == GridMenuType.Row)
         {
             e.Menu.Items.Clear();
             var        rowHandle     = gridViewLichHoc.FocusedRowHandle;
             int        _XepLichHocId = O2S_Common.TypeConvert.Parse.ToInt32(gridViewLichHoc.GetRowCellValue(rowHandle, "XepLichHocId").ToString());
             XEPLICHHOC _lichhoc      = XepLichHocLogic.SelectSingle(_XepLichHocId);
             if (_lichhoc != null && _lichhoc.IsLock == true)
             {
                 DXMenuItem item_sualich = new DXMenuItem("Sửa lịch học");
                 item_sualich.Image  = imMenu.Images[0];
                 item_sualich.Click += new EventHandler(repositoryItemButton_SuaLichHoc_Click);
                 e.Menu.Items.Add(item_sualich);
             }
         }
     }
     catch (Exception ex)
     {
         O2S_Common.Logging.LogSystem.Warn(ex);
     }
 }