Example #1
0
        public static List <UI_WFEntity_Info> GetWFEntityByHistoryDone(System.Linq.Expressions.Expression <Func <Mission, bool> > condition)
        {
            List <UI_WFEntity_Info> wfe_info = new List <UI_WFEntity_Info>();

            WorkFlows wfs = new WorkFlows();

            List <WorkFlow_Entity> wfes = null;

            //List<WorkFlow_Entity> wfes = wfs.GetWFEntityByConditon(s => s.Process_Info.wh );
            try
            {
                using (var db = new WorkFlowContext())
                {
                    wfes = db.mission.Where(condition).Select(a => a.Miss_WFentity).Distinct().Where(s => s.WE_Status == WE_STATUS.DONE).ToList();
                }
            }
            catch (Exception e)
            {
                return(null);
            }

            foreach (WorkFlow_Entity fe in wfes)
            {
                UI_WFEntity_Info fe_info = new UI_WFEntity_Info();
                fe_info.name        = wfs.GetWorkFlowEntityName(fe.WE_Id);
                fe_info.Status      = fe.WE_Status;
                fe_info.EntityID    = fe.WE_Id;
                fe_info.description = wfs.GetWorkFlowEntityDesc(fe.WE_Id);
                fe_info.serial      = fe.WE_Ser;
                wfe_info.Add(fe_info);
            }
            return(wfe_info);
        }