2024-01-26 开车分包管理修改
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FineUIPro;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -11,6 +13,74 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class DriverSubPlanService
|
||||
{
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int Count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static IQueryable<Model.DriverSub_DriverSubPlan> GetDriverSub_DriverSubPlanByModle(Model.DriverSub_DriverSubPlan table)
|
||||
{
|
||||
var q = from x in Funs.DB.DriverSub_DriverSubPlan
|
||||
where
|
||||
(string.IsNullOrEmpty(table.DriverSubPlanId) || x.DriverSubPlanId.Contains(table.DriverSubPlanId)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.Code) || x.Code.Contains(table.Code)) &&
|
||||
(string.IsNullOrEmpty(table.SubUnitId) || x.SubUnitId.Contains(table.SubUnitId)) &&
|
||||
(string.IsNullOrEmpty(table.Introductions) || x.Introductions.Contains(table.Introductions)) &&
|
||||
(string.IsNullOrEmpty(table.Achievement) || x.Achievement.Contains(table.Achievement)) &&
|
||||
(string.IsNullOrEmpty(table.Cooperation) || x.Cooperation.Contains(table.Cooperation)) &&
|
||||
(string.IsNullOrEmpty(table.InstallationIds) || x.InstallationIds.Contains(table.InstallationIds)) &&
|
||||
(string.IsNullOrEmpty(table.InstallationNames) || x.InstallationNames.Contains(table.InstallationNames)) &&
|
||||
(string.IsNullOrEmpty(table.AttachUrl) || x.AttachUrl.Contains(table.AttachUrl)) &&
|
||||
(string.IsNullOrEmpty(table.Remark) || x.Remark.Contains(table.Remark)) &&
|
||||
(string.IsNullOrEmpty(table.DriverSubNames) || x.DriverSubNames.Contains(table.DriverSubNames))
|
||||
select x
|
||||
;
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="table"></param>
|
||||
/// <param name="grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IQueryable GetListData(Model.DriverSub_DriverSubPlan table, Grid grid1)
|
||||
{
|
||||
var q = GetDriverSub_DriverSubPlanByModle(table);
|
||||
Count = q.Count() ;
|
||||
if (Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize);
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.DriverSubPlanId,
|
||||
x.ProjectId,
|
||||
x.Code,
|
||||
x.SubUnitId,
|
||||
x.Introductions,
|
||||
x.Achievement,
|
||||
x.Cooperation,
|
||||
x.InstallationIds,
|
||||
x.InstallationNames,
|
||||
x.IsInvited,
|
||||
x.AttachUrl,
|
||||
x.Remark,
|
||||
x.DriverSubNames,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取开车分包计划信息
|
||||
/// </summary>
|
||||
@@ -20,7 +90,10 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.DriverSub_DriverSubPlan.FirstOrDefault(e => e.DriverSubPlanId == DriverSubPlanId);
|
||||
}
|
||||
|
||||
public static List<Model.DriverSub_DriverSubPlan> GetDriverSubPlanByProjectid(string projectId)
|
||||
{
|
||||
return Funs.DB.DriverSub_DriverSubPlan.Where(e => e.ProjectId == projectId).ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加开车分包计划信息
|
||||
/// </summary>
|
||||
@@ -40,6 +113,7 @@ namespace BLL
|
||||
newDriverSubPlan.IsInvited = DriverSubPlan.IsInvited;
|
||||
newDriverSubPlan.AttachUrl = DriverSubPlan.AttachUrl;
|
||||
newDriverSubPlan.Remark = DriverSubPlan.Remark;
|
||||
newDriverSubPlan.DriverSubNames= DriverSubPlan.DriverSubNames;
|
||||
Funs.DB.DriverSub_DriverSubPlan.InsertOnSubmit(newDriverSubPlan);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
@@ -63,6 +137,8 @@ namespace BLL
|
||||
newDriverSubPlan.IsInvited = DriverSubPlan.IsInvited;
|
||||
newDriverSubPlan.AttachUrl = DriverSubPlan.AttachUrl;
|
||||
newDriverSubPlan.Remark = DriverSubPlan.Remark;
|
||||
newDriverSubPlan.DriverSubNames = DriverSubPlan.DriverSubNames;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -84,5 +160,16 @@ namespace BLL
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void InitSubPlanDropDownList(FineUIPro.DropDownList dropName,string projectid, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "DriverSubPlanId";
|
||||
dropName.DataTextField = "Code";
|
||||
dropName.DataSource = GetDriverSubPlanByProjectid(projectid);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user