Пример #1
0
 public BillWindow(ClientBill clientBill, YearAndMonth date)
 {
     InitializeComponent();
     viewModel   = CrmContianer.container.GetInstance <IBillViewModel>();
     DataContext = viewModel;
     viewModel.GetClientBill(clientBill);
     viewModel.GetGridFromWindow(DynamicGrid);
 }
Пример #2
0
        public AutoEditBillForm(ViewModelBase vm, string title, EditFormPurpose formPurpose)
            : base(vm, title, formPurpose)
        {
            //if (!vm.GetType().Is(typeof(IBillViewModel))) throw new Exception(vm.GetType().FullName + "不是有效的IBillViewModel!");
            _billModel = (IBillViewModel)vm;

            _separator = new ToolStripSeparator();
            _bAddRow   = new ToolStripButton("添加明细(&A)", Properties.Resources.icons8_加_40, OnAddRow, "bAddRow")
            {
                TextImageRelation = TextImageRelation.ImageAboveText
            };
            _bRemove = new ToolStripButton("删除明细(&R)", Properties.Resources.icons8_减去_40, OnRemove, "bRemove")
            {
                TextImageRelation = TextImageRelation.ImageAboveText
            };
            toolStrip1.Items.Insert(1, _bRemove);
            toolStrip1.Items.Insert(1, _bAddRow);
            toolStrip1.Items.Insert(1, _separator);
            ShowGroupHeader = false;

            InitializeComponent();

            CreateDetailEditor();
        }