public ActionResult Create(FormCollection collection)
        {
            var obj = new QuanHuyen();
            if (TryUpdateModel(obj))
            {
                //try
                {
                    quanHuyenRes.Add(obj);
                    quanHuyenRes.Save();
                    ViewData["message"] = "Thêm thành công";

                }
                //catch (Exception ex)
                //{
                //    ViewData["message"] = ex;
                //}

            }

            return View();
        }
Beispiel #2
0
 public void Delete(QuanHuyen obj)
 {
     en.DeleteObject(obj);
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the QuanHuyen EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToQuanHuyen(QuanHuyen quanHuyen)
 {
     base.AddObject("QuanHuyen", quanHuyen);
 }
Beispiel #4
0
 public void Add(QuanHuyen obj)
 {
     en.AddObject("QuanHuyen", obj);
 }
 /// <summary>
 /// Create a new QuanHuyen object.
 /// </summary>
 /// <param name="quanID">Initial value of the quanID property.</param>
 public static QuanHuyen CreateQuanHuyen(global::System.Int32 quanID)
 {
     QuanHuyen quanHuyen = new QuanHuyen();
     quanHuyen.quanID = quanID;
     return quanHuyen;
 }