コード例 #1
0
ファイル: FrmWinFormGen.cs プロジェクト: thinhils/Nikita
 /// <summary>生成DAL
 ///
 /// </summary>
 /// <param name="sender">sender</param>
 /// <param name="e">e</param>
 private void cmdGenDAL_Click(object sender, EventArgs e)
 {
     switch (m_codeGenType)
     {
     case CodeGenType.WinFromSimpleQuery:
         IDalMaker      dalMaker       = DalMakerManager.GetDalMaker(m_dbSchema.SqlType);
         BasicParameter basicParameter = ParameterManager.GetBasicParameter(cboTable.Text.Trim());
         string         strContent     = dalMaker.GenDalCode(basicParameter.NameSpace, basicParameter.TableName, basicParameter.ClassName, m_dbSchema.DatabaseSchema.ConnectionString);
         string         strFolder      = basicParameter.OutFolderPath + "\\DAL\\";
         FileHelper.GenFile(strFolder, basicParameter.ClassName + "DAL.cs", strContent);
         break;
     }
 }
コード例 #2
0
        /// <summary>生成DAL
        ///
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="e">e</param>
        private void cmdGenDAL_Click(object sender, EventArgs e)
        {
            IDalMaker dalMaker = DalMakerManager.GetDalMaker(m_dbSchema.SqlType);

            if (m_codeGenType == CodeGenType.WinFromParentChildEditWithDialog)
            {
                BasicParameter basicParameterDetail = ParameterManager.GetBasicParameter(cboTableDetail.Text.Trim());
                string         strContentDetail     = dalMaker.GenDalCode(basicParameterDetail.NameSpace, basicParameterDetail.TableName, basicParameterDetail.ClassName, m_dbSchema.DatabaseSchema.ConnectionString);
                string         strFolderDetail      = basicParameterDetail.OutFolderPath + "\\DAL\\";
                FileHelper.GenFile(strFolderDetail, basicParameterDetail.ClassName + "DAL.cs", strContentDetail, false);
            }
            BasicParameter basicParameter = ParameterManager.GetBasicParameter(cboTable.Text.Trim());
            string         strContent     = dalMaker.GenDalCode(basicParameter.NameSpace, basicParameter.TableName, basicParameter.ClassName, m_dbSchema.DatabaseSchema.ConnectionString);
            string         strFolder      = basicParameter.OutFolderPath + "\\DAL\\";

            FileHelper.GenFile(strFolder, basicParameter.ClassName + "DAL.cs", strContent);
        }