Example #1
0
        public EditPriceCostForm(IPriceCostRepo repo, PriceCostBl item = null)
        {
            InitializeComponent();
            _repo = repo;
            _item = item;

            if (item != null)
            {
                Text = "Редактирование себестоимости";
            }
            else
            {
                Text          = "Новая себестоимость";
                _item         = new PriceCostBl();
                _item.DateEnd = DateTime.Today;
            }

            textEditType.DataBindings.Add("EditValue", _item, nameof(_item.Type), true, DataSourceUpdateMode.OnPropertyChanged);
            textEditProcedure.DataBindings.Add("EditValue", _item, nameof(_item.Procedure), true, DataSourceUpdateMode.OnPropertyChanged);
            numericUpDownValue.DataBindings.Add("Value", _item, nameof(_item.Value), true, DataSourceUpdateMode.OnPropertyChanged);
            dateEditDateEnd.DataBindings.Add("EditValue", _item, nameof(_item.DateEnd), true, DataSourceUpdateMode.OnPropertyChanged);
        }
Example #2
0
 public UCPriceCost()
 {
     InitializeComponent();
     _repo = Di.Container.Instance.Resolve <IPriceCostRepo>();
 }