public ActionResult ViralloadSummary(string sdate, string edate, int?_emmergency) { bool?emergency = null; if (_emmergency == 1) { emergency = false; } else if (_emmergency == 2) { emergency = true; } ViralLoadModels obj = new ViralLoadModels(); DateTime? StartDate = DateTime.ParseExact(sdate, "dd/MM/yyyy", null); DateTime? EndDate = DateTime.ParseExact(edate, "dd/MM/yyyy", null); // obj.GetAll(StartDate, EndDate); //obj.EndDate = EndDate; Microsoft.Reporting.WebForms.ReportViewer reportViewer = new Microsoft.Reporting.WebForms.ReportViewer(); reportViewer.ProcessingMode = ProcessingMode.Local; reportViewer.SizeToReportContent = true; reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Views\Queries\ViralloadSummary.rdlc"; reportViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("viralloadSummary", obj.ViralloadSummary(StartDate, EndDate, emergency).ToList())); ViewBag.ReportViewer = reportViewer; return(View()); }
//public ActionResult GetOrder_Add(Syncfusion.JavaScript.DataManager dm, int FC, string StartDate, string EndDate) //{ // DateTime? sDate = DateTime.ParseExact(StartDate, "dd/MM/yyyy", null); // DateTime? eDate = DateTime.ParseExact(EndDate, "dd/MM/yyyy", null); // ViralLoadModels obj = new ViralLoadModels(); // //IEnumerable DataSource = obj.getOrders(18, DateTime.Parse("2017-04-01 00:00:00.000"), DateTime.Parse("2017-05-31 00:00:00.000")); // context.Configuration.ProxyCreationEnabled = false; // IEnumerable data = obj.GetOrder_Add(FC, sDate, eDate).ToList(); // int count = obj.GetOrder_Add(FC, sDate, eDate).Count(); // DataOperations operation = new DataOperations(); // //Performing filtering operation // if (dm.Where != null) // { // data = operation.PerformWhereFilter(data, dm.Where, "and"); // var filtered = (IEnumerable<object>)data; // count = filtered.Count(); // } // //Performing search operation // if (dm.Search != null) // { // data = operation.PerformSearching(data, dm.Search); // var searched = (IEnumerable<object>)data; // count = searched.Count(); // } // //Performing sorting operation // if (dm.Sorted != null) // data = operation.PerformSorting(data, dm.Sorted); // //Performing paging operations // if (dm.Skip != 0) // data = operation.PerformSkip(data, dm.Skip); // if (dm.Take != 0) // data = operation.PerformTake(data, dm.Take); // return Json(new { result = data, count = count }, JsonRequestBehavior.AllowGet); //} public ActionResult GetOrderCustom(Syncfusion.JavaScript.DataManager dm, string param_on) { //string a = start_date.ToString(); //string b = end_date.ToString(); ViralLoadModels obj = new ViralLoadModels(); //IEnumerable DataSource = obj.getOrders(18, DateTime.Parse("2017-04-01 00:00:00.000"), DateTime.Parse("2017-05-31 00:00:00.000")); context.Configuration.ProxyCreationEnabled = false; IEnumerable data = obj.GetOrderCustom(param_on); int count = obj.GetOrderCustom(param_on).Count(); DataOperations operation = new DataOperations(); //Performing filtering operation if (dm.Where != null) { data = operation.PerformWhereFilter(data, dm.Where, "and"); var filtered = (IEnumerable <object>)data; count = filtered.Count(); } //Performing search operation if (dm.Search != null) { data = operation.PerformSearching(data, dm.Search); var searched = (IEnumerable <object>)data; count = searched.Count(); } //Performing sorting operation if (dm.Sorted != null) { data = operation.PerformSorting(data, dm.Sorted); } //Performing paging operations if (dm.Skip != 0) { data = operation.PerformSkip(data, dm.Skip); } if (dm.Take != 0) { data = operation.PerformTake(data, dm.Take); } return(Json(new { result = data, count = count }, JsonRequestBehavior.AllowGet)); }
public ActionResult DataSourceGetAll(DataManager dm) { ViralLoadModels obj = new ViralLoadModels(); IEnumerable data = obj.GetAll(null, null, null).ToList(); int count = obj.GetAll(null, null, null).ToList().Count(); DataOperations operation = new DataOperations(); //Performing filtering operation if (dm.Where != null) { data = operation.PerformWhereFilter(data, dm.Where, "and"); var filtered = (IEnumerable <object>)data; count = filtered.Count(); } //Performing search operation if (dm.Search != null) { data = operation.PerformSearching(data, dm.Search); var searched = (IEnumerable <object>)data; count = searched.Count(); } //Performing sorting operation if (dm.Sorted != null) { data = operation.PerformSorting(data, dm.Sorted); } //Performing paging operations if (dm.Skip != 0) { data = operation.PerformSkip(data, dm.Skip); } if (dm.Take != 0) { data = operation.PerformTake(data, dm.Take); } return(Json(new { result = data, count = count }, JsonRequestBehavior.AllowGet)); }