This commit is contained in:
高飞 2025-06-09 10:47:10 +08:00
parent b60a408dd5
commit 710db11e43
5 changed files with 22 additions and 4 deletions

View File

@ -73,7 +73,7 @@ namespace BLL
Model.SGGLDB db = Funs.DB;
var fbUnit = from x in db.Project_Unit
join y in db.Base_Unit on x.UnitId equals y.UnitId
where x.ProjectId == projectId && y.IsSubUnit == isSubUnit
where x.ProjectId == projectId && y.IsSubUnit == isSubUnit
select x;
if (fbUnit.Count() > 0)
{
@ -106,6 +106,18 @@ namespace BLL
return pUnit;
}
/// <summary>
/// 根据项目id和单位id获取单位是否在项目中
/// </summary>
/// <param name="projectId"></param>
/// <param name="unitId"></param>
/// <returns></returns>
public static Model.Project_Unit GetProject_UnitByUnitId(string unitId)
{
var pUnit = Funs.DB.Project_Unit.FirstOrDefault(x => x.UnitId == unitId && x.UnitType != null && x.UnitType != "");
return pUnit;
}
/// <summary>
/// 根据项目id获取项目单位信息
/// </summary>

View File

@ -260,7 +260,7 @@ namespace BLL
pUnit.ProjectId = projectid;
pUnit.UnitId = item.UnitId;
//单位类型
var bresult = bUnit.FirstOrDefault(x => x.UnitId == item.UnitId);
var bresult = bUnit.FirstOrDefault(x => x.UnitId == item.UnitId && x.UnitType!=null && x.UnitType!="");
if (bresult != null)
{
pUnit.UnitType = bresult.UnitType;

View File

@ -31,7 +31,7 @@
<Rows>
<f:FormRow ColumnWidths="25% 25% 20%">
<Items>
<f:DropDownList ID="drpProject" runat="server" LabelWidth="80px" Label="项目" EnableCheckBoxSelect="true" EnableMultiSelect="true">
<f:DropDownList ID="drpProject" runat="server" LabelWidth="80px" Label="项目" EnableCheckBoxSelect="true" EnableEdit="true" EnableMultiSelect="true">
</f:DropDownList>
<f:TextBox ID="txtIsoNo" runat="server" Label="管线号">
</f:TextBox>

View File

@ -11,7 +11,7 @@
<FineUIPro DebugMode="false" Theme="Cupertino"/>
<appSettings>
<!--连接字符串-->
<add key="ConnectionString" value="Server=.\SQL2019;Database=HJGLDB_DS;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/>
<add key="ConnectionString" value="Server=.\MSSQLSERVER01;Database=HJGLDB_DS;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/>
<!--系统名称-->
<add key="SystemName" value="诺必达焊接管理系统"/>
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/>

View File

@ -200,6 +200,11 @@ namespace FineUIPro.Web.common.BaseInfo
newUnit.ProjectId = newProjectId;
newUnit.UnitId = this.CurrUser.UnitId;
newUnit.InTime = System.DateTime.Now;
Model.Project_Unit pu = BLL.Project_UnitService.GetProject_UnitByUnitId(newUnit.UnitId);
if (pu != null)
{
newUnit.UnitType = pu.UnitType;
}
BLL.Project_UnitService.AddProject_Unit(newUnit);
// 给新项目项目用户插入当前用户
@ -266,6 +271,7 @@ namespace FineUIPro.Web.common.BaseInfo
Model.Project_Unit nUnit = new Model.Project_Unit();
nUnit.UnitId = this.drpCheckUnit.SelectedValue;
nUnit.ProjectId = project.ProjectId;
nUnit.UnitType = BLL.Const.UnitType_8;
BLL.Project_UnitService.AddProject_Unit(nUnit);
}
}