0813
This commit is contained in:
@@ -12,10 +12,42 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
{
|
||||
public partial class ConstructionStandardListProject : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 被选择项列表
|
||||
/// </summary>
|
||||
public List<string> SelectedList
|
||||
{
|
||||
get
|
||||
{
|
||||
return (List<string>)ViewState["SelectedList"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["SelectedList"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 未被选择项列表
|
||||
/// </summary>
|
||||
public List<string> NoSelectedList
|
||||
{
|
||||
get
|
||||
{
|
||||
return (List<string>)ViewState["NoSelectedList"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["NoSelectedList"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.SelectedList = new List<string>();
|
||||
this.NoSelectedList = new List<string>();
|
||||
GetButtonPower();
|
||||
InitTreeMenu();
|
||||
BindGrid();
|
||||
@@ -53,6 +85,17 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
/// <param name="e"></param>
|
||||
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
||||
{
|
||||
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||
{
|
||||
if (this.Grid1.SelectedRowIDArray.Contains(this.Grid1.Rows[i].RowID))
|
||||
{
|
||||
SelectedList.Add(this.Grid1.Rows[i].RowID);
|
||||
}
|
||||
else
|
||||
{
|
||||
NoSelectedList.Add(this.Grid1.Rows[i].RowID);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
@@ -79,6 +122,7 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
standardList.IsSelected8,
|
||||
standardList.IsSelected9,
|
||||
standardList.IsSelected10,
|
||||
standardList.IsChecked,
|
||||
standardList.pubDate,
|
||||
standardList.ImpDate,
|
||||
standardList.ReplaceStandard,
|
||||
@@ -113,6 +157,26 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
if (tb.Rows.Count > 0)
|
||||
{
|
||||
List<string> ids = new List<string>();
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
if (tb.Rows[i][16].ToString() == "True")
|
||||
{
|
||||
ids.Add(tb.Rows[i][0].ToString());
|
||||
}
|
||||
}
|
||||
if (ids.Count() > 0)
|
||||
{
|
||||
this.Grid1.SelectedRowIDArray = ids.ToArray();
|
||||
}
|
||||
}
|
||||
//var selectIds = (from x in Funs.DB.WBS_BreakdownProject where x.DivisionProjectId == this.trWBS.SelectedNodeID && x.IsSelected == true select x.BreakdownProjectId).ToList();
|
||||
//if (selectIds.Count() > 0)
|
||||
//{
|
||||
// this.Grid1.SelectedRowIDArray = selectIds.ToArray();
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -124,6 +188,17 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||
{
|
||||
if (this.Grid1.SelectedRowIDArray.Contains(this.Grid1.Rows[i].RowID))
|
||||
{
|
||||
SelectedList.Add(this.Grid1.Rows[i].RowID);
|
||||
}
|
||||
else
|
||||
{
|
||||
NoSelectedList.Add(this.Grid1.Rows[i].RowID);
|
||||
}
|
||||
}
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
@@ -279,6 +354,48 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存事件
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||
{
|
||||
if (this.Grid1.SelectedRowIDArray.Contains(this.Grid1.Rows[i].RowID))
|
||||
{
|
||||
SelectedList.Add(this.Grid1.Rows[i].RowID);
|
||||
}
|
||||
else
|
||||
{
|
||||
NoSelectedList.Add(this.Grid1.Rows[i].RowID);
|
||||
}
|
||||
}
|
||||
foreach (var item in SelectedList.Distinct())
|
||||
{
|
||||
var rows = BLL.ConstructionStandardListProjectService.GetConstructionStandardListProjectByStandardCode(Convert.ToInt32(item), this.CurrUser.LoginProjectId);
|
||||
rows.IsChecked = true;
|
||||
BLL.ConstructionStandardListProjectService.UpdateConstructionStandardListProject(rows);
|
||||
}
|
||||
NoSelectedList = NoSelectedList.Distinct().ToList();
|
||||
var q = NoSelectedList.Distinct().ToList();
|
||||
foreach (var item in q)
|
||||
{
|
||||
foreach (var i in SelectedList.Distinct())
|
||||
{
|
||||
if (item == i)
|
||||
{
|
||||
NoSelectedList.Remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var item in NoSelectedList)
|
||||
{
|
||||
var rows = BLL.ConstructionStandardListProjectService.GetConstructionStandardListProjectByStandardCode(Convert.ToInt32(item), this.CurrUser.LoginProjectId);
|
||||
rows.IsChecked = null;
|
||||
BLL.ConstructionStandardListProjectService.UpdateConstructionStandardListProject(rows);
|
||||
}
|
||||
Alert.ShowInTop("保存成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 权限设置
|
||||
/// <summary>
|
||||
/// 权限设置
|
||||
@@ -297,6 +414,10 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
this.btnMenuModify.Hidden = false;
|
||||
this.Grid1.EnableRowDoubleClickEvent = true;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDel.Hidden = false;
|
||||
|
||||
Reference in New Issue
Block a user