SVN-Revision: r567
This commit is contained in:
wyf
2025-05-09 08:40:39 +00:00
parent 3954a0f523
commit 71b2e2bdf6
+48 -20
View File
@@ -73,10 +73,8 @@ namespace Lskj.PubAdd
//this.SuspendLayout();
this.SysModel = new ModuleModel(MainImpl.GetSystemdllTab(this.Model.ModuleCode));
this.SysModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(this.Model.ModuleCode);
this.SysModel.maintabFocusedRow = Model.GetMaintabFocusedRow();
this.ModuleAddControl.OnAddRecordCallBack += OnAddRecordCallBack;
this.details = BaseModuleImpl.GetBaseAddTabDetail(Model.ModuleCode);
this.details = BaseModuleImpl.GetBaseAddTabDetail(Model.ModuleCode);
this.CreateControlLocation();
this.SetControlPanelSize();
@@ -129,12 +127,9 @@ namespace Lskj.PubAdd
int height = this.ModuleAddControl.ControlHeight + this.ModuleAddControl.OperatePanelControlObj.Height + this.ModuleAddControl.SpeciesPanelControlObj.Height;
height = Convert.ToInt32(item["height"] + "") > height ? height : Convert.ToInt32(item["height"] + "");//如果控件高度小于设置高度,以实际高度为准
if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
{
//加上下方明细的高度(上方的一半)
//height = height+height / 2;
height += 200;
}
this.Height = height + otherHeight;
@@ -151,16 +146,20 @@ namespace Lskj.PubAdd
this.Top = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2;
isAutoScroll = true;
ModuleAddControl.plMainControlObj.AutoScroll = isAutoScroll;
if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
{
this.ModuleAddControl.SplitContainerControl.SplitterPosition = (this.Height * 2) / 3;
}
}
else {
else
{
this.ModuleAddControl.plMainControlObj.AutoScroll = true;
this.ModuleAddControl.plMainControlObj.HorizontalScroll.Visible = false;
if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
{
this.ModuleAddControl.SplitContainerControl.SplitterPosition = this.ModuleAddControl.ControlHeight;
}
}
if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
{
this.ModuleAddControl.SplitContainerControl.SplitterPosition = this.Height / 3 * 2;
}
}
}
/// <summary>
@@ -180,7 +179,7 @@ namespace Lskj.PubAdd
foreach (DataRow item in this.details.Rows)
{
if (this.details.Columns.Contains("orderId")&& !string.IsNullOrWhiteSpace(item["orderId"] + "")&& int.Parse(item["orderId"] + "") < 0)
if (this.details.Columns.Contains("orderId") && !string.IsNullOrWhiteSpace(item["orderId"] + "") && int.Parse(item["orderId"] + "") < 0)
{
continue;
}
@@ -241,9 +240,9 @@ namespace Lskj.PubAdd
this.ModuleAddControl.OnCloseCallback += new EventHandler(OnCloseCallback);
this.ModuleAddControl.SearchObject = Model.SearchObject;
if (this.details.Columns.Contains("orderId"))
if (this.details.Columns.Contains("orderId"))
{
DataRow[] dataRows =details.Select("orderId<0");
DataRow[] dataRows = details.Select("orderId<0");
this.ModuleAddControl.DetailsData = dataRows;
}
@@ -477,7 +476,7 @@ namespace Lskj.PubAdd
moduleGrid.ParentKeyField = string.IsNullOrEmpty(detailModel.UnionParentField) ? SysModel.ParmaryKey : detailModel.UnionParentField;
//直接在控件数据源中取值,控件可能是禁显状态(没用控件获取不到值)
if (!string.IsNullOrWhiteSpace(moduleGrid.ParentKeyField) &&this.ModuleAddControl.ControlObj.CurrentData.Table.Columns.Contains(moduleGrid.ParentKeyField))
if (!string.IsNullOrWhiteSpace(moduleGrid.ParentKeyField) && this.ModuleAddControl.ControlObj.CurrentData.Table.Columns.Contains(moduleGrid.ParentKeyField))
{
moduleGrid.ParentKeyValue = moduleGrid.UnionValue = this.ModuleAddControl.ControlObj.CurrentData[moduleGrid.ParentKeyField] + "";
}
@@ -529,7 +528,7 @@ namespace Lskj.PubAdd
// BaseImpl.ExecSqlValue(searchobj.ReplaceControlValue(this.SysModel.CustomColumnSQL));
//}
searchobj.SearchGrid();
OnSearchAfter(null,null);
OnSearchAfter(null, null);
}
catch (Exception ex)
{
@@ -579,4 +578,33 @@ namespace Lskj.PubAdd
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="FormClosingEventArgs"/> instance containing the event data.</param>
protected void OnFormClosing(object sender, FormClosingEventArgs e)
{
try
{
if (this.ModuleAddControl != null && this.ModuleAddControl.IsCard)
{
this.ModuleAddControl.CloseIDCardThread();
}
this.DialogResult = DialogResult.OK;
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000;
return cp;
}
}
}
}