public bool Update(ProductAgreementTypeModel model, string userId) { var ProductAgreeType = _context.MstProductAgreementTypes.Find(model.Cd); ProductAgreeType.Code = model.Code.Trim(); ProductAgreeType.Name = model.Name.Trim(); ProductAgreeType.NameKana = model.NameKana.Trim(); ProductAgreeType.UpdateDate = DateTime.Now; ProductAgreeType.UpdateUserId = userId; Update(ProductAgreeType); return(true); }
public bool Create(ProductAgreementTypeModel model, string userId) { var ProductAgreeType = new MstProductAgreementType { Code = model.Code.Trim(), Name = model.Name.Trim(), NameKana = model.NameKana.Trim(), InsertDate = DateTime.Now, IsDeleted = false, InsertUserId = userId }; Add(ProductAgreeType); return(true); }
public bool IsDuplicated(ProductAgreementTypeModel model) { return(_context.MstProductAgreementTypes.Any(c => c.Code.ToLower().Equals(model.Code.ToLower().Trim()) && (model.Cd == 0 || c.Cd != model.Cd))); }