提交代码
This commit is contained in:
@@ -62,6 +62,7 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
this.btnNew.Hidden = false;
|
||||
this.btnModify.Hidden = false;
|
||||
this.btnMenuDel.Hidden = false;
|
||||
this.btnMenuDel2.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,6 +79,7 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string weekNo2 = string.Empty;
|
||||
var weekPlan = Funs.DB.JDGL_WeekPlan.FirstOrDefault(x => x.WeekNo == this.drpWeekNo.SelectedValue);
|
||||
if (weekPlan != null)
|
||||
{
|
||||
@@ -89,6 +91,11 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
{
|
||||
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", weekPlan.EndDate);
|
||||
}
|
||||
var lastWeekPlan = (from x in Funs.DB.JDGL_WeekPlan where x.ProjectId == this.CurrUser.LoginProjectId && x.StartDate < weekPlan.StartDate orderby x.StartDate descending select x).FirstOrDefault();
|
||||
if (lastWeekPlan != null)
|
||||
{
|
||||
weekNo2 = lastWeekPlan.WeekNo;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -116,6 +123,24 @@ where mp.ProjectId=@ProjectId and mp.WeekNo=@WeekNo order by mp.SortIndex";
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
||||
string strSql2 = @"select mp.*,u.UnitName,us.UserName as DutyPersonName,uw.UnitWorkName,cn.ProfessionalName,case mp.IsOK when 1 then '已完成' when 0 then '未完成' else '' end as IsOKStr from [dbo].[JDGL_WeekPlan] mp
|
||||
left join Base_Unit u on u.UnitId=mp.UnitId
|
||||
left join Sys_User us on us.UserId=mp.DutyPerson
|
||||
left join WBS_UnitWork uw on uw.UnitWorkId=mp.UnitWork
|
||||
left join Base_CNProfessional cn on cn.CNProfessionalId=mp.Major
|
||||
where mp.ProjectId=@ProjectId2 and mp.WeekNo=@WeekNo2 order by mp.SortIndex";
|
||||
List<SqlParameter> listStr2 = new List<SqlParameter>();
|
||||
listStr2.Add(new SqlParameter("@ProjectId2", this.CurrUser.LoginProjectId));
|
||||
|
||||
listStr2.Add(new SqlParameter("@WeekNo2", weekNo2));
|
||||
SqlParameter[] parameter2 = listStr2.ToArray();
|
||||
DataTable tb2 = SQLHelper.GetDataTableRunText(strSql2, parameter2);
|
||||
Grid2.RecordCount = tb2.Rows.Count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table2 = this.GetPagedDataTable(Grid2, tb2);
|
||||
Grid2.DataSource = table2;
|
||||
Grid2.DataBind();
|
||||
}
|
||||
|
||||
#region 月份选择事件
|
||||
@@ -172,22 +197,36 @@ where mp.ProjectId=@ProjectId and mp.WeekNo=@WeekNo order by mp.SortIndex";
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
BLL.WeekPlanService.DeleteWeekPlanByWeekPlanId(rowID);
|
||||
}
|
||||
var weekPlans = (from x in Funs.DB.JDGL_WeekPlan where x.ProjectId == this.CurrUser.LoginProjectId orderby x.StartDate descending select x.WeekNo).Distinct().OrderByDescending(x => x).ToList();
|
||||
if (weekPlans.Count() > 0)
|
||||
//var weekPlans = (from x in Funs.DB.JDGL_WeekPlan where x.ProjectId == this.CurrUser.LoginProjectId orderby x.StartDate descending select x.WeekNo).Distinct().OrderByDescending(x => x).ToList();
|
||||
//if (weekPlans.Count() > 0)
|
||||
//{
|
||||
// ListItem[] list = new ListItem[weekPlans.Count()];
|
||||
// for (int i = 0; i < weekPlans.Count(); i++)
|
||||
// {
|
||||
// list[i] = new ListItem(weekPlans[i], weekPlans[i]);
|
||||
// }
|
||||
// this.drpWeekNo.DataSource = list;
|
||||
// this.drpWeekNo.DataBind();
|
||||
// this.drpWeekNo.SelectedValue = list[0].Value;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// this.drpWeekNo.DataSource = null;
|
||||
// this.drpWeekNo.DataBind();
|
||||
//}
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnMenuDel2_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid2.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid2.SelectedRowIndexArray)
|
||||
{
|
||||
ListItem[] list = new ListItem[weekPlans.Count()];
|
||||
for (int i = 0; i < weekPlans.Count(); i++)
|
||||
{
|
||||
list[i] = new ListItem(weekPlans[i], weekPlans[i]);
|
||||
}
|
||||
this.drpWeekNo.DataSource = list;
|
||||
this.drpWeekNo.DataBind();
|
||||
this.drpWeekNo.SelectedValue = list[0].Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpWeekNo.DataSource = null;
|
||||
this.drpWeekNo.DataBind();
|
||||
string rowID = Grid2.DataKeys[rowIndex][0].ToString();
|
||||
BLL.WeekPlanService.DeleteWeekPlanByWeekPlanId(rowID);
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
|
||||
Reference in New Issue
Block a user