コード例 #1
0
ファイル: EquipmentManage.cs プロジェクト: Winsor/ITInfra
 private void cmiCustomerLink_Click(object sender, EventArgs e)
 {
     CustomersSidesForm csf = new CustomersSidesForm(_dataContexts) { SelectColumnVisible = true, FocusedLink = _clonedEquipment.SideLink };
     csf.OnClickSelectSideButton += (s, ee) =>
     {
         csf.DialogResult = DialogResult.OK;
     };
     if (csf.ShowDialog(this) == DialogResult.OK)
     {
         if (_clonedEquipment.SideLink == null)
         {
             _clonedEquipment.SideLink = new SideLink() { LinkId = Guid.NewGuid() };
             _clonedEquipment.SideLinkId = _clonedEquipment.SideLink.LinkId;
         }
         Customer customer = csf.gvCustomers.SelectedRows[0].DataBoundItem as Customer;
         if (customer == null) throw new Exception("Invalid Customer");
         CustomerSide customerSide = csf.gvSides.SelectedRows[0].DataBoundItem as CustomerSide;
         if (customerSide == null) throw new Exception("Invalid Assignment");
         _clonedEquipment.SideLink.LinkType = (int)SideLinkType.toCustomerSide;
         _clonedEquipment.SideLink.CustomerSide = customerSide;
         _clonedEquipment.SideLink.LinkCustomerSideId = customerSide.Id;
         tbCustomer.Text = _dataContexts.GetSideLinkDescription2(_clonedEquipment.SideLink);
     }
 }
コード例 #2
0
 private void miCustomersSidesVocab_Click(object sender, EventArgs e)
 {
     if (SharedAppData.IsAccesible(CustomersSidesForm.ObjectAccessId))
     {
         CustomersSidesForm customersSidesForm = new CustomersSidesForm(_dataContexts);
         customersSidesForm.OnHistoryEvent += _ => SharedAppData.HistoryStore.AddHistoryEvent(_);
         customersSidesForm.ShowDialog(this);
     }
     else
     {
         MessageBox.Show(@"Отсутсвуют права на использование " + CustomersSidesForm.ObjectAccessId.Description + @"!");
     }
 }