inboxsystem.cs

来自「手机串口编程 手机串口编程 手机串口编程」· CS 代码 · 共 96 行

CS
96
字号
using System;

namespace JB.GraduateDesign.ESM.Business
{
	using JB.GraduateDesign.ESM.Entity;
	using JB.GraduateDesign.ESM.DataAccess;

	/// <summary>
	/// InBoxSystem 的摘要说明。
	/// </summary>
	public class InBoxSystem
	{
		public InBoxSystem()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}

		public bool DeleteInBoxMessage ( int[] inBoxIds )
		{
			if ( inBoxIds.Length == 0 )
			{
				throw new ApplicationException ( "缺少ID。" );
			}
			for ( int i = 0; i < inBoxIds.Length; i ++ )
			{
				if ( inBoxIds[i] <= 0 )
				{
					throw new ApplicationException ( "输入的ID号不正确。" );
				}
			}
			InBoxes inBoxes = new InBoxes();
			try
			{
				inBoxes.DeleteInBox ( inBoxIds );
			}
			catch ( Exception e )
			{
				throw e;
			}	
			return true;
		}

		public bool MarkUnsealed ( int inBoxId )
		{
			if ( inBoxId <= 0 )
			{
				throw new ApplicationException ( "ID号错误。" );
			}
			
			InBoxes inBoxes = new InBoxes();
			try
			{
				return inBoxes.UpdateInBoxStatus ( inBoxId, 2 );
			}
			catch ( Exception e )
			{
				throw e;
			}
		}

		public InBoxData GetAllMessage ( int receiveUserId )
		{
			InBoxes inBoxes = new InBoxes();
			try
			{
				return inBoxes.SelectInBox ( receiveUserId, 0 );
			}
			catch ( Exception e )
			{
				throw e;
			}
		}	
		
		public InBoxData GetUnReadMessage ( int receiveUserId )
		{
			return GetMessage ( receiveUserId, 1 );
		}

		public InBoxData GetMessage ( int receiveUserId, int status )
		{
			InBoxes inBoxes = new InBoxes();
			try
			{
				return inBoxes.SelectInBox ( receiveUserId, status );
			}
			catch ( Exception e )
			{
				throw e;
			}
		}

	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?