SVN r841
SVN-Revision: r841
This commit is contained in:
@@ -179,7 +179,7 @@ namespace Lskj.ProductiSched
|
||||
treebandGcTop.Model = DataModel.TopSysModel;
|
||||
treebandGcTop.moduleModel = DataModel.TopModuleModel;
|
||||
treebandGcTop.SetEditColumns(DataModel.TopGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.TopModuleModel.FormKey);
|
||||
treebandGcTop.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.ModeCode), DataModel.TopSysModel);
|
||||
treebandGcTop.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.ModeCode), DataModel.TopSysModel,this.OnGridViewRightCallBack);
|
||||
treebandGcTop.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.ModeCode));
|
||||
bandGcTop.Visible = false;
|
||||
}
|
||||
@@ -188,7 +188,7 @@ namespace Lskj.ProductiSched
|
||||
//上方表格
|
||||
bandGcTop.Model = DataModel.TopSysModel;
|
||||
bandGcTop.SetEditColumns(DataModel.TopGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.TopModuleModel.FormKey);
|
||||
bandGcTop.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.ModeCode), DataModel.TopSysModel);
|
||||
bandGcTop.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.ModeCode), DataModel.TopSysModel,this.OnGridViewRightCallBack);
|
||||
bandGcTop.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.ModeCode));
|
||||
bandGcTop.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.ModeCode));
|
||||
treebandGcTop.Visible = false;
|
||||
@@ -238,7 +238,7 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
gcRight.Model = DataModel.RightSysModel;
|
||||
gcRight.SetEditColumns(DataModel.RightGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.RightModuleModel.FormKey);
|
||||
gcRight.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.RightModuleModel.ModeCode), DataModel.RightSysModel);
|
||||
gcRight.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.RightModuleModel.ModeCode), DataModel.RightSysModel, this.OnGridViewRightCallBack);
|
||||
gcRight.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.RightModuleModel.ModeCode));
|
||||
}
|
||||
}
|
||||
@@ -1324,7 +1324,7 @@ namespace Lskj.ProductiSched
|
||||
gridColumn.OptionsColumn.AllowMerge = DefaultBoolean.False;
|
||||
gridColumn.OptionsColumn.AllowSort = DefaultBoolean.False;
|
||||
gridColumn.FieldName = $"WWeek_{i - 93}";
|
||||
gridColumn.Width = 140;
|
||||
gridColumn.Width = 105;
|
||||
gridColumn.DisplayFormat.FormatType = FormatType.Numeric;
|
||||
gridColumn.DisplayFormat.FormatString = "{0:#,##0.####}";
|
||||
gridColumn.Visible = false;
|
||||
@@ -1424,7 +1424,7 @@ namespace Lskj.ProductiSched
|
||||
TreeListColumn weekColumn = new TreeListColumn
|
||||
{
|
||||
FieldName = $"WWeek_{i - 93}",
|
||||
Width = 140,
|
||||
Width = 105,
|
||||
Visible = false,
|
||||
OptionsColumn = {
|
||||
AllowMove = false,
|
||||
@@ -1652,7 +1652,7 @@ namespace Lskj.ProductiSched
|
||||
weekColumn.FieldName = weekStart.ToString("yyyy-MM-dd");
|
||||
// 使用修改后的方法设置 Caption
|
||||
weekColumn.Caption = $"{weekEnd.Month}月第{GetWeekOfMonth(weekEnd)}周";
|
||||
weekColumn.Width = 140;
|
||||
weekColumn.Width = 105;
|
||||
// 新优化方式(使用字典存储)
|
||||
DataModel.columnDateMapping[weekColumn] = weekStart;
|
||||
weekColumn.OptionsColumn.AllowEdit = weekEnd >= DateTime.Today;
|
||||
@@ -2473,4 +2473,108 @@ namespace Lskj.ProductiSched
|
||||
|
||||
// 对每个动态日期列,从 dtPlan 中查找 billdocument_id 在 keyValues 内,
|
||||
// 且 ShowDay 等于当前列名的记录,将 amount 累加后再乘以系数
|
||||
foreach (stri
|
||||
foreach (string dateCol in dateColumns)
|
||||
{
|
||||
decimal sumAmount = planRows
|
||||
.Where(pr => keyValues.Contains(pr.BillId) && pr.ShowDay == dateCol)
|
||||
.Sum(pr => pr.Amount);
|
||||
// 乘以系数得到实际值
|
||||
newRow[dateCol] = sumAmount * coefficient;
|
||||
}
|
||||
dtC.Rows.Add(newRow);
|
||||
}
|
||||
return dtC;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 纠正输入异常
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnInvalidValueException(object sender, InvalidValueExceptionEventArgs e)
|
||||
{
|
||||
if (e.Value.Equals(""))
|
||||
{
|
||||
e.ExceptionMode = ExceptionMode.Ignore;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:右键菜单执行后刷新数据,刷新规则按照上一次查询条件刷新</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-02 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
protected void OnGridViewRightCallBack(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TreeMultiHeader)
|
||||
{
|
||||
DataTable dt = this.treebandGcTop.GetGridViewDataSource();
|
||||
if (dt == null || dt.Rows.Count == 0) return;
|
||||
DataRow SelectTheLine = this.treebandGcTop.GetViewFocusedDataRow();
|
||||
this.DataModel.TopSearchObj.RememberRow = (this.DataModel.TopModuleModel.AccordingNameSelected == 0);
|
||||
this.DataModel.TopSearchObj.ButtonObj.PerformClick();
|
||||
if (this.DataModel.TopModuleModel.AccordingNameSelected != 0)//根据主键刷新目标选中行
|
||||
{
|
||||
DataRow items = dt.Rows.Cast<DataRow>().FirstOrDefault(x => x[this.DataModel.TopModuleModel.ParmaryKey].Equals(SelectTheLine[this.DataModel.TopModuleModel.ParmaryKey]));
|
||||
dt = this.treebandGcTop.GridView.GetGridViewFilteredAndSortedDataToDataTable();
|
||||
BindingSource bindingSource = new BindingSource();
|
||||
bindingSource.DataSource = dt;
|
||||
int numberOfRows = bindingSource.Find(this.DataModel.TopModuleModel.ParmaryKey, SelectTheLine[this.DataModel.TopModuleModel.ParmaryKey].ToString());
|
||||
this.treebandGcTop.GridView.ClearSelection();
|
||||
this.treebandGcTop.GridView.FocusedRowHandle = numberOfRows;
|
||||
this.treebandGcTop.GridView.SelectRow(numberOfRows);
|
||||
}
|
||||
//this.OnSearchAfterCallBack(null,null);
|
||||
}
|
||||
else
|
||||
{
|
||||
int oldRowHandle = bandGcTop.GridView.FocusedRowHandle;
|
||||
DataTable dt = this.bandGcTop.GridView.GetGridViewFilteredAndSortedDataToDataTable();
|
||||
if (dt == null || dt.Rows.Count == 0) return;
|
||||
DataRow SelectTheLine = dt.Rows[oldRowHandle];
|
||||
this.DataModel.TopSearchObj.RememberRow = (this.DataModel.TopModuleModel.AccordingNameSelected == 0);
|
||||
this.DataModel.TopSearchObj.ButtonObj.PerformClick();
|
||||
bandGcTop.GridView.SelectRowHandler(oldRowHandle);
|
||||
if (this.DataModel.TopModuleModel.AccordingNameSelected != 0)//根据主键刷新目标选中行
|
||||
{
|
||||
DataRow items = dt.Rows.Cast<DataRow>().FirstOrDefault(x => x[this.DataModel.TopModuleModel.ParmaryKey].Equals(SelectTheLine[this.DataModel.TopModuleModel.ParmaryKey]));
|
||||
dt = this.bandGcTop.GridView.GetGridViewFilteredAndSortedDataToDataTable();
|
||||
BindingSource bindingSource = new BindingSource();
|
||||
bindingSource.DataSource = dt;
|
||||
int numberOfRows = bindingSource.Find(this.DataModel.TopModuleModel.ParmaryKey, SelectTheLine[this.DataModel.TopModuleModel.ParmaryKey].ToString());
|
||||
this.bandGcTop.GridView.ClearSelection();
|
||||
this.bandGcTop.GridView.FocusedRowHandle = numberOfRows;
|
||||
this.bandGcTop.GridView.SelectRow(numberOfRows);
|
||||
}
|
||||
//this.OnSearchAfterCallBack(null, null);
|
||||
//int rightOldRowHandle = 0;
|
||||
//rightOldRowHandle = gcRight.GridView.FocusedRowHandle;//上一次选中行
|
||||
//刷新右侧
|
||||
this.OnBandedViewRowCellClick(null, null);
|
||||
// gcRight.GridView.SelectRowHandler(oldRowHandle);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user