예제 #1
0
        protected override bool Insert()
        {
            bool success = false;
            DataLayer.MySQL mySql = null;
            try
            {
                mySql = new DataLayer.MySQL(ConnectionString);
                AssetSubscriptionId = (int)mySql.ExecuteScalar(StoredProcedures.AssetSubscriptions_Insert.ToString(),
                    "_SubscriberAssetGuid", SubscriberAssetGuid,
                    "_PublisherAssetGuid", PublisherAssetGuid,
                    "_CreatedBy", CreatedBy);
                success = AssetSubscriptionId > 1;
            }
            catch (Exception ex) { throw new Exceptions.BusinessLogicException("Error saving asset subscription.", ex); }
            finally { if (mySql != null) mySql.Dispose(); }

            return success;
        }
예제 #2
0
        protected override bool Save()
        {
            bool success = false;
            DataLayer.MySQL mySql = null;
            try
            {
                mySql = new DataLayer.MySQL(ConnectionString);
                AssetId = (int)mySql.ExecuteScalar(StoredProcedures.Assets_Update.ToString(),
                    "_AssetName", AssetName,
                    "_AssetGuid", AssetGuid,
                    "_AssetCode", AssetCode);
                success = AssetId > 1;
            }
            catch (Exception ex) { throw new Exceptions.BusinessLogicException("Error saving asset.", ex); }
            finally { if (mySql != null) mySql.Dispose(); }

            return success;
        }
예제 #3
0
        protected override bool Save()
        {
            bool success = false;
            DataLayer.MySQL mySql = null;
            string truncatedResult = Result;

            try {

              if (Result != null)
                if (Result.ToCharArray().Length >= 20000) truncatedResult = Result.Substring(0, 20000);

              mySql = new DataLayer.MySQL(ConnectionString);
              RequestId = mySql.ExecuteScalar(StoredProcedures.Requests_Update.ToString(),
                          "_RequestId", RequestId,
                          "_Result", truncatedResult );
              success = RequestId > 0;

            }
            catch (Exception ex) { throw new Exceptions.BusinessLogicException("Error saving request.", ex); }
            finally { if (mySql != null) mySql.Dispose(); }

            return success;
        }
예제 #4
0
        protected override bool Save()
        {
            bool success = false;
            DataLayer.MySQL mySql = null;
            try
            {
                mySql = new DataLayer.MySQL(ConnectionString);
                RoleId = (int)mySql.ExecuteScalar(StoredProcedures.Roles_Update_ByRoleId.ToString(),
                    "_RoleName", RoleName,
                    "_RoleDescription", RoleDescription);

                success = RoleId > 0;
            }
            catch (Exception ex) { throw new Exceptions.BusinessLogicException("Error role user.", ex); }
            finally { if (mySql != null) mySql.Dispose(); }

            return success;
        }
예제 #5
0
        protected override bool Insert()
        {
            bool success = false;
            DataLayer.MySQL mySql = null;
            string truncatedResult = Result;

            try {

              if (Result != null)
                if (Result.ToCharArray().Length >= 20000) truncatedResult = Result.Substring(0, 20000);

                mySql = new DataLayer.MySQL(ConnectionString);
                RequestId = mySql.ExecuteScalar(StoredProcedures.Requests_Insert.ToString(),
                            "_Version", Version,
                            "_AssetCode", AssetCode,
                            "_Service", Service,
                            "_EndPoint", EndPoint,
                            "_Parameters", Parameters,
                            "_Method", Method,
                            "_UserGuid", UserGuid,
                            "_IpAddress", IpAddress,
                            "_Url", Url,
                            "_Headers", Headers,
                            "_HttpAuth", HttpAuth,
                            "_Language", Language,
                            "_Referrer", Referrer,
                            "_UserAgent", UserAgent,
                            "_Cookies", Cookies,
                            "_InputStream", InputStream,
                            "_ContentType", ContentType,
                            "_SubscriberAssetGuid", SubscriberAssetGuid,
                            "_AcceptType", AcceptType,
                            "_Result", truncatedResult,
                            "_ServerIpAddress", ServerIpAddress);
                success = RequestId > 0;

            }
            catch (Exception ex) { throw new Exceptions.BusinessLogicException("Error saving request.", ex); }
            finally { if (mySql != null) mySql.Dispose(); }

            return success;
        }
예제 #6
0
        protected override bool Save()
        {
            bool success = false;
            DataLayer.MySQL mySql = null;
            try
            {
                mySql = new DataLayer.MySQL(ConnectionString);
                UserId = mySql.ExecuteScalar(StoredProcedures.Users_Update.ToString(),
                    "_UserId", UserId,
                    "_EmailAddress", EmailAddress,
                    "_FirstName", FirstName,
                    "_LastName", LastName,
                    "_UserGuid", UserGuid,
                    "_Password", Password,
                    "_Active", Active,
                    "_RoleId", RoleId);
                success = UserId > 0;
            }
            catch (Exception ex) { throw new Exceptions.BusinessLogicException("Error saving user.", ex); }
            finally { if (mySql != null) mySql.Dispose(); }

            return success;
        }
예제 #7
0
        protected override bool Insert()
        {
            bool success = false;
            DataLayer.MySQL mySql = null;
            try
            {
                mySql = new DataLayer.MySQL(ConnectionString);
                LogId = (int)mySql.ExecuteScalar(StoredProcedures.Logs_Insert.ToString(),
                    "_RequestId", RequestId,
                    "_LogType", LogType,
                    "_Title", Title,
                    "_Text", Text,
                    "_ReferenceKey", ReferenceKey,
                    "_Action", Action,
                    "_Success", Success);
                success = LogId > 1;
            }
            catch (Exception ex) { throw new Exceptions.BusinessLogicException("Error saving log.", ex); }
            finally { if (mySql != null) mySql.Dispose(); }

            return success;
        }
예제 #8
0
        protected override bool Insert()
        {
            bool success = false;
            DataLayer.MySQL mySql = null;
            try
            {
                mySql = new DataLayer.MySQL(ConnectionString);
                RolePermissionId = (int)mySql.ExecuteScalar(StoredProcedures.RolePermissions_Insert.ToString(),
                    "_RoleId", RoleId,
                    "_PermissionId", PermissionId,
                    "_CreatedBy", CreatedBy);
                success = RolePermissionId > 1;
            }
            catch (Exception ex) { throw new Exceptions.BusinessLogicException("Error saving role permission.", ex); }
            finally { if (mySql != null) mySql.Dispose(); }

            return success;
        }
예제 #9
0
        protected override bool Insert()
        {
            bool success = false;
            DataLayer.MySQL mySql = null;

            try
            {
                mySql = new DataLayer.MySQL(ConnectionString);
                UserEventId = mySql.ExecuteScalar(StoredProcedures.UserEvents_Update.ToString(),
                    "_UserEventId", UserEventId,
                    "_UserEventReferenceKey", UserEventReferenceKey,
                    "_UserGuid", UserGuid,
                    "_EventId", EventId,
                    "_UserEventDescription", Description);
                success = UserEventId > 0;
            }
            catch (Exception ex) { throw new Exceptions.BusinessLogicException("Error saving user event.", ex); }
            finally { if (mySql != null) mySql.Dispose(); }

            return success;
        }