public DeliveryManViewModel(DeliveryMan MydeliveryMan, LogIn_AdministratorViewModel logIn_AdministratorViewModel)
 {
     deliveryMan          = MydeliveryMan;
     addDeliveryManCMD    = new AddDeliveryManCommand(this);
     deliveryMan_M        = new DeliveryManModel();
     cities               = deliveryMan_M.GetCities();
     streetsGroupedByCity = deliveryMan_M.GetstreetsGroupedByCity();
     this.LogIn_AdministratorViewModel = logIn_AdministratorViewModel;
 }
 public AdultViewModel(Adult adulty, LogIn_AdministratorViewModel logIn_AdministratorViewModel)
 {
     adult                = adulty;
     addAdultCMD          = new AddAdultCommnd(this);
     adultM               = new AdultModel();
     cities               = adultM.GetCities();
     streetsGroupedByCity = adultM.GetstreetsGroupedByCity();
     this.LogIn_AdministratorViewModel = logIn_AdministratorViewModel;
 }
 //Constructor in order to search an adult
 public Search_ViewModel(SearchAdult_UserCntrl mySearchAdult_UserCntrlV, LogIn_AdministratorViewModel logIn_AdministratorViewModel)
 {
     search_CMD             = new Search_Command(this);
     search_Update_CMD      = new Search_Update_Command(this);
     search_M               = new Search_Model();
     adults                 = new List <Adult>();
     SearchAdult_UserCntrlV = mySearchAdult_UserCntrlV;
     LogIn_AdministratorVM  = logIn_AdministratorViewModel;
 }
 //Constructors
 //Constructor in order to search a delivery man
 public Search_ViewModel(SearchDeliverMan_UserCntrl mySearchDeliverMan_UserCntrlV, LogIn_AdministratorViewModel logIn_AdministratorViewModel)
 {
     search_CMD                  = new Search_Command(this);
     search_Update_CMD           = new Search_Update_Command(this);
     search_M                    = new Search_Model();
     delivermen                  = new List <DeliveryMan>();
     SearchDeliverMan_UserCntrlV = mySearchDeliverMan_UserCntrlV;
     LogIn_AdministratorVM       = logIn_AdministratorViewModel;
 }
 //Constructors
 public DeliveriesTasks_ViewModel(LogIn_AdministratorViewModel logIn_AdministratorViewModel)
 {
     deliveries            = new List <Delivery>();
     deliveriesTask_CMD    = new DeliveriesTask_Command(this);
     isTaskDone_CMD        = new IsTaskDone_Command(this);
     DeliveriesTasks_M     = new DeliveriesTasks_Model();
     DeliveryDone          = new Delivery();
     selectedDate          = DateTime.Now;
     logIn_AdministratorVM = logIn_AdministratorViewModel;
 }
Ejemplo n.º 6
0
        //Constructors
        public DeliveryViewModel(LogIn_AdministratorViewModel logIn_AdministratorViewModel)
        {
            adult               = new Adult();
            deliveryM           = new DeliveryModel();
            delivery            = new Delivery();
            addDelivery_btn_CMD = new AddDeliveryButton(this);
            //removeDelivery_btn_CMD = new RemoveDeliveryButton(this);
            cityActionCMD            = new CityActionCommand(this);
            SelectedAdultsList       = new List <Adult>();
            SelectedDeliveryMansList = new List <DeliveryMan>();
            AdultsByCityList         = new List <Adult>();
            DeliveryMansList         = deliveryM.Get_All_DeliveryMans();
            string   cityPath   = @"..\..\..\Cities and Streets xml\CitiesList.xml";
            XElement citiesRoot = XElement.Load(cityPath);

            cities = (from item in citiesRoot.Elements() select item.Value).ToList();
            this.LogIn_AdministratorViewModel = logIn_AdministratorViewModel;
            btn_CMD      = new BtnOfMenu_Command(LogIn_AdministratorViewModel);
            selectedDate = DateTime.Now;
        }