//Xóa Brand public async Task <bool> Delete(object id) { var glue = _repoGlue.FindById(id); _repoGlue.Remove(glue); return(await _repoGlue.SaveAll()); }
//Xóa Brand public async Task <bool> Delete(object id) { var glue = _repoGlue.FindById(id); string token = _accessor.HttpContext.Request.Headers["Authorization"]; var userID = JWTExtensions.GetDecodeTokenByProperty(token, "nameid").ToInt(); // _repoGlue.Remove(glue); glue.isShow = false; glue.ModifiedBy = userID; glue.ModifiedDate = DateTime.Now; return(await _repoGlue.SaveAll()); }
public async Task <MixingInfo> Mixing(MixingInfoForCreateDto mixing) { var item = _mapper.Map <MixingInfoForCreateDto, MixingInfo>(mixing); item.Code = CodeUtility.RandomString(8); item.CreatedTime = DateTime.Now; var glue = _repoGlue.FindById(mixing.GlueID); item.ExpiredTime = DateTime.Now.AddMinutes(glue.ExpiredTime); _repoMixingInfor.Add(item); await _repoMixingInfor.SaveAll(); return(item); }