39 lines
1009 B
C#
39 lines
1009 B
C#
|
|
using GZ_LTHPilot_ORDER.Config;
|
|||
|
|
using Kingdee.BOS;
|
|||
|
|
using Kingdee.BOS.ServiceHelper;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
|
|||
|
|
namespace GZ_LTHPilot_ORDER.Utils
|
|||
|
|
{
|
|||
|
|
public class ContextUtil
|
|||
|
|
{
|
|||
|
|
Context ctx { get; set; }
|
|||
|
|
|
|||
|
|
public ContextUtil(Context ctx)
|
|||
|
|
{
|
|||
|
|
this.ctx = ctx;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public Context GetDefaultContext()
|
|||
|
|
{
|
|||
|
|
var userName = ContextConfig.DefaultUserName;
|
|||
|
|
var userId = ContextConfig.DefaultUserId;
|
|||
|
|
return GetNewContext(userId, userName);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public Context GetNewContext(long userId, string userName)
|
|||
|
|
{
|
|||
|
|
Context newCtx = DataCenterService.GetDataCenterContextByID(ctx.DBId);
|
|||
|
|
newCtx.UserId = userId;
|
|||
|
|
newCtx.UserName = userName;
|
|||
|
|
newCtx.ServiceType = WebType.WebSite;
|
|||
|
|
newCtx.CurrentOrganizationInfo.ID = 1;
|
|||
|
|
return newCtx;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|