You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.3 KiB
76 lines
2.3 KiB
8 months ago
|
using QMAPP.BLL.Sys;
|
||
|
using QMAPP.DAL.Sys;
|
||
|
using QMAPP.Entity.Sys;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Data;
|
||
|
using System.Linq;
|
||
|
using System.Net;
|
||
|
using System.Net.Http;
|
||
|
using System.Web.Http;
|
||
|
using WebAPI.App_Start;
|
||
|
using WebAPI.Models;
|
||
|
|
||
|
namespace WebAPI.Controllers
|
||
|
{
|
||
|
public class PlanController : ApiController
|
||
|
{
|
||
|
public Response<LoginInfo> GetPaoMoList(string UserName, string PassWord)
|
||
|
{
|
||
|
var result = new Response<LoginInfo>();
|
||
|
|
||
|
LoginInfo login = new LoginInfo();
|
||
|
login.LoginUserID = UserName;
|
||
|
|
||
|
login.PassWord = QMFrameWork.Common.Encrypt.DESEncrypt.Encrypt(PassWord);
|
||
|
|
||
|
var sqlScript = $"select * from T_PP_ORDERPLAN_PAOMO where PLAN_DATE >='{DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd")} 00:00:00' and PLAN_DATE <= '{DateTime.Now.ToString("yyyy-MM-dd")} 00:00:00'";
|
||
|
|
||
|
DataSet dataSet = SqlHelper.ExecuteDataset(Config.maindbConnectionString, CommandType.Text, sqlScript);
|
||
|
|
||
|
if (dataSet.Tables[0].Rows.Count > 0)
|
||
|
{
|
||
|
login.UserName = dataSet.Tables[0].Rows[0]["USERNAME"].ToString();
|
||
|
result.Result = login;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
result.Code = 201;
|
||
|
result.Message = "用户信息不存在";
|
||
|
}
|
||
|
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
|
||
|
public Response<LoginInfo> Get(string UserName,string PassWord)
|
||
|
{
|
||
|
var result = new Response<LoginInfo>();
|
||
|
|
||
|
LoginInfo login = new LoginInfo();
|
||
|
login.LoginUserID = UserName;
|
||
|
|
||
|
login.PassWord = QMFrameWork.Common.Encrypt.DESEncrypt.Encrypt(PassWord);
|
||
|
|
||
|
var sqlScript = $"select * from T_QM_USER where LOGINUSERID ='{UserName}' and PASSWORD = '{login.PassWord}'";
|
||
|
|
||
|
DataSet dataSet = SqlHelper.ExecuteDataset(Config.maindbConnectionString, CommandType.Text, sqlScript);
|
||
|
|
||
|
if (dataSet.Tables[0].Rows.Count > 0)
|
||
|
{
|
||
|
login.UserName = dataSet.Tables[0].Rows[0]["USERNAME"].ToString();
|
||
|
result.Result = login;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
result.Code = 201;
|
||
|
result.Message = "用户信息不存在";
|
||
|
}
|
||
|
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|