Ejemplo n.º 1
0
 public JsonResult SecurityValueReport(FormCollection collection)
 {
     SecurityValueModel model = new SecurityValueModel();
     this.TryUpdateModel(model, collection);
     string error = string.Empty;
     ResultModel resultModel = new ResultModel();
     FlexigridData flexgridData = new FlexigridData();
     int pageIndex = DataTypeHelper.ToInt32(collection["pageIndex"]);
     int pageSize = DataTypeHelper.ToInt32(collection["pageSize"]);
     string sortName = collection["sortName"];
     string sortOrder = collection["sortOrder"];
     int totalRows = 0;
     if (ModelState.IsValid) {
         List<SecurityValueReportDetail> feesExpenses = ReportRepository.FindSecurityValueReport(pageIndex, pageSize, sortName, sortOrder, ref totalRows, model.FundId, (model.StartDate ?? Convert.ToDateTime("01/01/1900")), (model.EndDate ?? DateTime.Now));
         flexgridData.total = totalRows;
         flexgridData.page = 1;
         foreach (var securityValue in feesExpenses) {
             flexgridData.rows.Add(new FlexigridRow {
                 cell = new List<object> {
                     securityValue.DealNo,
                     securityValue.Security,
                     securityValue.SecurityType,
                     securityValue.NoOfShares,
                     securityValue.Price,
                     securityValue.Value,
                     securityValue.Date
                 }
             });
         }
     }
     else {
         foreach (var values in ModelState.Values.ToList()) {
             foreach (var err in values.Errors.ToList()) {
                 if (string.IsNullOrEmpty(err.ErrorMessage) == false) {
                     error += err.ErrorMessage + "\n";
                 }
             }
         }
     }
     return Json(new { Error = error, Data = flexgridData, page = pageIndex, total = totalRows }, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 2
0
 public ActionResult SecurityValue()
 {
     ViewData["MenuName"] = "ReportManagement";
     ViewData["SubmenuName"] = "SecurityValue";
     SecurityValueModel model = new SecurityValueModel();
     return View(model);
 }