| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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.Collections.Generic;
- using System.Collections;
- using System.Data.SqlClient;
- using System.Data;
- namespace Procurement.Controllers
- {
- [Produces("application/json")]
- [Route("api/wms/[controller]")]
- public class LoginController : AbpController
- {
- private readonly ISqlRepository _repository;
- public LoginController(ISqlRepository sqlRepository)
- {
- _repository = sqlRepository;
- }
- [HttpPost]
- public async Task<IActionResult> Post([FromBody] LoginViewModel login)
- {
- ResultCode code = ResultCode.Success, subCode = ResultCode.Success;
- string subMsg = "";
- dynamic items = null;
- try
- {
- SqlParameter[] parameters = {
- new SqlParameter { ParameterName = "@Domain", Value = login.Domain,SqlDbType=SqlDbType.VarChar },
- new SqlParameter { ParameterName = "@UserNo", Value = login.UserName,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@Password", Value = login.Password,SqlDbType=SqlDbType.VarChar },
- new SqlParameter { ParameterName = "@App", Value = login.App,SqlDbType=SqlDbType.VarChar },
- };
- items = await _repository.GetListByProcAsync("pr_WMS_BPM_GetUserInfo", parameters);
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- }
- }
|