private string GetDIAPR(string CP_NO) { if (!string.IsNullOrEmpty(CP_NO)) { int CP_ID = int.Parse(CP_NO); if (AllCP.Where(x => x.CP_NO == CP_ID).Count() > 0) { return(AllCP.Where(x => x.CP_NO == CP_ID).FirstOrDefault().DIAPR); } } return(""); }
public BaseResponse <List <CodeValue> > GetDiaPR(string category, string levelPR) { BaseResponse <List <CodeValue> > response = new BaseResponse <List <CodeValue> >(); if (!string.IsNullOrEmpty(levelPR)) { response.Data = (from p in AllCP.Where(x => x.LEVELPR == levelPR) select new CodeValue { ItemCode = p.CP_NO.ToString(), ItemName = p.DIAPR }).Distinct().ToList(); } return(response); }