Example #1
0
        private void btnSubjDelete_Click(object sender, EventArgs e)
        {
            int curRowId = Convert.ToInt32(grdSubjects.CurrentRow.Cells[0].Value);

            if (grdSubjects.DataSource == null)
            {
                return;
            }
            sbj.DeleteSubject(curRowId);
            grdSubjects.DataSource = sbj.GetSubjects().ToList();
            setcmbGrSbjSubject();
        }
Example #2
0
        public void DeleteSubjectTest()
        {
            var expectedCount   = subjectManager.GetSubjects().Count();
            var expectedSubject = subjectManager.GetSubjects().Last();
            var expectedId      = expectedSubject.Id;

            subjectManager.DeleteSubject(expectedId);

            var actuaList   = subjectManager.GetSubjects();
            var actualCount = actuaList.Count();

            Assert.AreEqual(expectedCount - 1, actualCount, "deleted from DB not one value. Its" + (expectedCount - actualCount).ToString());

            foreach (var item in actuaList)
            {
                Assert.AreNotEqual(expectedId, item.Id, "DB do not delete item with id: " + expectedId.ToString());
            }
        }
Example #3
0
 public static void DeleteDtoSubject(int id)
 {
     SubjectManager.DeleteSubject(id);
 }