예제 #1
0
        //Update
        public string update(ProductFashtionDto tProductFashtionDto)
        {
            try
            {
                ProductFashtion tProductFashtionUpdate = _context.ProductFashtion.Find(tProductFashtionDto.Id);
                if (tProductFashtionUpdate == null)
                {
                    return("1");
                }
                tProductFashtionUpdate.Id             = tProductFashtionDto.Id;
                tProductFashtionUpdate.Name           = tProductFashtionDto.Name;
                tProductFashtionUpdate.RetailPrice    = tProductFashtionDto.RetailPrice;
                tProductFashtionUpdate.WholesalePrice = tProductFashtionDto.WholesalePrice;
                tProductFashtionUpdate.Description    = tProductFashtionDto.Description;
                tProductFashtionUpdate.Status         = tProductFashtionDto.Status;
                tProductFashtionUpdate.CreateDate     = tProductFashtionDto.CreateDate;
                tProductFashtionUpdate.CreateUser     = tProductFashtionDto.CreateUser;

                _context.ProductFashtion.Update(tProductFashtionUpdate);
                _context.SaveChanges();
                return("0");
            }
            catch (Exception)
            {
                return("1");
            }
        }
예제 #2
0
        public string create(ProductFashtionDto tProductFashtionDto)
        {
            try
            {
                ProductFashtion tProductFashtionNew = mapper.Map <ProductFashtionDto, ProductFashtion>(tProductFashtionDto);
                tProductFashtionNew.Id         = Guid.NewGuid().ToString();
                tProductFashtionNew.CreateDate = DateTime.Now;

                _context.ProductFashtion.Add(tProductFashtionNew);
                _context.SaveChanges();
                return("0");
            }
            catch (Exception)
            {
                return("1");
            }
        }
        public IActionResult Update([FromBody] ProductFashtionDto value)
        {
            string result = _bbService.update(value);

            return(new ObjectResult(result));
        }