/* 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."); } } }
/* 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."); } } }
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)); }
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))); }
public ActionResult Detail(string Id) { Contact message = saklambacDb.GetOneById(Id); return(View(message)); }
/* UPDATE BLOG POST */ public IActionResult Update(string Id) { var blog = blogDb.GetOneById(Id); return(View(blog)); }
public IActionResult MesajOku(string Id) { return(View(contactDb.GetOneById(Id))); }
public ActionResult Detail(string Id) { return(View(directorDb.GetOneById(Id))); }