FrmBase.cs
29.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MetroFramework.Forms;
using System.Resources;
using System.Reflection;
using System.Threading;
using System.Globalization;
using Comm;
using Dal;
using System.Drawing.Text;
using log4net;
namespace App
{
public partial class FrmBase : MetroForm
{
protected TextBox RTBMessage = null;
private ResourceManager rmCulture;
private ResourceManager rmBitmap;
public string _loginLanguage;
public Fuction fuction = new Fuction();
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmBase()
{
InitializeComponent();
}
public void ResizeForm()
{
//if (this.MdiParent != null)
//{
// int[] childSize = ((FrmMDI)this.MdiParent).childSize();
// //this.StartPosition = childSize[0];
// //this.Location.Y = childSize[1];
// if (this.Height < childSize[2] - 5)
// {
// this.Height = childSize[2] - 5;
// }
// if (this.Width < childSize[3] - 5)
// {
// this.Width = childSize[3] - 5;
// }
//}
}
#region 换语言
private string formName;
public string str_LResourse = "zh-CN"; //默认为中文
public void SelectLanguage(string kkk)
{
}
public void SetCMSLanguage(string formName, ContextMenuStrip cms)
{
for (int i = 0; i < cms.Items.Count; i++)
{
cms.Items[i].Text = getMsg(formName + cms.Items[i].Name);
}
}
/// <summary>
/// 获取字符串相关的资源文件
/// </summary>
public ResourceManager GetCurrentCulture
{
get
{
if (rmCulture == null)
rmCulture = new ResourceManager("App.Properties.LResource", Assembly.GetExecutingAssembly());//从指定的资源文件中获取资源
return rmCulture;
}
}
/// <summary>
/// 获取图像文件相关的资源文件
/// </summary>
public ResourceManager GetCurrentCultureForBitmap
{
get
{
if (rmBitmap == null)
rmBitmap = new ResourceManager("MyCMMI.App.Properties.Resources", Assembly.GetExecutingAssembly());
return rmBitmap;
}
}
/// <summary>
///根据传来的图像控件的名字返回该控件在指定语言区域的图像
/// </summary>
/// <param name="strObjectId"></param>
/// <returns></returns>
public System.Drawing.Bitmap GetImage(string strObjectId)
{
ResourceManager rm = this.GetCurrentCultureForBitmap;//获取指定图像资源文件
object obj = rm.GetObject(strObjectId);
return (System.Drawing.Bitmap)obj;
}
/// <summary>
/// 根据传入的控件名字返回该控件在指定语言区域的TEXT
/// </summary>
/// <param name="strId"></param>
/// <returns></returns>
public string getMsg(string strId)
{
string currentLanguage = "";
try
{
ResourceManager rm = this.GetCurrentCulture;//得到当前语言区域的指定资源
//
//通过语言种类变量设置当前线程的语言区域,若是注释该行,则根据操作系统自身区域语言设置显示值
//
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(str_LResourse);
CultureInfo ci = Thread.CurrentThread.CurrentCulture;//获取当前线程所设置的语言区域
currentLanguage = rm.GetString(strId, ci);//通过所选语言区域匹配资源文件,根据传入控件名称返回该控件相应的TEXT
}
catch(Exception ex)
{
//LOGGER.Info(ex.StackTrace);
currentLanguage = "";//未找到匹配字符时返回默认的字符
}
return currentLanguage;
}
/// <summary>
/// 用于MessageBox根据传入ID值获取MessageBox显示的字符串
/// </summary>
/// <param name="ID"></param>
/// <returns></returns>
public string MBSelectLang(String ID)
{
ID = getMsg(ID);
return ID;
}
/// <summary>
/// 用于事件触发TextBox显示相应内容
/// </summary>
/// <param name="ID"></param>
/// <returns></returns>
public string TBSelectLang(String ID)
{
ID = getMsg(formName + ID);
return ID;
}
/// <summary>
/// 根据传入的控件设置该控件内的所有控件TEXT属性,若AppGlobal为null,则默认显示中文
/// </summary>
/// <param name="control"></param>
public void SetFormLanguage(System.Windows.Forms.Control control)
{
//遍历所有控件 国际化并修改字体
string AppPath = Application.StartupPath;
PrivateFontCollection font = new PrivateFontCollection();
font.AddFontFile(AppPath + @"\msyh.ttc");//字体的路径及名字
if (control.GetType().BaseType.Name == "Form" || control.GetType().BaseType.Name == "FrmBase")//判断控件是否为Form类型
{
formName = control.Name;
if (control.GetType().Name == "frmLogin")
{
control.Text = "";
}
else
{
control.Text = getMsg(control.Name);//根据传入控件名字返回该控件TEXT
control.Font = new Font(font.Families[0].Name, control.Font.Size);
}
}
#region 对所有控件做循环,并判断,符合条件的控件能够将名字返回为该控件特定区域的TEXT
for (int i = 0; i < control.Controls.Count; i++)
{
//MessageBox.Show(control.Controls[i].GetType().ToString());
switch (control.Controls[i].GetType().Name)//根据控件的类型判断能否实现功能
{
case "Label":
case "Button":
case "CheckBox":
case "LinkLabel":
case "RadioButton":
case "TextBox":
//根据传入的控件名字返回该控件在制定语言区域的TEXT属性
control.Controls[i].Text = getMsg(formName + control.Controls[i].Name);
control.Controls[i].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
break;
case "RibbonButton":
//根据传入的控件名字返回该控件在制定语言区域的TEXT属性
control.Controls[i].Text = getMsg(formName + control.Controls[i].Name);
control.Controls[i].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
break;
case "Panel":
SetFormLanguage(control.Controls[i]);
break;
case "RibbonPanel":
SetFormLanguage(control.Controls[i]);
break;
case "TabPanel":
((RibbonStyle.TabPanel)control.Controls[i]).Caption = getMsg(formName + control.Controls[i].Name);
((RibbonStyle.TabPanel)control.Controls[i]).Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
SetFormLanguage(control.Controls[i]);
break;
case "TabStrip":
RibbonStyle.TabStrip ts = (RibbonStyle.TabStrip)control.Controls[i];
for (int j = 0; j < ts.Items.Count; j++)
{
ts.Items[j].Text = getMsg(formName + ((RibbonStyle.Tab)ts.Items[j]).Name);
ts.Items[j].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
SetFormLanguage(control.Controls[i]);//返回该页所拥有控件,并设置其语言
}
break;
case "TabStripPage":
SetFormLanguage(control.Controls[i]);
break;
case "TabPageSwitcher":
SetFormLanguage(control.Controls[i]);
break;
case "GroupBox":
control.Controls[i].Text = getMsg(formName + control.Controls[i].Name);
control.Controls[i].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
SetFormLanguage(control.Controls[i]);
break;
case "TabControl":
TabControl tbc = (TabControl)control.Controls[i];
for (int j = 0; j < tbc.TabCount; j++)
{
tbc.TabPages[j].Text = getMsg(formName + tbc.TabPages[j].Name);
tbc.TabPages[j].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
SetFormLanguage(tbc.TabPages[j]);//返回该页所拥有控件,并设置其语言
}
break;
case "DataGridView":
DataGridView dgv = (DataGridView)control.Controls[i];
dgv.Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
for (int j = 0; j < dgv.ColumnCount; j++)
{
dgv.Columns[j].HeaderText = getMsg(formName + dgv.Columns[j].Name);
}
break;
case "MenuStrip":
MenuStrip ms = (MenuStrip)control.Controls[i];
ToolStripMenuItem menu = new ToolStripMenuItem();
for (int k = 0; k < ms.Items.Count; k++)
{
ms.Items[k].Text = getMsg(formName + ms.Items[k].Name);
ms.Items[k].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
menu = (ToolStripMenuItem)ms.Items[k];
for (int l = 0; l < menu.DropDownItems.Count; l++)
{
menu.DropDownItems[l].Text = getMsg(formName + menu.DropDownItems[l].Name);
menu.DropDownItems[l].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
}
}
break;
case "ComboBox":
ComboBox cb = (ComboBox)control.Controls[i];
cb.Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
//for (int o = 0; o < cb.Items.Count; o++)
//{
if (cb.Items.Count > 0 || cb.DataSource != null)
{
break;
}
else
{
//string cbName = getMsg(formName + cb.Name);
//char[] delimiterChars = { '|' };
//string[] strarr_cbName = cbName.Split(delimiterChars);
////for (int j = 0; j < strarr_cbName.Length; j++)
////{
//cb.Items.AddRange(strarr_cbName);
//}
//}
break;
}
case "StatusStrip":
StatusStrip ss = (StatusStrip)control.Controls[i];
for (int x = 0; x < ss.Items.Count; x++)
{
ss.Items[x].Text = getMsg(formName + ss.Items[x].Name);
ss.Items[x].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
}
break;
case "ToolStrip":
ToolStrip ts1 = (ToolStrip)control.Controls[i];
for (int w = 0; w < ts1.Items.Count; w++)
{
ts1.Items[w].Text = getMsg(formName + ts1.Items[w].Name);
ts1.Items[w].ToolTipText = getMsg(formName + ts1.Items[w].Name + "Tip");
ts1.Items[w].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
}
break;
//case "PictureBox":
// PictureBox pb = (PictureBox)control.Controls[i];
// if (str_LResourse == "en-US")
// pb.Image = GetImage(formName + pb.Name + "EN");
// if (str_LResourse == "zh-CN")
// pb.Image = GetImage(formName + pb.Name + "CH");
// break;
case "ListView":
ListView lv = (ListView)control.Controls[i];
lv.Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
for (int v = 0; v < lv.Columns.Count; v++)
{
lv.Columns[v].Text = getMsg(formName + lv.Columns[v].Name);
}
break;
case "ContextMenuStrip":
ContextMenuStrip cms = (ContextMenuStrip)control.Controls[i];
for (int v = 0; v < cms.Items.Count; v++)
{
cms.Items[v].Text = getMsg(formName + cms.Items[v].Name);
cms.Items[v].Font = new Font(font.Families[0].Name, control.Controls[i].Font.Size);
}
break;
default:
break;
}
}
#endregion
//if (((Form)control.TopLevelControl).ActiveMdiChild!=null &&
// ((Form)control.TopLevelControl).ActiveMdiChild.GetType().Name == "frmProduct")
//{
// ((frmProduct)((Form)control.TopLevelControl).ActiveMdiChild).Init();
//}
}
#region 尚未登录时调用
/// </summary>
/// 根据语言种类变量设置str_LResourse
/// </summary>
public void GetCurrLanguageWithoutAppGlobal(string str_Language)
{
if (str_Language == Const.LANGUAGE_CHINESE)
{
str_LResourse = "zh-CN";
}else if (str_Language == Const.LANGUAGE_ENGLISH)
{
str_LResourse = "en-US";
}else if (str_Language == Const.LANGUAGE_JAPANESE)
{
str_LResourse = "ja-JP";
}
}
/// <summary>
/// 根据传入的语言设置该控件内的所有控件TEXT属性,当AppGlobal为null时使用
/// </summary>
/// <param name="str_Language">当前语言</param>
public void SetLanguageWithoutAppGlobal(string str_Language, System.Windows.Forms.Control control)
{
GetCurrLanguageWithoutAppGlobal(str_Language);
SetFormLanguage(control);
}
#endregion
#region 登录时调用
/// </summary>
/// 根据语言种类变量设置str_LResourse
/// </summary>
public void GetCurrLanguage()
{
if (Fuction.m_Language == Const.LANGUAGE_CHINESE)
{
str_LResourse = "zh-CN";
}else if (Fuction.m_Language == Const.LANGUAGE_ENGLISH)
{
str_LResourse = "en-US";
}else if (Fuction.m_Language == Const.LANGUAGE_JAPANESE)
{
str_LResourse = "ja-JP";
}
}
/// <summary>
/// 根据传入的控件设置该控件内的所有控件TEXT属性,若AppGlobal为null,则默认显示中文
/// </summary>
/// <param name="control"></param>
public void SetLanguage(System.Windows.Forms.Control control)
{
GetCurrLanguage();
SetFormLanguage(control);
}
#endregion
#endregion
#region SetStyle
public DataGridViewCellStyle CreatDataGridViewCellStyle()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle0 = new System.Windows.Forms.DataGridViewCellStyle();
dataGridViewCellStyle0.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle0.Font = new System.Drawing.Font("微软雅黑", 10F);
dataGridViewCellStyle0.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle0.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle0.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
dataGridViewCellStyle0.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
dataGridViewCellStyle0.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(90)))), ((int)(((byte)(154)))));
return dataGridViewCellStyle0;
}
public void SetStyle(string Name)
{
Color HaloColor = Color.White;
switch (Name)
{
case "Dark":
this.BackColor = Color.FromArgb(88, 77, 69);
HaloColor = Color.FromArgb(200, 200, 200);
SetBase(87, 61, 53, HaloColor);
break;
case "Nature":
this.BackColor = Color.FromArgb(78, 127, 52);
HaloColor = Color.FromArgb(254, 209, 94);
SetBase(73, 118, 46, HaloColor);
break;
case "Dawn":
this.BackColor = Color.FromArgb(177, 108, 45);
SetBase(172, 99, 39, Color.FromArgb(254, 209, 94));
break;
case "Corn":
this.BackColor = Color.FromArgb(230, 193, 106);
SetBase(225, 184, 100, Color.FromArgb(191, 219, 255));
break;
case "Chocolate":
this.BackColor = Color.FromArgb(87, 54, 34);
SetBase(82, 45, 28, Color.FromArgb(232, 80, 90));
break;
case "Navy":
this.BackColor = Color.FromArgb(88, 121, 169);
SetBase(84, 112, 163, Color.FromArgb(254, 209, 94));
break;
case "Ice":
this.BackColor = Color.FromArgb(235, 243, 236);
SetBase(228, 234, 230, Color.FromArgb(254, 209, 94));
break;
case "Vanilla":
this.BackColor = Color.FromArgb(233, 243, 213);
SetBase(228, 234, 207, Color.FromArgb(254, 209, 94));
break;
case "Canela":
this.BackColor = Color.FromArgb(235, 226, 197);
SetBase(228, 217, 191, Color.FromArgb(254, 209, 94));
break;
case "Cake":
this.BackColor = Color.FromArgb(235, 213, 197);
SetBase(228, 204, 198, Color.FromArgb(254, 209, 94));
break;
default:
this.BackColor = Color.FromArgb(191, 219, 255);
SetBase(215, 227, 242, Color.FromArgb(254, 209, 94));
break;
}
}
public void SetBase(int R, int G, int B, Color HaloColor)
{
this.SuspendLayout();
foreach (Control control in this.Controls)
{
if (typeof(RibbonStyle.RibbonPanel) == control.GetType())
{
foreach (Control control1 in control.Controls)
{
SetColor(control1, R, G, B, HaloColor);
}
}
if (typeof(RibbonStyle.TabPanel) == control.GetType())
{
foreach (Control control1 in control.Controls)
{
SetColor(control1, R, G, B, HaloColor);
}
}
SetColor(control, R, G, B, HaloColor);
}
this.ResumeLayout(false);
}
public void SetColor(Control control, int R, int G, int B, Color HaloColor)
{
if (typeof(RibbonStyle.TabStrip) == control.GetType())
{
((RibbonStyle.TabStripProfessionalRenderer)((RibbonStyle.TabStrip)control).Renderer).HaloColor = HaloColor;
((RibbonStyle.TabStripProfessionalRenderer)((RibbonStyle.TabStrip)control).Renderer).BaseColor = Color.FromArgb(R + 4, G + 3, B + 3);
for (int i = 0; i < ((RibbonStyle.TabStrip)control).Items.Count; i++)
{
RibbonStyle.Tab _tab = (RibbonStyle.Tab)((RibbonStyle.TabStrip)control).Items[i];
#region Set Tab Colors
if (Color.FromArgb(R, G, B).GetBrightness() < 0.5)
{
//try
//{
// _tab.ForeColor = Color.FromArgb(R + 76, G + 71, B + 66);
//}
//catch
//{
// _tab.ForeColor = Color.FromArgb(250, 250, 250);
//}
}
else
{
//try
//{
// _tab.ForeColor = Color.FromArgb(R - 96, G - 91, B - 86);
//}
//catch
//{
// _tab.ForeColor = Color.FromArgb(10, 10, 10);
//}
}
#endregion
}
control.BackColor = Color.FromArgb(R - 24, G - 8, B + 12);
}
if (typeof(RibbonStyle.TabPageSwitcher) == control.GetType())
{
control.BackColor = Color.FromArgb(R - 24, G - 8, B + 12);
foreach (Control _control in control.Controls)
{
if (typeof(RibbonStyle.TabStripPage) == _control.GetType())
{
((RibbonStyle.TabStripPage)_control).BaseColor = Color.FromArgb(R, G, B);
((RibbonStyle.TabStripPage)_control).BaseColorOn = Color.FromArgb(R, G, B);
foreach (Control __control in _control.Controls)
{
if (typeof(RibbonStyle.TabPanel) == __control.GetType())
{
#region Set TabPanel Colors
if (Color.FromArgb(R, G, B).GetBrightness() < 0.5)
{
try
{
__control.ForeColor = Color.FromArgb(R + 76, G + 71, B + 66);
}
catch
{
__control.ForeColor = Color.FromArgb(250, 250, 250);
}
}
else
{
try
{
__control.ForeColor = Color.FromArgb(R - 96, G - 91, B - 86);
}
catch
{
__control.ForeColor = Color.FromArgb(10, 10, 10);
}
}
#endregion
((RibbonStyle.TabPanel)__control).BaseColor = Color.FromArgb(R, G, B);
((RibbonStyle.TabPanel)__control).BaseColorOn = Color.FromArgb(R + 16, G + 11, B + 6);
foreach (Control ___control in __control.Controls)
{
if (typeof(RibbonStyle.RibbonButton) == ___control.GetType())
{
((RibbonStyle.RibbonButton)___control).InfoColor = Color.FromArgb(R, G, B);
RibbonStyle.RibbonButton _but = (RibbonStyle.RibbonButton)___control;
#region Set Button Colors
if (Color.FromArgb(R, G, B).GetBrightness() < 0.5)
{
try
{
_but.ForeColor = Color.FromArgb(R + 76, G + 71, B + 66);
}
catch
{
_but.ForeColor = Color.FromArgb(250, 250, 250);
}
}
else
{
try
{
_but.ForeColor = Color.FromArgb(R - 96, G - 91, B - 86);
}
catch
{
_but.ForeColor = Color.FromArgb(10, 10, 10);
}
}
#endregion
}
}
}
}
}
}
}
}
#endregion
public bool CheckNull(string name, System.Windows.Forms.Control control)
{
bool returnValue;
if (control.Text.Trim() == "")
{
returnValue = false;
ShowMessageBox.ShowError(
Const.MESSAGEBOX_TITLE_NOTE, name, Const.ERROR_NONE);
control.Focus();
}
else
returnValue = true;
return returnValue;
}
/// <summary>
/// 如果是大于等于0的数字,返回ture;否则返回false
/// </summary>
/// <param name="name"></param>
/// <param name="control"></param>
/// <returns></returns>
public bool CheckNumber(string name, System.Windows.Forms.Control control)
{
bool returnValue;
try
{
if (Convert.ToDecimal(control.Text.Trim()) >= 0)
returnValue = true;
else
{
returnValue = false;
ShowMessageBox.ShowError(
Const.MESSAGEBOX_TITLE_NOTE, name, Const.ERROR_NUM);
control.Focus();
}
}
catch
{
returnValue = false;
ShowMessageBox.ShowError(
Const.MESSAGEBOX_TITLE_NOTE, name, Const.ERROR_NUM);
control.Focus();
}
return returnValue;
}
public bool CheckSame(string name, System.Windows.Forms.Control control, string fileName)
{
bool returnValue;
if (!fuction.CheckSameName("",fileName, control.Text.Trim()))
{
returnValue = true;
}
else
{
returnValue = false;
ShowMessageBox.ShowError(
Const.MESSAGEBOX_TITLE_NOTE, name, Const.ERROR_SAME);
control.Focus();
}
return returnValue;
}
}
}