Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] ApprovedStatus approvedStatus)
        {
            if (id != approvedStatus.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(approvedStatus);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ApprovedStatusExists(approvedStatus.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(approvedStatus));
        }
        private void bunifuFlatButton5ApprovedSubject_Click(object sender, EventArgs e)
        {
            ApprovedStatus status = new ApprovedStatus();

            if (this.bunifuDropdownQualification.selectedValue == "H")
            {
                BusinessSubject.ChangeStudentSubjectStatus(BusinessStudent.SearchStudentByUser(session.user), BusinessSubject.ListSubjectByName(SelectedSubjectname.ToString()), status, 0);
            }
            else
            {
                BusinessSubject.ChangeStudentSubjectStatus(BusinessStudent.SearchStudentByUser(session.user), BusinessSubject.ListSubjectByName(SelectedSubjectname.ToString()), status, Convert.ToInt32(this.bunifuDropdownQualification.selectedValue));
            }


            this.bunifuCustomDataGridSubjects.DataSource = null;
            bunifuCustomDataGridSubjects.DataSource      = BusinessSubject.ListStudentSubjects(BusinessStudent.SearchStudentByUser(session.user), "All student subjects");
            this.bunifuCustomLabelSubjectCount.Text      = this.bunifuCustomDataGridSubjects.Rows.Count.ToString();

            #region Design...
            bunifuCustomDataGridSubjects.Columns["Student"].Visible       = false;
            bunifuCustomDataGridSubjects.Columns["Status"].Visible        = true;
            bunifuCustomDataGridSubjects.Columns["Qualification"].Visible = true;
            bunifuCustomDataGridSubjects.Columns["Subject"].Width         = 300;
            GoBackButtonColors();
            this.bunifuFlatButtonAllSubjects.Normalcolor  = Color.Coral;
            this.bunifuFlatButtonAllSubjects.OnHovercolor = Color.Coral;
            #endregion
        }
Exemple #3
0
        public async Task <IActionResult> Create([Bind("Id,Name")] ApprovedStatus approvedStatus)
        {
            if (ModelState.IsValid)
            {
                _context.Add(approvedStatus);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(approvedStatus));
        }