SVN-Revision: r283
This commit is contained in:
cyf
2025-02-25 01:55:30 +00:00
parent 645ed54877
commit b43690ae29
+30 -51
View File
@@ -55,6 +55,8 @@ namespace Lskj.PubAdd
double H_Scaling;
double W_Scaling;
public DataTable details = new DataTable();
public FrmMain()
{
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
@@ -74,6 +76,8 @@ namespace Lskj.PubAdd
this.SysModel.maintabFocusedRow = JsonUtil.ToDataRow(Model.MaintabFocusedRowJson);
this.ModuleAddControl.OnAddRecordCallBack += OnAddRecordCallBack;
this.details = BaseModuleImpl.GetBaseAddTabDetail(Model.ModuleCode);
this.CreateControlLocation();
this.SetControlPanelSize();
@@ -91,7 +95,6 @@ namespace Lskj.PubAdd
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
//this.ResumeLayout(false);
}
this.Text = Model.FormText + (string.IsNullOrWhiteSpace(Model.ObjectId) ? "" : "[" + Model.ObjectId + "]");
LogUtil.WriteDebug(Model.ModuleCode, "打开操作", ERPInfo.Instance.UserName, "打开[" + Model.FormText + "] 查看" + Model.ObjectId, Model.ModuleId + "");
WaitForm.HideForm();
@@ -125,16 +128,17 @@ namespace Lskj.PubAdd
this.Width = Convert.ToInt32(item["width"] + "");
int height = this.ModuleAddControl.ControlHeight + this.ModuleAddControl.OperatePanelControlObj.Height + this.ModuleAddControl.SpeciesPanelControlObj.Height;
//if (Convert.ToInt32(item["height"] + "") < height)
//{
// height = Convert.ToInt32(item["height"] + "");
// this.ModuleAddControl.plMainControlObj.VerticalScroll.Visible = true;
//}
height = Convert.ToInt32(item["height"] + "") > height ? height : Convert.ToInt32(item["height"] + "");//如果控件高度小于设置高度,以实际高度为准
if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
{
//加上下方明细的高度(上方的一半)
//height = height+height / 2;
}
this.Height = height + otherHeight;
//this.Height = Convert.ToInt32(item["height"] + "") + otherHeight;
if (this.Left < 0) this.Left = 0;
if (this.Top < 0) this.Top = 0;
this.Left = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2;
@@ -152,7 +156,11 @@ namespace Lskj.PubAdd
this.ModuleAddControl.plMainControlObj.AutoScroll = true;
this.ModuleAddControl.plMainControlObj.HorizontalScroll.Visible = false;
}
if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
{
this.ModuleAddControl.SplitContainerControl.SplitterPosition = this.Height / 3 * 2;
}
}
}
/// <summary>
@@ -168,11 +176,15 @@ namespace Lskj.PubAdd
{
this.Invoke((EventHandler)delegate
{
DataTable details = BaseModuleImpl.GetBaseAddTabDetail(Model.ModuleCode);
bool isInside = false;
foreach (DataRow item in details.Rows)
foreach (DataRow item in this.details.Rows)
{
if (this.details.Columns.Contains("orderId")&& !string.IsNullOrWhiteSpace(item["orderId"] + "")&& int.Parse(item["orderId"] + "") < 0)
{
continue;
}
XtraTabPage tabPage = new XtraTabPage();
GridDetailModel detailModel = new GridDetailModel(item, null, GridCustomColumnStruct.BaseDetailGridView);
if (!string.IsNullOrEmpty(detailModel.UnionModule))
@@ -228,6 +240,13 @@ namespace Lskj.PubAdd
this.ModuleAddControl.ControlSql = Model.ControlSql;
this.ModuleAddControl.OnCloseCallback += new EventHandler(OnCloseCallback);
this.ModuleAddControl.SearchObject = Model.SearchObject;
if (this.details.Columns.Contains("orderId"))
{
DataRow[] dataRows =details.Select("orderId<0");
this.ModuleAddControl.DetailsData = dataRows;
}
this.ModuleAddControl.InitializeControl(SysModel, Model, isAutoScroll);
}
@@ -383,18 +402,7 @@ namespace Lskj.PubAdd
{
try
{
//XtraTabPage page = e.Page;
//if (page != null && page.Tag is ModuleGridEx)
//{
// ModuleGridEx gridEx = page.Tag as ModuleGridEx;
// GridDetailModel detailModel = gridEx.Tag as GridDetailModel;
// gridEx.SearchObj.SearchGrid();
// gridEx.UnionValue = this.ModuleAddControl.PrimaryValue;
// page.Text = detailModel.DetailName + "(" + gridEx.SearchObj.GridRowCount + "条)";
//}
//if (xtcControl.SelectedTabPageIndex==0) return;
XtraTabPage tabPage = e.Page;
ModuleAddControl.OperatePanelControlObj.Visible = true;
//XtraTabPage tabPage = this.xtcControl.SelectedTabPage;
@@ -567,33 +575,4 @@ 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;
}
}
}
}
/// </