public JsonResult getChartData(ENT.UnitChartParam prm) { ENT.UnitChartParam ent = new ENT.UnitChartParam(); try { ent.mode = "UnitChart"; ent.datefrom = DA.DBHelper.ChangeDate(prm.datefrom) + " 12:00 AM"; ent.dateto = DA.DBHelper.ChangeDate(prm.dateto) + " 11:59 PM"; lstChart = objDAL.GetUnitChartData(ent); } catch (Exception ex) { lstChart = new List <ENT.UnitChartClass>(); ent.mode = ex.Message.ToString(); return(Json(new { lstChart, ent }, JsonRequestBehavior.AllowGet)); } return(Json(new { lstChart, ent }, JsonRequestBehavior.AllowGet)); }
public List <ENT.UnitChartClass> GetUnitChartData(ENT.UnitChartParam objENT) { List <ENT.UnitChartClass> lstENT = new List <ENT.UnitChartClass>(); try { sqlCMD = new SqlCommand(); sqlCMD.CommandText = "GetFurnaceSwitch"; sqlCMD.Parameters.AddWithValue("@datefrom", objENT.datefrom); sqlCMD.Parameters.AddWithValue("@dateto", objENT.dateto); sqlCMD.Parameters.AddWithValue("@Mode", objENT.mode); lstENT = DBHelper.GetEntityList <ENT.UnitChartClass>(sqlCMD); } catch (Exception ex) { throw ex; } return(lstENT); }