76 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			76 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using System.Threading.Tasks;
 | |
| 
 | |
| namespace BLL
 | |
| {
 | |
|     public static class GJSXProcessService
 | |
|     {
 | |
|         public static Model.SGGLDB db = Funs.DB;
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 添加
 | |
|         /// </summary>
 | |
|         /// <param name="process"></param>
 | |
|         public static void AddProcess(Model.GJSX_Process process)
 | |
|         {
 | |
|             Model.SGGLDB db = Funs.DB;
 | |
|             Model.GJSX_Process newProcess = new Model.GJSX_Process();
 | |
|             string newKeyID = SQLHelper.GetNewID(typeof(Model.GJSX_Process));
 | |
|             newProcess.ProcessID = newKeyID;
 | |
|             newProcess.UserId = process.UserId;
 | |
|             newProcess.GJSXID = process.GJSXID;
 | |
| 
 | |
|             db.GJSX_Process.InsertOnSubmit(newProcess);
 | |
|             db.SubmitChanges();
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 删除
 | |
|         /// </summary>
 | |
|         /// <param name="GJSXID"></param>
 | |
|         public static void DeleteProcess(string GJSXID)
 | |
|         {
 | |
|             Model.SGGLDB db = Funs.DB;
 | |
|             var q = (from x in db.GJSX_Process where x.GJSXID == GJSXID select x).ToList();
 | |
|             if (q != null)
 | |
|             {
 | |
|                 db.GJSX_Process.DeleteAllOnSubmit(q);
 | |
|                 db.SubmitChanges();
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 根据事项进展操作人获取事项进展信息
 | |
|         /// </summary>
 | |
|         /// <param name="userId"></param>
 | |
|         /// <returns></returns>
 | |
|         public static int GetGJSXProcessByUserId(string userId)
 | |
|         {
 | |
|             return (from x in Funs.DB.GJSX_Process where x.UserId == userId select x).Count();
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 根据事项进展操作人获取事项进展信息
 | |
|         /// </summary>
 | |
|         /// <param name="userId"></param>
 | |
|         /// <returns></returns>
 | |
|         public static int GetGJSXProcessByGJSXIDAndUserId(string GJSXID, string userId)
 | |
|         {
 | |
|             return (from x in Funs.DB.GJSX_Process where x.GJSXID == GJSXID && x.UserId == userId select x).Count();
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 根据编号获取下一接收人信息
 | |
|         /// </summary>
 | |
|         /// <param name="GJSXID"></param>
 | |
|         /// <returns></returns>
 | |
|         public static List<string> GetProcessListByGJSXID(string GJSXID)
 | |
|         {
 | |
|             return (from x in Funs.DB.GJSX_Process where x.GJSXID == GJSXID select x.UserId).Distinct().ToList();
 | |
|         }
 | |
|     }
 | |
| }
 |