public List <ShiftMappingDTO> GetAllCustomerShiftMapping(ShiftMappingGetDTO objGetAllCustomer) { List <ShiftMappingDTO> ShiftMapping = new List <ShiftMappingDTO>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectAllCustomer"); SqlCmd.Parameters.AddWithValue("@ActionBy", objGetAllCustomer.ActionBy); SqlCmd.CommandType = CommandType.StoredProcedure; ShiftMapping = dbLayer.GetEntityList <ShiftMappingDTO>(SqlCmd); } return(ShiftMapping); }
public List <ShiftMappingDTO> GetAllShiftByContract(ShiftMappingGetDTO objGetShiftMapping) { List <ShiftMappingDTO> ShiftMapping = new List <ShiftMappingDTO>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spselectShiftByContract"); SqlCmd.Parameters.AddWithValue("@ContractId", objGetShiftMapping.ContractId); SqlCmd.CommandType = CommandType.StoredProcedure; ShiftMapping = dbLayer.GetEntityList <ShiftMappingDTO>(SqlCmd); } return(ShiftMapping); }
public ShiftMappingDTO GetShiftMappingById(ShiftMappingGetDTO objGetShiftMappingById) { ShiftMappingDTO ShiftMapping = new ShiftMappingDTO(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectShiftMapping"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@MappingId", objGetShiftMappingById.MappingId); SqlCmd.Parameters.AddWithValue("@ActionBy", objGetShiftMappingById.ActionBy); ShiftMapping = dbLayer.GetEntityList <ShiftMappingDTO>(SqlCmd).FirstOrDefault(); } return(ShiftMapping); }
public HttpResponseMessage GetAllCustomerShiftMapping(ShiftMappingGetDTO objGetAllCustomer) { HttpResponseMessage message; try { // ShiftMappingDataAccessLayer dal = new ShiftMappingDataAccessLayer(); var dynObj = new { result = _Shift.GetAllCustomerShiftMapping(objGetAllCustomer) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" }); ErrorLog.CreateErrorMessage(ex, "ShiftMapping", "GetAllCustomerShiftMapping"); } return(message); }