public ActionResult delupship(int id) { string connectionString = ConfigurationManager .ConnectionStrings["LiteCommerceDB"] .ConnectionString; IShipperDAL dal = new ShipperDAL(connectionString); Shipper s = new Shipper() { ShipperName = "KAKA", Phone = "03399" }; var data = dal.Update(8, s); return(Json(data, JsonRequestBehavior.AllowGet)); }
//Test URL: https://localhost:44398/Test/PaginationCustomer?page=1&pageSize=10&searchValue /// <summary> /// Hiển thị danh sách Shipper(nhà vận chuyển) Tìm kiếm, phân trang /// </summary> /// <param name="page"></param> /// <param name="pageSize"></param> /// <param name="searchValue"></param> /// <returns></returns> public ActionResult PaginationShipper(int page, int pageSize, string searchValue) { string connectionString = ConfigurationManager.ConnectionStrings["LiteCommerceDB"].ConnectionString; IShipperDAL dal = new ShipperDAL(connectionString); /*var data = dal.List(page, pageSize, searchValue); * * return Json(data, JsonRequestBehavior.AllowGet);*/ Shipper data = new Shipper() { ShipperID = 4, ShipperName = "Lệ Quyên", Phone = "0988712" }; //var data = dal.Count(""); //var data = dal.Get(4); return(Json(dal.Update(data), JsonRequestBehavior.AllowGet)); }
public ActionResult Edit([Bind(Include = "ShipperID,Name,Email,Phone,Fax,Address,CreateDate,CreateUser,ModifiedDate,ModifiedUser,IsActive")] Shipper shipper) { var UserSession = (UserLogin)Session[TechDeviShopVs002.Common.CommonConstants.USER_SESSION]; if (ModelState.IsValid) { var _dal = new ShipperDAL(); shipper.ModifiedUser = UserSession.UserID; var _result = _dal.Update(shipper); if (_result) { return(RedirectToAction("Index", "Shippers")); } else { ModelState.AddModelError("", "Cập nhật shipper ko thành công"); } } return(View(shipper)); }