| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- /*******************************************************************************
- * 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
- {
- /// <summary>
- /// 服务返回实体控制
- /// </summary>
- public class ServiceResultEntityManager
- {
- /// <summary>
- /// 服务返回共通处理
- /// </summary>
- /// <param name="srEntity">服务返回实体</param>
- /// <param name="pageText">页面文本</param>
- 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);
- }
- }
- }
- }
|