52 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			52 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using Model.CQMS;
							 | 
						|||
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Text;
							 | 
						|||
| 
								 | 
							
								using System.Threading.Tasks;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace BLL.API.CQMS
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public class BreakdownProjectService
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        public static List<BreakdownProject> getBreakdowns(string projectId, string keyWord)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            List<BreakdownProject> res = new List<BreakdownProject>();
							 | 
						|||
| 
								 | 
							
								            using (var db = new Model.SGGLDB(Funs.ConnString))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                var q = from x in db.View_WBS_BreakdownProject
							 | 
						|||
| 
								 | 
							
								                        where x.ProjectId == projectId && x.IsSelected == true
							 | 
						|||
| 
								 | 
							
								                        where keyWord == "" || x.BreakdownName.Contains(keyWord)
							 | 
						|||
| 
								 | 
							
								                        select x;
							 | 
						|||
| 
								 | 
							
								                var list = q.ToList();
							 | 
						|||
| 
								 | 
							
								                foreach (var item in list)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    BreakdownProject breakdownProject = new BreakdownProject();
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.AttachUrl = item.AttachUrl;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.BreakdownProjectId = item.BreakdownProjectId;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.ProjectId = item.ProjectId;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.BreakdownCode = item.BreakdownCode;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.BreakdownName = item.BreakdownName;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.DivisionProjectId = item.DivisionProjectId;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.Basis = item.Basis;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.CheckPoints = item.CheckPoints;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.RecordAndCode = item.RecordAndCode;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.Class = item.Class;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.SortIndex = item.SortIndex.HasValue ? item.SortIndex.Value.ToString() : "";
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.Remark = item.Remark;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.AttachUrl = item.AttachUrl;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.IsAcceptance = item.IsAcceptance.HasValue ? item.IsAcceptance.Value.ToString() : "";
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.FenBao = item.FenBao;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.WuHuan = item.WuHuan;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.JianLi = item.JianLi;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.YeZhu = item.YeZhu;
							 | 
						|||
| 
								 | 
							
								                    breakdownProject.IsSelected = item.IsSelected.HasValue ? "" : "";
							 | 
						|||
| 
								 | 
							
								                    res.Add(breakdownProject);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            return res;
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |