Пример #1
0
 public ActionResult IncidentList_print(IncidentListBase reports)
 {
     actionResult = new ActionResult();
     try
     {
         actionResult.dtResult = incidentListDL.IncidentList_print(reports);
         if (actionResult.dtResult != null && actionResult.dtResult.Rows.Count > 0)
         {
             actionResult.IsSuccess = true;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(actionResult);
 }
Пример #2
0
        // [HttpPost]
        public JsonResult IncidentList_print(string type, string startDate, string endDate)
        {
            IncidentListModel        incidentListModel = new IncidentListModel();
            string                   jsonString        = string.Empty;
            List <IncidentListModel> incidentList      = new List <IncidentListModel>();

            try
            {
                IncidentListBase incidentListBase = new IncidentListBase();
                incidentListBase.Type      = type;
                incidentListBase.StartDate = startDate;
                incidentListBase.EndDate   = endDate;

                actionResult = incidentListAction.IncidentList_print(incidentListBase);

                if (actionResult.IsSuccess && actionResult.dtResult.Rows.Count > 0)
                {
                    for (int i = 0; i < actionResult.dtResult.Rows.Count; i++)
                    {
                        jsonString += "<tr><td class='td-border'>" + actionResult.dtResult.Rows[i]["IncidentDate"]
                                      + "</td><td class='td-border'>" + actionResult.dtResult.Rows[i]["Name"] + "</td><td class='td-border'>" + actionResult.dtResult.Rows[i]["NatureOfEvent"]
                                      + "</td><td class='td-border'>" + actionResult.dtResult.Rows[i]["ShortDescriptor"] + "</td><td class='td-border'>" + actionResult.dtResult.Rows[i]["Status"]
                                      + "</td><td class='td-border'>" + actionResult.dtResult.Rows[i]["Location"];
                        jsonString += "</tr>";
                    }
                }
                else
                {
                    jsonString = "fail";
                }
            }
            catch (Exception ex)
            {
                jsonString = "-1";
                ErrorReporting.WebApplicationError(ex);
            }
            return(Json(jsonString, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
 public DataTable IncidentList_print(IncidentListBase reports)
 {
     dtContainer = new DataTable();
     dsContainer = new DataSet();
     try
     {
         MyParameter[] myparams =
         {
             new MyParameter("@Type",      reports.Type),
             new MyParameter("@StartDate", reports.StartDate),
             new MyParameter("@EndDate",   reports.EndDate)
         };
         Common.Set_Procedures("IncidentList_print");
         Common.Set_ParameterLength(myparams.Length);
         Common.Set_Parameters(myparams);
         dtContainer = Common.Execute_Procedures_LoadData();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(dtContainer);
 }