예제 #1
0
        /// <summary>
        /// 删除部门
        /// </summary>
        /// <param name="departmentsId"></param>
        /// <returns></returns>
        public bool DelDepartment(string departmentsId)
        {
            string sql = "update Department set isDel = '0' where DepartmentID =  '" + departmentsId + "'";

            string        sql2 = "update UserInfo set DepartmentID = '70' where DepartmentID = '" + departmentsId + "'";
            List <string> list = new List <string>();

            list.Add(sql);
            list.Add(sql2);

            return(DBHelper.ExcuteMoreMethod(list));
        }
예제 #2
0
        /// <summary>
        /// 删除记录
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="LeaveID"></param>
        /// <returns></returns>
        public bool delLeave(string where)
        {
            string sql1 = "delete from Leave where 1=1 and LeaveID in (" + where + ")";
            string sql2 = "delete from OvertineCheck where 1=1 and LeaveID in (" + where + ")";

            List <string> list = new List <string>();

            list.Add(sql1);
            list.Add(sql2);

            return(DBHelper.ExcuteMoreMethod(list));
        }
예제 #3
0
        /// <summary>
        /// 批量删除部门
        /// </summary>
        /// <param name="departmentsId"></param>
        /// <returns></returns>
        public bool DelDepartment(string [] departmentsId)
        {
            string where = "";
            for (int i = 0; i < departmentsId.Length; i++)
            {
                if (i == departmentsId.Length - 1)
                {
                    where += departmentsId[i];
                }
                else
                {
                    where += departmentsId[i] + ",";
                }
            }
            string sql  = "update Department set isDel = '0' where DepartmentID in (" + where + ")";
            string sql2 = "update UserInfo set DepartmentID = '70' where DepartmentID in (" + where + ")";

            List <string> list = new List <string>();

            list.Add(sql);
            list.Add(sql2);

            return(DBHelper.ExcuteMoreMethod(list));
        }