C# public IActionResult Update(Guid id) { var Find = _db.Students.FirstOrDefault(x => x.Id == id); return View(Find); } [HttpPost] public IActionResult Update(Student st) { _db.Students.Update(st); _db.SaveChanges(); return RedirectToAction("List"); } public IActionResult Delete(Guid id) { var Find = _db.Students.FirstOrDefault(x => x.Id == id); _db.Students.Remove(Find); _db.SaveChanges(); return RedirectToAction("List"); }
C#using OpenQA.Selenium.Chrome;using OpenQA.Selenium.Support.UI;using OpenQA.Selenium;namespace Lab6_KiemThuNangCao{ internal class Program { static void Main(string[] args) { //Open Chrome IWebDriver driver = new ChromeDriver(); //go to link driver.Navigate().GoToUrl("https://lms.poly.edu.vn"); Thread.Sleep(1000); //login IWebElement menuButton = driver.FindElement(By.LinkText("Ha Noi")); menuButton.Click(); // Go back to the home page and refresh the browser driver.Navigate().Back(); driver.Navigate().Refresh(); // Enter the login credentials and click the login button IWebElement usernameField = driver.FindElement(By.Id("thieuddph45736")); IWebElement passwordField = driver.FindElement(By.Id("Thieu1810")); IWebElement loginButton = driver.FindElement(By.Id("login-btn")); //quit driver.Quit(); } }}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { int d = e.RowIndex; textBox1.Text = dataGridView1.Rows[d].Cells[0].Value.ToString(); textBox2.Text = dataGridView1.Rows[d].Cells[1].Value.ToString(); textBox3.Text = dataGridView1.Rows[d].Cells[2].Value.ToString(); dateTimePicker1.Value = Convert.ToDateTime(dataGridView1.Rows[d].Cells[4].Value.ToString()); string gioiTinh = dataGridView1.Rows[d].Cells[3].Value.ToString(); if (gioiTinh.Equals(1)) { checkBox1.Checked = true; checkBox2.Checked = false; } else { checkBox1.Checked = false; checkBox2.Checked = true; } comboBox1.Text = dataGridView1.Rows[d].Cells[4].Value.ToString(); }