private void Init(Client c)
        {
            StateManager = new StateManager();

            Entity = new Device()
            {
                InspectionPeriodicTimeInMonths = 24
            };
            Place = new Place()
            {
                State = "zachodniopomorskie"
            };
            Entity.Place = Place;

            Client = c;

            Entity.Client = Client;
            Entity.DateOfInitialization = DateTime.Today;

            DeviceModel        = new DeviceModel();
            DeviceModelManager = new DeviceModelManager();

            ButtonText  = "Dodaj";
            WindowTitle = "Dodawanie urządzenia";
        }
        public DeviceEditViewModel(Device dev)
        {
            StateManager = new StateManager();

            Entity = dev;

            using (var ctx = new FiscalDbContext())
            {
                Client = ctx.Clients.FirstOrDefault();
            }
            Entity.Client = Client;

            DeviceModel        = new DeviceModel();
            DeviceModelManager = new DeviceModelManager();

            ButtonText  = "Edytuj";
            WindowTitle = "Edytowanie urządzenia";
        }
        public DeviceEditViewModel(Device d, Client c, Place p)
        {
            StateManager = new StateManager();

            Entity       = d;
            Place        = p;
            Entity.Place = Place;

            Client = c;

            Entity.Client = Client;

            DeviceModel        = new DeviceModel();
            DeviceModelManager = new DeviceModelManager();

            ButtonText  = "Edytuj";
            WindowTitle = "Edytowanie urządzenia";
        }
示例#4
0
		static Services()
		{
			NetManager = new NetManager();
			DeviceModelManager = new DeviceModelManager();
			DeviceManager = new DeviceManager();
		}