public IActionResult ThemNhaCungCapData(NhaCungCapView NhaCungCapView)
 {
     if (ModelState.IsValid)
     {
         _nhaCungCapServices.ThemNhaCungCap(NhaCungCapView.NhaCungCapDTO);
         Index();
         return(View(nameof(Index)));
     }
     ViewBag.Error = "Thêm phiếu nhập thất bại";
     return(View(nameof(Index)));
 }
 public IActionResult SuaNhaCungCapData(NhaCungCapView NhaCungCapView)
 {
     ViewBag.Error = "Cập nhật thành công";
     if (ModelState.IsValid)
     {
         _nhaCungCapServices.SuaNhaCungCap(NhaCungCapView.NhaCungCapDTO);
         Index();
         return(View(nameof(Index)));
     }
     ViewBag.Error = "Cập nhật thất bại";
     return(View());
 }
 public IActionResult XoaNhaCungCapData(NhaCungCapView NhaCungCapView)
 {
     _nhaCungCapServices.XoaNhaCungCap(NhaCungCapView.NhaCungCapDTO);
     Index();
     return(View(nameof(Index)));
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NhaCungCapController"/> class.
 /// </summary>
 /// <param name="chatLieuService">The chat lieu service.</param>
 public NhaCungCapController(INhaCungCapService chatLieuService)
 {
     this.chatLieuService = chatLieuService;
     view = new NhaCungCapView(this);
 }