0813
This commit is contained in:
@@ -27,9 +27,9 @@
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="StandardCode" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="StandardCode" AllowSorting="true" SortField="StandardCode"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
ClicksToEdit="2" DataIDField="StandardCode" AllowSorting="true" SortField="StandardCode"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort" EnableCheckBoxSelect="true"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="200" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true" OnRowDataBound="Grid1_RowDataBound" OnRowCommand="Grid1_RowCommand">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
@@ -42,6 +42,9 @@
|
||||
<f:Button ID="btnNew" ToolTip="增加" Icon="Add" runat="server" Hidden="true"
|
||||
OnClick="btnNew_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSave" ToolTip="保存" Icon="SystemSave" runat="server" Text="" Hidden="true"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
@@ -105,10 +108,10 @@
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
<f:ListItem Text="30" Value="30" />
|
||||
<f:ListItem Text="200" Value="200" />
|
||||
<f:ListItem Text="300" Value="300" />
|
||||
<f:ListItem Text="400" Value="400" />
|
||||
<f:ListItem Text="500" Value="500" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
|
||||
@@ -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;
|
||||
|
||||
+9
@@ -138,6 +138,15 @@ namespace FineUIPro.Web.CQMS.DataBase {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// lblPageIndex 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
string standardCode = Request.Params["StandardCode"];
|
||||
if (!string.IsNullOrEmpty(standardCode))
|
||||
{
|
||||
Model.CQMS_Law_ConstructionStandardListProject standard = BLL.ConstructionStandardListProjectService.GetConstructionStandardListProjectByStandardCode(Convert.ToInt32(standardCode),this.CurrUser.LoginProjectId);
|
||||
Model.CQMS_Law_ConstructionStandardListProject standard = BLL.ConstructionStandardListProjectService.GetConstructionStandardListProjectByStandardCode(Convert.ToInt32(standardCode), this.CurrUser.LoginProjectId);
|
||||
if (standard != null)
|
||||
{
|
||||
this.drpStandardType.SelectedValue = standard.StandardType;
|
||||
@@ -85,7 +85,7 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
{
|
||||
maxStandardCode = BLL.ConstructionStandardListProjectService.GetMaxStandardCode(this.CurrUser.LoginProjectId);
|
||||
}
|
||||
this.hdStandardCode.Text = (maxStandardCode + 1).ToString()+this.CurrUser.LoginProjectId;
|
||||
this.hdStandardCode.Text = (maxStandardCode + 1).ToString() + this.CurrUser.LoginProjectId;
|
||||
}
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/DataBase/ConstructionStandardProject&menuId={1}", this.hdStandardCode.Text, BLL.Const.CQMSConstructionStandardListProjectMenuId)));
|
||||
}
|
||||
@@ -122,6 +122,8 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
if (!string.IsNullOrEmpty(standardCode))
|
||||
{
|
||||
newStandard.StandardCode = Convert.ToInt32(standardCode);
|
||||
Model.CQMS_Law_ConstructionStandardListProject standard = BLL.ConstructionStandardListProjectService.GetConstructionStandardListProjectByStandardCode(Convert.ToInt32(standardCode), this.CurrUser.LoginProjectId);
|
||||
newStandard.IsChecked = standard.IsChecked;
|
||||
BLL.ConstructionStandardListProjectService.UpdateConstructionStandardListProject(newStandard);
|
||||
}
|
||||
else
|
||||
@@ -132,12 +134,13 @@ namespace FineUIPro.Web.CQMS.DataBase
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
int maxStandardCode = 0;
|
||||
if (BLL.ConstructionStandardListProjectService.GetCountConstructionStandardListProject(this.CurrUser.LoginProjectId) != 0)
|
||||
{
|
||||
maxStandardCode = BLL.ConstructionStandardListProjectService.GetMaxStandardCode(this.CurrUser.LoginProjectId);
|
||||
}
|
||||
newStandard.StandardCode = maxStandardCode + 1;
|
||||
int maxStandardCode = 0;
|
||||
if (BLL.ConstructionStandardListProjectService.GetCountConstructionStandardListProject(this.CurrUser.LoginProjectId) != 0)
|
||||
{
|
||||
maxStandardCode = BLL.ConstructionStandardListProjectService.GetMaxStandardCode(this.CurrUser.LoginProjectId);
|
||||
}
|
||||
newStandard.StandardCode = maxStandardCode + 1;
|
||||
newStandard.IsChecked = true;
|
||||
//}
|
||||
BLL.ConstructionStandardListProjectService.AddConstructionStandardListProject(newStandard);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user