Ejemplo n.º 1
0
        private void grd_editItemType_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;
            int itemTypeId = 0;

            BLL.ClsItemTypeData typeData = new BLL.ClsItemTypeData();

            try
            {
                //check for do action
                if (COMM_METHODS.checkActPermission(this.Name, USERNAME))
                {
                    if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
                    {
                        itemTypeId = Convert.ToInt16(senderGrid.SelectedCells[e.ColumnIndex].Value);
                        typeData   = MANAGEDB.getSingleItemTypeData(itemTypeId);

                        FrmAddItemType additemType = new FrmAddItemType(typeData, USERNAME);
                        additemType.WindowState = FormWindowState.Normal;
                        additemType.ShowDialog();
                        grd_editItemType.DataSource = MANAGEDB.getItemTypeDetails();
                    }
                }
                else
                {
                    COM_MESSAGE.permissionMessage("Sorry You dont have permission to do action !!!");
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }