123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
-
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using QWPlatform.DataIntface;
- using QWPlatform.IService;
- using PMS.EntityModels.ComplaintManage;
- namespace PMS.DBService.ComplaintManage
- {
- public class Complaintfileservice : DataServiceBase
- {
- /// <summary>
- /// 重写数据工厂
- /// </summary>
- /// <param name="conName"></param>
- protected override void DBFctory(string conName)
- {
- base.DBFctory(conName);
- }
- /// <summary>
- /// 增加数据记录
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int Add(ComplaintFileModel model)
- {
- model.SetDataFactory(this.DataFactoryObject);
- return model.Insert();
- }
- /// <summary>
- /// 增加数据记录
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int Add(ComplaintFileModel model, ITransaction trans)
- {
- model.SetDataFactory(this.DataFactoryObject);
- if (trans == null)
- {
- return model.Insert();
- }
- else
- {
- return model.Insert(trans);
- }
- }
- /// <summary>
- /// 更新数据库记录
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int Update(ComplaintFileModel model)
- {
- model.SetDataFactory(this.DataFactoryObject);
- List<string> where = new List<string>();
- where.Add("ID");
- return model.Update(where, string.Empty);
- }
- /// <summary>
- /// 更新数据库记录
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int Update(ComplaintFileModel model, ITransaction trans)
- {
- model.SetDataFactory(this.DataFactoryObject);
- List<string> where = new List<string>();
- where.Add("ID");
- if (trans == null)
- {
- return model.Update(where, string.Empty);
- }
- else
- {
- return model.Update(trans, where, string.Empty);
- }
- }
- /// <summary>
- /// 删除数据记录
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int Delete(ComplaintFileModel model)
- {
- model.SetDataFactory(this.DataFactoryObject);
- return model.Delete("ID");
- }
- /// <summary>
- /// 删除数据记录
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int Delete(ComplaintFileModel model, ITransaction trans)
- {
- model.SetDataFactory(this.DataFactoryObject);
- if (trans == null)
- {
- return model.Delete("ID");
- }
- else
- {
- return model.Delete(trans, "ID");
- }
- }
- /// <summary>
- /// 查询数据对象并进行赋值
- /// </summary>
- /// <returns></returns>
- public ComplaintFileModel Select(ComplaintFileModel model)
- {
- model.SetDataFactory(this.DataFactoryObject);
- model.Select();
- return model;
- }
- /// <summary>
- /// 列表查询
- /// </summary>
- /// <returns></returns>
- public List<ComplaintFileModel> SelectList(ComplaintFileModel model)
- {
- model.SetDataFactory(this.DataFactoryObject);
- return model.SelectList<ComplaintFileModel>();
- }
- /// <summary>
- /// 调用存储过程
- /// </summary>
- /// <returns></returns>
- public void CallProcedure(ComplaintFileModel model)
- {
- this.ProcedureBuilder
- .Procedure("p_PT_项目投诉附件_INSERT")
- .Paramter("附件ID_IN", model.FJID)
- .Paramter("投诉ID_IN", model.TSID)
- .Paramter("类型_IN", model.LX)
- .Paramter("添加时间_IN", model.TJSJ)
- .Paramter("添加人_IN", model.TJR)
- .Paramter("附件路径_IN", model.FJLJ)
- .Execute();
- }
- }
- }
|