Esempio n. 1
0
        /// <summary>
        /// 增加部门信息
        /// 增加前需要注意重复信息的插入
        /// </summary>
        /// <param name="departmentInfo">待插入的部门信息</param>
        /// <returns>bool</returns>
        public bool Add(DepartmentInfo departmentInfo)
        {
            Dictionary <string, object> paramsMap = new Dictionary <string, object>();

            paramsMap.Add("dept_No", departmentInfo.No);
            SqlDataReader reader = Query(paramsMap);

            if (!reader.Read())
            {
                return(sqlDepartment.AddDepartmentInfo(departmentInfo));
            }
            else
            {
                return(false);
            }
        }