/// <summary>
    /// 
    /// </summary>
    /// <param name="vendor"></param>
    /// <returns>True = vendor was selected, False = dialog cancelled</returns>
    static public bool ShowModal(Control parentCtrl, out VendorSelection vendor)
    {
      vendor = null;

      frmVendorSearch frm = new frmVendorSearch();
      frm.Owner = Window.GetWindow(parentCtrl);
      //frm.Top = parentCtrl.hor
      frm.ShowDialog();
      
      if (!frm.DialogResult.Value) return ( false );

      DataRowView row = frm.grdVendorList.SelectedItem as DataRowView;
      vendor = new VendorSelection() {
        VendorName = row["ShortDescription"],
        VendorID = row["VendorID"]
      };
      return (true);
    }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="vendor"></param>
        /// <returns>True = vendor was selected, False = dialog cancelled</returns>
        static public bool ShowModal(Control parentCtrl, out VendorSelection vendor)
        {
            vendor = null;

            frmVendorSearch frm = new frmVendorSearch();

            frm.Owner = Window.GetWindow(parentCtrl);
            //frm.Top = parentCtrl.hor
            frm.ShowDialog();

            if (!frm.DialogResult.Value)
            {
                return(false);
            }

            DataRowView row = frm.grdVendorList.SelectedItem as DataRowView;

            vendor = new VendorSelection()
            {
                VendorName = row["ShortDescription"],
                VendorID   = row["VendorID"]
            };
            return(true);
        }