SVN r1101
SVN-Revision: r1101
This commit is contained in:
@@ -142,6 +142,12 @@ namespace Lskj.BaseAccraditation
|
|||||||
/// <param name="sender">The sender.</param>
|
/// <param name="sender">The sender.</param>
|
||||||
public event RefreshThePage refreshThePage;
|
public event RefreshThePage refreshThePage;
|
||||||
public delegate void RefreshThePage(string promptInformation, string id);
|
public delegate void RefreshThePage(string promptInformation, string id);
|
||||||
|
/// <summary>
|
||||||
|
/// 是否有明细必填
|
||||||
|
/// </summary>
|
||||||
|
public bool DetailsRequired = false;
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 初始化分割条位置
|
#region 初始化分割条位置
|
||||||
@@ -845,28 +851,34 @@ namespace Lskj.BaseAccraditation
|
|||||||
//修改字段
|
//修改字段
|
||||||
GridControlEx gridControl = tabpage.Tag as GridControlEx;
|
GridControlEx gridControl = tabpage.Tag as GridControlEx;
|
||||||
string DetailModifyFields = rt["modifyFields"] + "";
|
string DetailModifyFields = rt["modifyFields"] + "";
|
||||||
|
string DetailRequiredFields = Detailtable.Columns.Contains("requiredFields") ? rt["requiredFields"] + "" : "";
|
||||||
bool isEditable = string.IsNullOrEmpty(DetailModifyFields);
|
bool isEditable = string.IsNullOrEmpty(DetailModifyFields);
|
||||||
|
if (!string.IsNullOrWhiteSpace(DetailRequiredFields)) DetailsRequired = true;
|
||||||
gridControl.GridView.OptionsBehavior.Editable = !isEditable;
|
gridControl.GridView.OptionsBehavior.Editable = !isEditable;
|
||||||
GridColumnCollection gc = gridControl.GridView.Columns;
|
GridColumnCollection gc = gridControl.GridView.Columns;
|
||||||
|
//设置表格可编辑列和必填列
|
||||||
|
gridControl.SetReadOnlyAllColumn();
|
||||||
|
gridControl.SetFieldStatus(DetailModifyFields, DetailRequiredFields);
|
||||||
|
|
||||||
//if (isEditable) continue;
|
//if (isEditable) continue;
|
||||||
DetailModifyFields = DetailModifyFields + ",";
|
//DetailModifyFields = DetailModifyFields + ",";
|
||||||
foreach (GridColumn item in gc)
|
//foreach (GridColumn item in gc)
|
||||||
{
|
//{
|
||||||
GridColumnModel gcmodel = item.Tag as GridColumnModel;
|
// GridColumnModel gcmodel = item.Tag as GridColumnModel;
|
||||||
item.OptionsColumn.AllowEdit = DetailModifyFields.IndexOf(item.FieldName + ",", StringComparison.OrdinalIgnoreCase) != -1;
|
// item.OptionsColumn.AllowEdit = DetailModifyFields.IndexOf(item.FieldName + ",", StringComparison.OrdinalIgnoreCase) != -1;
|
||||||
item.OptionsColumn.ReadOnly = !item.OptionsColumn.AllowEdit;
|
// item.OptionsColumn.ReadOnly = !item.OptionsColumn.AllowEdit;
|
||||||
if (!item.OptionsColumn.AllowEdit)
|
// if (!item.OptionsColumn.AllowEdit)
|
||||||
{
|
// {
|
||||||
item.AppearanceHeader.Options.UseForeColor = true;
|
// item.AppearanceHeader.Options.UseForeColor = true;
|
||||||
item.AppearanceHeader.ForeColor = ColorTranslator.FromHtml(HeaderColor);
|
// item.AppearanceHeader.ForeColor = ColorTranslator.FromHtml(HeaderColor);
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
item.AppearanceHeader.Options.UseForeColor = true;
|
// item.AppearanceHeader.Options.UseForeColor = true;
|
||||||
item.AppearanceHeader.ForeColor = Color.Black;
|
// item.AppearanceHeader.ForeColor = Color.Black;
|
||||||
}
|
// }
|
||||||
if (gcmodel.FieldType == ControlType.LabMemoEdit) item.OptionsColumn.AllowEdit = true;
|
// if (gcmodel.FieldType == ControlType.LabMemoEdit) item.OptionsColumn.AllowEdit = true;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -1568,7 +1580,20 @@ namespace Lskj.BaseAccraditation
|
|||||||
graphicsText.DrawString(this._waterMark.Text, new Font("宋体", 20, FontStyle.Bold), new SolidBrush(Color.Red), new PointF(x, y), format, -20f);
|
graphicsText.DrawString(this._waterMark.Text, new Font("宋体", 20, FontStyle.Bold), new SolidBrush(Color.Red), new PointF(x, y), format, -20f);
|
||||||
e.Graphics.TranslateTransform(x, y);
|
e.Graphics.TranslateTransform(x, y);
|
||||||
e.Graphics.RotateTransform(-20f);
|
e.Graphics.RotateTransform(-20f);
|
||||||
e.Graphics.DrawRectangle(new Pen(Color.Red, 2f), new Rectangle(-45, -19, 90, 32));
|
|
||||||
|
if (Business.Impl.LanguageTranslation.Translatable)
|
||||||
|
{
|
||||||
|
// 1. 测量文本尺寸
|
||||||
|
SizeF textSize = e.Graphics.MeasureString(this._waterMark.Collect, new Font("宋体", 20, FontStyle.Bold), new SizeF(float.MaxValue, float.MaxValue), format);
|
||||||
|
// 2. 计算边框矩形的尺寸和位置
|
||||||
|
int rectWidth = (int)textSize.Width + 10;
|
||||||
|
e.Graphics.DrawRectangle(new Pen(Color.Red, 2f), new Rectangle(-rectWidth / 2, -19, rectWidth, 32));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Graphics.DrawRectangle(new Pen(Color.Red, 2f), new Rectangle(-45, -19, 90, 32));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1919,7 +1944,24 @@ namespace Lskj.BaseAccraditation
|
|||||||
{
|
{
|
||||||
this.SaveAdditionalModules();
|
this.SaveAdditionalModules();
|
||||||
}
|
}
|
||||||
|
if (this.DetailsRequired)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach (XtraTabPage page in this.tab_basicInfo.TabControlObj.TabPages)
|
||||||
|
{
|
||||||
|
GridDetailModel model = this.tab_basicInfo.GetGridDetailModel(page);
|
||||||
|
bool isDetailAttach = (model.IsReadOnly || model.IsChart);
|
||||||
|
|
||||||
|
if (page.Tag is GridControlEx)
|
||||||
|
{
|
||||||
|
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)));
|
||||||
|
if(!string.IsNullOrWhiteSpace(grdExMain.RequiredFields) &&!grdExMain.GridControl.isRequiredFields(grdExMain.RequiredFields, grdExMain.GridView)) return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (VerificationRequired()) return;
|
if (VerificationRequired()) return;
|
||||||
WaitForm.ShowForm(ResourceKeys.Handing);
|
WaitForm.ShowForm(ResourceKeys.Handing);
|
||||||
@@ -2617,6 +2659,11 @@ namespace Lskj.BaseAccraditation
|
|||||||
{
|
{
|
||||||
sqlValue = ReplaceHelper.ReplaceWhereCond(sqlValue) + string.Format(" and {0}='{1}'", model.UnionValue, unionPatentValue);
|
sqlValue = ReplaceHelper.ReplaceWhereCond(sqlValue) + string.Format(" and {0}='{1}'", model.UnionValue, unionPatentValue);
|
||||||
}
|
}
|
||||||
|
if (!string.IsNullOrEmpty(model.UnionCond))
|
||||||
|
{
|
||||||
|
string UnionCond = ReplaceHelper.ReplaceRowParam(this._baseRowData, model.UnionCond);
|
||||||
|
sqlValue +=UnionCond;
|
||||||
|
}
|
||||||
return sqlValue;
|
return sqlValue;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user