public override Business GetBusinessByID(int id)
        {
            DBCommands.PopulateParams("@BusinessID", id);
            DataTable businessTable = DBCommands.AdapterFill("p_Business_GetByID");
            Business  business      = new Business();

            try
            {
                foreach (DataRow row in businessTable.Rows)
                {
                    business.AppLink            = (row["AppLink"] != DBNull.Value) ? row["AppLink"].ToString() : "";
                    business.AppStatus          = (row["AppStatus"] != DBNull.Value) ? row["AppStatus"].ToString() : "";
                    business.BusinessAddress    = (row["BusinessAddress"] != DBNull.Value) ? row["BusinessAddress"].ToString() : "";
                    business.BusinessEmail      = (row["BusinessEmail"] != DBNull.Value) ? row["BusinessEmail"].ToString() : "";
                    business.BusinessHoursEnd   = (row["BusinessHoursEnd"] != DBNull.Value) ? row["BusinessHoursEnd"].ToString() : "";
                    business.BusinessHoursStart = (row["BusinessHoursStart"] != DBNull.Value) ? row["BusinessHoursStart"].ToString() : "";
                    business.BusinessID         = Convert.ToInt32(row["BusinessID"]);
                    business.BusinessName       = (row["BusinessName"] != DBNull.Value) ? row["BusinessName"].ToString() : "";
                    business.BusinessPhone      = (row["BusinessPhone"] != DBNull.Value) ? row["BusinessPhone"].ToString() : "";
                    business.FacebookUrl        = (row["FacebookUrl"] != DBNull.Value) ? row["FacebokUrl"].ToString() : "";
                    business.ImageGalleryUrl    = (row["ImageGalleryUrl"] != DBNull.Value) ? row["ImageGalleryUrl"].ToString() : "";
                    business.IsPublic           = Convert.ToBoolean(row["IsPublic"] != DBNull.Value) ? Convert.ToBoolean(row["IsPublic"]) : false;
                    business.Other          = (row["Other"] != DBNull.Value) ? row["Other"].ToString() : "";
                    business.TypeOfBusiness = (row["TypeOfBusiness"] != DBNull.Value) ? row["TypeOfBusiness"].ToString() : "";
                    business.user           = UserInfoGetByUser(row["UserName"].ToString());
                    business.WebsiteUrl     = (row["WebsiteUrl"] != DBNull.Value) ? row["WebsiteUrl"].ToString() : "";
                }
            }
            catch (Exception ex)
            {
                DBCommands.RecordError(ex);
            }

            return(business);
        }
        public override bool FeaturesUpdate(Features feature)
        {
            DBCommands.PopulateParams("@FeatureID", feature.FeatureID);
            DBCommands.PopulateParams("@FeatureName", feature.FeatureName);
            DBCommands.PopulateParams("@MainFeature", feature.MainFeature);
            DBCommands.PopulateParams("@FeatureDescription", feature.FeatureDescription);

            return(DBCommands.ExecuteNonQuery("p_Feature_Update"));
        }
        public override bool AppRequestUpdate(AppRequest request)
        {
            DBCommands.PopulateParams("@AppRequestID", request.AppRequestID);
            DBCommands.PopulateParams("@DateRequested", request.DateRequested);
            DBCommands.PopulateParams("@BusinessID", request.AppBusiness.BusinessID);
            DBCommands.PopulateParams("@DevStatus", request.DevStatus);

            return(DBCommands.ExecuteNonQuery("p_AppRequest_Update"));
        }
        public override bool UserInfoUpdate(UserInfo user)
        {
            DBCommands.PopulateParams("@UserName", user.UserName);
            DBCommands.PopulateParams("@ProfileImage", user.ProfileImage);
            DBCommands.PopulateParams("@Phone", user.Phone);
            DBCommands.PopulateParams("@Name", user.Name);
            DBCommands.PopulateParams("@AddBusiness", user.AddBusiness);
            DBCommands.PopulateParams("@GroupUsers", MapGroupListToTable(user.GroupUsers));

            return(DBCommands.ExecuteNonQuery("p_UserInfo_Update"));
        }
        public override int FeaturesInsert(Features feature)
        {
            DBCommands.PopulateParams("@FeatureName", feature.FeatureName);
            DBCommands.PopulateParams("@MainFeature", feature.MainFeature);
            DBCommands.PopulateParams("@FeatureDescription", feature.FeatureDescription);

            int id = -1;

            Int32.TryParse(DBCommands.ExecuteScalar("p_Feature_Insert"), out id);

            return(id);
        }
        public override bool RequestedFeatureUpdate(FeatureRequested feature)
        {
            DBCommands.PopulateParams("@FeatureRequestedID", feature.FeatureRequestedID);
            DBCommands.PopulateParams("@AppRequestID", feature.AppRequestID);
            DBCommands.PopulateParams("@FeatureID", feature.RequestedFeature.FeatureID);
            DBCommands.PopulateParams("@DateRequested", feature.DateRequested);
            DBCommands.PopulateParams("@DevStatus", feature.DevStatus);
            DBCommands.PopulateParams("@AssignedTo", feature.AssignedTo);
            DBCommands.PopulateParams("@Active", feature.Active);

            return(DBCommands.ExecuteNonQuery("p_FeatureRequested_Update"));
        }
        public override bool BusinessUpdate(Business business)
        {
            DBCommands.PopulateParams("@BusinessID", business.BusinessID);
            DBCommands.PopulateParams("@BusinessName", business.BusinessName);
            DBCommands.PopulateParams("@BusinessEmail", business.BusinessEmail);
            DBCommands.PopulateParams("@BusinessAddress", business.BusinessAddress);
            DBCommands.PopulateParams("@BusinessHoursStart", business.BusinessHoursStart);
            DBCommands.PopulateParams("@BusinessHoursEnd", business.BusinessHoursEnd);
            DBCommands.PopulateParams("@WebsiteUrl", business.WebsiteUrl);
            DBCommands.PopulateParams("@FacebookUrl", business.FacebookUrl);
            DBCommands.PopulateParams("@ImageGalleryUrl", business.ImageGalleryUrl);
            DBCommands.PopulateParams("@Other", business.Other);
            DBCommands.PopulateParams("@TypeOfBusiness", business.TypeOfBusiness);
            DBCommands.PopulateParams("@AppLink", business.AppLink);
            DBCommands.PopulateParams("@IsPublic", business.IsPublic);
            DBCommands.PopulateParams("@AppStatus", business.AppStatus);
            DBCommands.PopulateParams("@UserName", business.user.UserName);

            return(DBCommands.ExecuteNonQuery("p_Business_Update"));
        }
        public override Features FeatureGetByID(int featureID)
        {
            DBCommands.PopulateParams("@FeatureID", featureID);

            return((Features)DBCommands.DataReader("p_Feature_GetByID", DBCommands.ObjectTypes.Features));
        }
        public override bool FeatureDelete(int featureID)
        {
            DBCommands.PopulateParams("@FeatureID", featureID);

            return(DBCommands.ExecuteNonQuery("p_Feature_Delete"));
        }
        public override DataTable GroupUsersGetByUserName(string userName)
        {
            DBCommands.PopulateParams("@UserName", userName);

            return(DBCommands.AdapterFill("p_GroupUsers_GetByUserName"));
        }
        public override DataTable BusinessRequestedFeature(int businessID)
        {
            DBCommands.PopulateParams("@BusinessID", businessID);

            return(DBCommands.AdapterFill("p_FeatureRequested_GetByBusinessID"));
        }
        public override UserInfo UserInfoGetByUser(string userName)
        {
            DBCommands.PopulateParams("@UserName", userName);

            return((UserInfo)DBCommands.DataReader("p_UserInfo_GetByUser", DBCommands.ObjectTypes.UserInfo));
        }