// // Retrieves the pcaCode object with the specified ID and returns the 5-digit code // (note: called from searchPCA_WE View) public int getPcaCodeFromID(int id) { PcaCode pcaCodeObj = PcaCodeDB.PcaCodeList.Find(id); if (pcaCodeObj != null) { return(pcaCodeObj.code); } else { return(0); } }
// // Retrieves the PcaCode object with specified ID and returns the description // (note: called from searchPCA_WE View) public string getPcaDescriptionFromID(int id) { PcaCode pcaCodeObj = PcaCodeDB.PcaCodeList.Find(id); if (pcaCodeObj != null) { return(pcaCodeObj.description); } else { return(null); } }
// // Retrieves the PcaCode object with the specified code and returns the object public PcaCode getPcaObjFromCode(int pcacode) { PcaCode pcaCodeObj = new PcaCode(); var searchPca = from m in PcaCodeDB.PcaCodeList where m.code == pcacode select m; foreach (var item in searchPca) { pcaCodeObj = item; } if (pcaCodeObj != null) { return(pcaCodeObj); } else { return(null); } }
// /* Retrieves all PCA codes associated with the specified work effort and returns * them as a selection list */ public virtual List <SelectListItem> getWePcaCodesSelectList(WorkEffort we) { List <SelectListItem> pcaList = new List <SelectListItem>(); PcaCode tmpPca = new PcaCode(); var searchPcaWe = from p in PCA_WEDB.PCA_WEList where p.WE == we.ID where p.active == true select p; foreach (var item in searchPcaWe) { tmpPca = PcaCodeDB.PcaCodeList.Find(item.PCA); pcaList.Add(new SelectListItem { Text = tmpPca.code + " (" + tmpPca.division + ")", Value = tmpPca.code.ToString() }); } return(pcaList); }