Exemple #1
0
        public ActionResult OrgSeeDetails(int id)
        {
            var activity = ActivityService.GetEntities(u => u.ActivityID == id).FirstOrDefault();

            ViewData.Model = activity;

            var           major    = MajorService.GetEntities(u => !activity.ActivityMajor.Contains(("," + u.MajorID.ToString() + ",")) && u.Status == delNormal).AsQueryable();;
            StringBuilder MajorStr = new StringBuilder();

            foreach (var i in major)
            {
                MajorStr.Append(i.MajorName + " ");
            }
            ViewBag.MajorStr = MajorStr;

            StringBuilder DepartmentStr = new StringBuilder();
            var           department    = DepartmentService.GetEntities(u => !activity.ActivityDepartment.Contains(("," + u.DepartmentID.ToString() + ",")) && u.Status == delNormal).AsQueryable();

            foreach (var i in department)
            {
                DepartmentStr.Append(i.DepartmentName + " ");
            }
            ViewBag.DepartmentStr = DepartmentStr;

            StringBuilder PoliticalStr = new StringBuilder();
            var           political    = PoliticalService.GetEntities(u => !activity.ActivityPolitical.Contains(("," + u.PoliticalID.ToString() + ",")) && u.Status == delNormal).AsQueryable();

            foreach (var i in political)
            {
                PoliticalStr.Append(i.PoliticalName + " ");
            }
            ViewBag.PoliticalStr = PoliticalStr;
            return(View());
        }
Exemple #2
0
        public ActionResult OrgCreate()
        {
            var allActivityType = ActivityTypeService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewBag.ActivityTypeID = (from u in allActivityType select new SelectListItem()
            {
                Selected = false, Text = u.ActivityTypeName, Value = u.ActivityTypeID + ""
            }).ToList();
            ViewBag.MajorDict      = MajorService.GetEntities(u => u.Status == delNormal).AsQueryable().ToDictionary(u => u.MajorID, u => u.MajorName);
            ViewBag.PoliticalDict  = PoliticalService.GetEntities(u => u.Status == delNormal).AsQueryable().ToDictionary(u => u.PoliticalID, u => u.PoliticalName);
            ViewBag.DepartmentDict = DepartmentService.GetEntities(u => u.Status == delNormal).AsQueryable().ToDictionary(u => u.DepartmentID, u => u.DepartmentName);
            return(View());
        }
Exemple #3
0
        public ActionResult UserEditUser()
        {
            var allDepartment = DepartmentService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewData["DepartmentList"] = (from u in allDepartment
                                          select new SelectListItem()
            {
                Text = u.DepartmentName, Value = u.DepartmentID + ""
            }).ToList();

            var allMajor = MajorService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewData["MajorList"] = (from u in allMajor
                                     select new SelectListItem()
            {
                Text = u.MajorName, Value = u.MajorID + ""
            }).ToList();

            var allPolitical = PoliticalService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewData["UpdatePoliticalList"] = (from u in allPolitical
                                               select new SelectListItem()
            {
                Text = u.PoliticalName, Value = u.PoliticalID + ""
            }).ToList();
            var allOrganizeInfo = OrganizeInfoService.GetEntities(u => u.Status == delNormal && u.OrganizeInfoManageId != null).AsQueryable();

            ViewData["OrganizeinfoList"] = (from u in allOrganizeInfo
                                            select new SelectListItem()
            {
                Text = u.OrganizeInfoShowName, Value = u.OrganizeInfoID + ""
            }).ToList();
            LoginUser = UserInfoService.GetEntities(u => u.UserInfoID == LoginUser.UserInfoID).FirstOrDefault();
            UpdateCaching(LoginUser);
            return(View(LoginUser));
        }
Exemple #4
0
        public ActionResult OrgEditUser(int id)
        {
            UserInfo user = UserInfoService.GetEntities(u => u.UserInfoID == id).FirstOrDefault();

            if (user == null)
            {
                return(Redirect("/Login/Index"));
            }
            var allMajor = MajorService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewBag.MajorList = (from u in allMajor select new SelectListItem()
            {
                Selected = false, Text = u.MajorName, Value = u.MajorID + ""
            }).ToList();
            var allPolitical = PoliticalService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewBag.PoliticalList = (from u in allPolitical select new SelectListItem()
            {
                Text = u.PoliticalName, Value = u.PoliticalID + ""
            }).ToList();
            var allDepartment = DepartmentService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewBag.DepartmentList = (from u in allDepartment select new SelectListItem()
            {
                Selected = false, Text = u.DepartmentName, Value = u.DepartmentID + ""
            }).ToList();
            var allOrganizeInfo = OrganizeInfoService.GetEntities(u => u.Status == delNormal && u.OrganizeInfoManageId != null).AsQueryable();

            ViewBag.OrganizeinfoList = (from u in allOrganizeInfo select new SelectListItem()
            {
                Selected = false, Text = u.OrganizeInfoShowName, Value = u.OrganizeInfoID + ""
            }).ToList();
            ViewBag.Status           = user.Status;
            ViewData.Model           = user;
            return(View());
        }
Exemple #5
0
        public ActionResult Create() //给出默认/可选择选项
        {
            var allMajor = MajorService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewBag.MajorID = (from u in allMajor select new SelectListItem()
            {
                Selected = false, Text = u.MajorName, Value = u.MajorID + ""
            }).ToList();
            var allPolitical = PoliticalService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewBag.PoliticalID = (from u in allPolitical select new SelectListItem()
            {
                Text = u.PoliticalName, Value = u.PoliticalID + ""
            }).ToList();
            var allDepartment = DepartmentService.GetEntities(u => u.Status == delNormal).AsQueryable();

            ViewBag.DepartmentID = (from u in allDepartment select new SelectListItem()
            {
                Selected = false, Text = u.DepartmentName, Value = u.DepartmentID + ""
            }).ToList();
            var allOrganizeInfo = OrganizeInfoService.GetEntities(u => u.Status == delNormal && u.OrganizeInfoManageId != null).AsQueryable();

            if (LoginOrganize.OrganizeInfoManageId != null)
            {
                allOrganizeInfo = allOrganizeInfo.Where(u => u.OrganizeInfoID == LoginOrganize.OrganizeInfoID).AsQueryable();
            }
            ViewBag.OrganizeInfoID = (from u in allOrganizeInfo select new SelectListItem()
            {
                Selected = false, Text = u.OrganizeInfoShowName, Value = u.OrganizeInfoID + ""
            }).ToList();
            UserInfo userInfo = new UserInfo();

            userInfo.UserInfoIcon = userInfo.UserInfoIcon = System.Configuration.ConfigurationManager.AppSettings["DefaultIconPath"];
            ViewData.Model        = userInfo;
            return(View());
        }