123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace IControls_FireManager
- {
- public partial class Form_Project_New : Form
- {
- public Form_Project_New()
- {
- InitializeComponent();
-
-
-
-
-
- this.FormClosing += new FormClosingEventHandler(CreateForm_FormClosing);
-
- _Event.WindowStyleSet_SendMessage_Event += new _Event.WindowStyleSet_SendMessage_Handler(_Event_WindowStyleSet_SendMessage_Event);
-
-
-
- UI_Style_Initialize();
- }
-
-
- public void CreateForm_FormClosing(object sender, FormClosingEventArgs e)
- {
-
- _Event.WindowStyleSet_SendMessage_Event -= new _Event.WindowStyleSet_SendMessage_Handler(_Event_WindowStyleSet_SendMessage_Event);
- }
-
- public void _Event_WindowStyleSet_SendMessage_Event()
- {
- UI_Style_Initialize();
- }
-
- private void UI_Style_Initialize()
- {
-
- }
-
-
- private bool Check_ProjectName(string ProjectName)
- {
-
- string result = _File.Get_FolderNameList(_Data.Project_Path);
- if (result != null)
- {
-
- string[] FolderNames = _Convert.String_to_ArrayString(result);
- foreach (string FolderName in FolderNames)
- {
-
- if (FolderName.ToUpper().ToString() == ProjectName.ToUpper().ToString())
- return false;
- }
- }
-
- return true;
- }
- private void UiButton_Project_Save_Click(object sender, EventArgs e)
- {
-
- this.EditBox_ProjectName.Text = this.EditBox_ProjectName.Text.Trim();
- if (this.EditBox_ProjectName.Text == null
- || this.EditBox_ProjectName.Text == _Text.DEFAULT_PROJECT_NAME
- || this.EditBox_ProjectName.Text.Length == 0)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.Warnning, 250, 150, _Text.NotCorrectProjectNameInform, 0);
- }
- else if (Check_ProjectName(this.EditBox_ProjectName.Text) == false)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.Warnning, 300, 150, _Text.SameProjectNameInform, 0);
- }
- else if (_Error.Data_Confirm_NotDefineString(this.EditBox_ProjectName.Text.Trim()) != null)
- {
- ;
- }
- else
- {
-
- _Data.HASH_RECEIVER.Clear();
- _Data.LIST_RECEIVER_ID.Clear();
- _Data.HASH_XMLDEVTYPE.Clear();
- _Data.LIST_XMLDEVTYPE_ID.Clear();
-
-
-
-
- _Data.LIST_XMLRECEIVER_ID.Clear();
- _Data.List_ExcelPoint.Clear();
- _Data.HASH_CodePosition.Clear();
- _Data.LIST_CodePosition_NAME.Clear();
- _Data.LIST_XmlDBNotSave_Receiver.Clear();
- _Data.Hash_ImportPoint.Clear();
-
- _Data.INIT_RECEIVER_ID = 1;
-
- _Data.DB_FullPath = null;
-
- _Data.Project_Name = this.EditBox_ProjectName.Text.Trim();
-
- _File.Create_ProjectFolder(_Data.Project_Path, _Data.Project_Name);
-
- _File.Write_Receiver_XML(_Data.Project_Path + "\\" + _Data.Project_Name);
-
- _Event.WorkView_Clear_SendMessage_Write();
- _Event.TreeView_Clear_SendMessage_Write(_Data.Project_Name);
-
- this.Close();
- }
- }
-
- }
- }
|