Update Request & Fix Item Qr Code
This commit is contained in:
parent
bf6e53b56e
commit
9f1283f7c9
@ -26,8 +26,12 @@ namespace PSTW_CentralSystem.Areas.Inventory.Models
|
|||||||
public DateTime? approvalDate { get; set; }
|
public DateTime? approvalDate { get; set; }
|
||||||
public int? RequestQuantity { get; set; }
|
public int? RequestQuantity { get; set; }
|
||||||
public string? Document { get; set; }
|
public string? Document { get; set; }
|
||||||
public string? fromStoreItem { get; set; }
|
public int? fromStoreItem { get; set; }
|
||||||
public string? assignStoreItem { get; set; }
|
[ForeignKey("fromStoreItem")]
|
||||||
|
public virtual StoreModel? Store { get; set; }
|
||||||
|
public int? assignStoreItem { get; set; }
|
||||||
|
[ForeignKey("assignStoreItem")]
|
||||||
|
public virtual StoreModel? Stores { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,7 +74,7 @@
|
|||||||
<div v-show="sortBy === 'master'">
|
<div v-show="sortBy === 'master'">
|
||||||
<div class="row card">
|
<div class="row card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h2>Pending Request Master</h2>
|
<h2>Outgoing Requests to Other Stores</h2>
|
||||||
<button id="addRequestBtn" class="btn btn-success col-md-3 col-lg-3 m-1 col-12"
|
<button id="addRequestBtn" class="btn btn-success col-md-3 col-lg-3 m-1 col-12"
|
||||||
v-on:click="showRequestModal = true">
|
v-on:click="showRequestModal = true">
|
||||||
<i class="fa fa-plus"></i> Add Request
|
<i class="fa fa-plus"></i> Add Request
|
||||||
@ -88,7 +88,7 @@
|
|||||||
|
|
||||||
<div class="row card">
|
<div class="row card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h2>Pending Approval Request (Your Item)</h2>
|
<h2>Incoming Requests from Other Inventory Masters</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<table class="table table-bordered table-hover table-striped no-wrap" id="requestOtherMasterDatatable" style=" width:100%;border-style: solid; border-width: 1px"></table>
|
<table class="table table-bordered table-hover table-striped no-wrap" id="requestOtherMasterDatatable" style=" width:100%;border-style: solid; border-width: 1px"></table>
|
||||||
@ -472,15 +472,16 @@
|
|||||||
dropdownOpen: false,
|
dropdownOpen: false,
|
||||||
showRequestModal: false,
|
showRequestModal: false,
|
||||||
}
|
}
|
||||||
},
|
}, async mounted() {
|
||||||
async mounted() {
|
|
||||||
this.fetchRequest();
|
this.fetchRequest();
|
||||||
this.fetchProducts();
|
this.fetchProducts();
|
||||||
this.fetchStation();
|
this.fetchStation();
|
||||||
await this.fetchUser();
|
await this.fetchUser();
|
||||||
|
|
||||||
|
// Wait for fetchStoreSpecific to complete before calling fetchStore
|
||||||
|
await this.fetchStoreSpecific(this.currentUserId);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
this.fetchStoreSpecific(this.currentUserId),
|
await this.fetchStore(),
|
||||||
this.fetchStore(),
|
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -532,9 +533,9 @@
|
|||||||
|
|
||||||
|
|
||||||
// Prepare data as JSON (No file upload)
|
// Prepare data as JSON (No file upload)
|
||||||
const requestData = {
|
const requestDatas = {
|
||||||
ProductId: this.productId,
|
ProductId: this.productId,
|
||||||
StationId: null,
|
StationId: this.stationId,
|
||||||
UserId: this.userId,
|
UserId: this.userId,
|
||||||
ProductCategory: this.productCategory,
|
ProductCategory: this.productCategory,
|
||||||
RequestQuantity: this.quantity,
|
RequestQuantity: this.quantity,
|
||||||
@ -557,14 +558,14 @@
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
// 'Authorization': `Bearer ${this.token}`
|
// 'Authorization': `Bearer ${this.token}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify(formData)
|
body: JSON.stringify(requestDatas)
|
||||||
});
|
});
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
// If the form submission was successful, display a success message
|
// If the form submission was successful, display a success message
|
||||||
alert('Success!', 'Request form has been successfully submitted.', 'success');
|
alert('Success!', 'Request form has been successfully submitted.', 'success');
|
||||||
const requestItem = await response.json();
|
const requestItem = await response.json();
|
||||||
this.items.push(requestItem);
|
this.items.push(requestItem);
|
||||||
|
this.resetForm();
|
||||||
this.fetchRequest();
|
this.fetchRequest();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -591,8 +592,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Proceed to send the data to the API
|
// Proceed to send the data to the API
|
||||||
const response = await fetch('/InvMainAPI/AddRequest', {
|
const response = await fetch('/InvMainAPI/AddRequest', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -702,17 +701,24 @@
|
|||||||
"data": this.items.filter(item => item.assignStoreItem != null && item.status == "Requested" && item.userId == this.currentUserId),
|
"data": this.items.filter(item => item.assignStoreItem != null && item.status == "Requested" && item.userId == this.currentUserId),
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "title": "Request ID", "data": "requestID" },
|
{ "title": "Request ID", "data": "requestID" },
|
||||||
{ "title": "Action", "data": "requestID", "render": renderActionButtons, "className": "align-middle" },
|
|
||||||
{ "title": "Product", "data": "productName", "render": renderDocument },
|
{ "title": "Product", "data": "productName", "render": renderDocument },
|
||||||
{ "title": "Requested by User", "data": "userName" },
|
{ "title": "From Store", "data": "fromStoreItem" },
|
||||||
{ "title": "Requested by Station", "data": "stationName" },
|
{ "title": "Assign Store", "data": "assignStoreItem" },
|
||||||
{ "title": "Product Category", "data": "productCategory" },
|
{ "title": "Product Category", "data": "productCategory" },
|
||||||
{ "title": "Request Quantity", "data": "requestQuantity" },
|
{ "title": "Request Quantity", "data": "requestQuantity" },
|
||||||
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
||||||
{ "title": "User Remark", "data": "remarkUser" },
|
{ "title": "Remark", "data": "remarkUser" },
|
||||||
{ "title": "Status", "data": "status" },
|
{ "title": "Status", "data": "status" },
|
||||||
{ "title": "Request Date", "data": "requestDate" },
|
{ "title": "Request Date", "data": "requestDate" },
|
||||||
{ "title": "Approval Date", "data": "approvalDate" }
|
{ "title": "Approval Date", "data": "approvalDate" },
|
||||||
|
{
|
||||||
|
"title": "Delete", "data": "requestID",
|
||||||
|
"render": function (data) {
|
||||||
|
var deleteButton = `<button type="button" class="btn btn-danger delete-btn" data-id="${data}">Delete</button>`;
|
||||||
|
return deleteButton;
|
||||||
|
},
|
||||||
|
"className": "align-middle",
|
||||||
|
}
|
||||||
],
|
],
|
||||||
responsive: true,
|
responsive: true,
|
||||||
drawCallback: function (settings) { }
|
drawCallback: function (settings) { }
|
||||||
@ -725,7 +731,8 @@
|
|||||||
{ "title": "Action", "data": "requestID", "render": renderActionButtons, "className": "align-middle" },
|
{ "title": "Action", "data": "requestID", "render": renderActionButtons, "className": "align-middle" },
|
||||||
{ "title": "Product", "data": "productName", "render": renderDocument },
|
{ "title": "Product", "data": "productName", "render": renderDocument },
|
||||||
{ "title": "Requested by User", "data": "userName" },
|
{ "title": "Requested by User", "data": "userName" },
|
||||||
{ "title": "Requested by Station", "data": "stationName" },
|
{ "title": "From Store", "data": "fromStoreItem" },
|
||||||
|
{ "title": "Assign Store", "data": "assignStoreItem" },
|
||||||
{ "title": "Product Category", "data": "productCategory" },
|
{ "title": "Product Category", "data": "productCategory" },
|
||||||
{ "title": "Request Quantity", "data": "requestQuantity" },
|
{ "title": "Request Quantity", "data": "requestQuantity" },
|
||||||
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
||||||
@ -741,10 +748,10 @@
|
|||||||
"data": this.items.filter(item => item.status != "Requested" && item.assignStoreItem != null && item.userId != this.currentUserId),
|
"data": this.items.filter(item => item.status != "Requested" && item.assignStoreItem != null && item.userId != this.currentUserId),
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "title": "Request ID", "data": "requestID" },
|
{ "title": "Request ID", "data": "requestID" },
|
||||||
{ "title": "Action", "data": "requestID", "render": renderActionButtons, "className": "align-middle" },
|
|
||||||
{ "title": "Product", "data": "productName", "render": renderDocument },
|
{ "title": "Product", "data": "productName", "render": renderDocument },
|
||||||
{ "title": "Requested by User", "data": "userName" },
|
{ "title": "Requested by User", "data": "userName" },
|
||||||
{ "title": "Requested by Station", "data": "stationName" },
|
{ "title": "From Store", "data": "fromStoreItem" },
|
||||||
|
{ "title": "Assign Store", "data": "assignStoreItem" },
|
||||||
{ "title": "Product Category", "data": "productCategory" },
|
{ "title": "Product Category", "data": "productCategory" },
|
||||||
{ "title": "Request Quantity", "data": "requestQuantity" },
|
{ "title": "Request Quantity", "data": "requestQuantity" },
|
||||||
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
||||||
@ -767,50 +774,22 @@
|
|||||||
self.approveRequestModal(requestID);
|
self.approveRequestModal(requestID);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#requestDatatable tbody').on('click', '.print-btn', function () {
|
// Attach event listeners
|
||||||
const $button = $(this);
|
$('#requestOtherMasterDatatable tbody').on('click', '.reject-btn', function () {
|
||||||
const $row = $button.closest('tr');
|
const requestID = $(this).data('id');
|
||||||
const itemId = $button.data('id');
|
self.rejectRequestModal(requestID);
|
||||||
let imageSrc = $row.hasClass('child') ? $row.prev('tr').find('td:nth-child(1) img').attr('src') : $row.find('td:nth-child(1) img').attr('src');
|
|
||||||
if (imageSrc) {
|
|
||||||
self.printItem(itemId, imageSrc);
|
|
||||||
} else {
|
|
||||||
console.error("Image source not found.");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#requestOtherMasterDatatable tbody').on('click', '.approve-btn', function () {
|
||||||
$('#requestDatatable tbody').on('click', '.print-btn', function () {
|
const requestID = $(this).data('id');
|
||||||
const $button = $(this); // The clicked button
|
self.approveRequestModal(requestID);
|
||||||
const $row = $button.closest('tr'); // The parent row of the button
|
|
||||||
const itemId = $button.data('id'); // Get the item ID from the button's data attribute
|
|
||||||
|
|
||||||
let imageSrc;
|
|
||||||
|
|
||||||
// Check if the table is collapsed
|
|
||||||
if ($row.hasClass('child')) {
|
|
||||||
// For collapsed view: Look for the closest `.dtr-data` that contains the img
|
|
||||||
imageSrc = $row.prev('tr').find('td:nth-child(1) img').attr('src');
|
|
||||||
} else {
|
|
||||||
// For expanded view: Find the img in the first column of the current row
|
|
||||||
imageSrc = $row.find('td:nth-child(1) img').attr('src');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (imageSrc) {
|
|
||||||
self.printItem(itemId, imageSrc); // Call the print function with the itemId and imageSrc
|
|
||||||
} else {
|
|
||||||
console.error("Image source not found.");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#itemDatatable tbody').on('click', '.reject-btn', function () {
|
$('#requestMasterDatatable tbody').off('click', '.delete-btn');
|
||||||
const $button = $(this); // The clicked button
|
|
||||||
const $row = $button.closest('tr'); // The parent row of the button
|
|
||||||
const itemId = $button.data('id'); // Get the item ID from the button's data attribute
|
|
||||||
|
|
||||||
|
|
||||||
self.printItem(itemId, imageSrc); // Call the print function with the itemId and imageSrc
|
|
||||||
|
|
||||||
|
$('#requestMasterDatatable tbody').on('click', '.delete-btn', function () {
|
||||||
|
const requestID = $(this).data('id');
|
||||||
|
self.deleteRequestItem(requestID);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -907,7 +886,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
this.stores = data.filter(stores => stores.id !== this.storeUser.storeId);
|
this.stores = data.filter(store =>
|
||||||
|
!this.storeUser.some(userStore => userStore.id === store.id)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching suppliers:', error);
|
console.error('Error fetching suppliers:', error);
|
||||||
@ -1102,38 +1084,6 @@
|
|||||||
$(`#approveModal`).modal('show');
|
$(`#approveModal`).modal('show');
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
async printItem(itemId, imgSrc) {
|
|
||||||
try {
|
|
||||||
this.thisQRInfo.uniqueID = itemId;
|
|
||||||
const uniqueQR = itemId;
|
|
||||||
const container = document.getElementById("QrContainer");
|
|
||||||
|
|
||||||
if (!container) {
|
|
||||||
console.error("Container not found.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Safely set image content
|
|
||||||
const sanitizedImgSrc = encodeURI(imgSrc); // Sanitize the URL
|
|
||||||
container.innerHTML = `<img src="${sanitizedImgSrc}" alt="QR Code" class="text-center " />`;
|
|
||||||
|
|
||||||
// Fetch QR information
|
|
||||||
const qrInfo = this.getPrintedQR(uniqueQR);
|
|
||||||
if (!qrInfo) {
|
|
||||||
console.error("QR Info not found.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.thisQRInfo = qrInfo;
|
|
||||||
this.thisQRInfo.imgSrc = sanitizedImgSrc
|
|
||||||
this.thisQRInfo.imgContainer = container.innerHTML
|
|
||||||
$(`#QrItemModal`).modal('show'); // Show modal
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
console.error("Error generating QR code:", error);
|
|
||||||
alert("An error occurred while generating the QR code.");
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async fetchUser() {
|
async fetchUser() {
|
||||||
try {
|
try {
|
||||||
@ -1188,11 +1138,79 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
resetForm() {
|
resetForm() {
|
||||||
|
this.searchQuery = "";
|
||||||
|
this.stationId = "";
|
||||||
|
this.productId = "";
|
||||||
|
this.remark = "";
|
||||||
|
this.document = null;
|
||||||
|
this.quantity = 0;
|
||||||
|
this.status = "";
|
||||||
|
this.requestDate = null;
|
||||||
|
this.approvalDate = null;
|
||||||
|
this.productCategory = "";
|
||||||
|
this.fromStoreItem = "",
|
||||||
|
this.assignStoreItem = "",
|
||||||
|
|
||||||
|
this.productName = null;
|
||||||
|
this.selectedProduct = "";
|
||||||
|
this.selectedStation = "";
|
||||||
|
this.selectedCategory = "";
|
||||||
|
this.loading = false;
|
||||||
this.rejectremark = "";
|
this.rejectremark = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async deleteRequestItem(requestID) {
|
||||||
|
if (!confirm("Are you sure you want to delete this request?")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const response = await fetch(`/InvMainAPI/DeleteRequest/${requestID}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
alert(result.message);
|
||||||
|
|
||||||
|
if ($.fn.dataTable.isDataTable('#requestMasterDatatable')) {
|
||||||
|
const table = $('#requestMasterDatatable').DataTable();
|
||||||
|
table.row($(`.delete-btn[data-id="${requestID}"]`).closest('tr')).remove().draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.request = this.request.filter(req => req.requestID !== requestID);
|
||||||
|
} else {
|
||||||
|
alert(result.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.error("Error deleting item:", error);
|
||||||
|
alert("An error occurred while deleting the item.");
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
handleSorting() {
|
handleSorting() {
|
||||||
this.fetchRequest();
|
if (this.requestDatatable) {
|
||||||
|
this.requestDatatable.clear().destroy();
|
||||||
|
}
|
||||||
|
if (this.settledrequestDatatable) {
|
||||||
|
this.settledrequestDatatable.clear().destroy();
|
||||||
|
}
|
||||||
|
if (this.requestMasterDatatable) {
|
||||||
|
this.requestMasterDatatable.clear().destroy();
|
||||||
|
}
|
||||||
|
if (this.requestOtherMasterDatatable) {
|
||||||
|
this.requestOtherMasterDatatable.clear().destroy();
|
||||||
|
}
|
||||||
|
if (this.settledrequestMasterDatatable) {
|
||||||
|
this.settledrequestMasterDatatable.clear().destroy();
|
||||||
|
}
|
||||||
|
this.initiateTable();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
|
|||||||
@ -1014,9 +1014,7 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory
|
|||||||
_centralDbContext.Requests.Add(request);
|
_centralDbContext.Requests.Add(request);
|
||||||
await _centralDbContext.SaveChangesAsync();
|
await _centralDbContext.SaveChangesAsync();
|
||||||
|
|
||||||
var updatedList = await _centralDbContext.Requests
|
var updatedList = await _centralDbContext.Requests.ToListAsync();
|
||||||
.Where(r => r.UserId == request.UserId)
|
|
||||||
.ToListAsync();
|
|
||||||
|
|
||||||
return Json(updatedList.Select(i => new
|
return Json(updatedList.Select(i => new
|
||||||
{
|
{
|
||||||
@ -1049,6 +1047,7 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory
|
|||||||
return Json(itemRequestList.Select(i => new
|
return Json(itemRequestList.Select(i => new
|
||||||
{
|
{
|
||||||
i.requestID,
|
i.requestID,
|
||||||
|
i.UserId,
|
||||||
productName = i.Product?.ProductName,
|
productName = i.Product?.ProductName,
|
||||||
i.ProductId,
|
i.ProductId,
|
||||||
productImage = i.Product?.ImageProduct,
|
productImage = i.Product?.ImageProduct,
|
||||||
|
|||||||
1075
Migrations/20250311003003_UpdateRequestTable2.Designer.cs
generated
Normal file
1075
Migrations/20250311003003_UpdateRequestTable2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
126
Migrations/20250311003003_UpdateRequestTable2.cs
Normal file
126
Migrations/20250311003003_UpdateRequestTable2.cs
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace PSTW_CentralSystem.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class UpdateRequestTable2 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "fromStoreItem",
|
||||||
|
table: "request",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "longtext",
|
||||||
|
oldNullable: true)
|
||||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "assignStoreItem",
|
||||||
|
table: "request",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "longtext",
|
||||||
|
oldNullable: true)
|
||||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "AspNetUsers",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: 1,
|
||||||
|
columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
|
||||||
|
values: new object[] { "853a1cf1-3482-47c4-b4b0-7b6a3af6696c", "AQAAAAIAAYagAAAAEBJPP1cHHZZyaGLaskNvSj8sOEizvDa1W2JgxMlYtK18+uhZWvW2RPlqBOhaKc0loQ==", "c911b03d-918a-482f-9c9e-773dc64cdd5d" });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "AspNetUsers",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: 2,
|
||||||
|
columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
|
||||||
|
values: new object[] { "9ccd914d-6310-4d4e-88c0-e842892e1831", "AQAAAAIAAYagAAAAELxkKuB4hcfQ7Pqe/XCRgygejUsY7X9ByQuS/3FMl50OSzmz9s0byWxGYWQXbyBpGA==", "5b9a67a3-8186-474b-9499-c9c40457fb54" });
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_request_assignStoreItem",
|
||||||
|
table: "request",
|
||||||
|
column: "assignStoreItem");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_request_fromStoreItem",
|
||||||
|
table: "request",
|
||||||
|
column: "fromStoreItem");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_request_Stores_assignStoreItem",
|
||||||
|
table: "request",
|
||||||
|
column: "assignStoreItem",
|
||||||
|
principalTable: "Stores",
|
||||||
|
principalColumn: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_request_Stores_fromStoreItem",
|
||||||
|
table: "request",
|
||||||
|
column: "fromStoreItem",
|
||||||
|
principalTable: "Stores",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_request_Stores_assignStoreItem",
|
||||||
|
table: "request");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_request_Stores_fromStoreItem",
|
||||||
|
table: "request");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_request_assignStoreItem",
|
||||||
|
table: "request");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_request_fromStoreItem",
|
||||||
|
table: "request");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "fromStoreItem",
|
||||||
|
table: "request",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldNullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "assignStoreItem",
|
||||||
|
table: "request",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldNullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "AspNetUsers",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: 1,
|
||||||
|
columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
|
||||||
|
values: new object[] { "407727d8-2266-45f2-9b48-ef3a450f09c6", "AQAAAAIAAYagAAAAEDc91vi8/AJwNGigDpnzFh7Iplvlph0VGj9GfG1zI6tY/jM/4f3P0CWVQZ/0oetzVg==", "2faceaca-f491-455a-9f10-3f641a5a7e0d" });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "AspNetUsers",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: 2,
|
||||||
|
columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
|
||||||
|
values: new object[] { "8065f043-f8ed-4733-aa42-6ee6a1ebb636", "AQAAAAIAAYagAAAAEOmfi3vsFMnCUitXZqLgUaq5+Jqmigy8HrXwNqd8IELW2yvFQAMrfHLvJM5h0c+lfQ==", "46a8accc-305f-42e6-a4a2-376bfec07e84" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -422,11 +422,11 @@ namespace PSTW_CentralSystem.Migrations
|
|||||||
b.Property<DateTime?>("approvalDate")
|
b.Property<DateTime?>("approvalDate")
|
||||||
.HasColumnType("datetime(6)");
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
b.Property<string>("assignStoreItem")
|
b.Property<int?>("assignStoreItem")
|
||||||
.HasColumnType("longtext");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<string>("fromStoreItem")
|
b.Property<int?>("fromStoreItem")
|
||||||
.HasColumnType("longtext");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<string>("remarkMasterInv")
|
b.Property<string>("remarkMasterInv")
|
||||||
.HasColumnType("longtext");
|
.HasColumnType("longtext");
|
||||||
@ -448,6 +448,10 @@ namespace PSTW_CentralSystem.Migrations
|
|||||||
|
|
||||||
b.HasIndex("UserId");
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.HasIndex("assignStoreItem");
|
||||||
|
|
||||||
|
b.HasIndex("fromStoreItem");
|
||||||
|
|
||||||
b.ToTable("request");
|
b.ToTable("request");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -760,16 +764,16 @@ namespace PSTW_CentralSystem.Migrations
|
|||||||
{
|
{
|
||||||
Id = 1,
|
Id = 1,
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "407727d8-2266-45f2-9b48-ef3a450f09c6",
|
ConcurrencyStamp = "853a1cf1-3482-47c4-b4b0-7b6a3af6696c",
|
||||||
Email = "admin@pstw.com.my",
|
Email = "admin@pstw.com.my",
|
||||||
EmailConfirmed = true,
|
EmailConfirmed = true,
|
||||||
FullName = "MAAdmin",
|
FullName = "MAAdmin",
|
||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "ADMIN@PSTW.COM.MY",
|
NormalizedEmail = "ADMIN@PSTW.COM.MY",
|
||||||
NormalizedUserName = "ADMIN@PSTW.COM.MY",
|
NormalizedUserName = "ADMIN@PSTW.COM.MY",
|
||||||
PasswordHash = "AQAAAAIAAYagAAAAEDc91vi8/AJwNGigDpnzFh7Iplvlph0VGj9GfG1zI6tY/jM/4f3P0CWVQZ/0oetzVg==",
|
PasswordHash = "AQAAAAIAAYagAAAAEBJPP1cHHZZyaGLaskNvSj8sOEizvDa1W2JgxMlYtK18+uhZWvW2RPlqBOhaKc0loQ==",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "2faceaca-f491-455a-9f10-3f641a5a7e0d",
|
SecurityStamp = "c911b03d-918a-482f-9c9e-773dc64cdd5d",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserInfoStatus = 1,
|
UserInfoStatus = 1,
|
||||||
UserName = "admin@pstw.com.my"
|
UserName = "admin@pstw.com.my"
|
||||||
@ -778,16 +782,16 @@ namespace PSTW_CentralSystem.Migrations
|
|||||||
{
|
{
|
||||||
Id = 2,
|
Id = 2,
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "8065f043-f8ed-4733-aa42-6ee6a1ebb636",
|
ConcurrencyStamp = "9ccd914d-6310-4d4e-88c0-e842892e1831",
|
||||||
Email = "sysadmin@pstw.com.my",
|
Email = "sysadmin@pstw.com.my",
|
||||||
EmailConfirmed = true,
|
EmailConfirmed = true,
|
||||||
FullName = "SysAdmin",
|
FullName = "SysAdmin",
|
||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "SYSADMIN@PSTW.COM.MY",
|
NormalizedEmail = "SYSADMIN@PSTW.COM.MY",
|
||||||
NormalizedUserName = "SYSADMIN@PSTW.COM.MY",
|
NormalizedUserName = "SYSADMIN@PSTW.COM.MY",
|
||||||
PasswordHash = "AQAAAAIAAYagAAAAEOmfi3vsFMnCUitXZqLgUaq5+Jqmigy8HrXwNqd8IELW2yvFQAMrfHLvJM5h0c+lfQ==",
|
PasswordHash = "AQAAAAIAAYagAAAAELxkKuB4hcfQ7Pqe/XCRgygejUsY7X9ByQuS/3FMl50OSzmz9s0byWxGYWQXbyBpGA==",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "46a8accc-305f-42e6-a4a2-376bfec07e84",
|
SecurityStamp = "5b9a67a3-8186-474b-9499-c9c40457fb54",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserInfoStatus = 1,
|
UserInfoStatus = 1,
|
||||||
UserName = "sysadmin@pstw.com.my"
|
UserName = "sysadmin@pstw.com.my"
|
||||||
@ -979,10 +983,22 @@ namespace PSTW_CentralSystem.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.StoreModel", "Stores")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("assignStoreItem");
|
||||||
|
|
||||||
|
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.StoreModel", "Store")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("fromStoreItem");
|
||||||
|
|
||||||
b.Navigation("Product");
|
b.Navigation("Product");
|
||||||
|
|
||||||
b.Navigation("Station");
|
b.Navigation("Station");
|
||||||
|
|
||||||
|
b.Navigation("Store");
|
||||||
|
|
||||||
|
b.Navigation("Stores");
|
||||||
|
|
||||||
b.Navigation("User");
|
b.Navigation("User");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user