29 Kasım 2017 Çarşamba

Action İle Formdan Forma Veri Taşımak

   1. Adım Ben bunu bir method içinde kullandım .

Action setCustomerAction = delegate (int CustomerId)
            {
                _customerId = CustomerId;

                _controller.List(new CustomerFilterModel() { CustomerId = _customerId });
                var searchSponsor = _controller.DataSource.FirstOrDefault();


                lblCustomerTitle.Text = searchSponsor.Title;
                txtCustomerCode.Text = searchSponsor.CustomerCode;
            };

2.Adım Actionu diğer forma göndeririz.
   var customerList = new UICurrentList(_controller, setCustomerAction);
            customerList.Show();




   3.Adım Actionun içine parametreyi gönderip Invoke ettikmi 1. adımdaki kod çalışır.

_selectCustomerId.Invoke(_listController.DataSource.FirstOrDefault().CustomerId);

Hiç yorum yok:

Yorum Gönder