using System; using System.Collections.Generic; using System.Data; using QMAPP.BLL; using QMAPP.Entity; using QMAPP.FJC.BLL.Dict; using QMAPP.FJC.DAL.FileCopy; using QMAPP.FJC.Entity.FeedInManage; using QMAPP.FJC.Entity.FileCopy; using QMFrameWork.Data; using QMFrameWork.Log; namespace QMAPP.FJC.BLL.FileCopy { /// /// 模块编号: /// 作 用: /// 作 者:王庆男 /// 编写日期:2015年09月08日 /// public class FileCopyRecordBLL : BaseBLL { #region 获取信息 /// /// 获取信息 /// /// 条件 /// 信息 public FileCopyRecord Get(FileCopyRecord model) { try { return new FileCopyRecordDAL().Get(model); } catch (Exception ex) { throw ex; } } #endregion #region 获取列表 /// /// 获取列表 /// /// 条件 /// 数据页 /// 数据页 public DataPage GetList(FileCopyRecord condition, DataPage page) { try { return new FileCopyRecordDAL().GetList(condition, page); } catch (Exception ex) { throw ex; } } /// /// 获取列表 /// /// 条件 /// 数据页 /// 数据页 public List GetAllList(FileCopyRecord condition) { try { return new FileCopyRecordDAL().GetList(condition); } catch (Exception ex) { throw ex; } } #endregion #region 信息是否重复 /// /// 判断名称是否存在 /// /// /// true:已存在;fasel:不存在。 public bool ExistsFileCopyRecord(FileCopyRecord model) { try { return new FileCopyRecordDAL().ExistsT_AW_FILE_COPY_RECORD(model); } catch (Exception ex) { throw ex; } } #endregion #region 插入信息 /// /// 插入信息(单表) /// /// 信息 /// 插入行数 public int Insert(FileCopyRecord model) { try { //基本信息 //model.RECORD_KEY = Guid.NewGuid().ToString(); //model.RECORD_COPY_DATETIME = DateTime.Now; FileCopyRecordDAL cmdDAL = new FileCopyRecordDAL(); if (ExistsFileCopyRecord(model) == true) return -1; return new FileCopyRecordDAL().Insert(model); } catch (Exception ex) { throw ex; } } #endregion #region 更新信息 /// /// 更新信息 /// /// /// 更新行数 public int Update(FileCopyRecord model) { try { //if (ExistsFileCopyRecord(Model) == true) //return -1; //基本信息 return new FileCopyRecordDAL().Update(model); } catch (Exception ex) { throw ex; } } /// /// 更新信息 /// /// /// 更新行数 public int UpdateForTime(string EQUIPMENT_INFO_KEY, string RECORD_FILENAME, string FILE_HOSTNAME, string FILE_EXPLANTTIME) { try { //if (ExistsFileCopyRecord(Model) == true) //return -1; //基本信息 return new FileCopyRecordDAL().Update(EQUIPMENT_INFO_KEY, RECORD_FILENAME, FILE_HOSTNAME, FILE_EXPLANTTIME); } catch (Exception ex) { throw ex; } } #endregion #region 删除 /// /// 删除信息 /// /// /// 删除个数 public int Delete(string strs) { int count = 0; string[] list = strs.Split(":".ToCharArray()); try { foreach (string str in list) { count += this.DeleteFileCopyRecord(new FileCopyRecord { RECORD_KEY = str }); } return count; } catch (Exception ex) { throw ex; } } /// /// 删除信息 /// /// 信息 /// 删除个数 public int DeleteFileCopyRecord(FileCopyRecord model) { int count = 0; try { count = new FileCopyRecordDAL().Delete(model); return count; } catch (Exception ex) { throw ex; } } #endregion /// /// 获取条码 /// /// /// 获取条码 public string GetBarcode(string tempbarcode) { return new FileCopyRecordDAL().GetBarcode(tempbarcode); } public FileCopyRecord GetLastRecord(string equipmentCode) { return new FileCopyRecordDAL().GetLastRecord(equipmentCode); } } }