public EstimateStatus MapEstimateStatusDTO(EstimateStatusDTO input) { EstimateStatus output = new EstimateStatus(); output.Description = input.Description; output.EstimateStatusId = input.EstimateStatusId; return output; }
public ActionResult EstimateStatusPost(EstimateStatusDTO estimateStatusDTO) { if (!ModelState.IsValid) throw new HttpException(400, "Invalid data."); EstimateStatus estimateStatus = _mapper.MapEstimateStatusDTO(estimateStatusDTO); if (!_estimateStatusService.Exists(estimateStatusDTO.EstimateStatusId)) _estimateStatusService.Insert(estimateStatus); else _estimateStatusService.Update(estimateStatus); return RedirectToAction("EstimateStatuses"); }