天津投入产出系统后端
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.

100 lines
2.6 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.Entity.Sys;
using QMAPP.DAL.Sys;
namespace QMAPP.BLL.Sys
{
/// <summary>
/// 桌面快捷方式逻辑层对象
/// 创建者:李炳海
/// 创建日期:2015.2.25
/// </summary>
public class DeskTopItemBLL:BaseBLL
{
#region 根据桌面布局信息
/// <summary>
/// 根据桌面布局信息
/// </summary>
/// <returns>桌面布局信息集合</returns>
public List<DeskTopItem> GetList()
{
return new DeskTopItemDAL().GetList(this.LoginUser.UserID);
}
#endregion
#region 添加
/// <summary>
/// 添加
/// </summary>
/// <param name="info">信息</param>
/// <returns>插入行数</returns>
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 交换序号
/// <summary>
/// 交换序号
/// </summary>
/// <param name="userID">用户主键</param>
/// <param name="id1">主键1</param>
/// <param name="id2">主键2</param>
public void ExchangeSort(string id1, string id2)
{
new DeskTopItemDAL().ExchangeSort(this.LoginUser.UserID, id1, id2);
}
#endregion
#region 删除
/// <summary>
/// 删除
/// </summary>
/// <param name="guid">主键</param>
/// <returns>删除个数</returns>
public int Delete(string id)
{
return new DeskTopItemDAL().Delete(this.LoginUser.UserID,id);
}
#endregion
}
}