|
|
|
@ -4,9 +4,11 @@ using TSingSoft.WebControls2; |
|
|
|
using System.Web.UI; |
|
|
|
using BWP.B3DogAuth; |
|
|
|
using BWP.B3Frameworks; |
|
|
|
using BWP.B3Frameworks.Utils; |
|
|
|
using BWP.Web; |
|
|
|
using BWP.Web.Utils; |
|
|
|
using Forks.EnterpriseServices.BusinessInterfaces; |
|
|
|
using TSingSoft.WebControls2.DataGrids; |
|
|
|
|
|
|
|
namespace Bwp.Web.Pages { |
|
|
|
class DogLoginUserList : ListPage<DogLoginUser> { |
|
|
|
@ -18,12 +20,29 @@ namespace Bwp.Web.Pages { |
|
|
|
AddDFBrowseGridColumn(grid, "Stopped"); |
|
|
|
grid.AllowDeletion = CheckDefaultRole("删除"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected override void InitGridToolbar(HLayoutPanel toolbar) { |
|
|
|
AddInputControls(toolbar ); |
|
|
|
AddInputControls(toolbar); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void AddGrid(Control parent) { |
|
|
|
var editor = new DFDataTableEditor(); |
|
|
|
editor.CanDeleteFunc = (x) => CheckDefaultRole("删除"); |
|
|
|
editor.DeleteAction = (row) => { |
|
|
|
var dmo = bl.Load((long)row["ID"]); |
|
|
|
bl.Delete(dmo); |
|
|
|
}; |
|
|
|
|
|
|
|
mBrowseGrid = new DFBrowseGrid(editor); |
|
|
|
parent.Controls.Add(mBrowseGrid); |
|
|
|
InitBrowseGrid(mBrowseGrid); |
|
|
|
var hbox = new HLayoutPanel(); |
|
|
|
hbox.CssClass += " LeftPaddingWrapper"; |
|
|
|
parent.Controls.Add(hbox); |
|
|
|
InitGridToolbar(hbox); |
|
|
|
} |
|
|
|
|
|
|
|
private IDogLoginUserBL bl = BIFactory.Create<IDogLoginUserBL>(); |
|
|
|
private readonly static IDogLoginUserBL bl = BIFactory.Create<IDogLoginUserBL>(); |
|
|
|
|
|
|
|
|
|
|
|
void AddInputControls(HLayoutPanel hPanel) { |
|
|
|
@ -31,7 +50,7 @@ namespace Bwp.Web.Pages { |
|
|
|
return; |
|
|
|
|
|
|
|
var dfContainer = new DFContainer<DogLoginUser>(); |
|
|
|
|
|
|
|
|
|
|
|
hPanel.Add(new LiteralControl("序号:")); |
|
|
|
DFTextBox idInput = hPanel.Add(dfContainer.Add(InputCreator.DFTextBox, "ID")); |
|
|
|
hPanel.Add(new LiteralControl("用户:")); |
|
|
|
@ -44,7 +63,7 @@ namespace Bwp.Web.Pages { |
|
|
|
dfContainer.DFObject = new DogLoginUser(); |
|
|
|
dfContainer.GetFromUI(); |
|
|
|
bl.Insert(dfContainer.DFObject); |
|
|
|
|
|
|
|
|
|
|
|
idInput.Text = string.Empty; |
|
|
|
userInput.Value = string.Empty; |
|
|
|
userInput.DisplayValue = string.Empty; |
|
|
|
@ -70,21 +89,19 @@ namespace Bwp.Web.Pages { |
|
|
|
DFBoolComboBox boolComboBox; |
|
|
|
tablePanel.Add(5, 6, row, row + 1, boolComboBox = mQueryContainer.Add(QueryCreator.DFBoolComboBox(mDFInfo.Fields["Stopped"]), "Stopped")); |
|
|
|
boolComboBox.Value = false; |
|
|
|
|
|
|
|
|
|
|
|
tablePanel.Add(6, 7, row, row + 1, new DFLabel(mDFInfo.Fields["Remark"], 4)); |
|
|
|
tablePanel.Add(7,8, row, row + 1, mQueryContainer.Add(new DFTextBox(mDFInfo.Fields["Remark"]), "Remark")); |
|
|
|
tablePanel.Add(7, 8, row, row + 1, mQueryContainer.Add(new DFTextBox(mDFInfo.Fields["Remark"]), "Remark")); |
|
|
|
} |
|
|
|
|
|
|
|
protected bool CheckDefaultRole(string lastRoleName, bool notExistsAsTrue = false) { |
|
|
|
protected bool CheckDefaultRole(string lastRoleName, bool notExistsAsTrue = false) { |
|
|
|
string fullRoleName = PluginName + "." + LogicName + "." + lastRoleName; |
|
|
|
return CurrentUser.EIsInRole(fullRoleName, notExistsAsTrue); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnLoad(EventArgs e) |
|
|
|
{ |
|
|
|
protected override void OnLoad(EventArgs e) { |
|
|
|
base.OnLoad(e); |
|
|
|
if (!IsPostBack) |
|
|
|
{ |
|
|
|
if (!IsPostBack) { |
|
|
|
StartQuery(); |
|
|
|
} |
|
|
|
} |
|
|
|
|