天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

173 lines
4.3 KiB

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.Entity.Sys;
using QMFrameWork.Data;
using QMAPP.DAL.Sys;
namespace QMAPP.BLL.Sys
{
/// <summary>
/// 系统锁定逻辑层对象
/// 创建者:韩磊
/// 创建日期:2014.12.17
/// </summary>
public class SystemLockBLL:BaseBLL
{
#region 获取系统锁定列表
/// <summary>
/// 获取系统锁定列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataPage GetList(SystemLockInfo condition, DataPage page)
{
try
{
return new SystemLockDAL().GetList(condition, page);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 系统锁定信息编辑
/// <summary>
/// 获取锁定信息
/// </summary>
/// <param name="lockInfo">条件</param>
/// <returns>锁定信息</returns>
public SystemLockInfo Get(SystemLockInfo lockInfo)
{
try
{
return new SystemLockDAL().Get(lockInfo);
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 插入系统锁定信息
/// </summary>
/// <param name="lockInfo">锁定信息</param>
/// <returns>插入数</returns>
public int Insert(SystemLockInfo lockInfo)
{
try
{
lockInfo.PID = Guid.NewGuid().ToString();
lockInfo.CreateUser = this.LoginUser.UserID;
lockInfo.UpdateUser = this.LoginUser.UserID;
return new SystemLockDAL().Insert(lockInfo);
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 更新系统锁定
/// </summary>
/// <param name="lockInfo">锁定信息</param>
/// <returns>更新个数</returns>
public int Update(SystemLockInfo lockInfo)
{
try
{
lockInfo.UpdateUser = this.LoginUser.UserID;
return new SystemLockDAL().Update(lockInfo);
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 删除系统锁定信息
/// </summary>
/// <param name="lockInfo">公告信息</param>
/// <returns>删除个数</returns>
public int DeleteAll(ArrayList lockInfos)
{
int count = 0;
try
{
foreach (string lockInfo in lockInfos)
{
count += this.Delete(new SystemLockInfo { PID = lockInfo });
}
return count;
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 删除锁定信息
/// </summary>
/// <param name="user">公告信息</param>
/// <returns>删除个数</returns>
public int Delete(SystemLockInfo lockInfo)
{
try
{
return new SystemLockDAL().Delete(lockInfo);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 解除锁定
/// <summary>
/// 解除锁定
/// </summary>
/// <param name="lockInfo"></param>
public void UnLock(SystemLockInfo lockInfo)
{
try
{
new SystemLockDAL().UnLock(lockInfo);
}
catch (Exception ex)
{
throw;
}
}
#endregion
#region 判断时候有生效锁定
/// <summary>
/// 判断时候有生效锁定
/// </summary>
/// <returns>true:具有有效锁定;false:不具有有效锁定</returns>
public bool IsHaveValidLock()
{
return new SystemLockDAL().IsHaveValidLock();
}
#endregion
}
}