/******************************************************************************* * Copyright(c) 2014 dongke All rights reserved. / Confidential * 类的信息: * 1.程序名称:ServiceResultEntityManager.cs * 2.功能描述:服务返回实体控制 * 编辑履历: * 作者 日期 版本 修改内容 * 庄天威 2014/12/4 1.00 新建 *******************************************************************************/ using System; using System.Data; using System.ServiceModel; using System.Windows.Forms; using Dongke.IBOSS.PRD.Basics.BaseResources; using Dongke.IBOSS.PRD.Basics.Library; using Dongke.IBOSS.PRD.WCF.DataModels; using Dongke.IBOSS.PRD.WCF.Proxys.TATModuleService; namespace Dongke.IBOSS.PRD.Client.CommonModule { /// /// 服务返回实体控制 /// public class ServiceResultEntityManager { /// /// 服务返回共通处理 /// /// 服务返回实体 /// 页面文本 public static void HandleServiceResultEntity(ServiceResultEntity srEntity, String pageText) { //如果有提示信息的话 //根据返回值的不同状态设置不同的消息框图标 if (srEntity.Message != null && srEntity.Message != "") { MessageBoxIcon boxIcon; switch (srEntity.Status) { case Constant.ServiceResultStatus.Success: boxIcon = MessageBoxIcon.Information; break; case Constant.ServiceResultStatus.ValidationFailed: boxIcon = MessageBoxIcon.Warning; break; case Constant.ServiceResultStatus.UserNotLogin: boxIcon = MessageBoxIcon.Warning; break; case Constant.ServiceResultStatus.UserOtherLogin: boxIcon = MessageBoxIcon.Warning; break; case Constant.ServiceResultStatus.AccountDateError: boxIcon = MessageBoxIcon.Warning; break; case Constant.ServiceResultStatus.NoFunRight: boxIcon = MessageBoxIcon.Warning; break; case Constant.ServiceResultStatus.NoModifyData: boxIcon = MessageBoxIcon.Warning; break; case Constant.ServiceResultStatus.DataChanged: boxIcon = MessageBoxIcon.Warning; break; case Constant.ServiceResultStatus.DataDuplicated: boxIcon = MessageBoxIcon.Warning; break; case Constant.ServiceResultStatus.NoLicensesRight: boxIcon = MessageBoxIcon.Warning; break; case Constant.ServiceResultStatus.SystemError: boxIcon = MessageBoxIcon.Error; break; default: boxIcon = MessageBoxIcon.Information; break; } MessageBox.Show(srEntity.Message, pageText, MessageBoxButtons.OK, boxIcon); } } } }