Esempio n. 1
0
 public void SaveDBO()
 {
     cfgfile = new Maticsoft.Utility.INIFile(cmcfgfile);
     if (radbtnDBO_SP.Checked)
     {
         cfgfile.IniWriteValue("dbo", "dbosp", "1");
     }
     else
     {
         cfgfile.IniWriteValue("dbo", "dbosp", "0");
     }
     if (chkLoginfo.Checked)
     {
         cfgfile.IniWriteValue("loginfo", "save", "1");
     }
     else
     {
         cfgfile.IniWriteValue("loginfo", "save", "0");
     }
 }
Esempio n. 2
0
        private void btn_ok_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count < 1)
            {
                return;
            }
            string selstr  = this.listView1.SelectedItems[0].Text;
            string daltype = "S3";

            switch (selstr)
            {
            case "单类结构":
            {
                daltype = "One";
                MessageBox.Show("该功能暂不支持,可以选择其他功能继续使用。");
            }
            break;

            case "简单三层结构":
            {
                folder1 = Application.StartupPath + "\\Template\\CodematicDemoS3";
                daltype = "S3";
            }
            break;

            case "简单三层结构(管理)":
            {
                folder1 = Application.StartupPath + "\\Template\\CodematicDemoS3p";
                daltype = "S3p";
            }
            break;

            case "工厂模式结构":
            {
                folder1 = Application.StartupPath + "\\Template\\CodematicDemoF3";
                daltype = "F3";
            }
            break;

            default:
                break;
            }

            #region  制目录
            folder2 = txtProPath.Text.Trim();
            ProName = txtProName.Text.Trim();
            cfgfile.IniWriteValue("Project", "lastpath", folder2);
            if (ProName != "")
            {
                folder2 += "\\" + ProName;
            }
            else
            {
                MessageBox.Show("请输入项目名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (txtProPath.Text.Trim() == "")
            {
                MessageBox.Show("请选择输出目录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            string longservername = FormCommon.GetDbViewSelServer();
            if (longservername == "")
            {
                MessageBox.Show("你尚未选择要生成代码的数据库信息!\r\n请先建立数据库连接。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            #region 目录检查
            //try
            //{
            //    DirectoryInfo source = new DirectoryInfo(folder1);
            //    DirectoryInfo target = new DirectoryInfo(folder2);
            //    if (!source.Exists)
            //    {
            //        MessageBox.Show("源目录已经不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //        return;
            //    }
            //    if (!target.Exists)
            //    {
            //        try
            //        {
            //            target.Create();
            //        }
            //        catch
            //        {
            //            MessageBox.Show("目标目录不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //            return;
            //        }
            //    }
            //}
            //catch
            //{
            //    MessageBox.Show("目录信息有误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    return;
            //}
            #endregion

            //mythread = new Thread(new ThreadStart(ThreadWork));
            //mythread.Start();

            NewProjectDB npb = new NewProjectDB(longservername, this, folder2, daltype, ProName);
            npb.Show();

            #endregion

            Close();
        }
Esempio n. 3
0
 /// <summary>
 /// 标记今天已经下载过RSS数据
 /// </summary>
 /// <param name="filename"></param>
 /// <param name="loginfo"></param>
 private void LoadedRssMarker()
 {
     cfgfile.IniWriteValue("updaterss", "today", DateTime.Today.ToString("yyyyMMdd"));
 }