Example #1
0
        //按部门查询
        public static DataTable Work2(Entity.Department dp)
        {
            string    sqlstr = "select WID,PName,Work.PID,Wtime,WState,DepName from Work,Person,Department,Job where Person.PID=Work.PID and Person.JID=Job.JID and Job.DepID=Department.DepID and Department.DepID='" + dp.depID + "' ";
            DataTable dt1    = DBHelper.GetDT(sqlstr);

            return(dt1);
        }
Example #2
0
        //按部门查询
        public static DataTable LeaveDep(Entity.Department dp)
        {
            string    sqlstr = "select  LID,Leave.PID,PName,LWhy,LStart,LStop,LBoss,Lstate from Leave,Person,Department,Job where Person.PID=Leave.PID and Person.JID=Job.JID and Job.DepID=Department.DepID and Department.DepID='" + dp.depID + "' ";
            DataTable dt1    = DBHelper.GetDT(sqlstr);

            return(dt1);
        }
Example #3
0
        /// <summary>
        /// 删除部门的方法
        /// </summary>
        /// <param name="DDPL"></param>
        /// <returns></returns>
        public static bool DDPL(Entity.Department DDPL)
        {
            string sql = string.Format("delete from Department where DepID='{0}'", DDPL.depID);
            int    i   = (int)DBHelper.GetLine(sql);

            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #4
0
        /// <summary>
        /// 添加部门的方法
        /// </summary>
        /// <param name="DPL"></param>
        /// <returns></returns>
        public static bool ADPL(Entity.Department DPL)
        {
            string sql = string.Format("insert into Department values('{0}')", DPL.depName);
            int    i   = (int)DBHelper.GetLine(sql);

            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #5
0
        /// <summary>
        /// 修改部门的方法
        /// </summary>
        /// <param name="users"></param>
        /// <returns></returns>
        public static bool DPL(Entity.Department DPL)
        {
            string sql = string.Format("update Department set DepName='{0}'where DepID='{1}'", DPL.depName, DPL.depID);
            int    i   = (int)DBHelper.GetLine(sql);

            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }