身份验证
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Base\SupplierDAL.cs" />
|
||||
<Compile Include="Account\Accinformation.cs" />
|
||||
<Compile Include="System\User.cs" />
|
||||
<Compile Include="U8LoginContext.cs" />
|
||||
<Compile Include="Base\UnitDAL.cs" />
|
||||
<Compile Include="Base\WarehouseDAL.cs" />
|
||||
@@ -128,5 +129,6 @@
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -307,13 +307,17 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
|
||||
{
|
||||
where.Add(" mmm.mocode in @moCodes");
|
||||
}
|
||||
if (info.InvCodes!= null )
|
||||
if (info.InvCodes != null)
|
||||
{
|
||||
where.Add(" mmm.InvCode in @invcode");
|
||||
}
|
||||
if (info.InvCodes1!= null )
|
||||
{
|
||||
where.Add(" mmm.invcode1 in @invcode1");
|
||||
}
|
||||
if (!info.byFinish)
|
||||
if (info.byFinish != null)
|
||||
{
|
||||
where.Add(" mmm.Status <> 4");
|
||||
where.Add(" mmm.Status in @byFinish");
|
||||
}
|
||||
if (!info.byiss)
|
||||
{
|
||||
@@ -333,7 +337,7 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
|
||||
|
||||
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
|
||||
{
|
||||
return conn.Query<NX.ERP.Model.PmcInventorymomRes>(sql, new { moCodes = info.moCodes, invcode1=info.InvCodes });
|
||||
return conn.Query<NX.ERP.Model.PmcInventorymomRes>(sql, new { moCodes = info.moCodes, invcode = info.InvCodes, invcode1=info.InvCodes1, info.byFinish });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
46
NX.ERP.U8/System/User.cs
Normal file
46
NX.ERP.U8/System/User.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Dapper;
|
||||
|
||||
|
||||
namespace NX.ERP.U8.User
|
||||
|
||||
{
|
||||
public class User
|
||||
{
|
||||
|
||||
|
||||
|
||||
public string Userrole(string Opnanme, string Pasd)
|
||||
{
|
||||
var AccID = ConfigurationManager.AppSettings["AccId"];
|
||||
//NX.ERP.U8.U8LoginContext.Instance.PassWord = System.Configuration.ConfigurationManager.AppSettings["Password"];
|
||||
|
||||
//NX.ERP.U8.U8LoginContext.Instance.UserId = System.Configuration.ConfigurationManager.AppSettings["UserId"];
|
||||
|
||||
var Server = ConfigurationManager.AppSettings["Server"];
|
||||
var _login = new NX.ERP.U8.U8LoginContext(Server, AccID);
|
||||
_login.Login(Opnanme, Pasd);
|
||||
|
||||
var sql = $@" SELECT 1 from UFSystem..UA_Role where cUser_Id=@Opnanme and cGroup_Id='report' ;";
|
||||
|
||||
|
||||
|
||||
using (var conn =_login.Connection)
|
||||
{
|
||||
return conn.ExecuteScalar<string>(sql, new {Opnanme},null,30,System.Data.CommandType.Text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user