public ActionResult Create(FormCollection collection) { var obj = new TinhThanh(); if (TryUpdateModel(obj)) { //try { tinhthanhRes.Add(obj); tinhthanhRes.Save(); ViewData["message"] = "Thêm thành công"; } //catch (Exception ex) //{ // ViewData["message"] = ex; //} } return PartialView("Create"); }
public void Delete(TinhThanh obj) { en.DeleteObject(obj); }
/// <summary> /// Deprecated Method for adding a new object to the TinhThanh EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTinhThanh(TinhThanh tinhThanh) { base.AddObject("TinhThanh", tinhThanh); }
public void Add(TinhThanh obj) { en.AddObject("TinhThanh", obj); }
/// <summary> /// Create a new TinhThanh object. /// </summary> /// <param name="tinhThanhID">Initial value of the tinhThanhID property.</param> public static TinhThanh CreateTinhThanh(global::System.Int32 tinhThanhID) { TinhThanh tinhThanh = new TinhThanh(); tinhThanh.tinhThanhID = tinhThanhID; return tinhThanh; }