78 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using System.Threading.Tasks;
 | |
| 
 | |
| namespace BLL
 | |
| {
 | |
|     public class Person_TestRunPerformanceService
 | |
|     {
 | |
|         /// <summary>
 | |
|         /// 获取人员信息
 | |
|         /// </summary>
 | |
|         /// <param name="TestRunPerformanceId">人员Id</param>
 | |
|         /// <returns>人员信息</returns>
 | |
|         public static Model.Person_TestRunPerformance GetPersonTestRunPerformanceById(string TestRunPerformanceId)
 | |
|         {
 | |
|             return Funs.DB.Person_TestRunPerformance.FirstOrDefault(e => e.TestRunPerformanceId == TestRunPerformanceId);
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 增加人员总结信息
 | |
|         /// </summary>
 | |
|         /// <param name="user">人员实体</param>
 | |
|         public static void AddPersonTestRunPerformance(Model.Person_TestRunPerformance TestRunPerformance)
 | |
|         {
 | |
|             Model.SGGLDB db = Funs.DB;
 | |
|             Model.Person_TestRunPerformance newTestRunPerformance = new Model.Person_TestRunPerformance
 | |
|             {
 | |
|                 TestRunPerformanceId = TestRunPerformance.TestRunPerformanceId,
 | |
|                 ProjectId = TestRunPerformance.ProjectId,
 | |
|                 UserId = TestRunPerformance.UserId,
 | |
|                 Months = TestRunPerformance.Months,
 | |
|                 JobContent = TestRunPerformance.JobContent,
 | |
|                 TestRunPerformanceStandardId = TestRunPerformance.TestRunPerformanceStandardId,
 | |
|                 Days = TestRunPerformance.Days,
 | |
|                 Num = TestRunPerformance.Num,
 | |
|             };
 | |
|             db.Person_TestRunPerformance.InsertOnSubmit(newTestRunPerformance);
 | |
|             db.SubmitChanges();
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 修改人员总结信息
 | |
|         /// </summary>
 | |
|         /// <param name="user">实体</param>
 | |
|         public static void UpdatePersonTestRunPerformance(Model.Person_TestRunPerformance TestRunPerformance)
 | |
|         {
 | |
|             Model.SGGLDB db = Funs.DB;
 | |
|             Model.Person_TestRunPerformance newTestRunPerformance = db.Person_TestRunPerformance.FirstOrDefault(e => e.TestRunPerformanceId == TestRunPerformance.TestRunPerformanceId);
 | |
|             if (newTestRunPerformance != null)
 | |
|             {
 | |
|                 newTestRunPerformance.Months = TestRunPerformance.Months;
 | |
|                 newTestRunPerformance.JobContent = TestRunPerformance.JobContent;
 | |
|                 newTestRunPerformance.TestRunPerformanceStandardId = TestRunPerformance.TestRunPerformanceStandardId;
 | |
|                 newTestRunPerformance.Days = TestRunPerformance.Days;
 | |
|                 newTestRunPerformance.Num = TestRunPerformance.Num;
 | |
|                 db.SubmitChanges();
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 根据人员Id删除一个人员信息
 | |
|         /// </summary>
 | |
|         /// <param name="Person_TestRunPerformanceId"></param>
 | |
|         public static void DeletePersonTestRunPerformance(string TestRunPerformanceId)
 | |
|         {
 | |
|             Model.SGGLDB db = Funs.DB;
 | |
|             Model.Person_TestRunPerformance user = db.Person_TestRunPerformance.FirstOrDefault(e => e.TestRunPerformanceId == TestRunPerformanceId);
 | |
|             if (user != null)
 | |
|             {
 | |
|                 db.Person_TestRunPerformance.DeleteOnSubmit(user);
 | |
|                 db.SubmitChanges();
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| }
 |