Esempio n. 1
0
        /// <summary>
        /// Gets UserRight by ID.
        /// </summary>
        /// <param name="CategoryID">The CategoryID.</param>
        /// <param name="UserID">The UserID.</param>
        /// <returns></returns>
        public UserRightValue SelectByID(System.Int32 CategoryID, System.Int32 UserID)
        {
            IDbCommand command = Database.CreateSPCommand("UserRight_GetByID");

            command.AddInputParameter("@CategoryID", DbType.Int32, CategoryID);
            command.AddInputParameter("@UserID", DbType.Int32, UserID);
            return(SelectSingle(command));
        }
Esempio n. 2
0
        /// <summary>
        /// Deletes the specified UserRight.
        /// </summary>
        /// <param name="CategoryID">The CategoryID.</param>
        /// <param name="UserID">The UserID.</param>
        public void Delete(System.Int32 CategoryID, System.Int32 UserID)
        {
            IDbCommand command = Database.CreateSPCommand("UserRight_Delete");

            command.AddInputParameter("@CategoryID", DbType.Int32, CategoryID);
            command.AddInputParameter("@UserID", DbType.Int32, UserID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 3
0
        /// <summary>
        /// Deletes the specified FileStorage.
        /// </summary>
        /// <param name="FileStorageID">The FileStorageID.</param>
        /// <param name="SettingsID">The SettingsID.</param>
        public void Delete(System.Int16 FileStorageID, System.Byte SettingsID)
        {
            IDbCommand command = Database.CreateSPCommand("FileStorage_Delete");

            command.AddInputParameter("@FileStorageID", DbType.Int16, FileStorageID);
            command.AddInputParameter("@SettingsID", DbType.Byte, SettingsID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 4
0
        /// <summary>
        /// Deletes the specified FileStorage.
        /// </summary>
        /// <param name="value">The value.</param>
        public void Delete(FileStorageValue value)
        {
            IDbCommand command = Database.CreateSPCommand("FileStorage_Delete");

            command.AddInputParameter("@FileStorageID", DbType.Int16, value.FileStorageID);
            command.AddInputParameter("@SettingsID", DbType.Byte, value.SettingsID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 5
0
        /// <summary>
        /// Creates from user file.
        /// </summary>
        /// <param name="userFileId">The user file id.</param>
        /// <param name="fileIncludeID">The file include ID.</param>
        /// <param name="knowledgeID">The knowledge ID.</param>
        public void CreateFromUserFile(int userFileId, Guid fileIncludeID, int knowledgeID)
        {
            IDbCommand command = Database.CreateSPCommand("_FileIncludes_CreateFromUserFile", "@UserFileId", userFileId);

            command.AddInputParameter("@FileIncludeID", DbType.Guid, fileIncludeID);
            command.AddInputParameter("@KnowledgeID", DbType.Int32, knowledgeID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 6
0
        /// <summary>
        /// Selects the by file storage ID by path.
        /// </summary>
        /// <param name="FileStorageID">The file storage ID.</param>
        /// <param name="Path">The path.</param>
        /// <returns></returns>
        public FileLinkValue SelectByFileStorageIDByPath(Int16 FileStorageID, string Path)
        {
            IDbCommand command = Database.CreateSPCommand("_FileLinks_GetByFileStorageIDByPath");

            command.AddInputParameter("@FileStorageID", DbType.Int16, FileStorageID);
            command.AddInputParameter("@Path", DbType.String, Path);
            return(SelectSingle(command));
        }
Esempio n. 7
0
        /// <summary>
        /// Deletes the specified UserRight.
        /// </summary>
        /// <param name="value">The value.</param>
        public void Delete(UserRightValue value)
        {
            IDbCommand command = Database.CreateSPCommand("UserRight_Delete");

            command.AddInputParameter("@CategoryID", DbType.Int32, value.CategoryID);
            command.AddInputParameter("@UserID", DbType.Int32, value.UserID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 8
0
        /// <summary>
        /// Gets FileStorage by ID.
        /// </summary>
        /// <param name="FileStorageID">The FileStorageID.</param>
        /// <param name="SettingsID">The SettingsID.</param>
        /// <returns></returns>
        public FileStorageValue SelectByID(System.Int16 FileStorageID, System.Byte SettingsID)
        {
            IDbCommand command = Database.CreateSPCommand("FileStorage_GetByID");

            command.AddInputParameter("@FileStorageID", DbType.Int16, FileStorageID);
            command.AddInputParameter("@SettingsID", DbType.Byte, SettingsID);
            return(SelectSingle(command));
        }
Esempio n. 9
0
        /// <summary>
        /// Gets the by login by password.
        /// </summary>
        /// <param name="Login">The login.</param>
        /// <param name="Password">The password.</param>
        /// <returns></returns>
        public UserValue GetByLoginByPassword(string Login, string Password)
        {
            IDbCommand command = database.CreateSPCommand("_User_GetByLoginByPassword");

            command.AddInputParameter("@Login", DbType.String, Login);
            command.AddInputParameter("@Password", DbType.String, Password);

            return(SelectSingle(command));
        }
Esempio n. 10
0
        /// <summary>
        /// Creates the insert command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public void Insert(UserRightValue value)
        {
            IDbCommand command = Database.CreateSPCommand("UserRight_Insert");

            command.AddInputParameter("@CategoryID", DbType.Int32, value.CategoryID);
            command.AddInputParameter("@PermissionID", DbType.Int16, value.PermissionID);
            command.AddInputParameter("@UserID", DbType.Int32, value.UserID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 11
0
        /// <summary>
        /// Sets the status.
        /// </summary>
        /// <param name="keywordId">The keyword ID.</param>
        /// <param name="keywordStatusId">The keyword status ID.</param>
        public void SetStatus(int keywordId, byte keywordStatusId)
        {
            IDbCommand command = Database.CreateSPCommand("_Keywords_SetStatus");

            command.AddInputParameter("@KeywordID", DbType.Int32, keywordId);
            command.AddInputParameter("@KeywordStatusID", DbType.Byte, keywordStatusId);

            Database.ExecuteNonQuery(command);
        }
Esempio n. 12
0
        /// <summary>
        /// Updates the specified UserFile.
        /// </summary>
        /// <param name="value">The UserFile value.</param>
        public void Update(UserFileValue value)
        {
            IDbCommand command = Database.CreateSPCommand("UserFile_Update");

            command.AddInputParameter("@FileName", DbType.String, value.FileName);
            command.AddInputParameter("@Size", DbType.Int32, value.Size);
            command.AddInputParameter("@UserFileID", DbType.Int32, value.UserFileID);
            command.AddInputParameter("@UserID", DbType.Int32, value.UserID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 13
0
        /// <summary>
        /// Updates the specified Keyword.
        /// </summary>
        /// <param name="value">The Keyword value.</param>
        public void Update(KeywordValue value)
        {
            IDbCommand command = Database.CreateSPCommand("Keyword_Update");

            command.AddInputParameter("@KeywordID", DbType.Int32, value.KeywordID);
            command.AddInputParameter("@KeywordStatusID", DbType.Byte, value.KeywordStatusID);
            command.AddInputParameter("@KeywordTypeID", DbType.Int16, value.KeywordTypeID);
            command.AddInputParameter("@Name", DbType.String, value.Name);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 14
0
        /// <summary>
        /// Updates the specified FileLink.
        /// </summary>
        /// <param name="value">The FileLink value.</param>
        public void Update(FileLinkValue value)
        {
            IDbCommand command = Database.CreateSPCommand("FileLink_Update");

            command.AddInputParameter("@FileLinkID", DbType.Int32, value.FileLinkID);
            command.AddInputParameter("@FileStorageID", DbType.Int16, value.FileStorageID);
            command.AddInputParameter("@Path", DbType.String, value.Path);
            command.AddInputParameter("@PublicID", DbType.Guid, value.PublicID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 15
0
        /// <summary>
        /// Creates the insert command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public void Insert(FileStorageValue value)
        {
            IDbCommand command = Database.CreateSPCommand("FileStorage_Insert");

            command.AddInputParameter("@FileStorageID", DbType.Int16, value.FileStorageID);
            command.AddInputParameter("@Name", DbType.String, value.Name);
            command.AddInputParameter("@Path", DbType.String, value.Path);
            command.AddInputParameter("@SettingsID", DbType.Byte, value.SettingsID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 16
0
        /// <summary>
        /// Updates the specified Category.
        /// </summary>
        /// <param name="value">The Category value.</param>
        public void Update(CategoryValue value)
        {
            IDbCommand command = Database.CreateSPCommand("Category_Update");

            command.AddInputParameter("@CategoryID", DbType.Int32, value.CategoryID);
            command.AddInputParameter("@CreationDate", DbType.DateTime, value.CreationDate);
            command.AddInputParameter("@Name", DbType.String, value.Name);
            command.AddInputParameter("@ParentCategoryID", DbType.Int32, value.ParentCategoryID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 17
0
        /// <summary>
        /// Updates the specified FileInclude.
        /// </summary>
        /// <param name="value">The FileInclude value.</param>
        public void Update(FileIncludeValue value)
        {
            IDbCommand command = Database.CreateSPCommand("FileInclude_Update");

            command.AddInputParameter("@FileIncludeID", DbType.Guid, value.FileIncludeID);
            command.AddInputParameter("@FileName", DbType.String, value.FileName);
            command.AddInputParameter("@KnowledgeID", DbType.Int32, value.KnowledgeID);
            command.AddInputParameter("@Size", DbType.Int32, value.Size);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 18
0
        /// <summary>
        /// Updates the specified Product.
        /// </summary>
        /// <param name="value">The Product value.</param>
        public void Update(ProductValue value)
        {
            IDbCommand command = database.CreateSPCommand("Product_Update");

            command.AddInputParameter("@CreationDate", DbType.DateTime, value.CreationDate);
            command.AddInputParameter("@Name", DbType.String, value.Name);
            command.AddInputParameter("@PrivateKey", DbType.Binary, value.PrivateKey);
            command.AddInputParameter("@ProductID", DbType.Int32, value.ProductID);
            command.AddInputParameter("@PublicKey", DbType.Binary, value.PublicKey);
            database.ExecuteNonQuery(command);
        }
Esempio n. 19
0
        /// <summary>
        /// Creates the insert command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public void Insert(KeywordValue value)
        {
            IDbCommand       command            = Database.CreateSPCommand("Keyword_Insert");
            IDbDataParameter KeywordIDParameter = command.AddParameter("@KeywordID", DbType.Int32, null, ParameterDirection.Output);

            command.AddInputParameter("@KeywordStatusID", DbType.Byte, value.KeywordStatusID);
            command.AddInputParameter("@KeywordTypeID", DbType.Int16, value.KeywordTypeID);
            command.AddInputParameter("@Name", DbType.String, value.Name);
            Database.ExecuteNonQuery(command);

            value.KeywordID = (System.Int32)KeywordIDParameter.Value;
        }
Esempio n. 20
0
        /// <summary>
        /// Creates the insert command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public void Insert(CategoryValue value)
        {
            IDbCommand       command             = Database.CreateSPCommand("Category_Insert");
            IDbDataParameter CategoryIDParameter = command.AddParameter("@CategoryID", DbType.Int32, null, ParameterDirection.Output);

            command.AddInputParameter("@CreationDate", DbType.DateTime, value.CreationDate);
            command.AddInputParameter("@Name", DbType.String, value.Name);
            command.AddInputParameter("@ParentCategoryID", DbType.Int32, value.ParentCategoryID);
            Database.ExecuteNonQuery(command);

            value.CategoryID = (System.Int32)CategoryIDParameter.Value;
        }
Esempio n. 21
0
        /// <summary>
        /// Creates the insert command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public void Insert(FileLinkValue value)
        {
            IDbCommand       command             = Database.CreateSPCommand("FileLink_Insert");
            IDbDataParameter FileLinkIDParameter = command.AddParameter("@FileLinkID", DbType.Int32, null, ParameterDirection.Output);

            command.AddInputParameter("@FileStorageID", DbType.Int16, value.FileStorageID);
            command.AddInputParameter("@Path", DbType.String, value.Path);
            command.AddInputParameter("@PublicID", DbType.Guid, value.PublicID);
            Database.ExecuteNonQuery(command);

            value.FileLinkID = (System.Int32)FileLinkIDParameter.Value;
        }
Esempio n. 22
0
        /// <summary>
        /// Creates the insert command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public void Insert(UserFileValue value)
        {
            IDbCommand command = Database.CreateSPCommand("UserFile_Insert");

            command.AddInputParameter("@FileName", DbType.String, value.FileName);
            command.AddInputParameter("@Size", DbType.Int32, value.Size);
            IDbDataParameter UserFileIDParameter = command.AddParameter("@UserFileID", DbType.Int32, null, ParameterDirection.Output);

            command.AddInputParameter("@UserID", DbType.Int32, value.UserID);
            Database.ExecuteNonQuery(command);

            value.UserFileID = (System.Int32)UserFileIDParameter.Value;
        }
Esempio n. 23
0
        /// <summary>
        /// Creates the insert command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public void Insert(ProductValue value)
        {
            IDbCommand command = database.CreateSPCommand("Product_Insert");

            command.AddInputParameter("@CreationDate", DbType.DateTime, value.CreationDate);
            command.AddInputParameter("@Name", DbType.String, value.Name);
            command.AddInputParameter("@PrivateKey", DbType.Binary, value.PrivateKey);
            IDbDataParameter ProductIDParameter = command.AddParameter("@ProductID", DbType.Int32, null, ParameterDirection.Output);

            command.AddInputParameter("@PublicKey", DbType.Binary, value.PublicKey);
            database.ExecuteNonQuery(command);

            value.ProductID = (System.Int32)ProductIDParameter.Value;
        }
Esempio n. 24
0
        /// <summary>
        /// Selects User values RootPermissionID .
        /// ForeignKey: FK_Users_Permissions
        /// </summary>
        /// <param name="RootPermissionID">The RootPermissionID.</param>
        /// <returns>List of User</returns>
        public IList <UserValue> SelectByRootPermissionID(System.Int16 RootPermissionID)
        {
            IDbCommand command = Database.CreateSPCommand("User_GetByRootPermissionID");

            command.AddInputParameter("@RootPermissionID", DbType.Int16, RootPermissionID);
            return(Select(command));
        }
Esempio n. 25
0
        /// <summary>
        /// Updates the specified User.
        /// </summary>
        /// <param name="value">The User value.</param>
        public void Update(UserValue value)
        {
            IDbCommand command = Database.CreateSPCommand("User_Update");

            command.AddInputParameter("@CreationDate", DbType.DateTime, value.CreationDate);
            command.AddInputParameter("@Email", DbType.String, value.Email);
            command.AddInputParameter("@FirstName", DbType.String, value.FirstName);
            command.AddInputParameter("@LastName", DbType.String, value.LastName);
            command.AddInputParameter("@Login", DbType.String, value.Login);
            command.AddInputParameter("@Password", DbType.String, value.Password);
            command.AddInputParameter("@RootPermissionID", DbType.Int16, value.RootPermissionID);
            command.AddInputParameter("@SecurityAnswer", DbType.String, value.SecurityAnswer);
            command.AddInputParameter("@SecurityQuestion", DbType.String, value.SecurityQuestion);
            command.AddInputParameter("@UserID", DbType.Int32, value.UserID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 26
0
        /// <summary>
        /// Selects Knowledge values ModificatorID .
        /// ForeignKey: FK_Knowledges_Modificator
        /// </summary>
        /// <param name="ModificatorID">The ModificatorID.</param>
        /// <returns>List of Knowledge</returns>
        public IList <KnowledgeValue> SelectByModificatorID(System.Int32 ModificatorID)
        {
            IDbCommand command = Database.CreateSPCommand("Knowledge_GetByModificatorID");

            command.AddInputParameter("@ModificatorID", DbType.Int32, ModificatorID);
            return(Select(command));
        }
Esempio n. 27
0
        /// <summary>
        /// Selects Knowledge values KnowledgeTypeID .
        /// ForeignKey: FK_Knowledges_KnowledgeTypes
        /// </summary>
        /// <param name="KnowledgeTypeID">The KnowledgeTypeID.</param>
        /// <returns>List of Knowledge</returns>
        public IList <KnowledgeValue> SelectByKnowledgeTypeID(System.Int16 KnowledgeTypeID)
        {
            IDbCommand command = Database.CreateSPCommand("Knowledge_GetByKnowledgeTypeID");

            command.AddInputParameter("@KnowledgeTypeID", DbType.Int16, KnowledgeTypeID);
            return(Select(command));
        }
Esempio n. 28
0
        /// <summary>
        /// Deletes the specified Knowledge.
        /// </summary>
        /// <param name="value">The value.</param>
        public void Delete(KnowledgeValue value)
        {
            IDbCommand command = Database.CreateSPCommand("Knowledge_Delete");

            command.AddInputParameter("@KnowledgeID", DbType.Int32, value.KnowledgeID);
            Database.ExecuteNonQuery(command);
        }
Esempio n. 29
0
        /// <summary>
        /// Gets Knowledge by ID.
        /// </summary>
        /// <param name="KnowledgeID">The KnowledgeID.</param>
        /// <returns></returns>
        public KnowledgeValue SelectByID(System.Int32 KnowledgeID)
        {
            IDbCommand command = Database.CreateSPCommand("Knowledge_GetByID");

            command.AddInputParameter("@KnowledgeID", DbType.Int32, KnowledgeID);
            return(SelectSingle(command));
        }
Esempio n. 30
0
        /// <summary>
        /// Updates the specified Knowledge.
        /// </summary>
        /// <param name="value">The Knowledge value.</param>
        public void Update(KnowledgeValue value)
        {
            IDbCommand command = Database.CreateSPCommand("Knowledge_Update");

            command.AddInputParameter("@CategoryID", DbType.Int32, value.CategoryID);
            command.AddInputParameter("@CreationDate", DbType.DateTime, value.CreationDate);
            command.AddInputParameter("@CreatorID", DbType.Int32, value.CreatorID);
            command.AddInputParameter("@KnowledgeID", DbType.Int32, value.KnowledgeID);
            command.AddInputParameter("@KnowledgeStatusID", DbType.Byte, value.KnowledgeStatusID);
            command.AddInputParameter("@KnowledgeTypeID", DbType.Int16, value.KnowledgeTypeID);
            command.AddInputParameter("@ModificationDate", DbType.DateTime, value.ModificationDate);
            command.AddInputParameter("@ModificatorID", DbType.Int32, value.ModificatorID);
            command.AddInputParameter("@Summary", DbType.String, value.Summary);
            command.AddInputParameter("@Title", DbType.String, value.Title);
            Database.ExecuteNonQuery(command);
        }