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

238 lines
7.0 KiB

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 获取信息
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
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
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <returns>全部数据</returns>
public List<VideoInfo> GetAllList()
{
try
{
return new VideoInfoDAL().GetAllList();
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo { ErrorInfo = ex, Tag = ex.StackTrace, Info = "获取视频播放表错误!" });
throw;
}
}
/// <summary>
/// 报警信息获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetDataPageList(VideoInfo condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
//获取信息列表
DataPage dataPage = new VideoInfoDAL().GetDataPageList(condition, page);
#region 转换工序类别显示类型
List<VideoInfo> list = dataPage.Result as List<VideoInfo>;
#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 更新信息
/// <summary>
/// 更新信息
/// </summary>
/// <param name="model"></param>
/// <returns>更新行数</returns>
public DataResult<int> Update(VideoInfo model)
{
DataResult<int> result = new DataResult<int>
{
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 插入信息
/// <summary>
/// 插入信息(单表)
/// </summary>
/// <param name="">信息</param>
/// <returns>插入行数</returns>
public DataResult<int> Insert(VideoInfo model)
{
DataResult<int> result = new DataResult<int>();
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 删除
/// <summary>
/// 删除信息
/// </summary>
/// <param name=""></param>
/// <returns>删除个数</returns>
public DataResult<int> Delete(string str)
{
DataResult<int> result = new DataResult<int>();
//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;
}
/// <summary>
/// 删除信息
/// </summary>
/// <param name="">信息</param>
/// <returns>删除个数</returns>
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
}
}