using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using Microsoft.VisualBasic.CompilerServices;

//namespace SE0085.Q2CdB
namespace FAS_LIB
{
    public class clsT2Q2CdB
    {

        //Fetches all records from mdsq2ccd table and returns col_nm_cd_nbr and cd_desc columns 
        public Hashtable getHashmdsq2ccd()
        {
            Hashtable hashtable = new Hashtable();
            //IQueryable<mdsq2ccd> source = (IQueryable<mdsq2ccd>)Queryable.Select<mdsq2ccd, mdsq2ccd>((IQueryable<M0>)Queryable.OrderBy<mdsq2ccd, short>(Queryable.Where<mdsq2ccd>((IQueryable<M0>)this.ldDataProCD.mdsq2ccd, (Expression<Func<M0, bool>>)(q => Expression.Call((Expression)null, (MethodInfo)MethodBase.GetMethodFromHandle((Operators.CompareString)), q.col_nm, "PRGRS_PNT", false) == 0)), (Expression<Func<M0, M1>>)(q => q.col_nm_cd_nbr)), (Expression<Func<M0, M1>>)(q => q));
            using(SE0085CTEntities1 se0085CTEntities1 = new SE0085CTEntities1())
            {
                IQueryable<mdsq2ccd> source = from s in se0085CTEntities1.mdsq2ccd
                                              where string.Equals(s.col_nm,"PRGRS_PNT")
                                              orderby s.col_nm_cd_nbr
                                              select s;
                IEnumerator<mdsq2ccd> enumerator = null;
                if (source != null)
                {
                    if (source.Count<mdsq2ccd>() > 0)
                    {
                        try
                        {
                            enumerator = source.GetEnumerator();
                            while (enumerator.MoveNext())
                            {
                                mdsq2ccd current = enumerator.Current;
                                hashtable.Add((object)current.col_nm_cd_nbr, (object)current.cd_desc);
                            }
                        }
                        finally
                        {
                            if (enumerator != null)
                                enumerator.Dispose();
                        }
                    }
                }
            }
            return hashtable;
        }
    }
}
