示例#1
0
        /* The task of this method is to update teacher by Id */
        private void btnUpdateTeacher_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Do you want to update this teacher ?", "Warning", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                if (txtId.Text.Length > 0)
                {
                    Teacher findTeacher = teacherDb.GetOneById(txtId.Text);

                    Teacher teacher = new Teacher();
                    teacher.TeacherName = txtNameSurname.Text;
                    teacher.Class       = Convert.ToInt16(txtClass.Text);

                    teacherDb.Update(findTeacher, teacher);
                    MessageBox.Show("Updated This Teacher.");

                    ShowAllTeachers();
                    ShowStatistics();
                }
                else
                {
                    MessageBox.Show("Please, select a teacher.");
                }
            }
        }
示例#2
0
        /* The task of this method is to update student by Id */
        private void btnUpdateStudent_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Do you want to update this student ?", "Warning", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                if (txtId.Text.Length > 0)
                {
                    Student findStudent = studentDb.GetOneById(txtId.Text);

                    Student student = new Student();
                    student.NameSurname = txtNameSurname.Text;
                    student.Number      = txtNumber.Text;
                    student.Class       = Convert.ToInt16(txtClass.Value);
                    student.Grade       = Convert.ToInt16(txtGrade.Text);
                    student.TeacherName = cmbTeacherName.Text;

                    studentDb.Update(findStudent, student);
                    MessageBox.Show("Updated This Student.");

                    ShowAllStudents();
                    ShowStatistics();
                }
                else
                {
                    MessageBox.Show("Please, select a student.");
                }
            }
        }
示例#3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello Saklambac");
            Console.WriteLine("************** LIST ALL NOTES ***************");

            SaklambacDb <Note> saklambacDb = new SaklambacDb <Note>();
            List <Note>        notes       = saklambacDb.GetAll();

            foreach (var item in notes)
            {
                Console.WriteLine(item.Id + "/" + item.Title + "/" + item.Description + "/" + item.isCompleted);
            }

            Console.WriteLine("************** UPDATE NOTE ***************");

            Note updateNote = saklambacDb.GetOneById("0g7ceyzd8ce1fu8ieja8dede");
            Note newNote    = new Note();

            newNote.isCompleted = true;
            newNote.Title       = "Update Tests";
            newNote.Description = "test";
            saklambacDb.Update(updateNote, newNote);

            Console.WriteLine("************** LIST ALL NOTES ***************");

            List <Note> notess = saklambacDb.GetAll();

            foreach (var item in notess)
            {
                Console.WriteLine(item.Id + "/" + item.Title + "/" + item.Description + "/" + item.isCompleted);
            }

            Console.ReadLine();
        }
        public IActionResult Haber(string Id)
        {
            var item = newsDb.GetOneById(Id);

            if (item == null)
            {
                return(RedirectToAction("Haberler"));
            }
            return(View(item));
        }
示例#5
0
 public ActionResult Detail(string Id)
 {
     return(View(movieDb.GetOneById(Id)));
 }
 /* TEK HABER */
 public IActionResult Incele(string Id)
 {
     return(View(newsDb.GetOneById(Id)));
 }
 public async Task <ActionResult> GetByNewsId(string newsId)
 {
     return(Ok(newsDb.GetOneById(newsId)));
 }
示例#8
0
        public ActionResult Detail(string Id)
        {
            Contact message = saklambacDb.GetOneById(Id);

            return(View(message));
        }
示例#9
0
        /* UPDATE BLOG POST */
        public IActionResult Update(string Id)
        {
            var blog = blogDb.GetOneById(Id);

            return(View(blog));
        }
示例#10
0
 public IActionResult MesajOku(string Id)
 {
     return(View(contactDb.GetOneById(Id)));
 }
示例#11
0
 public ActionResult Detail(string Id)
 {
     return(View(directorDb.GetOneById(Id)));
 }