public bool InsertUpdateDeleteJobEntry(ENT.JobEntry objENT) { bool row = false; try { sqlCMD = new SqlCommand(); sqlCMD.CommandText = "InsertUpdateDeleteJobEntry"; sqlCMD.Parameters.AddWithValue("@JobID", objENT.JobID); sqlCMD.Parameters.AddWithValue("@JobNo", objENT.JobNo); sqlCMD.Parameters.AddWithValue("@JobFurnaceNo", objENT.JobFurnaceNo); sqlCMD.Parameters.AddWithValue("@StartTime", objENT.StartTime); sqlCMD.Parameters.AddWithValue("@EndTime", objENT.EndTime); sqlCMD.Parameters.AddWithValue("@Pour1Time", objENT.Pour1Time); sqlCMD.Parameters.AddWithValue("@Pour2Time", objENT.Pour2Time); sqlCMD.Parameters.AddWithValue("@Pour3Time", objENT.Pour3Time); sqlCMD.Parameters.AddWithValue("@Pour4Time", objENT.Pour4Time); sqlCMD.Parameters.AddWithValue("@Pour5Time", objENT.Pour5Time); sqlCMD.Parameters.AddWithValue("@Pour6Time", objENT.Pour6Time); sqlCMD.Parameters.AddWithValue("@IsFinish", objENT.IsFinish); sqlCMD.Parameters.AddWithValue("@HeatFurnaceID", objENT.HeatFurnaceID); sqlCMD.Parameters.AddWithValue("@Mode", objENT.Mode); row = objCRUD.InsertUpdateDelete(sqlCMD); } catch (Exception ex) { throw ex; } return(row); }
public HttpResponseMessage GetAllJobData() { ENT.JobEntry objENT = new ENT.JobEntry(); List <ENT.JobEntry> lstResult = new List <ENT.JobEntry>(); try { objENT.Mode = "GetAllJobEntry"; lstResult = new DAL.JobEntry().GetJobEntry(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 })); }
public HttpResponseMessage SaveJobEntry(ENT.JobEntry Model) { try { if (new DAL.JobEntry().InsertUpdateDeleteJobEntry(Model)) { Model.Message = "Job Save 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 })); }
public List <ENT.JobEntry> GetJobEntry(ENT.JobEntry objENT) { List <ENT.JobEntry> lstENT = new List <ENT.JobEntry>(); try { sqlCMD = new SqlCommand(); sqlCMD.CommandText = "GetJobEntry"; sqlCMD.Parameters.AddWithValue("@JobID", objENT.JobID); sqlCMD.Parameters.AddWithValue("@StartTime", objENT.StartTime); sqlCMD.Parameters.AddWithValue("@EndTime", objENT.EndTime); sqlCMD.Parameters.AddWithValue("@HeatFurnaceID", objENT.HeatFurnaceID); sqlCMD.Parameters.AddWithValue("@Mode", objENT.Mode); lstENT = DBHelper.GetEntityList <ENT.JobEntry>(sqlCMD); } catch (Exception ex) { throw ex; } return(lstENT); }