Exemplo n.º 1
0
        public List <WorkNameOutput> WorkNameList()
        {
            List <C16_WorkType>   items       = db.C16_WorkType.ToList();
            List <WorkNameOutput> lstWorkName = new List <WorkNameOutput>();

            foreach (C16_WorkType item in items)
            {
                WorkNameOutput wn = new WorkNameOutput();
                wn.WorkID    = item.WorkID;
                wn.WorkName  = item.WorkName;
                wn.WorkGroup = item.WorkGroup;
                lstWorkName.Add(wn);
            }
            items.Clear();
            return(lstWorkName);
        }
Exemplo n.º 2
0
        public WorkNameOutput FindWorkNameByID(int id)
        {
            if (id < 0)
            {
                return(null);
            }
            var item = db.C16_WorkType.FirstOrDefault(s => s.WorkID == id);

            if (item == null)
            {
                return(null);
            }
            WorkNameOutput wn = new WorkNameOutput();

            wn.WorkID    = item.WorkID;
            wn.WorkName  = item.WorkName;
            wn.WorkGroup = item.WorkGroup;
            return(wn);
        }
Exemplo n.º 3
0
        public List <WorkNameOutput> FindWorkInGroup(int groupID)
        {
            if (groupID < 0)
            {
                groupID = 1;
            }
            List <C16_WorkType>   items       = db.C16_WorkType.Where(s => s.WorkGroup == groupID).ToList();
            List <WorkNameOutput> lstWorkName = new List <WorkNameOutput>();

            foreach (C16_WorkType item in items)
            {
                WorkNameOutput wn = new WorkNameOutput();
                wn.WorkID    = item.WorkID;
                wn.WorkName  = item.WorkName;
                wn.WorkGroup = item.WorkGroup;
                lstWorkName.Add(wn);
            }
            items.Clear();
            return(lstWorkName);
        }