Example #1
0
 private void BtnCreateModel_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtClassName.Text) && !string.IsNullOrEmpty(tableName))
     {
         txtCode.Text = BSqlFunction.GetInstance().GetModelClass(txtClassName.Text.Trim(), tableName);
     }
     else
     {
         MessageBox.Show(@"请选择要生成代码的数据表或者填写要生成的类名", @"提醒", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #2
0
        private void BtnCreateDAL_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtClassName.Text))
            {
                MessageBox.Show(@"必须填写类名", @"提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            string className = txtClassName.Text.Substring(0, 1).ToUpper() + txtClassName.Text.Substring(1);

            //MessageBox.Show(className);

            txtCode.Text = BSqlFunction.GetInstance().GetDalClass(className, tableName);
        }
Example #3
0
        private void TopMenuItem2_Click(object sender, EventArgs e)
        {
            DbConfigInfo dbConfigInfo = DbConfigUtil.GetDbConfig();

            if (dbConfigInfo != null)
            {
                Global.GetInstance().DB = dbConfigInfo;
            }

            try
            {
                Global.GetInstance().Tables = BSqlFunction.GetInstance().GetTables();
                CreateTreeNode();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }