public static void sua(CTDD d) { var dd = db.CTDDs.Find(d.ID); db.Entry(dd).CurrentValues.SetValues(d); db.SaveChanges(); }
public ActionResult Edit([Bind(Include = "ID,TENDIADIEM,MATP,TENTP_NUOC")] CTDD cTDD) { if (ModelState.IsValid) { int t = QLDD_BUS.sua(cTDD); if (t != 0) { return(RedirectToAction("Index")); } } return(View(cTDD)); }
public static int sua(CTDD d) { try { DAO.QLDD.sua(d); return 1; } catch (Exception ex) { Console.WriteLine(ex.Message); return 0; } }
// GET: CTDD/Edit/5 public ActionResult Edit(int id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CTDD cTDD = QLDD_BUS.findd(id); if (cTDD == null) { return(HttpNotFound()); } return(View(cTDD)); }
public void set(TOUR t) { textBox1.Text = t.TENTOUR; richTextBox1.Text = t.DACDIEM; textBox4.Text = t.GIATOUR.ToString(); textBox3.Text = t.LOAIHINH; List <DIADIEM> dd = QLTOUR_BUS.load(t.ID); List <CTDD> ctdd = new List <CTDD>(); foreach (var x in dd) { CTDD ct = new CTDD(); ct = x.CTDD; ctdd.Add(ct); } List <GIATOUR> gia = QLTOUR_BUS.loadg(t.ID); gridControl1.DataSource = ctdd; gridControl2.DataSource = gia; }
public static void them(CTDD d) { db.CTDDs.Add(d); db.SaveChanges(); }