/*******************************************************************************
* Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
* 类的信息:
* 1.程序名称:DKIBOSSPRDService.cs
* 2.功能描述:系统登录模块服务。
* 编辑履历:
* 作者 日期 版本 修改内容
* 陈晓野 2014/09/16 1.00 新建
*******************************************************************************/
using System;
using System.Data;
using System.Diagnostics;
using System.Reflection;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Dongke.IBOSS.PRD.Basics.Library;
using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
using Dongke.IBOSS.PRD.WCF.Contracts;
using Dongke.IBOSS.PRD.WCF.DataModels;
namespace Dongke.IBOSS.PRD.WCF.Services
{
///
/// 系统登录模块服务
///
// 服务实现类,继承服务声明接口
// 该标签声明该服务可以在ASP.NET下运行
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(ConfigurationName = "DKIBOSSPRDService",
InstanceContextMode = InstanceContextMode.PerCall,
ConcurrencyMode = ConcurrencyMode.Multiple,
UseSynchronizationContext = false)]
public class DKIBOSSPRDService : ServicesBase, IDKIBOSSPRD
{
#region 构造函数
///
/// 构造函数
///
public DKIBOSSPRDService()
: base()
{
}
#endregion
#region 服务连接测试
///
/// 服务连接测试
///
///
public bool GetServiceState()
{
return true;
}
#endregion
#region 系统登录、退出
///
/// 系统登录
///
/// 系统登录请求
/// 系统登录结果
public LoginResultEntity DoLogin(LoginRequestEntity requestEntity)
{
LoginResultEntity result = ServiceInvoker.Invoke(this,
() => DKIBOSSPRDLogic.DoLogin(requestEntity, "0"));
result.CurrentUserEntity.Remarks = INIUtility.Instance(INIUtility.IniFile.Config).ReadIniData("WCFSetting", "ServerName");
return result;
}
///
/// 系统登录
///
/// 系统登录请求
/// 系统登录结果
public LoginResultEntity DoLoginRefresh(LoginRequestEntity requestEntity)
{
LoginResultEntity result = ServiceInvoker.Invoke(this,
() => DKIBOSSPRDLogic.DoLoginRefresh(requestEntity, "3"));
return result;
}
///
/// 系统登出
///
///
///
public void Logout(int userID)
{
bool result = ServiceInvoker.Invoke(this,
() => DKIBOSSPRDLogic.Logout(userID, "1", this.SUserInfo));
}
#endregion
#region 客户端升级
///
/// 客户端升级判断
///
/// 客户端版本号
/// 客户端是否需要更新信息
public NeedUpgradeResultEntity IsNeedUpgrade(string version)
{
FileVersionInfo info = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string dllVersion = info.FileVersion;
NeedUpgradeResultEntity result = ServiceInvoker.Invoke(this,
() => DKIBOSSPRDLogic.IsNeedUpgrade(version, dllVersion));
return result;
}
///
/// 下载更新程序
///
/// 更新程序
public byte[] DownloadUpgradeFile(string flag)
{
byte[] result = ServiceInvoker.Invoke(this,
() => DKIBOSSPRDLogic.DownloadUpgradeFile(flag));
return result;
}
#endregion
}
}