public HttpResponseMessage GetHeatStartStop()
        {
            ENT.HeatStartStop        objENT    = new ENT.HeatStartStop();
            List <ENT.HeatStartStop> lstResult = new List <ENT.HeatStartStop>();

            try
            {
                objENT.Mode    = "GetAll";
                lstResult      = new DAL.HeatStartStop().GetHeatStartStop(objENT);
                objENT.Message = lstResult.Count + " Record Found.";
            }
            catch (Exception ex)
            {
                objENT.Message = ex.Message.ToString();
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.InternalServerError, new { objENT }));
            }
            return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { lstResult, objENT }));
        }
Пример #2
0
        public List <ENT.HeatStartStop> GetHeatStartStop(ENT.HeatStartStop objENT)
        {
            List <ENT.HeatStartStop> lstENT = new List <ENT.HeatStartStop>();

            try
            {
                sqlCMD             = new SqlCommand();
                sqlCMD.CommandText = "GetHeatStartStop";
                sqlCMD.Parameters.AddWithValue("@HeatID", objENT.HeatID);
                sqlCMD.Parameters.AddWithValue("@HeatStart", objENT.HeatStart);
                sqlCMD.Parameters.AddWithValue("@HeatStop", objENT.HeatStop);
                sqlCMD.Parameters.AddWithValue("@Mode", objENT.Mode);
                lstENT = DBHelper.GetEntityList <ENT.HeatStartStop>(sqlCMD);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lstENT);
        }
 public HttpResponseMessage SaveHeatStartStop(ENT.HeatStartStop Model)
 {
     try
     {
         if (new DAL.HeatStartStop().InsertUpdateDeleteHeatStartStop(Model))
         {
             Model.Message = "Heat Started Successfully.";
         }
         else
         {
             Model.Message = "Internal Server Error";
         }
     }
     catch (Exception ex)
     {
         Model.Message = ex.Message.ToString();
         return(ControllerContext.Request.CreateResponse(HttpStatusCode.InternalServerError, new { ex.Message }));
     }
     return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { Model }));
 }
Пример #4
0
        public bool InsertUpdateDeleteHeatStartStop(ENT.HeatStartStop objENT)
        {
            bool row = false;

            try
            {
                sqlCMD             = new SqlCommand();
                sqlCMD.CommandText = "InsertUpdateDeleteHeatStartStop";
                sqlCMD.Parameters.AddWithValue("@HeatID", objENT.HeatID);
                sqlCMD.Parameters.AddWithValue("@HeatStart", objENT.HeatStart);
                sqlCMD.Parameters.AddWithValue("@HeatStop", objENT.HeatStop);
                sqlCMD.Parameters.AddWithValue("@IsStop", objENT.IsStop);
                sqlCMD.Parameters.AddWithValue("@Mode", objENT.Mode);
                row = objCRUD.InsertUpdateDelete(sqlCMD);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(row);
        }