public ActionResult DangTinBan (string SDT, string TheLoai, string TieuDe, string MoTa, string TinhTrang, string GiaTien, string HoTen, string ThanhPho, string QuanHuyen, string Email, ImageFile objImage) { string strLink = ""; VatPhamAccess vpa = new VatPhamAccess(); foreach (var file in objImage.files) { if (file != null && file.ContentLength > 0) { string fileName = Path.Combine(Server.MapPath("/Content/uploads"), Guid.NewGuid() + Path.GetExtension(file.FileName)); strLink += fileName + ','; file.SaveAs(fileName); } } string[] temp = strLink.Split(','); int MaTinhThanh = Int32.Parse(ThanhPho); long giaTien = long.Parse(GiaTien); int theloai = Int32.Parse(TheLoai); if (vpa.ThemVatPham(SDT, HoTen, MaTinhThanh, QuanHuyen, TieuDe, MoTa, TinhTrang, giaTien, theloai, temp[0], strLink)) { return(RedirectToAction("Index", "Product", new { MaDM = theloai, Trang = 1 })); } return(View("DangTinBan")); }
public JsonResult TiepTucBan(int MaVP) { VatPhamAccess vpa = new VatPhamAccess(); if (vpa.BanTiep(MaVP)) { return(Json(new { status = true })); } return(Json(new { status = false })); }
public JsonResult NgungBan(int MaVP) { VatPhamAccess vpa = new VatPhamAccess(); if (vpa.NgungBan(MaVP)) { return(Json(new { status = true })); } return(Json(new { status = false })); }