This repository has been archived by the owner on May 31, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from hardingadonis/chuong-add-product
Chuong add product finished
- Loading branch information
Showing
7 changed files
with
122 additions
and
58 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package io.hardingadonis.saledock.dao; | ||
|
||
import io.hardingadonis.saledock.model.*; | ||
import java.util.Optional; | ||
|
||
public interface IProductDAO extends IDAO<Product>, IPagination<Product> { | ||
|
||
public String getTop10(Integer duration); | ||
public String getTop10(Integer duration); | ||
|
||
public Optional<Product> getByCode(String code); | ||
} |
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
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
35 changes: 35 additions & 0 deletions
35
src/main/webapp/view/assets/js/management/product/add-product.js
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,35 @@ | ||
$(document).ready(function () { | ||
$('#add-product').on('submit', function (e) { | ||
e.preventDefault(); | ||
|
||
var formData = new FormData(this); | ||
|
||
$.ajax({ | ||
type: 'POST', | ||
url: $(this).attr('action'), | ||
data: formData, | ||
processData: false, | ||
contentType: false, | ||
success: function (response) { | ||
Swal.fire({ | ||
title: 'Thành công!', | ||
text: 'Thêm sản phẩm thành công', | ||
icon: 'success', | ||
timer: 3000 | ||
}).then((result) => { | ||
if (result.dismiss === Swal.DismissReason.timer) { | ||
console.log('I was closed by the timer') | ||
} | ||
window.location.href = 'product'; | ||
}); | ||
|
||
setTimeout(function () { | ||
window.location.href = 'product'; | ||
}, 3000); | ||
}, | ||
error: function (response) { | ||
|
||
} | ||
}); | ||
}); | ||
}); |
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