public List <AdminBookingList> GetAdminBookingList()
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.Get_Admin_BookingList, connection);
                command.CommandType = CommandType.StoredProcedure;

                try
                {
                    connection.Open();
                    SqlDataReader           dataReader  = command.ExecuteReader();
                    List <AdminBookingList> bookingList = new List <AdminBookingList>();
                    bookingList = UtilityManager.DataReaderMapToList <AdminBookingList>(dataReader);
                    return(bookingList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
        public List <ClientsBookingHistory> GetClientBookingHistory(long clientId)
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GETCLIENTSBOOKINGHISTORY, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@ClientId", +clientId));

                try
                {
                    connection.Open();
                    SqlDataReader reader = command.ExecuteReader();
                    List <ClientsBookingHistory> bookingList = new List <ClientsBookingHistory>();
                    bookingList = UtilityManager.DataReaderMapToList <ClientsBookingHistory>(reader);
                    return(bookingList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews." + e.Message);
                }
                finally
                {
                    connection.Close();
                }
            }
        }
        public List <PropertyServiceViewModel> GetServicesByPropertyId(long propertyId)
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.Get_Services_By_PropertyId, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@PropertyId", propertyId));

                try
                {
                    connection.Open();
                    SqlDataReader reader = command.ExecuteReader();
                    List <PropertyServiceViewModel> serviceList = new List <PropertyServiceViewModel>();
                    serviceList = UtilityManager.DataReaderMapToList <PropertyServiceViewModel>(reader);
                    return(serviceList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }
                finally
                {
                    connection.Close();
                }
            }
        }
        public List <Product> GetAllProductsBySubCategoryId(long categoryId)
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GetAllProductsBySubCategoryId, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@SubCategoryId", categoryId));
                try
                {
                    connection.Open();
                    SqlDataReader  dataReader  = command.ExecuteReader();
                    List <Product> ProductList = new List <Product>();
                    ProductList = UtilityManager.DataReaderMapToList <Product>(dataReader);
                    return(ProductList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
        public List <Models.Property.Property> GetAllProperties()
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GETALLPROPERTYS, connection);
                command.CommandType = CommandType.StoredProcedure;

                try
                {
                    connection.Open();
                    SqlDataReader dataReader = command.ExecuteReader();
                    List <Models.Property.Property> propertyList = new List <Models.Property.Property>();
                    propertyList = UtilityManager.DataReaderMapToList <Models.Property.Property>(dataReader);
                    return(propertyList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
        //public List<PropertySearchResultNew> GetPropertiesBySearch(string fromDate, string toDate, string fromHour, string toHour)
        //{
        //    using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
        //    {
        //        SqlCommand command = new SqlCommand(StoreProcedure.GET_PROPERTY_BY_SEARCH, connection);
        //        command.CommandType = CommandType.StoredProcedure;
        //        command.Parameters.Add(new SqlParameter("@fromDate", fromDate));
        //        command.Parameters.Add(new SqlParameter("@toDate", toDate));
        //        command.Parameters.Add(new SqlParameter("@fromHour", fromHour));
        //        command.Parameters.Add(new SqlParameter("@toHour", toHour));
        //        try
        //        {
        //            connection.Open();
        //            SqlDataReader dataReader = command.ExecuteReader();
        //            List<PropertySearchResultNew> propertyList = new List<PropertySearchResultNew>();
        //            propertyList = UtilityManager.DataReaderMapToList<PropertySearchResultNew>(dataReader);
        //            return propertyList;
        //        }
        //        catch (Exception e)
        //        {
        //            throw new Exception("Exception retrieving reviews. " + e.Message);
        //        }

        //        finally
        //        {
        //            connection.Close();
        //        }
        //    }
        //}

        public List <PropertySearchResultNew> GetPropertiesBySearch(string searchtext)
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GET_PROPERTY_BY_SEARCH, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@searchtext", searchtext));
                try
                {
                    connection.Open();
                    SqlDataReader dataReader = command.ExecuteReader();
                    List <PropertySearchResultNew> propertyList = new List <PropertySearchResultNew>();
                    propertyList = UtilityManager.DataReaderMapToList <PropertySearchResultNew>(dataReader);
                    return(propertyList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
        public List <PropertyWorkingDays> GetAllPropertyWorkingDays()
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GET_ALL_PROPERTY_WORKING_DAYS, connection);
                command.CommandType = CommandType.StoredProcedure;

                try
                {
                    connection.Open();
                    SqlDataReader dataReader = command.ExecuteReader();
                    List <PropertyWorkingDays> workingDaysList = new List <PropertyWorkingDays>();
                    workingDaysList = UtilityManager.DataReaderMapToList <PropertyWorkingDays>(dataReader);
                    return(workingDaysList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
        public List <Models.NewsLetter.NewsLetter> GetAllNewsLetters()
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GETALLNEWSLETTERS, connection);
                command.CommandType = CommandType.StoredProcedure;

                try
                {
                    connection.Open();
                    SqlDataReader dataReader = command.ExecuteReader();
                    List <Models.NewsLetter.NewsLetter> newsletterList = new List <Models.NewsLetter.NewsLetter>();
                    newsletterList = UtilityManager.DataReaderMapToList <Models.NewsLetter.NewsLetter>(dataReader);
                    return(newsletterList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
        public List <ClientPropertyRating> GetClientPropertyRatings(int Id)
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GETCLIENTPROPERTYRATING, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@PropertyId", Id));

                try
                {
                    connection.Open();
                    SqlDataReader reader = command.ExecuteReader();
                    List <ClientPropertyRating> ratingList = new List <ClientPropertyRating>();
                    ratingList = UtilityManager.DataReaderMapToList <ClientPropertyRating>(reader);
                    return(ratingList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }
                finally
                {
                    connection.Close();
                }
            }
        }
        public List <PropertyServiceViewModel> GetPropertyServiceByPropertyIds(string ids)
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.PROPERTY_PROPERTYSERVICE_GETBYPROPERTYIDS, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@PropertyIds", ids));

                try
                {
                    connection.Open();
                    SqlDataReader reader = command.ExecuteReader();
                    List <PropertyServiceViewModel> propertyServiceList = new List <PropertyServiceViewModel>();
                    propertyServiceList = UtilityManager.DataReaderMapToList <PropertyServiceViewModel>(reader);
                    return(propertyServiceList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }
                finally
                {
                    connection.Close();
                }
            }
        }
        public List <FeatureProperty> GetFeatureProperties(int maxRow)
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GETFEATUREDPROPERTIES, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@NumberOfProperty", maxRow));

                try
                {
                    connection.Open();
                    SqlDataReader          reader = command.ExecuteReader();
                    List <FeatureProperty> featurePropertiesList = new List <FeatureProperty>();
                    featurePropertiesList = UtilityManager.DataReaderMapToList <FeatureProperty>(reader);
                    return(featurePropertiesList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews " + e.Message);
                }
                finally
                {
                    connection.Close();
                }
            }
        }
        public List <PropertySearchResultNew> GetPropertiesAndPropertyRating()
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.Get_Property_PropertyRating, connection);
                command.CommandType = CommandType.StoredProcedure;

                try
                {
                    connection.Open();
                    SqlDataReader dataReader = command.ExecuteReader();
                    List <PropertySearchResultNew> propertyList = new List <PropertySearchResultNew>();
                    propertyList = UtilityManager.DataReaderMapToList <PropertySearchResultNew>(dataReader);
                    return(propertyList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
Esempio n. 13
0
        public List <Models.Testimonial.Testimonial> GetAllTestimonials()
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GETALLTESTIMONIALS, connection);
                command.CommandType = CommandType.StoredProcedure;

                try
                {
                    connection.Open();
                    SqlDataReader dataReader = command.ExecuteReader();
                    List <Models.Testimonial.Testimonial> testimonialList = new List <Models.Testimonial.Testimonial>();
                    testimonialList = UtilityManager.DataReaderMapToList <Models.Testimonial.Testimonial>(dataReader);
                    return(testimonialList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
        public List <News> GetAllNews()
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                List <News> newsList = new List <News>();
                SqlCommand  command  = new SqlCommand(StoreProcedure.GetAllNews, connection);
                command.CommandType = CommandType.StoredProcedure;

                try
                {
                    connection.Open();
                    SqlDataReader dataReader = command.ExecuteReader();
                    newsList = UtilityManager.DataReaderMapToList <News>(dataReader);
                    return(newsList);
                }
                catch (Exception e)
                {
                    UtilityManager.WriteLogError(e.ToString());
                    return(newsList);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
        public List <PropertySearchResultNew> GetShareType(string type)
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GETSHARETYPEFROMVIEW, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@ShareType", type));

                try
                {
                    connection.Open();
                    SqlDataReader reader = command.ExecuteReader();
                    List <PropertySearchResultNew> shareTypeList = new List <PropertySearchResultNew>();
                    shareTypeList = UtilityManager.DataReaderMapToList <PropertySearchResultNew>(reader);
                    return(shareTypeList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }
                finally
                {
                    connection.Close();
                }
            }
        }
        public List <News> GetNewsBySearchKey(string searchKey)
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                List <News> newsList = new List <News>();
                SqlCommand  command  = new SqlCommand(StoreProcedure.GetNewsSearchResults, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@searchKey", searchKey));
                try
                {
                    connection.Open();
                    SqlDataReader dataReader = command.ExecuteReader();
                    newsList = UtilityManager.DataReaderMapToList <News>(dataReader);
                    return(newsList);
                }
                catch (Exception e)
                {
                    UtilityManager.WriteLogError(e.ToString());
                    return(newsList);
                }

                finally
                {
                    connection.Close();
                }
            }
        }
        public List <ProductSubCategory> GetAllProductSubCategory()
        {
            using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString))
            {
                SqlCommand command = new SqlCommand(StoreProcedure.GetAllProductSubCategory, connection);
                command.CommandType = CommandType.StoredProcedure;

                try
                {
                    connection.Open();
                    SqlDataReader             dataReader   = command.ExecuteReader();
                    List <ProductSubCategory> categoryList = new List <ProductSubCategory>();
                    categoryList = UtilityManager.DataReaderMapToList <ProductSubCategory>(dataReader);
                    return(categoryList);
                }
                catch (Exception e)
                {
                    throw new Exception("Exception retrieving reviews. " + e.Message);
                }

                finally
                {
                    connection.Close();
                }
            }
        }