Exemplo n.º 1
0
        public void UpdateGroupName(MInstalledMotor mInstalledMotor, Guid installedMotorId)
        {
            var _installedMotor = this._context.InstalledMotors
                                  .Where(g => g.InstalledMotorId == installedMotorId)
                                  .First <InstalledMotor>();

            _installedMotor.Orientation          = mInstalledMotor.Orientation;
            _installedMotor.MotorLocationNumber  = mInstalledMotor.MotorLocationNumber;
            _installedMotor.FavorPositionFirst   = mInstalledMotor.FavorPositionFirst;
            _installedMotor.FavorPositionrSecond = mInstalledMotor.FavorPositionrSecond;
            _installedMotor.FavorPositionThird   = mInstalledMotor.FavorPositionThird;
            _installedMotor.ModifiedDate         = DateTime.Now;

            _context.InstalledMotors.Update(_installedMotor);
            _context.SaveChanges();
        }
Exemplo n.º 2
0
        public void Add(MInstalledMotor mInstallMotor, Guid locaitonId)
        {
            this._context.InstalledMotors.Add(new InstalledMotor
            {
                InstalledMotorId     = new Guid(),
                Orientation          = mInstallMotor.Orientation,
                MotorLocationNumber  = mInstallMotor.MotorLocationNumber,
                FavorPositionFirst   = mInstallMotor.FavorPositionFirst,
                FavorPositionrSecond = mInstallMotor.FavorPositionrSecond,
                FavorPositionThird   = mInstallMotor.FavorPositionThird,
                LocationId           = locaitonId,
                ModifiedDate         = DateTime.Now
            });

            this._context.SaveChanges();
        }