-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
324 changed files
with
101,912 additions
and
19,210 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file modified
BIN
+200 KB
(110%)
BookStore2019/.vs/BookStore2019/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
BookStore2019/.vs/BookStore2019/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified
BIN
+4.02 KB
(100%)
BookStore2019/.vs/BookStore2019/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
24 changes: 24 additions & 0 deletions
24
BookStore2019/BookStore2019/Areas/Area/AreaAreaRegistration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Web.Mvc; | ||
|
||
namespace BookStore2019.Areas.Area | ||
{ | ||
public class AreaAreaRegistration : AreaRegistration | ||
{ | ||
public override string AreaName | ||
{ | ||
get | ||
{ | ||
return "Area"; | ||
} | ||
} | ||
|
||
public override void RegisterArea(AreaRegistrationContext context) | ||
{ | ||
context.MapRoute( | ||
"Area_default", | ||
"Area/{controller}/{action}/{id}", | ||
new { action = "Index",Controller="Default", id = UrlParameter.Optional } | ||
); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
BookStore2019/BookStore2019/Areas/Area/Controllers/DefaultController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Mvc; | ||
|
||
namespace BookStore2019.Areas.Area.Controllers | ||
{ | ||
public class DefaultController : Controller | ||
{ | ||
// GET: Area/Default | ||
public ActionResult Index() | ||
{ | ||
return View(); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
BookStore2019/BookStore2019/Areas/Area/Controllers/QuanLyNXBController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Mvc; | ||
|
||
namespace BookStore2019.Areas.Area.Controllers | ||
{ | ||
public class QuanLyNXBController : Controller | ||
{ | ||
// GET: Area/QuanLyNXB | ||
public ActionResult Index() | ||
{ | ||
return View(); | ||
} | ||
} | ||
} |
214 changes: 214 additions & 0 deletions
214
BookStore2019/BookStore2019/Areas/Area/Controllers/QuanLySanPhamController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,214 @@ | ||
using BookStore2019.Services; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Mvc; | ||
using ValuesObject; | ||
|
||
namespace BookStore2019.Areas.Area.Controllers | ||
{ | ||
public class QuanLySanPhamController : Controller | ||
{ | ||
ChuDeService chuDeService = new ChuDeService(); | ||
SachService sachService = new SachService(); | ||
NhaXuatBanService nxbService = new NhaXuatBanService(); | ||
#region admin | ||
// GET: Default | ||
|
||
[HttpGet] | ||
public ActionResult SearchCate() | ||
{ | ||
var listCate = chuDeService.GetAll(); | ||
return View(listCate); | ||
} | ||
|
||
[HttpGet] | ||
public ActionResult CreateCate() | ||
{ | ||
OChuDe data = new OChuDe(); | ||
data.IsActive = false; | ||
|
||
List<OChuDe> listCate = chuDeService.GetByParentId(); | ||
|
||
ViewBag.ListCate = new SelectList(listCate, "ParentId", "Ten"); ; | ||
|
||
return View("UpdateCate", data); | ||
} | ||
[HttpPost, ValidateInput(false)] | ||
[ValidateAntiForgeryToken] | ||
public ActionResult CreateCate(OChuDe model) | ||
{ | ||
|
||
try | ||
{ | ||
chuDeService.Add(model); | ||
return RedirectToAction("SearchCate", "QuanLySanPham"); | ||
} | ||
catch (Exception e) | ||
{ | ||
|
||
} | ||
List<OChuDe> listCate = chuDeService.GetByParentId(); | ||
ViewBag.ListCate = new SelectList(listCate, "ParentId", "Ten"); ; | ||
ViewBag.IsEdit = true; | ||
return View("UpdateCate", model); | ||
} | ||
|
||
[HttpGet] | ||
public ActionResult UpdateCate(int? id) | ||
{ | ||
if (id.HasValue) | ||
{ | ||
var obj = chuDeService.Get(new OChuDe { MaChuDe = (int)id }); | ||
var categories = chuDeService.GetByParentId(); | ||
var listCate = new SelectList(categories, "ParentId", "Ten"); | ||
ViewBag.ListCate = listCate; | ||
ViewBag.IsEdit = true; | ||
return View(obj); | ||
} | ||
//var listCate = new SelectList(chuDeService.GetAll(), "ParentId", "Ten"); | ||
//ViewBag.Categories = listCate; | ||
return View(); | ||
} | ||
[HttpPost, ValidateInput(false)] | ||
[ValidateAntiForgeryToken] | ||
public ActionResult UpdateCate(OChuDe model) | ||
{ | ||
if (ModelState.IsValid) | ||
{ | ||
var pro = chuDeService.Get(new OChuDe { MaChuDe = model.MaChuDe }); | ||
if (pro != null) | ||
{ | ||
try | ||
{ | ||
|
||
chuDeService.Update(model); | ||
return RedirectToAction("SearchCate", "QuanLySanPham"); | ||
} | ||
catch (Exception e) | ||
{ | ||
|
||
} | ||
} | ||
} | ||
var categories = chuDeService.GetByParentId(); | ||
var listCate = new SelectList(categories, "ParentId", "Ten"); | ||
ViewBag.ListCate = listCate; | ||
ViewBag.IsEdit = true; | ||
return View(model); | ||
} | ||
[HttpPost] | ||
[ValidateAntiForgeryToken] | ||
public ActionResult DeleteCate(int id) | ||
{ | ||
chuDeService.Delete(new OChuDe { MaChuDe = id }); | ||
return RedirectToAction("SearchCate", "QuanLySanPham"); | ||
} | ||
#region sach | ||
|
||
[HttpGet] | ||
public ActionResult Search(bool isSach) | ||
{ | ||
var listSach = sachService.GetAll(isSach); | ||
return View(listSach); | ||
} | ||
|
||
[HttpGet] | ||
public ActionResult Create() | ||
{ | ||
OSach data = new OSach(); | ||
data.IsActive = false; | ||
|
||
data.IsHot = false; | ||
data.IsSach = false; | ||
List<OChuDe> listCate = chuDeService.GetAll(); | ||
ViewBag.ListCate = new SelectList(listCate, "MaChuDe", "Ten"); ; | ||
List<ONhaXuatBan> listNXB = nxbService.GetAll(); | ||
ViewBag.ListNXB = new SelectList(listNXB, "MaNXB", "TenNXB"); | ||
return View("Update", data); | ||
} | ||
[HttpPost, ValidateInput(false)] | ||
[ValidateAntiForgeryToken] | ||
public ActionResult Create(OSach model) | ||
{ | ||
if (ModelState.IsValid) | ||
{ | ||
// var pro = ServiceFactory.NewsgoryManager.Get(new Newsgories { NewsgoryId = model.NewsgoryId }); | ||
try | ||
{ | ||
model.TenVanTat = Help.Helper.convertToUnSign3(model.TenSach); | ||
sachService.Add(model); | ||
return RedirectToAction("Search", "QuanLySanPham", new { isSach = model.IsSach }); | ||
} | ||
catch (Exception e) | ||
{ | ||
|
||
} | ||
} | ||
List<OChuDe> listCate = chuDeService.GetAll(); | ||
ViewBag.ListCate = new SelectList(listCate, "MaChuDe", "Ten"); | ||
List<ONhaXuatBan> listNXB = nxbService.GetAll(); | ||
ViewBag.ListNXB = new SelectList(listNXB, "MaNXB", "TenNXB"); | ||
ViewBag.IsEdit = true; | ||
return View("Update", model); | ||
} | ||
|
||
[HttpGet] | ||
public ActionResult Update(int? id) | ||
{ | ||
if (id.HasValue) | ||
{ | ||
var obj = sachService.Get(new OSach { MaSach = (int)id }); | ||
List<OChuDe> listCate = chuDeService.GetAll(); | ||
ViewBag.ListCate = new SelectList(listCate, "MaChuDe", "Ten"); | ||
List<ONhaXuatBan> listNXB = nxbService.GetAll(); | ||
ViewBag.ListNXB = new SelectList(listNXB, "MaNXB", "TenNXB"); | ||
ViewBag.IsEdit = true; | ||
return View(obj); | ||
} | ||
|
||
return View(); | ||
} | ||
[HttpPost, ValidateInput(false)] | ||
[ValidateAntiForgeryToken] | ||
public ActionResult Update(OSach model) | ||
{ | ||
if (ModelState.IsValid) | ||
{ | ||
var pro = sachService.Get(new OSach { MaSach = model.MaSach }); | ||
if (pro != null) | ||
{ | ||
try | ||
{ | ||
model.TenVanTat = Help.Helper.convertToUnSign3(model.TenSach); | ||
//model.CreateBy = CurrentUser.Name; | ||
sachService.Update(model); | ||
return RedirectToAction("Search", "QuanLySanPham", new { isSach = model.IsSach }); | ||
} | ||
catch (Exception e) | ||
{ | ||
|
||
} | ||
} | ||
} | ||
List<OChuDe> listCate = chuDeService.GetAll(); | ||
ViewBag.ListCate = new SelectList(listCate, "MaChuDe", "Ten"); | ||
List<ONhaXuatBan> listNXB = nxbService.GetAll(); | ||
ViewBag.ListNXB = new SelectList(listNXB, "MaNXB", "TenNXB"); | ||
ViewBag.IsEdit = true; | ||
return View(model); | ||
} | ||
[HttpPost] | ||
[ValidateAntiForgeryToken] | ||
public ActionResult Delete(int id) | ||
{ | ||
var pro = sachService.Get(new OSach { MaSach = id }); | ||
bool isSach = (bool)pro.IsSach; | ||
sachService.Delete(new OSach { MaSach = id }); | ||
return RedirectToAction("Search", "QuanLySanPham", new { isSach = isSach }); | ||
} | ||
#endregion | ||
#endregion | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
BookStore2019/BookStore2019/Areas/Area/Controllers/QuanLySlideController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Mvc; | ||
|
||
namespace BookStore2019.Areas.Area.Controllers | ||
{ | ||
public class QuanLySlideController : Controller | ||
{ | ||
// GET: Area/QuanLySlide | ||
public ActionResult Index() | ||
{ | ||
return View(); | ||
} | ||
} | ||
} |
Oops, something went wrong.