public void Command() { ContainerBuilder build = new ContainerBuilder(); var ioc = ContainerManage.Register(build); var bus = ioc.Resolve <ICommandBus>(); var resp = bus.Send <Command1, Command1Result>(new Command1()); }
public void Event() { Autofac.ContainerBuilder build = new Autofac.ContainerBuilder(); var ioc = ContainerManage.Register(build); var bus = ioc.Resolve <IEventBus>(); bus.Publish(new Event1()); bus.Publish(new Event2()); }
private void Btn_select_container_Click(object sender, EventArgs e) { data_point.Rows.Clear(); var containers = ContainerManage.SelectContainer(cbpoints.SelectedItem.ToString()); containers.ForEach(container => { data_point.Rows.Add(container.containercode, container.materielcode, container.capacity); }); }
private void Btn_add_Click(object sender, EventArgs e) { Container container = new Container(); container.containercode = txtcontainercode.Text; container.materielcode = cbmateriels.SelectedItem.ToString(); container.capacity = Convert.ToDouble(txtcapacity.Text); ContainerManage.AddContainer(container); MessageBox.Show("添加完成!"); Close(); }
private void FrmAddPointContainer_Load(object sender, EventArgs e) { txtpointcode.Text = PointCode; List <Container> containers = ContainerManage.SelectContainerByWare(WareCode); cbcontainers.Items.Clear(); containers.ForEach(container => { cbcontainers.Items.Add(container.containercode); }); if (cbcontainers.Items.Count > 0) { cbcontainers.SelectedIndex = 0; } }