📄 designreportconfiginfodlg.cs
字号:
this.button_cancel.Text = "取 消";
this.button_cancel.Click += new System.EventHandler(this.button_cancel_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(14, 12);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(106, 16);
this.label1.TabIndex = 3;
this.label1.Text = "对象(控件)名称:";
//
// textBox_control
//
this.textBox_control.Enabled = false;
this.textBox_control.Location = new System.Drawing.Point(114, 8);
this.textBox_control.Name = "textBox_control";
this.textBox_control.ReadOnly = true;
this.textBox_control.Size = new System.Drawing.Size(283, 21);
this.textBox_control.TabIndex = 4;
this.textBox_control.Text = "";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox_Hname);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.textBox_Cname);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.textBox_Ename);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Location = new System.Drawing.Point(2, 38);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(398, 96);
this.groupBox1.TabIndex = 5;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "对象的各语种名称(别名) 可选";
//
// textBox_Hname
//
this.textBox_Hname.Location = new System.Drawing.Point(44, 69);
this.textBox_Hname.Name = "textBox_Hname";
this.textBox_Hname.Size = new System.Drawing.Size(326, 21);
this.textBox_Hname.TabIndex = 9;
this.textBox_Hname.Text = "";
//
// label5
//
this.label5.Location = new System.Drawing.Point(5, 73);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 16);
this.label5.TabIndex = 8;
this.label5.Text = "繁中:";
//
// textBox_Cname
//
this.textBox_Cname.Location = new System.Drawing.Point(44, 42);
this.textBox_Cname.Name = "textBox_Cname";
this.textBox_Cname.Size = new System.Drawing.Size(326, 21);
this.textBox_Cname.TabIndex = 7;
this.textBox_Cname.Text = "";
//
// label6
//
this.label6.Location = new System.Drawing.Point(5, 47);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(56, 16);
this.label6.TabIndex = 6;
this.label6.Text = "简中:";
//
// textBox_Ename
//
this.textBox_Ename.Location = new System.Drawing.Point(44, 17);
this.textBox_Ename.Name = "textBox_Ename";
this.textBox_Ename.Size = new System.Drawing.Size(326, 21);
this.textBox_Ename.TabIndex = 5;
this.textBox_Ename.Text = "";
//
// label7
//
this.label7.Location = new System.Drawing.Point(5, 22);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(56, 16);
this.label7.TabIndex = 4;
this.label7.Text = "英语:";
//
// TreeReportConfigInfoDlg
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(400, 341);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.textBox_control);
this.Controls.Add(this.label1);
this.Controls.Add(this.button_OK);
this.Controls.Add(this.tabControl_configs);
this.Controls.Add(this.button_cancel);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TreeReportConfigInfoDlg";
this.Text = "用户可配置性的配置";
this.Load += new System.EventHandler(this.TreeReportConfigInfoDlg_Load);
this.tabControl_configs.ResumeLayout(false);
this.tabPage_visible.ResumeLayout(false);
this.groupBox_DisplayOption.ResumeLayout(false);
this.tabPage_dataconfig.ResumeLayout(false);
this.tabPage_miltilang.ResumeLayout(false);
this.groupBox_languish.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void checkBox_IsMultilanguish_CheckedChanged(object sender, System.EventArgs e)
{
if(checkBox_IsMultilanguish.Checked)
{
groupBox_languish.Enabled = true;
//textBox_englishtext.Enabled = true;
//textBox_chinesetext.Enabled = true;
//textBox_HKchinsestext.Enabled = true;
}
else
{
groupBox_languish.Enabled = false;
//textBox_englishtext.Enabled = false;
//textBox_chinesetext.Enabled = false;
//textBox_HKchinsestext.Enabled = false;
}
}
private void button_cancel_Click(object sender, System.EventArgs e)
{
DialogResult = DialogResult.Cancel;
this.Close();
}
private void checkBox_DisplaySelectable_CheckedChanged(object sender, System.EventArgs e)
{
if(checkBox_DisplaySelectable.Checked)
{
groupBox_DisplayOption.Enabled = true;
//radioButton_DefaultShow.Enabled = true;
//radioButton_DefaultHide.Enabled = true;
}
else
{
groupBox_DisplayOption.Enabled = false;
//radioButton_DefaultShow.Enabled = false;
//radioButton_DefaultHide.Enabled = false;
}
}
/// <summary>
/// TreeReportConfigInfoDlg_Load -- 用配置数据初始化界面
/// </summary>
private void TreeReportConfigInfoDlg_Load(object sender, System.EventArgs e)
{
Debug.Assert(reportid!=null && reportid.Length>0,"窗体还没有指派报表ID");
Debug.Assert(controlid!=null && controlid.Length>0,"窗体还没有指派报表控件ID");
textBox_control.Text = controlid;
//查找控件ID对应的配置数据(记录行)
DataRow[] rows = configinfo.configdata.Select("ReportID='"+reportid+"' and ControlID='"+controlid+"'");
//用配置数据初始化界面
if(rows.Length >0)
{
//可见的可配性
if(rows[0]["DisplaySelectable"] != null && rows[0]["DisplaySelectable"].ToString().Equals("Y"))
checkBox_DisplaySelectable.Checked = true;
else
checkBox_DisplaySelectable.Checked = false;
//默认的可见性
if(rows[0]["DisplayDefaultVal"] != null && rows[0]["DisplayDefaultVal"].ToString().Equals("Y"))
{
radioButton_DefaultShow.Checked = true;
radioButton_DefaultHide.Checked = false;
}
else
{
radioButton_DefaultShow.Checked = false;
radioButton_DefaultHide.Checked = true;
}
//开始数据的可配性
if(rows[0]["DataFieldSelectable"] != null && rows[0]["DataFieldSelectable"].ToString().Equals("Y"))
checkBox_datafield.Checked = true;
else
checkBox_datafield.Checked = false;
if(rows[0]["FormatSelectable"] != null && rows[0]["FormatSelectable"].ToString().Equals("Y"))
checkBox_format.Checked = true;
else
checkBox_format.Checked = false;
if(rows[0]["StyleSelectable"] != null && rows[0]["StyleSelectable"].ToString().Equals("Y"))
checkBox_style.Checked = true;
else
checkBox_style.Checked = false;
if(rows[0]["ColorSelctable"] != null && rows[0]["ColorSelctable"].ToString().Equals("Y"))
checkBox_color.Checked = true;
else
checkBox_color.Checked = false;
//是否使用多语种标题
if(rows[0]["IsMultilanguish"] != null && rows[0]["IsMultilanguish"].ToString().Equals("Y"))
checkBox_IsMultilanguish.Checked = true;
else
checkBox_IsMultilanguish.Checked = false;
//标题的可配性
if(rows[0]["CaptionConfigurable"] != null && rows[0]["CaptionConfigurable"].ToString().Equals("Y"))
checkBox_CaptionConfigurable.Checked = true;
else
checkBox_CaptionConfigurable.Checked = false;
//多语种标题
if(rows[0]["ELabelCaption"] == null)
textBox_englishtext.Text = "";
else
textBox_englishtext.Text = rows[0]["ELabelCaption"].ToString();
if(rows[0]["CLabelCaption"] == null)
textBox_chinesetext.Text = "";
else
textBox_chinesetext.Text = rows[0]["CLabelCaption"].ToString();
if(rows[0]["HLabelCaption"] == null)
textBox_HKchinsestext.Text = "";
else
textBox_HKchinsestext.Text = rows[0]["HLabelCaption"].ToString();
//多语种别名
textBox_Cname.Text = (rows[0]["EName"]==null)?"":rows[0]["EName"].ToString();
textBox_Ename.Text = (rows[0]["CName"]==null)?"":rows[0]["CName"].ToString();
textBox_Hname.Text = (rows[0]["HName"]==null)?"":rows[0]["HName"].ToString();
}
else
{
//可见的可配性
checkBox_DisplaySelectable.Checked = false;
//默认的可见性
radioButton_DefaultShow.Checked = true;
radioButton_DefaultHide.Checked = false;
//开始数据的可配性
checkBox_datafield.Checked = false;
checkBox_format.Checked = false;
checkBox_style.Checked = false;
checkBox_color.Checked = false;
//是否使用多语种标题
checkBox_IsMultilanguish.Checked = false;
//标题的可配性
checkBox_CaptionConfigurable.Checked = false;
//多语种标题
textBox_englishtext.Text = "";
textBox_chinesetext.Text = "";
textBox_HKchinsestext.Text = "";
//多语种别名
textBox_Cname.Text = "";
textBox_Ename.Text = "";
textBox_Hname.Text = "";
}
}
private void button_OK_Click(object sender, System.EventArgs e)
{
Debug.Assert(reportid!=null && reportid.Length>0,"窗体还没有指派报表ID");
Debug.Assert(controlid!=null && controlid.Length>0,"窗体还没有指派报表控件ID");
try
{
//查找控件ID对应的配置数据(记录行) Assert(textBox_control.Text == controlid)
DataRow[] rows = configinfo.configdata.Select("ControlID='"+controlid+"'");
DataRow rw;
//判断是否要插入新行
if(rows.Length==0)
{
rw = configinfo.configdata.NewRow();
rw["ReportID"] = reportid;
rw["ControlID"] = controlid;
configinfo.configdata.Rows.Add(rw);
}
else
rw = rows[0];
//可见的可配性
if (checkBox_DisplaySelectable.Checked)
rw["DisplaySelectable"] = "Y";
else
rw["DisplaySelectable"] = "N";
//默认的可见性
if (radioButton_DefaultShow.Checked)
rw["DisplayDefaultVal"] = "Y";
else
rw["DisplayDefaultVal"] = "N";
//开始数据的可配性
if (checkBox_datafield.Checked)
rw["DataFieldSelectable"] = "Y";
else
rw["DataFieldSelectable"] = "N";
if (checkBox_format.Checked)
rw["FormatSelectable"] = "Y";
else
rw["FormatSelectable"] = "N";
if (checkBox_style.Checked)
rw["StyleSelectable"] = "Y";
else
rw["StyleSelectable"] = "N";
if (checkBox_color.Checked)
rw["ColorSelctable"] = "Y";
else
rw["ColorSelctable"] = "N";
//是否使用多语种标题
rw["IsMultilanguish"] = checkBox_IsMultilanguish.Checked?"Y":"N";
//标题的可配性
rw["CaptionConfigurable"] = checkBox_CaptionConfigurable.Checked?"Y":"N";
//多语种标题
rw["ELabelCaption"] = textBox_englishtext.Text;
rw["CLabelCaption"] = textBox_chinesetext.Text;
rw["HLabelCaption"] = textBox_HKchinsestext.Text;
//多语种别名
rw["EName"] = textBox_Ename.Text;
rw["CName"] = textBox_Cname.Text;
rw["HName"] = textBox_Hname.Text;
}
catch
{
MessageBox.Show(this,"有错误发生,可能是数据不符要求!");
return;
}
DialogResult = DialogResult.OK;
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -