Esempio n. 1
0
        private void CreatePlaqueState()
        {
            var defaultPlaqueState = _context.PlaqueStates.IgnoreQueryFilters().FirstOrDefault(e => e.Name == "نصب شده");

            if (defaultPlaqueState == null)
            {
                defaultPlaqueState = new PlaqueState()
                {
                    Code = "1", Name = "نصب شده"
                };
                _context.PlaqueStates.Add(defaultPlaqueState);
                defaultPlaqueState = new PlaqueState()
                {
                    Code = "2", Name = "مفقود"
                };
                _context.PlaqueStates.Add(defaultPlaqueState);
                defaultPlaqueState = new PlaqueState()
                {
                    Code = "3", Name = "ابطال"
                };
                _context.PlaqueStates.Add(defaultPlaqueState);
                defaultPlaqueState = new PlaqueState()
                {
                    Code = "4", Name = "غیرمجاز"
                };
                _context.PlaqueStates.Add(defaultPlaqueState);
                defaultPlaqueState = new PlaqueState()
                {
                    Code = "5", Name = "نزد دامدار"
                };
                _context.PlaqueStates.Add(defaultPlaqueState);

                _context.SaveChanges();
            }
        }
Esempio n. 2
0
 public void ChangeState(PlaqueState newState)
 {
     State = newState;
 }
Esempio n. 3
0
        public PlaqueInfo(long code, string latitude, string longitude, Officer officer, PlaqueState state)
        {
            Code      = code;
            Longitude = longitude;
            Latitude  = latitude;
            OfficerId = officer.Id;
            StateId   = state.Id;

            CreationTime = Clock.Now;
            SetTime      = Clock.Now;
        }