예제 #1
0
        //--------------------------------------------------------------------------
        public List <UserRoles> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <UserRoles> l_UserRoles = new List <UserRoles>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    UserRoles m_UserRoles = new UserRoles();
                    m_UserRoles.UserRoleID          = smartReader.GetInt32("UserRoleID");
                    m_UserRoles.UserRoleName        = smartReader.GetString("UserRoleName");
                    m_UserRoles.UserRoleDescription = smartReader.GetString("UserRoleDescription");
                    l_UserRoles.Add(m_UserRoles);
                }
                smartReader.disposeReader(reader);
                return(l_UserRoles);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #2
0
        //--------------------------------------------------------------------------
        public List <PostCategory> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <PostCategory> l_PostCategory = new List <PostCategory>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    PostCategory m_PostCategory = new PostCategory();
                    m_PostCategory.PostCategory_ID    = smartReader.GetInt32("PostCategory_ID");
                    m_PostCategory.PostCategory_Title = smartReader.GetString("PostCategory_Title");
                    l_PostCategory.Add(m_PostCategory);
                }
                smartReader.disposeReader(reader);
                return(l_PostCategory);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #3
0
        //--------------------------------------------------------------------------
        public List <Hotel_Facilities> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <Hotel_Facilities> l_ContactPersons = new List <Hotel_Facilities>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    Hotel_Facilities m_ContactPersons = new Hotel_Facilities();
                    m_ContactPersons.Hotel_Facilities_ID = smartReader.GetInt32("Hotel_Facilities_ID");
                    m_ContactPersons.Name = smartReader.GetString("Name");
                    m_ContactPersons.Note = smartReader.GetString("Note");
                    l_ContactPersons.Add(m_ContactPersons);
                }
                smartReader.disposeReader(reader);
                return(l_ContactPersons);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #4
0
        //--------------------------------------------------------------------------
        public List <Hotel_Evaluate> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <Hotel_Evaluate> l_ContactPersons = new List <Hotel_Evaluate>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    Hotel_Evaluate m_ContactPersons = new Hotel_Evaluate();
                    m_ContactPersons.Hotel_Evaluate_ID = smartReader.GetInt32("Hotel_Evaluate_ID");
                    m_ContactPersons.Hotel_ID          = smartReader.GetInt32("Hotel_ID");
                    m_ContactPersons.CreateBy          = smartReader.GetString("CreateBy");
                    m_ContactPersons.Created           = smartReader.GetDateTime("Created");
                    m_ContactPersons.Score             = smartReader.GetFloat("Score");
                    m_ContactPersons.Content           = smartReader.GetString("Content");
                    l_ContactPersons.Add(m_ContactPersons);
                }
                smartReader.disposeReader(reader);
                return(l_ContactPersons);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #5
0
        //--------------------------------------------------------------------------
        public List <Location> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <Location> l_ContactPersons = new List <Location>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    Location m_ContactPersons = new Location();
                    m_ContactPersons.Location_ID          = smartReader.GetInt32("Location_ID");
                    m_ContactPersons.Location_Name        = smartReader.GetString("Location_Name");
                    m_ContactPersons.Location_Description = smartReader.GetString("Location_Description");
                    m_ContactPersons.Location_images      = smartReader.GetString("Location_images");
                    l_ContactPersons.Add(m_ContactPersons);
                }
                smartReader.disposeReader(reader);
                return(l_ContactPersons);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #6
0
        //--------------------------------------------------------------------------
        public List <TopicTour> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <TopicTour> l_TopicTour = new List <TopicTour>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    TopicTour m_TopicTour = new TopicTour();
                    m_TopicTour.TopicTour_ID          = smartReader.GetInt32("TopicTour_ID");
                    m_TopicTour.TopicTour_Name        = smartReader.GetString("TopicTour_Name");
                    m_TopicTour.TopicTour_Description = smartReader.GetString("TopicTour_Description");
                    l_TopicTour.Add(m_TopicTour);
                }
                smartReader.disposeReader(reader);
                return(l_TopicTour);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #7
0
        public List <ConfigInfomation> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <ConfigInfomation> l_ContactPersons = new List <ConfigInfomation>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    ConfigInfomation m_ContactPersons = new ConfigInfomation();
                    m_ContactPersons.Config_id    = smartReader.GetInt32("Config_id");
                    m_ContactPersons.Config_Field = smartReader.GetString("Config_Field");
                    m_ContactPersons.Config_Title = smartReader.GetString("Config_Title");
                    m_ContactPersons.Config_Value = smartReader.GetString("Config_Value");
                    l_ContactPersons.Add(m_ContactPersons);
                }
                smartReader.disposeReader(reader);
                return(l_ContactPersons);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #8
0
        public List <ContactInfo> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <ContactInfo> l_ContactPersons = new List <ContactInfo>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    ContactInfo m_ContactPersons = new ContactInfo();
                    m_ContactPersons.ContactInfo_ID      = smartReader.GetInt32("ContactInfo_ID");
                    m_ContactPersons.ContactInfo_Name    = smartReader.GetString("ContactInfo_Name");
                    m_ContactPersons.ContactInfo_Address = smartReader.GetString("ContactInfo_Address");
                    m_ContactPersons.ContactInfo_Email   = smartReader.GetString("ContactInfo_Email");
                    m_ContactPersons.ContactInfo_Phone   = smartReader.GetString("ContactInfo_Phone");
                    l_ContactPersons.Add(m_ContactPersons);
                }
                smartReader.disposeReader(reader);
                return(l_ContactPersons);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #9
0
파일: Tour.cs 프로젝트: huysunfa/Autravel2
        //--------------------------------------------------------------------------
        public List <Tour> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <Tour> l_Tour = new List <Tour>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    Tour m_Tour = new Tour();
                    m_Tour.Tour_ID                 = smartReader.GetInt32("Tour_ID");
                    m_Tour.Tour_Name               = smartReader.GetString("Tour_Name");
                    m_Tour.Tour_Location           = smartReader.GetInt32("Tour_Location");
                    m_Tour.Tour_Topic              = smartReader.GetString("Tour_Topic");
                    m_Tour.Tour_OrganizationalUnit = smartReader.GetString("Tour_OrganizationalUnit");
                    m_Tour.Tour_DepartureDate      = smartReader.GetDateTime("Tour_DepartureDate");
                    m_Tour.Tour_TimeZone           = smartReader.GetInt32("Tour_TimeZone");
                    m_Tour.Tour_Price              = smartReader.GetInt32("Tour_Price");
                    m_Tour.Tour_PriceSale          = smartReader.GetInt32("Tour_PriceSale");
                    m_Tour.Tour_Qty                = smartReader.GetInt32("Tour_Qty");
                    m_Tour.Tour_Score              = smartReader.GetFloat("Tour_Score");
                    m_Tour.Tour_Description        = smartReader.GetString("Tour_Description");
                    m_Tour.Tour_Content            = smartReader.GetString("Tour_Content");
                    m_Tour.Tour_Itinerary          = smartReader.GetString("Tour_Itinerary");
                    m_Tour.Tour_Schedule           = smartReader.GetString("Tour_Schedule");
                    m_Tour.Tour_Rules              = smartReader.GetString("Tour_Rules");
                    m_Tour.Tour_ListImage          = smartReader.GetString("Tour_ListImage");
                    m_Tour.Tour_Image              = smartReader.GetString("Tour_Image");
                    m_Tour.Product_ID              = smartReader.GetInt32("Product_ID");
                    m_Tour.Tour_Fixed              = smartReader.GetBoolean("Tour_Fixed");
                    m_Tour.UserCreate              = smartReader.GetInt32("UserCreate");
                    m_Tour.CreateDate              = smartReader.GetDateTime("CreateDate");
                    m_Tour.Tour_Active             = smartReader.GetBoolean("Tour_Active");
                    m_Tour.Tour_StarRate           = smartReader.GetFloat("Tour_StarRate");
                    m_Tour.Hotel_ID                = smartReader.GetInt32("Hotel_ID");
                    l_Tour.Add(m_Tour);
                }
                smartReader.disposeReader(reader);
                return(l_Tour);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #10
0
        public List <RoomHotel> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <RoomHotel> l_RoomHotel = new List <RoomHotel>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    RoomHotel m_RoomHotel = new RoomHotel();
                    m_RoomHotel.RoomHotel_ID           = smartReader.GetInt32("RoomHotel_ID");
                    m_RoomHotel.RoomHotel_Title        = smartReader.GetString("RoomHotel_Title");
                    m_RoomHotel.RoomHotel_Image        = smartReader.GetString("RoomHotel_Image");
                    m_RoomHotel.RoomHotel_ListImage    = smartReader.GetString("RoomHotel_ListImage");
                    m_RoomHotel.Hotel_ID               = smartReader.GetInt32("Hotel_ID");
                    m_RoomHotel.RoomHotel_Type         = smartReader.GetInt32("RoomHotel_Type");
                    m_RoomHotel.RoomHotel_Content      = smartReader.GetString("RoomHotel_Content");
                    m_RoomHotel.RoomHotel_Extensions   = smartReader.GetString("RoomHotel_Extensions");
                    m_RoomHotel.RoomHotel_View         = smartReader.GetString("RoomHotel_View");
                    m_RoomHotel.RoomHotel_Bed          = smartReader.GetString("RoomHotel_Bed");
                    m_RoomHotel.RoomHotel_Adutls       = smartReader.GetInt32("RoomHotel_Adutls");
                    m_RoomHotel.RoomHotel_Infants      = smartReader.GetInt32("RoomHotel_Infants");
                    m_RoomHotel.RoomHotel_Acreage      = smartReader.GetFloat("RoomHotel_Acreage");
                    m_RoomHotel.RoomHotel_TotalPrice   = smartReader.GetInt64("RoomHotel_TotalPrice");
                    m_RoomHotel.RoomHotel_DateStart    = smartReader.GetDateTime("RoomHotel_DateStart");
                    m_RoomHotel.RoomHotel_DateEndArray = smartReader.GetDateTime("RoomHotel_DateEndArray");
                    m_RoomHotel.Hotel_TimeZone         = smartReader.GetInt32("Hotel_TimeZone");
                    m_RoomHotel.Hotel_Price            = smartReader.GetInt32("Hotel_Price");
                    m_RoomHotel.Hotel_PriceSale        = smartReader.GetInt32("Hotel_PriceSale");
                    m_RoomHotel.Hotel_Qty              = smartReader.GetInt32("Hotel_Qty");

                    l_RoomHotel.Add(m_RoomHotel);
                }
                smartReader.disposeReader(reader);
                return(l_RoomHotel);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #11
0
파일: Hotel.cs 프로젝트: huysunfa/Autravel2
        //--------------------------------------------------------------------------
        public List <Hotel> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <Hotel> l_Hotel = new List <Hotel>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    Hotel m_Hotel = new Hotel();
                    m_Hotel.Hotel_ID            = smartReader.GetInt32("Hotel_ID");
                    m_Hotel.Hotel_Name          = smartReader.GetString("Hotel_Name");
                    m_Hotel.Hotel_Location      = smartReader.GetInt32("Hotel_Location");
                    m_Hotel.Hotel_Address       = smartReader.GetString("Hotel_Address");
                    m_Hotel.Hotel_Content       = smartReader.GetString("Hotel_Content");
                    m_Hotel.HotelImage          = smartReader.GetString("HotelImage");
                    m_Hotel.Hotel_StarRate      = smartReader.GetFloat("Hotel_StarRate");
                    m_Hotel.Hotel_ListImage     = smartReader.GetString("Hotel_ListImage");
                    m_Hotel.Product_ID          = smartReader.GetInt32("Product_ID");
                    m_Hotel.UserCreate          = smartReader.GetInt32("UserCreate");
                    m_Hotel.Hotel_CreateDate    = smartReader.GetDateTime("Hotel_CreateDate");
                    m_Hotel.Hotel_RulesRefund   = smartReader.GetString("Hotel_RulesRefund");
                    m_Hotel.Hotel_Facilities_ID = smartReader.GetString("Hotel_Facilities_ID");
                    m_Hotel.Tag_ID = smartReader.GetString("Tag_ID");
                    l_Hotel.Add(m_Hotel);
                }
                smartReader.disposeReader(reader);
                return(l_Hotel);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #12
0
        //--------------------------------------------------------------------------
        public List <User> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <User> l_User = new List <User>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    User m_User = new User();
                    m_User.User_ID              = smartReader.GetInt32("User_ID");
                    m_User.User_Name            = smartReader.GetString("User_Name");
                    m_User.User_transactionName = smartReader.GetString("User_transactionName");
                    m_User.Birthday             = smartReader.GetDateTime("Birthday");
                    m_User.User_Image           = smartReader.GetString("User_Image");
                    m_User.User_Address         = smartReader.GetString("User_Address");
                    m_User.User_Email           = smartReader.GetString("User_Email");
                    m_User.User_Phone           = smartReader.GetString("User_Phone");
                    m_User.User_Pass            = smartReader.GetString("User_Pass");
                    m_User.User_Active          = smartReader.GetBoolean("User_Active");
                    m_User.User_Role            = smartReader.GetInt32("User_Role");
                    m_User.User_InternalStaff   = smartReader.GetBoolean("User_InternalStaff");
                    m_User.Agents_ID            = smartReader.GetInt32("Agents_ID");
                    l_User.Add(m_User);
                }
                smartReader.disposeReader(reader);
                return(l_User);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #13
0
파일: Post.cs 프로젝트: huysunfa/Autravel2
        //--------------------------------------------------------------------------
        public List <Post> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <Post> l_Post = new List <Post>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    Post m_Post = new Post();
                    m_Post.Post_id          = smartReader.GetInt32("Post_id");
                    m_Post.Post_Title       = smartReader.GetString("Post_Tile");
                    m_Post.Post_Type        = smartReader.GetInt32("Post_Type");
                    m_Post.Post_Description = smartReader.GetString("Post_Description");
                    m_Post.Post_Content     = smartReader.GetString("Post_Content");
                    m_Post.Post_Images      = smartReader.GetString("Post_Images");
                    m_Post.Post_CategoryID  = smartReader.GetString("Post_CategoryID");
                    m_Post.Post_Slug        = smartReader.GetString("Post_Slug");
                    m_Post.Post_tag         = smartReader.GetString("Post_tag");
                    m_Post.Post_UserID      = smartReader.GetInt32("Post_UserID");
                    m_Post.Post_Location    = smartReader.GetInt32("Post_Location");
                    m_Post.Post_CreateDate  = smartReader.GetDateTime("Post_CreateDate");
                    l_Post.Add(m_Post);
                }
                smartReader.disposeReader(reader);
                return(l_Post);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #14
0
        //--------------------------------------------------------------------------
        public List <TourDetailPrice> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <TourDetailPrice> l_TourDetailPrice = new List <TourDetailPrice>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    TourDetailPrice m_TourDetailPrice = new TourDetailPrice();
                    m_TourDetailPrice.TourDetailPrice_ID            = smartReader.GetInt32("TourDetailPrice_ID");
                    m_TourDetailPrice.TourDetailPrice_ArrivalDate   = smartReader.GetDateTime("TourDetailPrice_ArrivalDate");
                    m_TourDetailPrice.TourDetailPrice_DepartureDate = smartReader.GetDateTime("TourDetailPrice_DepartureDate");
                    m_TourDetailPrice.TourDetailPrice_Price1        = smartReader.GetInt64("TourDetailPrice_Price1");
                    m_TourDetailPrice.TourDetailPrice_NumberPrice1  = smartReader.GetInt32("TourDetailPrice_NumberPrice1");
                    m_TourDetailPrice.TourDetailPrice_Price2        = smartReader.GetInt64("TourDetailPrice_Price2");
                    m_TourDetailPrice.TourDetailPrice_NumberPrice2  = smartReader.GetInt32("TourDetailPrice_NumberPrice2");
                    m_TourDetailPrice.TourDetailPrice_Price3        = smartReader.GetInt64("TourDetailPrice_Price3");
                    m_TourDetailPrice.TourDetailPrice_NumberPrice3  = smartReader.GetInt32("TourDetailPrice_NumberPrice3");
                    l_TourDetailPrice.Add(m_TourDetailPrice);
                }
                smartReader.disposeReader(reader);
                return(l_TourDetailPrice);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }
예제 #15
0
        public List <SetupMailSMTP> init(SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <SetupMailSMTP> l_ContactPersons = new List <SetupMailSMTP>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    SetupMailSMTP m_ContactPersons = new SetupMailSMTP();
                    m_ContactPersons.SetupMailSMTP_ID       = smartReader.GetInt32("SetupMailSMTP_ID");
                    m_ContactPersons.SetupMailSMTP_Email    = smartReader.GetString("SetupMailSMTP_Email");
                    m_ContactPersons.SetupMailSMTP_Password = smartReader.GetString("SetupMailSMTP_Password");
                    m_ContactPersons.SetupMailSMTP_Host     = smartReader.GetString("SetupMailSMTP_Host");
                    m_ContactPersons.SetupMailSMTP_Port     = smartReader.GetString("SetupMailSMTP_Port");
                    m_ContactPersons.SetupMailSMTP_SSL      = smartReader.GetBoolean("SetupMailSMTP_SSL");
                    m_ContactPersons.SetupMailSMTP_Header   = smartReader.GetString("SetupMailSMTP_Header");
                    m_ContactPersons.SetupMailSMTP_Footer   = smartReader.GetString("SetupMailSMTP_Footer");
                    m_ContactPersons.Agents_ID = smartReader.GetInt32("Agents_ID");
                    l_ContactPersons.Add(m_ContactPersons);
                }
                smartReader.disposeReader(reader);
                return(l_ContactPersons);
            }
            catch (SqlException err)
            {
                throw err;
            }
            finally
            {
                db.closeConnection(con);
            }
        }