⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inboxsystem.cs

📁 手机串口编程 手机串口编程 手机串口编程
💻 CS
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -