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.Text.Json; using System.Data.SqlClient; using System.Data; namespace Procurement.Controllers { [Produces("application/json")] [Route("api/wms/[controller]")] public class MobileTaskController : AbpController { private readonly ISqlRepository _repository; public MobileTaskController(ISqlRepository sqlRepository) { _repository = sqlRepository; } [HttpGet] public async Task Get(string typeid = "Wms", string userno = "", int page = 0) { ResultCode code = ResultCode.Success, subCode = ResultCode.Success; string subMsg = ""; dynamic items = null; try { SqlParameter[] parameters = { new SqlParameter { ParameterName = "@TypeID", Value = typeid,SqlDbType=SqlDbType.VarChar}, new SqlParameter { ParameterName = "@UserNo", Value = userno,SqlDbType=SqlDbType.VarChar}, new SqlParameter { ParameterName = "@Page", Value = page,SqlDbType=SqlDbType.Int}, }; items = await _repository.GetListByProcAsync("pr_WMS_BPM_GetMobileTaskList", parameters); } catch (Exception ex) { subMsg = ex.Message; code = ResultCode.Fail; subCode = ResultCode.Fail; } ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg); return Ok(result); } } }