public static List <PackagesList> GetPackagesDetails()
        {
            List <PackagesList> PackageData = new List <PackagesList>();
            PackagesList        LPackages   = null;

            System.Data.SqlClient.SqlConnection conn = Connection.GetConnection();
            System.Data.SqlClient.SqlCommand    cmd  = new System.Data.SqlClient.SqlCommand("Select * from Packages order by Packages.PkgName Asc", conn);
            System.Data.SqlClient.SqlDataReader reader;
            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    LPackages = new PackagesList((int)reader["PackageId"], reader["PkgName"].ToString(), Convert.ToDateTime(reader["PkgStartDate"]), Convert.ToDateTime(reader["PkgEndDate"]), (string)reader["PkgDesc"], (decimal)reader["PkgBasePrice"], (decimal)reader["PkgAgencyCommission"], DateTime.Today, "", 0);
                    PackageData.Add(LPackages);
                }
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                throw ex;
            }
            finally
            {
                conn.Close();
            }
            return(PackageData);
        }
        public static List <PackagesList> GetPackage(int PackageId)
        {
            List <PackagesList> PackageData = new List <PackagesList>();
            PackagesList        LPackages   = null;

            System.Data.SqlClient.SqlConnection conn = Connection.GetConnection();
            System.Data.SqlClient.SqlCommand    cmd  = new System.Data.SqlClient.SqlCommand("select P.PackageId,P.PkgName,P.PkgStartDate,P.PkgEndDate,P.PkgDesc,P.PkgBasePrice,P.PkgAgencyCommission,B.BookingDate,B.BookingNo,B.TravelerCount from Bookings B inner join Packages P on P.PackageId = B.PackageId where B.PackageId = " + PackageId + "", conn);
            System.Data.SqlClient.SqlDataReader reader;
            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    LPackages = new PackagesList((int)reader["PackageId"], reader["PkgName"].ToString(), Convert.ToDateTime(reader["PkgStartDate"]), Convert.ToDateTime(reader["PkgEndDate"]), (string)reader["PkgDesc"], (decimal)reader["PkgBasePrice"], (decimal)reader["PkgAgencyCommission"], (DateTime)reader["BookingDate"], (string)reader["BookingNo"], (double)reader["TravelerCount"]);

                    PackageData.Add(LPackages);
                }
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                throw ex;
            }
            finally
            {
                conn.Close();
            }
            return(PackageData);
        }
        public static List <PackagesList> PackagesList(int Idcus)
        {
            List <PackagesList> listofPackages = new List <PackagesList>();
            PackagesList        LPackages      = null;

            System.Data.SqlClient.SqlConnection connection = Connection.GetConnection();

            string selectQuery = "select Packages.PackageId,CustFirstName,CustEmail,PkgName,PkgStartDate,PkgEndDate,PkgDesc,PkgBasePrice" +
                                 " from Customers inner join UserLogin on Customers.UserId = UserLogin.UserId inner join Packages" +
                                 " on UserLogin.PackageId = Packages.PackageId where Customers.CustomerId = " + Idcus + "";

            System.Data.SqlClient.SqlCommand selectCommand = new System.Data.SqlClient.SqlCommand(selectQuery, connection);
            try
            {
                connection.Open();
                System.Data.SqlClient.SqlDataReader reader = selectCommand.ExecuteReader();
                while (reader.Read())
                {
                    LPackages = new PackagesList((int)reader["PackageId"], reader["PkgName"].ToString(), Convert.ToDateTime(reader["PkgStartDate"]), Convert.ToDateTime(reader["PkgEndDate"]), (string)reader["PkgDesc"], (decimal)reader["PkgBasePrice"], 0, DateTime.Today, "", 0);
                    listofPackages.Add(LPackages);
                    CustomersDetails.UserName = (string)reader["CustFirstName"];
                }
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return(listofPackages);
        }