Esempio n. 1
0
        private void createProject()
        {
            DAOTM            tmdao                 = new DAOTM();
            TextOfMessageBox a                     = new TextOfMessageBox();
            string           name                  = txtProjectName.Text;
            string           sourceFileLanguge     = cboSourceFilesLanguage.Text;
            string           translatedFileLanguge = cboTranslatedFilesLanguage.Text;
            //string locationFolder = txtLocation.Text + "\\" + txtProjectName.Text;
            string   locationFolder = Path.Combine(txtLocation.Text, txtProjectName.Text);
            DateTime now            = new DateTime();

            now = DateTime.Now;
            Project project = new Project();

            project.setLanguage(sourceFileLanguge, translatedFileLanguge);
            project.setNameProject(name);
            project.setPathProject(locationFolder);
            project.setCreationTime(now);
            if (ckbUseTMCreated.Checked)
            {
                tablename tbn = cboTMName.SelectedItem as tablename;
                project.setTMName(tbn.name);

                mainForm.setProject(project);
                closeForm();
                mainForm.createNewProject();
                //mainForm.creatNewProjectForm = null;
                //closeForm();
            }
            if (ckbCreateNewTM.Checked)
            {
                string tmname = txtTMName.Text;
                project.setTMName(tmname);
                int result = tmdao.createTable(project.getTMName());
                if (result == 0)
                {
                    mainForm.setProject(project);
                    closeForm();
                    mainForm.createNewProject();
                    //mainForm.creatNewProjectForm = null;
                    closeForm();
                }
                else
                {
                    MessageBox.Show(a.CREATE_TM_FAILED, "Cảnh báo", MessageBoxButtons.YesNo);
                }
            }
        }
Esempio n. 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            TextOfMessageBox a = new TextOfMessageBox();

            if (txtLocation.Text != "" && txtProjectName.Text != "")
            {
                string root = Path.Combine(txtLocation.Text, txtProjectName.Text);
                if (Directory.Exists(root))
                {
                    MessageBox.Show(a.FOLDER_EXISTING_MESAGEBOX, "Cảnh báo", MessageBoxButtons.YesNo);
                }
                else
                {
                    string name = txtProjectName.Text;
                    string sourceFileLanguge     = cboSourceFilesLanguage.Text;
                    string translatedFileLanguge = cboTranslatedFilesLanguage.Text;
                    //string locationFolder = txtLocation.Text + "\\" + txtProjectName.Text;
                    string   locationFolder = Path.Combine(txtLocation.Text, txtProjectName.Text);
                    DateTime now            = new DateTime();
                    now = DateTime.Now;
                    Project project = new Project();
                    project.setLanguage(sourceFileLanguge, translatedFileLanguge);
                    project.setNameProject(name);
                    project.setPathProject(locationFolder);
                    project.setCreationTime(now);
                    mainForm.setProject(project);
                    mainForm.createNewProject();
                    //mainForm.creatNewProjectForm = null;
                    closeForm();
                }
            }
            else
            {
                MessageBox.Show(a.CREATE_NEW_PROJECT_MESSAGEBOX, "Cảnh báo", MessageBoxButtons.YesNo);
            }
        }