Beispiel #1
0
        //-----------------------------------------------------------
        #region Method
        private List <SectionServices> Init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <SectionServices> l_SectionServices = new List <SectionServices>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    SectionServices m_SectionServices = new SectionServices();
                    m_SectionServices.SectionServiceId   = smartReader.GetInt32("SectionServiceId");
                    m_SectionServices.SectionServiceName = smartReader.GetString("SectionServiceName");
                    m_SectionServices.SectionServiceDesc = smartReader.GetString("SectionServiceDesc");
                    m_SectionServices.DisplayOrder       = smartReader.GetByte("DisplayOrder");
                    l_SectionServices.Add(m_SectionServices);
                }
                reader.Close();
                return(l_SectionServices);
            }
            catch (SqlException err)
            {
                throw new ApplicationException("Data error: " + err.Message);
            }
            finally
            {
                db.closeConnection(con);
            }
        }
Beispiel #2
0
        //--------------------------------------------------------------
        public static string Static_GetDisplayString(int SectionServiceId)
        {
            string          RetVal            = "";
            SectionServices m_SectionServices = new SectionServices();

            m_SectionServices.SectionServiceId = SectionServiceId;
            m_SectionServices = m_SectionServices.Get();
            RetVal            = m_SectionServices.SectionServiceName;
            return(RetVal);
        }
Beispiel #3
0
        //--------------------------------------------------------------
        public SectionServices Get()
        {
            SectionServices retVal     = new SectionServices();
            int             RowCount   = 0;
            string          DateFrom   = "";
            string          DateTo     = "";
            string          OrderBy    = "";
            int             PageSize   = 1;
            int             PageNumber = 0;

            try
            {
                List <SectionServices> list = GetPage(DateFrom, DateTo, OrderBy, PageSize, PageNumber, ref RowCount);
                if (list.Count > 0)
                {
                    retVal = list[0];
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(retVal);
        }