Department provider works with the department records and definition that can be used to separate the product groups and branches. It uses the CMS.Ecommerce.DepartmentInfo class.
• | object GetDepartmentInfo(int departmentId) – returns the DepartmentInfo object by given department ID. |
• | object GetDepartmentInfo(string departmentName) – returns the DepartmentInfo object selected by given department code name. |
• | void SetDepartmentInfo(object department) – updates the department record with the data from given DepartmentInfo object. If DepartmentID value is set, it updates the existing record, else it inserts a new record. |
• | void DeleteDepartmentInfo(int departmentId) – deletes department record specified by its department ID. |
• | void AddUserToDepartment(int departmentId, int userId) – adds the user to the department. User-Department is N:N relationship. This assignment is defined for the administration purposes and access control. |
• | void RemoveUserFromDepartment(int departmentId, int userId) – removes user from the department. |
• | bool IsUserInDepartment(int departmentId, int userId) – returns true if the user is member of given department. |
• | DataSet GetUserDepartments(int userId) – returns the DataSet of the user departments, see the database reference for required column definition. |
• | DataSet GetDepartments() – returns DataSet of all departments defined in the E-commerce system. |
• | DataSet GetDepartments(string where, string orderBy) – returns DataSet of the departments selected with given condition and order by specification. |
• | bool CheckDependencies(int departmentId) – returns true if some objects depend on given department to prevent the deletion. |
Page url:
http://devnet.kentico.com/docs/ecommerceguide/index.html?customdepartmentinfoprovider.htm