SVN r724
SVN-Revision: r724
This commit is contained in:
@@ -1055,8 +1055,12 @@ namespace Lskj.BaseAccraditation
|
||||
foreach (XtraTabPage page in this.tab_basicInfo.TabControlObj.TabPages)
|
||||
{
|
||||
GridDetailModel model = this.tab_basicInfo.GetGridDetailModel(page);
|
||||
|
||||
this.tab_basicInfo.SetGridDataSource(page, MainImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(this._baseRowData, model.DetailSql)));
|
||||
//this.tab_basicInfo.SetGridDataSource(page, MainImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(this._baseRowData, model.DetailSql)));
|
||||
bool isDetailAttach = (model.IsReadOnly || model.IsChart);
|
||||
string sqlValue = isDetailAttach ? model.DetailSql : GetSearchSql(model);
|
||||
GridControlEx grdExMain = (page.Tag as GridControlEx);
|
||||
if (!isDetailAttach) grdExMain.LastSearchSql = sqlValue;
|
||||
this.tab_basicInfo.SetGridDataSource(page, MainImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(this._baseRowData, sqlValue)));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1333,6 +1337,9 @@ namespace Lskj.BaseAccraditation
|
||||
if (this.AccditModelObj.BillModifyFields != "-1")
|
||||
this.ControlObj.SetReadOnlyAllControl(true);
|
||||
|
||||
|
||||
DataTable AuthorityTable = PowerImpl.GetModuleAuthorityEnable(this.SysModel.ModuleCode);
|
||||
|
||||
//改变控件状态 必填字段 (先设置必填字段,后面设置操作字段时可以改变颜色)
|
||||
string RequiredFields = this.AccditModelObj.RequiredFields.Trim(',');
|
||||
if (!string.IsNullOrEmpty(RequiredFields) && RequiredFields != "-1")
|
||||
@@ -1348,11 +1355,37 @@ namespace Lskj.BaseAccraditation
|
||||
//改变控件状态 操作字段
|
||||
if (!string.IsNullOrEmpty(OperationField) && OperationField != "-1")
|
||||
{
|
||||
foreach (DataRow dr in this._dtFileds.Rows)
|
||||
foreach (string item in OperationField.Split(','))
|
||||
{
|
||||
string fieldName = dr["fieldName"] + "";
|
||||
this.ControlObj.SetReadOnlyControl(fieldName, !OperationField.Split(',').Contains(fieldName), false);
|
||||
BaseUserControl control = this.ControlObj.FindControl(item);
|
||||
if (string.IsNullOrWhiteSpace(control.Model.PrivilegeOper))
|
||||
{
|
||||
//没有人员权限,转成可编辑
|
||||
this.ControlObj.SetReadOnlyControl(item, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<int> targetPrivTypeIds = new List<int>();
|
||||
foreach (string permission in control.Model.PrivilegeOper.Split(','))
|
||||
{
|
||||
targetPrivTypeIds.Add(int.Parse(permission));
|
||||
}
|
||||
//获取权限对应的人员名称
|
||||
string userString = string.Join(",", AuthorityTable.AsEnumerable()
|
||||
.Where(row => targetPrivTypeIds.Contains(row.Field<int>("privTypeId")))
|
||||
.Select(row => row.Field<string>("userList"))
|
||||
.Where(value => value != null)
|
||||
.ToList());
|
||||
//有权限的字段,转成可编辑
|
||||
if (userString.Split(',').Contains(ERPInfo.Instance.UserName)) this.ControlObj.SetReadOnlyControl(item, false, false);
|
||||
|
||||
}
|
||||
}
|
||||
//foreach (DataRow dr in this._dtFileds.Rows)
|
||||
//{
|
||||
// string fieldName = dr["fieldName"] + "";
|
||||
// this.ControlObj.SetReadOnlyControl(fieldName, !OperationField.Split(',').Contains(fieldName), true);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1541,7 +1574,14 @@ namespace Lskj.BaseAccraditation
|
||||
{
|
||||
XtraTabPage tabPage = item as XtraTabPage;
|
||||
GridDetailModel detailModel = this.tab_basicInfo.GetGridDetailModel(tabPage);
|
||||
this.tab_basicInfo.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(this._baseRowData, detailModel.DetailSql)));
|
||||
//this.tab_basicInfo.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(this._baseRowData, detailModel.DetailSql)));
|
||||
|
||||
|
||||
bool isDetailAttach = (detailModel.IsReadOnly || detailModel.IsChart);
|
||||
string sqlValue = isDetailAttach ? detailModel.DetailSql : GetSearchSql(detailModel);
|
||||
GridControlEx grdExMain = (tabPage.Tag as GridControlEx);
|
||||
if (!isDetailAttach) grdExMain.LastSearchSql = sqlValue;
|
||||
this.tab_basicInfo.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(this._baseRowData, sqlValue)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user