示例#1
0
        public ActionResult StudentFeeFollowUpReport()
        {
            BLLStudentReports objBLLStudentReports = new BLLStudentReports();

            ViewBag.dpReports = objBLLStudentReports.GetReportListDropdown(Convert.ToDouble(Session[DALVariables.SchoolAccountId]), 1);
            getdropdownData();
            return(View());
        }
示例#2
0
        public ActionResult StudentFeeFollowUpReport(string dropDownClass, string dropDownSection, string dropDownReportTypeId, string dropDownCampusTypeId, string strReportTitle)
        {
            BLLStudentReports objBLLStudentReports = new BLLStudentReports();

            ViewBag.dpReports = objBLLStudentReports.GetReportListDropdown(Convert.ToDouble(Session[DALVariables.SchoolAccountId]), 1);
            getdropdownData();

            StringBuilder strSearchCriteria = new StringBuilder();
            string        searchCriteria    = "";

            //If Selected Class Is Empty
            if (!string.IsNullOrEmpty(dropDownCampusTypeId.Trim()))
            {
                int _selectedCampusTypeId = Convert.ToInt32(dropDownCampusTypeId.Trim());
                if (_selectedCampusTypeId <= 0)
                {
                    return(Json(new { code = 1, css = "error", message = "Error occured ! Campus Type not selected" }));
                }
            }

            //If Selected Class Is Empty
            if (!string.IsNullOrEmpty(dropDownClass.Trim()))
            {
                int _selectedClass = Convert.ToInt32(dropDownClass.Trim());
                if (_selectedClass <= 0)
                {
                    return(Json(new { code = 1, css = "error", message = "Error occured ! Class not selected" }));
                }
            }

            //If Report Type Is Empty
            if (!string.IsNullOrEmpty(dropDownReportTypeId.Trim()))
            {
                int _selectedClass = Convert.ToInt32(dropDownReportTypeId.Trim());
                if (_selectedClass <= 0)
                {
                    return(Json(new { code = 1, css = "error", message = "Error occured ! Report not selected" }));
                }
            }

            //If Selected Class Is Not Empty
            if ((!string.IsNullOrEmpty(dropDownClass.Trim())))
            {
                int _selectedClass = Convert.ToInt32(dropDownClass.Trim());
                if (_selectedClass > 0)
                {
                    strSearchCriteria.Append(" Students.ClassId = " + _selectedClass + " AND ");
                }
            }

            //If Class Section Is Not Empty
            if ((!string.IsNullOrEmpty(dropDownSection.Trim())))
            {
                int _selectedSection = Convert.ToInt32(dropDownSection.Trim());
                if (_selectedSection > 0)
                {
                    strSearchCriteria.Append(" Students.SectionId = " + _selectedSection + " AND ");
                }
            }

            //strSearchCriteria.Append(" ServiceTypeCategoryId = " + CategoryId + " AND ");

            //If Filter Expression Is Not Null Or Empty
            if ((!string.IsNullOrEmpty(strSearchCriteria.ToString())))
            {
                //Set Filter Expression
                searchCriteria = strSearchCriteria.ToString().Remove(strSearchCriteria.ToString().Length - 4, 4);

                //User Log
                DALUtility.InsertUserLog("Generate Bulk Fee Voucher. Search Criteria - " + searchCriteria, "Student/Search", Convert.ToInt32(Session[DALVariables.UserAccountId].ToString()));
            }
            else
            {
                //User Log
                DALUtility.InsertUserLog("Generate Bulk Fee Voucher. Search Criteria - Nothing", "Student/Search", Convert.ToInt32(Session[DALVariables.UserAccountId].ToString()));
            }

            try
            {
                string reportURL = "../../ASPXReport/StudentFeeReport.aspx?Report=" + HttpUtility.UrlEncode(EncryptDecrypt.Encrypt(dropDownReportTypeId)) + "&CampId=" + HttpUtility.UrlEncode(EncryptDecrypt.Encrypt(dropDownCampusTypeId)) + "&Title=" + HttpUtility.UrlEncode(EncryptDecrypt.Encrypt(strReportTitle)) + "&Search=" + HttpUtility.UrlEncode(EncryptDecrypt.Encrypt(searchCriteria));
                return(Json(new { code = 3, css = "success", message = "Message ! Reridecting report URL", linkUrl = reportURL }));
            }
            catch (Exception ex)
            {
                DALUtility.ErrorLog(ex.Message, "GenerateBulkFeeVouchers, StudentFee");
            }


            return(View());
        }