예제 #1
0
        public CustomerDetail(DetailMode mode,
                              Dashboard parent,
                              AddressRepository addressRepo,
                              CustomerRepository custRepo,
                              Customer customerToModify = null)
        {
            CustomerRepo = custRepo;
            AddressRepo  = addressRepo;

            Mode      = mode;
            Dashboard = parent;
            if (customerToModify != null)
            {
                CustomerToModify = customerToModify;
                AddressToModify  = AddressRepo.GetAddress(customerToModify.AddressId);
            }

            Cities = AddressRepo.GetAllCities();

            InitializeComponent();

            lblError.Visible      = false;
            cmbCity.ValueMember   = "Id";
            cmbCity.DisplayMember = "Name";
            cmbCity.DataSource    = Cities;
        }