예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 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)));
 }