公司级看板,月计划、周计划项目详情补充查询条件
This commit is contained in:
@@ -46,16 +46,72 @@ namespace FineUIPro.Web.DataShow
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var lastWeek = (from x in db.JDGL_WeekPlan where x.ProjectId == this.ProjectId && DateTime.Now > ((DateTime)x.EndDate).AddDays(1) orderby x.EndDate select x).FirstOrDefault();
|
||||
|
||||
this.WeekNo = lastWeek.WeekNo;
|
||||
var lastWeek = (from x in db.JDGL_WeekPlan where x.ProjectId == this.ProjectId && DateTime.Now > ((DateTime)x.EndDate).AddDays(1) orderby x.EndDate descending select x).FirstOrDefault();
|
||||
|
||||
this.WeekNo = lastWeek != null ? lastWeek.WeekNo : string.Empty;
|
||||
this.InitDropDownList();
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化下拉框
|
||||
/// </summary>
|
||||
private void InitDropDownList()
|
||||
{
|
||||
WeekItemService.InitWeekItemDropDownList(this.drpWeekNo, this.ProjectId, false);
|
||||
if (!string.IsNullOrWhiteSpace(this.WeekNo))
|
||||
{
|
||||
var item = WeekItemService.GetWeekItemByProjectIdAndWeekNo(this.ProjectId, int.Parse(this.WeekNo));
|
||||
if (item != null)
|
||||
{
|
||||
this.drpWeekNo.SelectedValue = item.WeekNo.ToString();
|
||||
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", item.StartDate);
|
||||
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", item.EndDate);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//获取当前时间所在周号,存在默认选中当前时间点所在周,否则选择最后一个周
|
||||
var item = WeekItemService.GetWeekItemByDateNow(this.ProjectId);
|
||||
if (item != null)
|
||||
{//存在默认选中当前时间点所在周
|
||||
this.drpWeekNo.SelectedValue = item.WeekNo.ToString();
|
||||
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", item.StartDate);
|
||||
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", item.EndDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
var items = WeekItemService.GetWeekItemList(this.ProjectId);
|
||||
if (items.Any())
|
||||
{//否则选择最后一个周
|
||||
item = items.First();
|
||||
this.drpWeekNo.SelectedValue = item.WeekNo.ToString();
|
||||
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", item.StartDate);
|
||||
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", item.EndDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 周号选择触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpWeekNo_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string weekNo = this.drpWeekNo.SelectedValue;
|
||||
this.WeekNo = weekNo;
|
||||
var item = BLL.WeekItemService.GetWeekItemByProjectIdAndWeekNo(this.ProjectId, int.Parse(weekNo));
|
||||
if (item != null)
|
||||
{
|
||||
this.drpWeekNo.SelectedValue = item.WeekNo.ToString();
|
||||
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", item.StartDate);
|
||||
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", item.EndDate);
|
||||
}
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载Grid
|
||||
|
||||
Reference in New Issue
Block a user