public List <StatusMasterDTO> GetAllStatus(StatusMasterGetDTO objGetStatus) { List <StatusMasterDTO> status = new List <StatusMasterDTO>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectStatus"); SqlCmd.Parameters.AddWithValue("@ActionBy", objGetStatus.ActionBy); SqlCmd.CommandType = CommandType.StoredProcedure; status = dbLayer.GetEntityList <StatusMasterDTO>(SqlCmd); } return(status); }
public List <StatusMasterDTO> GetInActiveStatus(StatusMasterGetDTO objActive) { List <StatusMasterDTO> inactiveList = new List <StatusMasterDTO>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectStatus"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@Active", 0); SqlCmd.Parameters.AddWithValue("@ActionBy", objActive.ActionBy); inactiveList = dbLayer.GetEntityList <StatusMasterDTO>(SqlCmd); } return(inactiveList); }
public StatusMasterDTO GetStatusById(StatusMasterGetDTO objGetReqirementById) { StatusMasterDTO requirement = new StatusMasterDTO(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectStatus"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@Id", objGetReqirementById.Id); SqlCmd.Parameters.AddWithValue("@ActionBy", objGetReqirementById.ActionBy); requirement = dbLayer.GetEntityList <StatusMasterDTO>(SqlCmd).FirstOrDefault(); } return(requirement); }
public HttpResponseMessage GetActiveStatus(StatusMasterGetDTO objActive) { HttpResponseMessage message; try { // StatusMasterDataAccessLayer dal = new StatusMasterDataAccessLayer(); var dynObj = new { result = _status.GetActiveStatus(objActive) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" }); ErrorLog.CreateErrorMessage(ex, "StatusMaster", "GetActiveStatus"); } return(message); }