Пример #1
0
            public static SPDataProxy.SPLookupDataTable GetSearchResults(string SearchType, string SubType, string SearchFor, string SearchItem, string ConnectionString)
            {
                if (string.IsNullOrEmpty(ConnectionString))
                {
                    using (SoftLogik.Win.SPDataProxyTableAdapters.taSPLookup lookupAdapter = new SoftLogik.Win.SPDataProxyTableAdapters.taSPLookup())
                    {
                        return lookupAdapter.GetSearchResults(SearchType, SubType, SearchFor, SearchItem);
                    }

                }
                else
                {
                    SoftLogik.Win.Data.ISPDataStore lookupAdapter = new SQLDataStore(new System.Data.SqlClient.SqlConnection(ConnectionString));
                    SPDataParamCollection objParams = new SPDataParamCollection();

                    objParams.Add("@SearchType", SearchType);
                    objParams.Add("@SubType", SubType);
                    objParams.Add("@SearchFor", SearchFor);
                    objParams.Add("@SearchItem", SearchItem);

                    DataTable genericSearchTable = lookupAdapter.GetTable("SPLookup_Search", ref objParams, false);
                    SPDataProxy.SPLookupDataTable searchTable = new SPDataProxy.SPLookupDataTable();
                    searchTable.Load(genericSearchTable.CreateDataReader());
                    return searchTable;
                }
            }
							[global::System.Diagnostics.DebuggerNonUserCodeAttribute(), global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]public virtual SPDataProxy.SPLookupDataTable GetSearchResults(string SearchType, string SubType, string SearchFor, string SearchItem)
							{
								this.Adapter.SelectCommand = this.CommandCollection(0);
								if (SearchType == null)
								{
									this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
								}
								else
								{
									this.Adapter.SelectCommand.Parameters[1].Value = System.Convert.ToString(SearchType);
								}
								if (SubType == null)
								{
									this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
								}
								else
								{
									this.Adapter.SelectCommand.Parameters[2].Value = System.Convert.ToString(SubType);
								}
								if (SearchFor == null)
								{
									this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value;
								}
								else
								{
									this.Adapter.SelectCommand.Parameters[3].Value = System.Convert.ToString(SearchFor);
								}
								if (SearchItem == null)
								{
									this.Adapter.SelectCommand.Parameters[4].Value = global::System.DBNull.Value;
								}
								else
								{
									this.Adapter.SelectCommand.Parameters[4].Value = System.Convert.ToString(SearchItem);
								}
								SPDataProxy.SPLookupDataTable dataTable = new SPDataProxy.SPLookupDataTable();
								this.Adapter.Fill(dataTable);
								return dataTable;
							}