Esempio n. 1
0
        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));
     }
 }
Esempio n. 3
0
        public HttpResponseMessage FetchBeautyTip(int beautyTipId)
        {
            BeautyTipDto beautyTipDto = new BeautyTipDto {
                CrudStatus = CrudStatus.READ, Id = beautyTipId
            };

            return(SaveBeautyTip(beautyTipDto));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        public HttpResponseMessage DeleteBeautyTip(BeautyTipDto beautyTipDto)
        {
            beautyTipDto.CrudStatus = CrudStatus.DELETE;

            return(SaveBeautyTip(beautyTipDto));
        }
Esempio n. 7
0
        public HttpResponseMessage UpdateBeautyTip(BeautyTipDto beautyTipDto)
        {
            beautyTipDto.CrudStatus = CrudStatus.UPDATE;

            return(SaveBeautyTip(beautyTipDto));
        }
Esempio n. 8
0
        public HttpResponseMessage AddBeautyTip(BeautyTipDto beautyTipDto)
        {
            beautyTipDto.CrudStatus = CrudStatus.CREATE;

            return(SaveBeautyTip(beautyTipDto));
        }