using System;
using System.Collections.Generic;
using QMAPP.BLL;
using QMAPP.Entity;
using QMAPP.FJC.BLL.Dict;
using QMAPP.FJC.BLL.FIS;
using QMAPP.FJC.DAL.EquipMentAlarmManage;
using QMAPP.FJC.DAL.FIS;
using QMAPP.FJC.DAL.MesB9;
using QMAPP.FJC.DAL.ODS;
using QMAPP.FJC.Entity;
using QMAPP.FJC.Entity.FIS;
using QMAPP.FJC.Entity.MesB9;
using QMAPP.FJC.Entity.ODS;
using QMAPP.FJC.Entity.WarnManage;
using QMFrameWork.Data;
using QMFrameWork.Log;
namespace QMAPP.FJC.BLL.ODS
{
public class VideoInfoBLL : BaseBLL
{
#region 获取信息
///
/// 获取信息
///
/// 条件
/// 信息
public VideoInfo Get(VideoInfo model)
{
try
{
return new VideoInfoDAL().Get(model);
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "设备停机维护--获取停机信息"
});
throw ex;
}
}
#endregion
///
/// 获取列表
///
/// 条件
/// 全部数据
public List GetAllList()
{
try
{
return new VideoInfoDAL().GetAllList();
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo { ErrorInfo = ex, Tag = ex.StackTrace, Info = "获取视频播放表错误!" });
throw;
}
}
///
/// 报警信息获取列表
///
/// 条件
/// 数据页
/// 数据页
public DataResult GetDataPageList(VideoInfo condition, DataPage page)
{
DataResult result = new DataResult();
try
{
//获取信息列表
DataPage dataPage = new VideoInfoDAL().GetDataPageList(condition, page);
#region 转换工序类别显示类型
List list = dataPage.Result as List;
#endregion
result.IsSuccess = true;
result.Result = dataPage;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "视频播放异常!"
});
result.IsSuccess = false;
result.Ex = ex;
result.Msg = "视频播放异常!";
}
return result;
}
#region 更新信息
///
/// 更新信息
///
///
/// 更新行数
public DataResult Update(VideoInfo model)
{
DataResult result = new DataResult
{
IsSuccess = true,
Msg = Resource.MsgSuccess
};
try
{
result.Result = new VideoInfoDAL().Update(model);
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo { ErrorInfo = ex, Tag = ex.StackTrace, Info = "更新表异常!" });
result.IsSuccess = false;
result.Msg = Resource.SystemException;
}
return result;
}
#endregion
#region 插入信息
///
/// 插入信息(单表)
///
/// 信息
/// 插入行数
public DataResult Insert(VideoInfo model)
{
DataResult result = new DataResult();
try
{
//基本信息
model.PID = Guid.NewGuid().ToString();
model.CREATEUSER = this.LoginUser.UserID;
model.CREATEDATE = DateTime.Now;
model.UPDATEUSER = model.CREATEUSER;
model.UPDATEDATE = model.CREATEDATE;
//if (ExistsVideoType(model) == true)
//{
// result.IsSuccess = false;
// result.Msg = Resource.IsHaving;
// return result;
//}
result.Result = new VideoInfoDAL().Insert(model);
result.IsSuccess = true;
;
result.Msg = Resource.MsgSuccess;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "视频维护--插入视频信息"
});
result.IsSuccess = false;
result.Msg = Resource.SystemException;
}
return result;
}
#endregion
#region 删除
///
/// 删除信息
///
///
/// 删除个数
public DataResult Delete(string str)
{
DataResult result = new DataResult();
//string[] list = strs.Split(":".ToCharArray());
try
{
result.Result = this.Del(new VideoInfo { PID = str });
result.IsSuccess = true;
result.Msg = Resource.MsgSuccess;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "视频类型维护--删除视频类型信息"
});
result.IsSuccess = false;
result.Msg = Resource.SystemException;
}
return result;
}
///
/// 删除信息
///
/// 信息
/// 删除个数
public int Del(VideoInfo model)
{
int count = 0;
try
{
count = new VideoInfoDAL().Delete(model);
return count;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "视频类型维护--视频类型信息"
});
throw ex;
}
}
#endregion
}
}