Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtQtyType.Text.Trim() == "")
            {
                MessageBox.Show("Info required");
                return;
            }

            cPermissions qtyT = new cPermissions();

            qtyT.PermissionLevelID = Convert.ToUInt32(dgvPrmssnT["PermissionLevelID", dgvPrmssnT.CurrentCell.RowIndex].Value);
            qtyT.PermissionLevel = Convert.ToUInt16(numP.Value);
            qtyT.Info = txtQtyType.Text;
            qtyT.DateAdded = dtpDtAdd.Value.ToString();

            if (qtyT.prmssionLvlCheck())
            {
                MessageBox.Show("This permission level already exits!");
                return;
            }

            if (qtyT.saveRecord())
            {
                MessageBox.Show("Saved");
                txtQtyType.Clear();
            }
            loadPermissions();
        }