public int CreateFlyerType(FlyerTypeRequest flyerTypeRequest)
        {
            var flyerType = new FlyerType
            {
                TypeName     = flyerTypeRequest.TypeName,
                InDate       = DateTime.Now,
                InUser       = flyerTypeRequest.ActionUserID,
                LastEditDate = DateTime.Now,
                LastEditUser = flyerTypeRequest.ActionUserID
            };

            this.flyerTypeRepository.Create(flyerType);
            return(this.dbContext.SaveChanges());
        }
        public int UpdateFlyerType(FlyerTypeRequest flyerTypeRequest)
        {
            var flyerType = flyerTypeRepository.GetFlyerTypeByKey(flyerTypeRequest.TransactionNumber);

            if (flyerType != null)
            {
                flyerType.TypeName     = flyerTypeRequest.TypeName;
                flyerType.LastEditDate = DateTime.Now;
                flyerType.LastEditUser = flyerTypeRequest.ActionUserID;
                this.flyerTypeRepository.Update(flyerType);
                return(this.dbContext.SaveChanges());
            }

            return(-1);
        }
Example #3
0
 public int UpdateFlyerType(FlyerTypeRequest flyerTypeRequest)
 {
     return(configDictionary.UpdateFlyerType(flyerTypeRequest));
 }