mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-10-03 19:03:22 +00:00
fix
This commit is contained in:
parent
9a23c41b21
commit
2e9716fe34
1 changed files with 14 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Data.SqlClient;
|
using Microsoft.Data.SqlClient;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.VisualBasic;
|
||||||
using SendGrid.Helpers.Mail;
|
using SendGrid.Helpers.Mail;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
|
|
@ -33,7 +34,7 @@ namespace Api.SeaHavenIndustries.Controllers
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("AddWorkorder")]
|
[Route("AddWorkorder")]
|
||||||
public async Task<IActionResult> Addworkorder([FromForm] Workorder_DTO model)
|
public async Task<IActionResult> Addworkorder([FromBody] Workorder_DTO model)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -174,7 +175,7 @@ namespace Api.SeaHavenIndustries.Controllers
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("EditWorkorder")]
|
[Route("EditWorkorder")]
|
||||||
public async Task<IActionResult> Editworkorder([FromForm] EditWorkorder_DTO model)
|
public async Task<IActionResult> Editworkorder([FromBody] EditWorkorder_DTO model)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -347,10 +348,15 @@ namespace Api.SeaHavenIndustries.Controllers
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpDelete]
|
||||||
[Route("DeleteWorkorder")]
|
[Route("DeleteWorkorder")]
|
||||||
public IActionResult Deleteworkorder(int id)
|
public IActionResult Deleteworkorder([FromBody] EditWorkorder_DTO model)
|
||||||
{
|
{
|
||||||
|
int id = model.Id.HasValue ? model.Id.Value : 0;
|
||||||
|
if (id == 0)
|
||||||
|
{
|
||||||
|
return BadRequest("Id is required");
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var exist = _db.workOrders.Where(w => w.Id == id).FirstOrDefault();
|
var exist = _db.workOrders.Where(w => w.Id == id).FirstOrDefault();
|
||||||
|
|
@ -802,6 +808,10 @@ namespace Api.SeaHavenIndustries.Controllers
|
||||||
public string? Priority { get; set; }
|
public string? Priority { get; set; }
|
||||||
public string? Status { get; set; }
|
public string? Status { get; set; }
|
||||||
public DateTime? DueDate { get; set; }
|
public DateTime? DueDate { get; set; }
|
||||||
|
public string FormattedDueDate
|
||||||
|
{
|
||||||
|
get { return DueDate.HasValue? DueDate.Value.ToString("MM/dd/yyyy"): ""; }
|
||||||
|
}
|
||||||
public string? Dispatcher { get; set; }
|
public string? Dispatcher { get; set; }
|
||||||
public string? Scheduler { get; set; }
|
public string? Scheduler { get; set; }
|
||||||
public string? PO { get; set; }
|
public string? PO { get; set; }
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue