コード例 #1
0
        public long Update(long brokerId, string name, string login, string email)
        {
            var entity = _context.Brokers.First(x => x.Id == brokerId);

            entity.Name       = name;
            entity.User.Login = login;
            entity.Email      = email;

            _context.SaveChanges();

            return(entity.UserId);
        }
コード例 #2
0
ファイル: ApplicationEditor.cs プロジェクト: SKDon/Tracker
        public long Add(ApplicationEditData application)
        {
            var entity = new DbContext.Application();

            Map(application, entity);

            entity.StateId = _defaultStateId;
            entity.StateChangeTimestamp = DateTimeProvider.Now;
            entity.DisplayNumber        = _executor.Query <int>("[dbo].[GetNextDisplayNumber]");
            entity.CreationTimestamp    = DateTimeProvider.Now;

            _context.Applications.InsertOnSubmit(entity);

            _context.SaveChanges();

            return(entity.Id);
        }
コード例 #3
0
 public IActionResult Index(Tracker tracker)
 {
     if (!ModelState.IsValid)
     {
         ViewBag.TrackerList = _trackerDb.Trackers.ToList();
         return(View());
     }
     _trackerDb.Trackers.Add(tracker);
     _trackerDb.SaveChanges();
     return(RedirectToAction());
 }
コード例 #4
0
        public long Add(AirWaybillEditData data, long stateId, long creatorUserId)
        {
            var entity = new AirWaybill
            {
                CreationTimestamp    = DateTimeProvider.Now,
                StateChangeTimestamp = DateTimeProvider.Now,
                StateId       = stateId,
                IsActive      = true,
                CreatorUserId = creatorUserId
            };

            Map(data, entity);

            _context.AirWaybills.InsertOnSubmit(entity);

            _context.SaveChanges();

            return(entity.Id);
        }