Ejemplo n.º 1
0
        public ActionResult _AllNewStudentList()
        {
            Volunteer currVol = GetCurrentVolunteer();
            List <NewStudentViewModel> studList = new List <NewStudentViewModel>();

            if (currVol.Organization.ModelType == OrgModelType.IntGroupless)
            {
                studList = NewStudentListOps._GetNewStudentFromOrg(currVol.OrganizationId);
            }
            else if (currVol.GroupId != null)
            {
                studList = NewStudentListOps._GetNewStudentFromGrp(currVol.GroupId.Value);
            }

            if (NewStudentListOps.IsOrgFacss(currVol.Organization.Name))
            {
                foreach (var stud in studList)
                {
                    stud.CnName = stud.Id.ToString();
                }
            }

            return(View(new GridModel {
                Data = studList
            }));
        }
        public ActionResult NewStudentsExportExcel(int orgId)
        {
            var    org      = db.Organizations.Find(orgId);
            var    studs    = NewStudentListOps._GetNewStudentFromOrg(orgId);
            string filename = org.Name + "_NewStudents_" + DateTime.Now.ToString("MM-dd-yyyy-H-mm") + ".xlsx";

            return(new NewStudentController()._ExportNewStudentToExcel(studs, filename));
        }
        public JsonResult ShowOrgNewStudents(int orgId)
        {
            var newStudents = NewStudentListOps._GetNewStudentFromOrg(orgId);

            ViewBag.orgId = orgId;

            var    org = db.Organizations.Find(orgId);
            string PartialViewHtml;

            if (org.ModelType == OrgModelType.IntGrouped)
            {
                ViewBag.DropDownList_VolunteerGroups = new SelectList(org.Groups, "Id", "Name");
                ViewBag.orgId   = orgId;
                PartialViewHtml = RenderPartialViewToString("_ShowGroupedOrgNewStudents", newStudents);
            }
            else
            {
                List <SelectListItem> items = new List <SelectListItem>();
                items.Add(new SelectListItem()
                {
                    Text = ConfirmedStage.StringUnConfirmed, Value = ConfirmedStage.UnConfirmed.ToString(), Selected = false
                });
                items.Add(new SelectListItem()
                {
                    Text = ConfirmedStage.StringInfoConfirmed, Value = ConfirmedStage.InfoConfirmed.ToString(), Selected = false
                });
                items.Add(new SelectListItem()
                {
                    Text = ConfirmedStage.StringNeedConfirmed, Value = ConfirmedStage.NeedConfirmed.ToString(), Selected = false
                });
                items.Add(new SelectListItem()
                {
                    Text = ConfirmedStage.StringAllConfirmed, Value = ConfirmedStage.AllConfirmed.ToString(), Selected = false
                });
                SelectList sl = new SelectList(items, "Value", "Text");
                ViewBag.DropDownList_ConfirmedStages = sl;
                PartialViewHtml = RenderPartialViewToString("_ShowUngroupedOrgNewStudents", newStudents);
            }
            return(Json(new
            {
                Success = true,
                PartialViewHtml = PartialViewHtml,
            }));
        }
        public ActionResult _OrgNewStudentList(int orgId, int?grpId)
        {
            List <NewStudentViewModel> newStudents;

            if (grpId == null)
            {
                newStudents = NewStudentListOps._GetNewStudentFromOrg(orgId);
            }
            else if (grpId == -1)
            {
                newStudents = NewStudentListOps._GetOrgUnassignedNewStudents(orgId);
            }
            else if (grpId > 0)
            {
                newStudents = NewStudentListOps._GetNewStudentFromGrp(grpId.Value);
            }
            else
            {
                newStudents = NewStudentListOps._GetNewStudentFromOrg(orgId);
            }

            return(View(new GridModel(newStudents)));
        }