Ejemplo n.º 1
0
        /// <summary>
        ///根据传入的id查询院系对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Department GetDepartmentBuId(int id)
        {
            Department dep = new Department();
            IQueryable <Department> depiq = depDal.GetEntities(dp => dp.Dep_Id == id);

            if (depiq.Count() == 0)
            {
                return(null);
            }
            foreach (var item in depiq)
            {
                dep = item;
            }
            return(dep);
        }
Ejemplo n.º 2
0
        public ActionResult GetAllDep()
        {
            DepartmentDal           depd = new DepartmentDal();
            IQueryable <Department> iq   = depd.GetEntities(u => u.Dep_Id > 0);
            string deplist = "";

            foreach (var item in iq)
            {
                deplist = deplist + item.Dep_Name + "-";
            }

            Response.Write(deplist);
            Response.End();
            return(View());
        }