87 lines
3.1 KiB
C#
87 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web.UI.WebControls;
|
|
using GThinking.N_CONTROL;
|
|
|
|
namespace GThinking.N_XLXSBJ
|
|
{
|
|
/// <summary>
|
|
/// 外部线缆产品导入 — 线缆报价等效替换(XLXSBJDXTHDZQD)统一列表,通过 THLX 区分各子类型。
|
|
/// </summary>
|
|
public partial class XLBJD_WBBJDDXDZQDList : XLBJD_WBBJDDXListBase
|
|
{
|
|
private const string ViewStateThLxKey = "WBBJDDXDZQD_THLX";
|
|
|
|
private string _thLx = "";
|
|
|
|
protected override string ThLx { get { return _thLx; } }
|
|
|
|
protected override gtGridView GridControl { get { return grdContentGrid; } }
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
_thLx = PageParam.GetRTrimString("THLX");
|
|
if (!XLBJD_WBBJDDXListBase.IsSupportedDxdThLx(_thLx))
|
|
{
|
|
ShowMessage("缺少或无效的替换类型参数 THLX。");
|
|
return;
|
|
}
|
|
ViewState[ViewStateThLxKey] = _thLx;
|
|
}
|
|
else
|
|
{
|
|
object o = ViewState[ViewStateThLxKey];
|
|
_thLx = o == null ? "" : o.ToString().Trim();
|
|
if (!XLBJD_WBBJDDXListBase.IsSupportedDxdThLx(_thLx))
|
|
{
|
|
ShowMessage("会话中的替换类型无效,请重新打开。");
|
|
return;
|
|
}
|
|
}
|
|
|
|
ApplyGridColumnVisibility();
|
|
SetPageTitle();
|
|
DXList_Page_Load(sender, e);
|
|
}
|
|
|
|
private void SetPageTitle()
|
|
{
|
|
string title;
|
|
if (!ThLxTitles.TryGetValue(_thLx, out title))
|
|
title = "线缆报价等效替换";
|
|
Page.Title = title;
|
|
}
|
|
|
|
private static readonly Dictionary<string, string> ThLxTitles;
|
|
|
|
static XLBJD_WBBJDDXDZQDList()
|
|
{
|
|
ThLxTitles = new Dictionary<string, string>(StringComparer.Ordinal);
|
|
ThLxTitles.Add("DYDJJQTH", "电压等级精确等效");
|
|
ThLxTitles.Add("XHGGDYDJJQTH", "型号规格电压等级精确等效");
|
|
ThLxTitles.Add("XHGGJQTH", "型号规格精确等效");
|
|
ThLxTitles.Add("XHDYDJJQTH", "型号电压等级精确等效");
|
|
ThLxTitles.Add("XHZZDYDJJQTHDYDJ", "型号正则电压等级精确等效电压等级");
|
|
ThLxTitles.Add("XHJQTH", "型号精确等效");
|
|
ThLxTitles.Add("XHZZTH", "型号正则等效");
|
|
ThLxTitles.Add("GGZZTH", "规格正则等效");
|
|
}
|
|
|
|
private void ApplyGridColumnVisibility()
|
|
{
|
|
Dictionary<string, byte> visible = XLBJD_WBBJDDXListBase.GetVisibleDataFieldsForThLx(_thLx);
|
|
if (visible == null)
|
|
return;
|
|
foreach (DataControlField col in grdContentGrid.Columns)
|
|
{
|
|
BoundField bf = col as BoundField;
|
|
if (bf == null)
|
|
continue;
|
|
bf.Visible = visible.ContainsKey(bf.DataField);
|
|
}
|
|
}
|
|
}
|
|
}
|