private HttpResponseMessage SaveBeautyTip(BeautyTipDto beautyTipDto) { beautyTipDto.EditUserId = UserId; Response <BeautyTipDto> response = beautyTipManager.Save(beautyTipDto); return(Request.CreateResponse <Response <BeautyTipDto> >(HttpStatusCode.OK, response)); }
public Response <BeautyTipDto> Save(BeautyTipDto beautyTipDto) { using (UnitOfWork unitOfWork = new UnitOfWork()) { return(unitOfWork.BeautyTips.Save(beautyTipDto, BeautyTipMappers.Instance.MapToBeautyTipDto)); } }
public HttpResponseMessage FetchBeautyTip(int beautyTipId) { BeautyTipDto beautyTipDto = new BeautyTipDto { CrudStatus = CrudStatus.READ, Id = beautyTipId }; return(SaveBeautyTip(beautyTipDto)); }
public HttpResponseMessage ActivateBeautyTip(BeautyTipDto beautyTipDto) { beautyTipDto.CrudStatus = CrudStatus.UPDATE; beautyTipDto.EditUserId = UserId; Response <BeautyTipDto> response = beautyTipManager.Activate(beautyTipDto); return(Request.CreateResponse <Response <BeautyTipDto> >(HttpStatusCode.OK, response)); }
public BeautyTipDto MapToBeautyTipDto(SqlDataReader sqlDataReader) { BeautyTipDto beautyTipDto = new BeautyTipDto(); beautyTipDto.Id = sqlDataReader["Id"].ToInteger(); beautyTipDto.CategoryId = sqlDataReader["CategoryId"].ToInteger(); beautyTipDto.Subject = sqlDataReader["Subject"].ToString(); beautyTipDto.SubCategoryId = sqlDataReader["SubCategoryId"].ToInteger(); beautyTipDto.Tip = sqlDataReader["Tip"].ToString(); beautyTipDto.StatusId = sqlDataReader["StatusId"].ToInteger(); beautyTipDto.CreateDate = sqlDataReader["CreateDate"].ToDateTime(); beautyTipDto.CreateUserId = sqlDataReader["CreateUserId"].ToInteger(); beautyTipDto.EditDate = sqlDataReader["EditDate"].ToDateTime(); beautyTipDto.EditUserId = sqlDataReader["EditUserId"].ToInteger(); return(beautyTipDto); }
public HttpResponseMessage DeleteBeautyTip(BeautyTipDto beautyTipDto) { beautyTipDto.CrudStatus = CrudStatus.DELETE; return(SaveBeautyTip(beautyTipDto)); }
public HttpResponseMessage UpdateBeautyTip(BeautyTipDto beautyTipDto) { beautyTipDto.CrudStatus = CrudStatus.UPDATE; return(SaveBeautyTip(beautyTipDto)); }
public HttpResponseMessage AddBeautyTip(BeautyTipDto beautyTipDto) { beautyTipDto.CrudStatus = CrudStatus.CREATE; return(SaveBeautyTip(beautyTipDto)); }