SVN r1101
SVN-Revision: r1101
This commit is contained in:
@@ -142,6 +142,12 @@ namespace Lskj.BaseAccraditation
|
||||
/// <param name="sender">The sender.</param>
|
||||
public event RefreshThePage refreshThePage;
|
||||
public delegate void RefreshThePage(string promptInformation, string id);
|
||||
/// <summary>
|
||||
/// 是否有明细必填
|
||||
/// </summary>
|
||||
public bool DetailsRequired = false;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 初始化分割条位置
|
||||
@@ -845,28 +851,34 @@ namespace Lskj.BaseAccraditation
|
||||
//修改字段
|
||||
GridControlEx gridControl = tabpage.Tag as GridControlEx;
|
||||
string DetailModifyFields = rt["modifyFields"] + "";
|
||||
string DetailRequiredFields = Detailtable.Columns.Contains("requiredFields") ? rt["requiredFields"] + "" : "";
|
||||
bool isEditable = string.IsNullOrEmpty(DetailModifyFields);
|
||||
if (!string.IsNullOrWhiteSpace(DetailRequiredFields)) DetailsRequired = true;
|
||||
gridControl.GridView.OptionsBehavior.Editable = !isEditable;
|
||||
GridColumnCollection gc = gridControl.GridView.Columns;
|
||||
//设置表格可编辑列和必填列
|
||||
gridControl.SetReadOnlyAllColumn();
|
||||
gridControl.SetFieldStatus(DetailModifyFields, DetailRequiredFields);
|
||||
|
||||
//if (isEditable) continue;
|
||||
DetailModifyFields = DetailModifyFields + ",";
|
||||
foreach (GridColumn item in gc)
|
||||
{
|
||||
GridColumnModel gcmodel = item.Tag as GridColumnModel;
|
||||
item.OptionsColumn.AllowEdit = DetailModifyFields.IndexOf(item.FieldName + ",", StringComparison.OrdinalIgnoreCase) != -1;
|
||||
item.OptionsColumn.ReadOnly = !item.OptionsColumn.AllowEdit;
|
||||
if (!item.OptionsColumn.AllowEdit)
|
||||
{
|
||||
item.AppearanceHeader.Options.UseForeColor = true;
|
||||
item.AppearanceHeader.ForeColor = ColorTranslator.FromHtml(HeaderColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.AppearanceHeader.Options.UseForeColor = true;
|
||||
item.AppearanceHeader.ForeColor = Color.Black;
|
||||
}
|
||||
if (gcmodel.FieldType == ControlType.LabMemoEdit) item.OptionsColumn.AllowEdit = true;
|
||||
}
|
||||
//DetailModifyFields = DetailModifyFields + ",";
|
||||
//foreach (GridColumn item in gc)
|
||||
//{
|
||||
// GridColumnModel gcmodel = item.Tag as GridColumnModel;
|
||||
// item.OptionsColumn.AllowEdit = DetailModifyFields.IndexOf(item.FieldName + ",", StringComparison.OrdinalIgnoreCase) != -1;
|
||||
// item.OptionsColumn.ReadOnly = !item.OptionsColumn.AllowEdit;
|
||||
// if (!item.OptionsColumn.AllowEdit)
|
||||
// {
|
||||
// item.AppearanceHeader.Options.UseForeColor = true;
|
||||
// item.AppearanceHeader.ForeColor = ColorTranslator.FromHtml(HeaderColor);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item.AppearanceHeader.Options.UseForeColor = true;
|
||||
// item.AppearanceHeader.ForeColor = Color.Black;
|
||||
// }
|
||||
// if (gcmodel.FieldType == ControlType.LabMemoEdit) item.OptionsColumn.AllowEdit = true;
|
||||
//}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -1568,8 +1580,21 @@ namespace Lskj.BaseAccraditation
|
||||
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.RotateTransform(-20f);
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1919,7 +1944,24 @@ namespace Lskj.BaseAccraditation
|
||||
{
|
||||
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;
|
||||
WaitForm.ShowForm(ResourceKeys.Handing);
|
||||
@@ -2617,6 +2659,11 @@ namespace Lskj.BaseAccraditation
|
||||
{
|
||||
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;
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user