| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using Procurement.Enums;
- using Microsoft.AspNetCore.Mvc;
- using System;
- using System.Threading.Tasks;
- using Volo.Abp.AspNetCore.Mvc;
- using Procurement.EntityFrameworkCore.SqlRepositories;
- using Procurement.ViewModel;
- using Procurement.Helpers;
- using System.Data.SqlClient;
- using System.Data;
- namespace Procurement.Controllers
- {
- [Produces("application/json")]
- [Route("api/[controller]")]
- public class ASNBOLShipperMasterController : AbpController
- {
- private readonly ISqlRepository _repository;
- public ASNBOLShipperMasterController(ISqlRepository sqlRepository)
- {
- _repository = sqlRepository;
- }
- /// <summary>
- /// µ¥ºÅÑ¡ÔñÁбí
- /// </summary>
- /// <param name="domain"></param>
- /// <returns></returns>
- [Route("nbrselectlist")]
- [HttpGet]
- public async Task<IActionResult> Get(string domain, string type, string userno)
- {
- ResultCode code = ResultCode.Success, subCode = ResultCode.Success;
- string subMsg = "";
- dynamic items = null;
- try
- {
- SqlParameter[] parameters = {
- new SqlParameter { ParameterName = "@Domain", Value = domain,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@Type", Value = type,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@UserNo", Value = userno,SqlDbType=SqlDbType.VarChar},
- };
- items = await _repository.GetSingleListByProcAsync("pr_WMS_GetASNBOLShipperList", parameters);
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- [Route("nbrdetails")]
- [HttpGet]
- public async Task<IActionResult> GetNbrDetails(string domain, string nbr, string type)
- {
- ResultCode code = ResultCode.Success, subCode = ResultCode.Success;
- string subMsg = "";
- dynamic items = null;
- try
- {
- SqlParameter[] parameters = {
- new SqlParameter { ParameterName = "@Domain", Value = domain,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@Nbr", Value = nbr,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@Type", Value = type,SqlDbType=SqlDbType.VarChar}
- };
- items = await _repository.GetListByProcAsync("pr_WMS_GetASNBOLShipperDetails", parameters);
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- }
- }
|