コード例 #1
0
        public JsonResult GetLeadschildren(string centerId, string programId, int reqPage, int pgSize, int skipRow, string searchText = "")
        {
            List <LeadsChildren> leadsChildrenlist = new List <LeadsChildren>();
            ChildrenInfoClass    childInfo         = new ChildrenInfoClass();

            try
            {
                CenterAnalysisParameters leadsParam = new CenterAnalysisParameters
                {
                    CenterId      = (centerId == "0") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(centerId)),
                    ProgramId     = (programId == "0") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(programId.ToString())),
                    Skip          = skipRow,
                    Take          = pgSize,
                    RequestedPage = reqPage,
                    SearchText    = searchText
                };

                childInfo = new ERSEAData().GetLeadsChildrenData(leadsParam);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(Json(childInfo, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult GETChildrenByCenter(string centerId, string classRoomId, string programId, int reqPage = 0, int pgSize = 0, int skipRow = 0, string searchText = "")
        {
            ChildrenInfoClass childrenInfo = new ChildrenInfoClass();

            try
            {
                CenterAnalysisParameters CenterAnalysisParameters = new CenterAnalysisParameters
                {
                    CenterId      = (centerId == "0") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(centerId)),
                    ProgramId     = (programId == "0") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(programId.ToString())),
                    ClassRoomId   = (classRoomId == "0" || classRoomId == "")?0:Convert.ToInt64(EncryptDecrypt.Decrypt64(classRoomId)),
                    Skip          = skipRow,
                    Take          = pgSize,
                    RequestedPage = reqPage,
                    SearchText    = searchText
                };

                childrenInfo = new ERSEAData().GetChildrenByCenter(CenterAnalysisParameters);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(Json(childrenInfo, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public ActionResult GETChildrenByCenter(string CenterID, string programId)
        {
            ChildrenInfoClass childrenInfo = new ChildrenInfoClass();

            try
            {
                var       centerId   = EncryptDecrypt.Decrypt64(CenterID);
                var       AgencyId   = Session["AgencyID"].ToString();
                ERSEAData centerlist = new ERSEAData();
                long      programID  = (programId == "0") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(programId.ToString()));
                childrenInfo = centerlist.GetChildrenByCenter(centerId, AgencyId, programID);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(Json(childrenInfo, JsonRequestBehavior.AllowGet));
        }
コード例 #4
0
        public ActionResult GetChildrenByClassRoom(string centerId, string classroomId, string programId, int reqPage = 0, int pgSize = 0, int skipRow = 0)
        {
            List <ChildrenInfo> children_List  = new List <ChildrenInfo>();
            ChildrenInfoClass   childInfoClass = new ChildrenInfoClass();

            try
            {
                CenterAnalysisParameters getchildClassParameter = new CenterAnalysisParameters
                {
                    CenterId      = (centerId == "0") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(centerId)),
                    ProgramId     = (programId == "0") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(programId.ToString())),
                    Skip          = skipRow,
                    Take          = pgSize,
                    RequestedPage = reqPage,
                    ClassRoomId   = (classroomId == "0" || classroomId == "") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(classroomId))
                };
                childInfoClass = new ERSEAData().GetChildrenByClassRoom(getchildClassParameter);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(Json(childInfoClass, JsonRequestBehavior.AllowGet));
        }
コード例 #5
0
        public ActionResult DownloadERSEAReport(string centerId, string programId, string reportFor, bool isAllCenter)
        {
            try
            {
                ChildrenInfoClass     infoModel      = new ChildrenInfoClass();
                List <SelectListItem> parentNameList = new List <SelectListItem>();
                Export export = new Export();
                Response.Clear();
                Response.Buffer      = true;
                Response.Charset     = "";
                Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                //Response.AddHeader("content-disposition", "attachment;filename=ERSEA Status Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");
                CenterAnalysisParameters parameters = new CenterAnalysisParameters
                {
                    CenterId      = (centerId == "0") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(centerId)),
                    ProgramId     = (programId == "0") ? 0 : Convert.ToInt64(EncryptDecrypt.Decrypt64(programId.ToString())),
                    RequestedPage = 1,
                    SearchText    = "",
                    Take          = 500,
                    Skip          = 0
                };

                switch (reportFor)
                {
                case "#FosterDisplaymodal":
                    Response.AddHeader("content-disposition", "attachment;filename=Enrolled Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");
                    infoModel = new ERSEAData().GetChildrenByCenter(parameters);
                    break;

                case "#EnrolledModal":
                    Response.AddHeader("content-disposition", "attachment;filename=Enrolled Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");
                    infoModel = new ERSEAData().GetEnrolledChildrenData(parameters);
                    break;

                case "#WithdrawnModal":
                    Response.AddHeader("content-disposition", "attachment;filename=Withdrawn Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");
                    infoModel = new ERSEAData().GetWithdrawnChildList(parameters);
                    break;

                case "#DroppedModal":
                    Response.AddHeader("content-disposition", "attachment;filename=Dropped Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");
                    infoModel = new ERSEAData().GetDroppedChildList(parameters);
                    break;

                case "#WaitingModal":
                    Response.AddHeader("content-disposition", "attachment;filename=Waiting Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");
                    infoModel = new ERSEAData().GetWatitingChildrenData(parameters);
                    break;

                case "#ReturningModal":

                    Response.AddHeader("content-disposition", "attachment;filename=Returning Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");

                    infoModel = new ERSEAData().GetReturningChildren(parameters);
                    break;

                case "#GraduatingModal":
                    Response.AddHeader("content-disposition", "attachment;filename=Graduating Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");

                    infoModel = new ERSEAData().GetGraduatingChildrenData(parameters);
                    break;

                case "#OverIncomeModal":
                    Response.AddHeader("content-disposition", "attachment;filename=Over Income Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");

                    infoModel = new ERSEAData().GetOverIncomeChildrenData(out parentNameList, parameters);
                    break;

                case "#FosterModal":
                    Response.AddHeader("content-disposition", "attachment;filename=Foster Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");

                    infoModel = new ERSEAData().GetFosterChildData(parameters);
                    break;

                case "#HomeLessModal":
                    Response.AddHeader("content-disposition", "attachment;filename=Homeless Client Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");

                    infoModel = new ERSEAData().GetHomelessChildrenData(parameters);
                    break;

                case "#ExternalLeadsModal":
                    Response.AddHeader("content-disposition", "attachment;filename=External Leads Report " + DateTime.Now.ToString("MM/dd/yyyy") + ".xlsx");

                    infoModel = new ERSEAData().GetLeadsChildrenData(parameters);
                    break;
                }


                System.IO.MemoryStream ms = export.ExportERSEACenterAnalysisReport(reportFor, infoModel, parentNameList, isAllCenter);
                ms.WriteTo(Response.OutputStream);
                Response.Flush();
                Response.End();
                return(View());
                // return File(fullPath, "application/vnd.ms-excel", file);
            }
            catch (Exception Ex)
            {
                clsError.WriteException(Ex);
                return(Json("Error occurred please try again."));
            }
        }