public static List<stakeholder> GetStakeholderFullName() { var stakeholderList = new List<stakeholder>(); using (var db = new PMEntities()) { (from p in db.stakeholders orderby p.stakeholder_id select new { Id = p.stakeholder_id, Name = p.stakeholder_full_name }).ToList() .ForEach(f => stakeholderList.Add(new stakeholder { stakeholder_id = f.Id, stakeholder_full_name = f.Name })); //if (stakeholderList.Any() == true) //{ // stakeholderList.Insert(0, new stakeholder()); //} } return stakeholderList; }
public static List<proj_type> GetProjectTypeList() { var projectTypeList = new List<proj_type>(); using (var db = new PMEntities()) { (from p in db.proj_type orderby p.project_type_id ascending select new { Id = p.project_type_id, Name = p.project_type_name }).ToList() .ForEach(f => projectTypeList.Add(new proj_type { project_type_id = f.Id, project_type_name = f.Name })); } return projectTypeList; }
public static List<proj_status> GetStatusList() { var statusList = new List<proj_status>(); using (var db = new PMEntities()) { (from p in db.proj_status orderby p.proj_status_id ascending select new { Id = p.proj_status_id, Name = p.proj_status_desc }).ToList() .ForEach(f => statusList.Add(new proj_status { proj_status_id = f.Id, proj_status_desc = f.Name })); } return statusList; }
public static List<proj_sponsor> GetSponsorFullName() { var projSponsorList = new List<proj_sponsor>(); using (var db = new PMEntities()) { (from p in db.proj_sponsor orderby p.proj_sponsor_id ascending select new { Id = p.proj_sponsor_id, Name = p.full_name }).ToList() .ForEach(f => projSponsorList.Add(new proj_sponsor { proj_sponsor_id = f.Id, full_name = f.Name })); projSponsorList.Insert(0, new proj_sponsor { proj_sponsor_id = 0, full_name = "+Add New Sponsor" }); } return projSponsorList; }
public static List<proj_log_code> GetProjectLogCodeDescription() { var projcodedescList = new List<proj_log_code>(); using (var db = new PMEntities()) { (from p in db.proj_log_code orderby p.proj_log_code_id ascending where p.is_auto == false select new { Id = p.proj_log_code_id, Name = p.proj_log_code_desc }).ToList() .ForEach(f => projcodedescList.Add(new proj_log_code { proj_log_code_id = f.Id, proj_log_code_desc = f.Name })); } return projcodedescList; }
public static List<dept> GetDeptList() { var deptList = new List<dept>(); using (var db = new PMEntities()) { (from p in db.depts orderby p.dept_id ascending select new { Id = p.dept_id, Name = p.dept_desc }).ToList() .ForEach(f => deptList.Add(new dept { dept_id = f.Id, dept_desc = f.Name })); deptList.Insert(0, new dept { dept_id = 0, dept_desc = "+Add New Department" }); } return deptList; }