| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- 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 PurOrdRctMasterController : AbpController
- {
- private readonly ISqlRepository _repository;
- public PurOrdRctMasterController(ISqlRepository sqlRepository)
- {
- _repository = sqlRepository;
- }
- /// <summary>
- /// µ¥ºÅÑ¡ÔñÁбí
- /// </summary>
- /// <param name="domain"></param>
- /// <returns></returns>
- [Route("receiverselectlist")]
- [HttpGet]
- public async Task<IActionResult> Get(string domain, 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 = "@Type", Value = type,SqlDbType=SqlDbType.VarChar}
- };
- items = await _repository.GetSingleListByProcAsync("pr_WMS_GetPurOrdRctList", 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("purordrctdetails")]
- [HttpGet]
- public async Task<IActionResult> GetPurOrdRctDetails(string domain, string receiver, 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 = "@Receiver", Value = receiver,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@Type", Value = type,SqlDbType=SqlDbType.VarChar}
- };
- items = await _repository.GetListByProcAsync("pr_WMS_GetPurOrdRctDetails", parameters);
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- }
- }
|