提交代码
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -102,5 +103,104 @@ namespace BLL
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetTypes()
|
||||
{
|
||||
var q = (from x in Funs.DB.Base_TestRunPerformanceStandard orderby x.Code select new { Value = x.Type, Code1 = x.Code1 }).Distinct().ToList();
|
||||
q = q.OrderBy(x => x.Code1).ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
for (int i = 0; i < q.Count(); i++)
|
||||
{
|
||||
list[i] = new ListItem(q[i].Value ?? "", q[i].Value);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitTypeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Text";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetTypes();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetItems(string type)
|
||||
{
|
||||
var q = (from x in Funs.DB.Base_TestRunPerformanceStandard where x.Type == type orderby x.Code select new { Value = x.Item, Code1 = x.Code2 }).Distinct().ToList();
|
||||
q = q.OrderBy(x => x.Code1).ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
for (int i = 0; i < q.Count(); i++)
|
||||
{
|
||||
list[i] = new ListItem(q[i].Value ?? "", q[i].Value);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitItemDropDownList(FineUIPro.DropDownList dropName, string type, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Text";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetItems(type);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetUnits(string type, string item)
|
||||
{
|
||||
var q = (from x in Funs.DB.Base_TestRunPerformanceStandard where x.Type == type && x.Item == item orderby x.Code select new { Value = x.Unit, Code1 = x.Code3, x.TestRunPerformanceStandardId }).ToList();
|
||||
q = q.OrderBy(x => x.Code1).ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
for (int i = 0; i < q.Count(); i++)
|
||||
{
|
||||
list[i] = new ListItem(q[i].Value ?? "", q[i].TestRunPerformanceStandardId);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitUnitDropDownList(FineUIPro.DropDownList dropName, string type, string item, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetUnits(type, item);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user