小程序接口修改
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using NPOI.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -331,8 +332,22 @@ namespace BLL
|
||||
name = unit.UnitName;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
public static string GetUnitNameByUnitId(object unitId)
|
||||
}
|
||||
public static string GetUnitNameByUnitIdForApi(string unitId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
|
||||
string name = string.Empty;
|
||||
var unit = db.Base_Unit.FirstOrDefault(x => x.UnitId == unitId);
|
||||
if (unit != null)
|
||||
{
|
||||
name = unit.UnitName;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
public static string GetUnitNameByUnitId(object unitId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
if (unitId != null)
|
||||
@@ -391,14 +406,26 @@ namespace BLL
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
#region 单位表下拉框
|
||||
/// <summary>
|
||||
/// 单位表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitUnitDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
|
||||
public static string GetUnitCodeByUnitIdForApi(string unitId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string code = string.Empty;
|
||||
var unit = db.Base_Unit.FirstOrDefault(x => x.UnitId == unitId);
|
||||
if (unit != null)
|
||||
{
|
||||
code = unit.UnitCode;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
}
|
||||
#region 单位表下拉框
|
||||
/// <summary>
|
||||
/// 单位表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitUnitDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "UnitId";
|
||||
dropName.DataTextField = "UnitName";
|
||||
@@ -645,14 +672,39 @@ namespace BLL
|
||||
|
||||
return unitName;
|
||||
}
|
||||
#endregion
|
||||
public static string getUnitNamesUnitIdsForApi(object unitIds)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string unitName = string.Empty;
|
||||
if (unitIds != null)
|
||||
{
|
||||
string[] ids = unitIds.ToString().Split(',');
|
||||
foreach (string id in ids)
|
||||
{
|
||||
var q = db.Base_Unit.FirstOrDefault(x => x.UnitId == id) ;
|
||||
if (q != null)
|
||||
{
|
||||
unitName += q.UnitName + ",";
|
||||
}
|
||||
}
|
||||
if (unitName != string.Empty)
|
||||
{
|
||||
unitName = unitName.Substring(0, unitName.Length - 1); ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目Id获取总包和分包单位名称项
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] drpMainOrSubUnitList(string projectId)
|
||||
return unitName;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目Id获取总包和分包单位名称项
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] drpMainOrSubUnitList(string projectId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
|
||||
Reference in New Issue
Block a user