小程序接口修改
This commit is contained in:
@@ -99,14 +99,27 @@ namespace BLL
|
||||
}
|
||||
return name;
|
||||
}
|
||||
public static string getDepartNameByIdForApi(string departId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string name = string.Empty;
|
||||
var dep = db.Base_Depart.FirstOrDefault(e => e.DepartId == departId);
|
||||
if (dep != null)
|
||||
{
|
||||
name = dep.DepartName;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
#region 表下拉框
|
||||
/// <summary>
|
||||
/// 表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitDepartDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
#region 表下拉框
|
||||
/// <summary>
|
||||
/// 表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitDepartDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "DepartId";
|
||||
dropName.DataTextField = "DepartName";
|
||||
|
||||
@@ -170,14 +170,38 @@
|
||||
|
||||
return roleName;
|
||||
}
|
||||
public static string getRoleNamesRoleIdsForApi(object roleIds)
|
||||
{
|
||||
string roleName = string.Empty;
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
if (roleIds != null)
|
||||
{
|
||||
string[] roles = roleIds.ToString().Split(',');
|
||||
foreach (string roleId in roles)
|
||||
{
|
||||
var q = db.Sys_Role.FirstOrDefault(x => x.RoleId == roleId);
|
||||
if (q != null && !roleName.Contains(q.RoleName))
|
||||
{
|
||||
roleName += q.RoleName + ",";
|
||||
}
|
||||
}
|
||||
if (roleName != string.Empty)
|
||||
{
|
||||
roleName = roleName.Substring(0, roleName.Length - 1); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return roleName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 角色下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitRoleDropDownList(FineUIPro.DropDownList dropName, string roleId, bool? isOffice, bool isShowPlease)
|
||||
/// <summary>
|
||||
/// 角色下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitRoleDropDownList(FineUIPro.DropDownList dropName, string roleId, bool? isOffice, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "RoleId";
|
||||
dropName.DataTextField = "RoleName";
|
||||
|
||||
@@ -126,14 +126,27 @@
|
||||
}
|
||||
return passScore;
|
||||
}
|
||||
public static int getPassScoreForApi()
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
int passScore = 80;
|
||||
var testRule = db.Sys_TestRule.FirstOrDefault();
|
||||
if (testRule != null)
|
||||
{
|
||||
passScore = testRule.PassingScore;
|
||||
}
|
||||
return passScore;
|
||||
}
|
||||
}
|
||||
|
||||
#region 菜单编码模板
|
||||
/// <summary>
|
||||
/// 获取菜单编码模板信息 根据MenuId
|
||||
/// </summary>
|
||||
/// <param name="menuId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Sys_CodeTemplateRule GetCodeTemplateRuleByMenuId(string menuId)
|
||||
#region 菜单编码模板
|
||||
/// <summary>
|
||||
/// 获取菜单编码模板信息 根据MenuId
|
||||
/// </summary>
|
||||
/// <param name="menuId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Sys_CodeTemplateRule GetCodeTemplateRuleByMenuId(string menuId)
|
||||
{
|
||||
return Funs.DB.Sys_CodeTemplateRule.FirstOrDefault(x => x.MenuId == menuId);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -160,13 +160,26 @@ namespace BLL
|
||||
|
||||
return userName;
|
||||
}
|
||||
public static string GetUserNameByUserIdForApi(string userId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string userName = string.Empty;
|
||||
Model.Sys_User user = db.Sys_User.FirstOrDefault(e => e.UserId == userId);
|
||||
if (user != null)
|
||||
{
|
||||
userName = user.UserName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据用户获取用户名称
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetUserNameAndTelByUserId(string userId)
|
||||
return userName;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据用户获取用户名称
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetUserNameAndTelByUserId(string userId)
|
||||
{
|
||||
string userName = string.Empty;
|
||||
Model.Sys_User user = Funs.DB.Sys_User.FirstOrDefault(e => e.UserId == userId);
|
||||
@@ -1322,16 +1335,41 @@ namespace BLL
|
||||
}
|
||||
|
||||
return userName;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public static string getUserNamesUserIdsForApi(object userIds)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string userName = string.Empty;
|
||||
if (userIds != null)
|
||||
{
|
||||
string[] ids = userIds.ToString().Split(',');
|
||||
foreach (string id in ids)
|
||||
{
|
||||
var q = db.Sys_User.FirstOrDefault(e => e.UserId == id);
|
||||
if (q != null)
|
||||
{
|
||||
userName += q.UserName + ",";
|
||||
}
|
||||
}
|
||||
if (userName != string.Empty)
|
||||
{
|
||||
userName = userName.Substring(0, userName.Length - 1); ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Sys_User> GetProjectUserListByProjectIdForApi(string projectId, string name)
|
||||
return userName;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Sys_User> GetProjectUserListByProjectIdForApi(string projectId, string name)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user