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(); } }
public void ChangeState(PlaqueState newState) { State = newState; }
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; }