chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.ComponentModel;
|
||||
using WebLib;
|
||||
|
||||
namespace 報到系統
|
||||
{
|
||||
[DataObject]
|
||||
public class DAC_BPAA : DAC
|
||||
{
|
||||
public DAC_BPAA()
|
||||
{ }
|
||||
|
||||
public DAC_BPAA(DbConnection conn)
|
||||
: base(conn)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// 搜尋專案 - 用於自動完成
|
||||
/// </summary>
|
||||
[DataObjectMethod(DataObjectMethodType.Select)]
|
||||
public NameValueList Select(string keyword)
|
||||
{
|
||||
if (string.IsNullOrEmpty(keyword))
|
||||
return new NameValueList();
|
||||
|
||||
DbCommand cmdSelect = NewCommand();
|
||||
cmdSelect.CommandText =
|
||||
@"select BPPYN as Value, BPPYM as Name
|
||||
from BPAA
|
||||
where (BPPYN like @BPPYN or BPPYM like @BPPYM)";
|
||||
|
||||
AddParam(cmdSelect, "BPPYN", $"%{keyword}%");
|
||||
AddParam(cmdSelect, "BPPYM", $"%{keyword}%");
|
||||
|
||||
cmdSelect.CommandText += " order by BPPYN";
|
||||
|
||||
var result = new NameValueList();
|
||||
var list = result as IDataList;
|
||||
Select(cmdSelect, ref list);
|
||||
return result;
|
||||
}
|
||||
|
||||
public string SelectProjectName(string value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
return string.Empty;
|
||||
|
||||
DbCommand cmdSelect = NewCommand();
|
||||
cmdSelect.CommandText =
|
||||
@"select BPPYM as Name
|
||||
from BPAA
|
||||
where BPPYN = @BPPYN";
|
||||
AddParam(cmdSelect, "BPPYN", value);
|
||||
ExecuteScalar(cmdSelect, out string name);
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user