using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.Entity.Sys;
using QMAPP.DAL.Sys;
namespace QMAPP.BLL.Sys
{
///
/// 桌面快捷方式逻辑层对象
/// 创建者:李炳海
/// 创建日期:2015.2.25
///
public class DeskTopItemBLL:BaseBLL
{
#region 根据桌面布局信息
///
/// 根据桌面布局信息
///
/// 桌面布局信息集合
public List GetList()
{
return new DeskTopItemDAL().GetList(this.LoginUser.UserID);
}
#endregion
#region 添加
///
/// 添加
///
/// 信息
/// 插入行数
public int Inserts(string list)
{
int sort = 0;
string[] items = list.Split(":".ToCharArray());
DeskTopItemDAL itemDal = new DeskTopItemDAL();
int count = 0;
try
{
sort = itemDal.GetMaxSort(this.LoginUser.UserID);
foreach (string item in items)
{
sort += 1;
DeskTopItem deskItem = new DeskTopItem();
deskItem.PID = Guid.NewGuid().ToString();
deskItem.USERID = this.LoginUser.UserID;
deskItem.MENUID = item;
deskItem.SORT = sort;
deskItem.CREATEUSER = this.LoginUser.UserID;
deskItem.UPDATEUSER = this.LoginUser.UserID;
count += itemDal.Insert(deskItem);
}
return count;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 交换序号
///
/// 交换序号
///
/// 用户主键
/// 主键1
/// 主键2
public void ExchangeSort(string id1, string id2)
{
new DeskTopItemDAL().ExchangeSort(this.LoginUser.UserID, id1, id2);
}
#endregion
#region 删除
///
/// 删除
///
/// 主键
/// 删除个数
public int Delete(string id)
{
return new DeskTopItemDAL().Delete(this.LoginUser.UserID,id);
}
#endregion
}
}