/// <summary> /// Generic lookup which shows a list of class instances /// </summary> /// <param name="dataTable">List of classes whose properties are shown</param> /// <param name="displayPropertyName">Name of property which should be shown in the lookup form</param> /// <param name="displayColumnCaption">Text label for the column on the lookup</param> /// <param name="returnPropertyName">Name of property which should be returned from selected record</param> /// <param name="returnPropertyValue">out string of the value in the return property</param> /// <param name="sizeFactor"></param> /// <param name="defaultValue">default focused row when lookup form opens</param> /// <returns>Exit result of the lookup dialog</returns> public DialogResult GenericLookup(IList dataTable, string displayPropertyName, string displayColumnCaption, string returnPropertyName, out String returnPropertyValue, string defaultValue) { using (frmGenericLookup frmGenericLookup = new frmGenericLookup(dataTable, displayPropertyName, displayColumnCaption, returnPropertyName, defaultValue)) { LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(frmGenericLookup); returnPropertyValue = frmGenericLookup.SelectedString; return(frmGenericLookup.DialogResult); } }
/// <summary> /// Generic lookup. /// </summary> /// <param name="dataTable"></param> /// <param name="displayColumn"></param> /// <param name="selectedRow"></param> /// <param name="sizeFactor"></param> /// <param name="defaultValue"></param> /// <returns></returns> public DialogResult GenericLookup(System.Data.DataTable dataTable, int displayColumn, ref System.Data.DataRow selectedRow, string defaultValue) { using (frmGenericLookup frmGenericLookup = new frmGenericLookup(dataTable, displayColumn, defaultValue)) { LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(frmGenericLookup); selectedRow = frmGenericLookup.SelectedDataRow; return(frmGenericLookup.DialogResult); } }