0915-gaofei
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -35,7 +36,19 @@ namespace BLL
|
||||
/// <param name="months">月</param>
|
||||
public static Model.WBS_CostControlDetail GetCostControlDetailByCostControlIdAndMonths(string costControlId, DateTime months)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == null select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据costControlId和年及月获取对应费控项明细信息
|
||||
/// </summary>
|
||||
/// <param name="costControlId">对应wbsId</param>
|
||||
/// <param name="toFlag">对应标志</param>
|
||||
/// <param name="years">年</param>
|
||||
/// <param name="months">月</param>
|
||||
public static Model.WBS_CostControlDetail GetCostControlDetailByCostControlIdAndMonthsWeek(string costControlId, DateTime months,DateTime startDate)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == startDate select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -57,9 +70,21 @@ namespace BLL
|
||||
/// <param name="toFlag">对应标志</param>
|
||||
/// <param name="years">年</param>
|
||||
/// <param name="months">月</param>
|
||||
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdYearMonth(string costControlId, DateTime months)
|
||||
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdAndMonth(string costControlId, DateTime months)
|
||||
{
|
||||
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
|
||||
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == null select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据costControlId和年及月获取对应费控项明细信息
|
||||
/// </summary>
|
||||
/// <param name="costControlId">对应wbsId</param>
|
||||
/// <param name="toFlag">对应标志</param>
|
||||
/// <param name="years">年</param>
|
||||
/// <param name="months">月</param>
|
||||
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdAndMonthWeek(string costControlId, DateTime months, DateTime startDate)
|
||||
{
|
||||
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == startDate select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
public static Model.WBS_CostControlDetail GetWBS_CostControlDetailByCostControlId(string costControlId)
|
||||
@@ -74,7 +99,7 @@ namespace BLL
|
||||
/// <param name="toFlag"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExitWBS_CostControlDetailByCostControlIdOrMonth(string costControlId, DateTime months)
|
||||
public static bool IsExitWeekCostControlDetailByCostControlIdAndMonth(string costControlId, DateTime months)
|
||||
{
|
||||
bool result = false;
|
||||
var q = Funs.DB.WBS_CostControlDetail.FirstOrDefault(e => e.CostControlId == costControlId && e.Months == months);
|
||||
@@ -99,9 +124,18 @@ namespace BLL
|
||||
/// 根据CostControlId月获取所有月份的对应费控项明细信息集合
|
||||
/// </summary>
|
||||
/// <param name="costControlId">costControlId</param>
|
||||
public static List<Model.WBS_CostControlDetail> GetCostControlDetailsByCostControlId(string costControlId)
|
||||
public static List<Model.WBS_CostControlDetail> GetMonthCostControlDetailsByCostControlId(string costControlId)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId orderby x.Months select x).ToList();
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.StartDate == null orderby x.Months select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据CostControlId月获取对应月份的对应费控项周明细信息集合
|
||||
/// </summary>
|
||||
/// <param name="costControlId">costControlId</param>
|
||||
public static List<Model.WBS_CostControlDetail> GetWeekCostControlDetailsByCostControlId(string costControlId, DateTime months)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate != null orderby x.StartDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -115,6 +149,8 @@ namespace BLL
|
||||
newWBS_CostControlDetail.CostControlDetailId = costControlDetail.CostControlDetailId;
|
||||
newWBS_CostControlDetail.CostControlId = costControlDetail.CostControlId;
|
||||
newWBS_CostControlDetail.Months = costControlDetail.Months;
|
||||
newWBS_CostControlDetail.StartDate = costControlDetail.StartDate;
|
||||
newWBS_CostControlDetail.EndDate = costControlDetail.EndDate;
|
||||
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
|
||||
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
|
||||
|
||||
@@ -130,6 +166,8 @@ namespace BLL
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.WBS_CostControlDetail newWBS_CostControlDetail = db.WBS_CostControlDetail.First(e => e.CostControlDetailId == costControlDetail.CostControlDetailId);
|
||||
newWBS_CostControlDetail.StartDate = costControlDetail.StartDate;
|
||||
newWBS_CostControlDetail.EndDate = costControlDetail.EndDate;
|
||||
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
|
||||
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
|
||||
|
||||
@@ -162,5 +200,54 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 周计划下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitWeekPlanList(FineUIPro.DropDownList dropName, string costControlId, DateTime months, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetWeekPlanList(costControlId, months);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据费控项Id和月份获取对应月份的周计划记录
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetWeekPlanList(string costControlId, DateTime months)
|
||||
{
|
||||
var q = (from x in Funs.DB.WBS_CostControlDetail
|
||||
where x.CostControlId == costControlId && x.Months == months && x.StartDate != null
|
||||
orderby x.StartDate
|
||||
select x).ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
string dateStr = string.Empty, date = string.Empty;
|
||||
for (int i = 0; i < list.Count(); i++)
|
||||
{
|
||||
date = string.Empty;
|
||||
dateStr = string.Empty;
|
||||
if (q[i].StartDate != null)
|
||||
{
|
||||
dateStr = string.Format("{0:yyyy-MM-dd}", q[i].StartDate);
|
||||
date = string.Format("{0:yyyy-MM-dd}", q[i].StartDate);
|
||||
}
|
||||
if (q[i].EndDate != null)
|
||||
{
|
||||
dateStr += "至" + string.Format("{0:yyyy-MM-dd}", q[i].EndDate);
|
||||
date += "," + string.Format("{0:yyyy-MM-dd}", q[i].EndDate);
|
||||
}
|
||||
list[i] = new ListItem(dateStr, date);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user