コード例 #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            epProgram.Clear();
            bool check = SessionsHelper.ControlValidate(txtProgramName, "Lütfen Program  İsmini Giriniz.", epProgram);

            if (check)
            {
                int selectIndex = dgvProgramList.CurrentRow.Index;
                var programID   = dgvProgramList.Rows[selectIndex].Cells[0].Value;

                var p = ProgramsHelper.GetById(Convert.ToInt32(programID));
                p.Name = txtProgramName.Text.Trim();

                ProgramsHelper.Update(p);

                MessageBox.Show("Program güncelleme başarılı", "Library Management System", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ClearForm();
                FillGrid();
                DisableComponent();
            }
        }