Esempio n. 1
0
        public override void Run(CInputInfo info)
        {
            GetInfo(info);
            string template = "";
            if (language != "JAVA")
            {
                template = "CXMLTemplate.txt";
            }
            else
            {
                template = "JXMLTemplate.txt";
            }
            GeneralClass gc = new GeneralClass();
            string content = gc.ReadTemplate(template);
            IDictionary<string,string> list = gc.GetField(sqlPath);

            if (list != null && list.Count > 0)
            {
                content = content.
                          Replace("<%actionName%>", GetActionName(list)).
                          Replace("<%tableCode%>", GetTableCode(list)).
                          Replace("<%tableDescripe%>", gc.GetDescripe(sqlPath)).
                          Replace("<%packageName%>", packageName).
                          Replace("<%className%>", GetTableCode(list)+"Class").
                          Replace("<%resultMap%>", CreateResultMap(list, language)).
                          Replace("<%allColumn%>",CreateAllColumn(list)).
                          Replace("<%create%>", CreateCreateCode(list)).
                          Replace("<%update%>", CreateUpdate(list, language)).
                          Replace("<%primarykey%>", CreatePrimarykey(list)).
                          Replace("<%dynamicWhere%>",CreateDynamicWhere(list)).
                          Replace("<%dynamicScope%>",CreateDynamicScope(list));
                byte[] by = Encoding.Default.GetBytes(content);
                GeneralClass.WriteToFile(savePath + "\\beanmapper\\" + GetTableCode(list) + ".xml", by);
            }
        }
        public override void Run(CInputInfo info)
        {
            GetInfo(info);
            string template = "";

            if (language != "JAVA")
            {
                template = "CXMLTemplate.txt";
            }
            else
            {
                template = "JXMLTemplate.txt";
            }
            GeneralClass gc      = new GeneralClass();
            string       content = gc.ReadTemplate(template);
            IDictionary <string, string> list = gc.GetField(sqlPath);

            if (list != null && list.Count > 0)
            {
                content = content.
                          Replace("<%tableCode%>", GetTableCode(list)).
                          Replace("<%tableDescripe%>", gc.GetDescripe(sqlPath)).
                          Replace("<%packageName%>", packageName).
                          Replace("<%className%>", GetTableCode(list) + "Class").
                          Replace("<%resultMap%>", CreateResultMap(list, language)).
                          Replace("<%allColumn%>", CreateAllColumn(list)).
                          Replace("<%create%>", CreateCreateCode(list)).
                          Replace("<%update%>", CreateUpdate(list, language)).
                          Replace("<%primarykey%>", CreatePrimarykey(list)).
                          Replace("<%dynamicWhere%>", CreateDynamicWhere(list)).
                          Replace("<%dynamicScope%>", CreateDynamicScope(list));
                byte[] by = Encoding.Default.GetBytes(content);
                GeneralClass.WriteToFile(savePath + "\\dao\\sqlmap\\" + GetTableCode(list) + ".xml", by);
            }
        }
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.ThreadException += Application_ThreadException;
     GeneralClass.GetDicTableAction();
     Application.Run(new MainForm());
 }
        public virtual void Run(CInputInfo info)
        {
            GetInfo(info);
            string template = "";

            if (language != "JAVA")
            {
                //template = "CEntityTemplate.txt";
            }
            else
            {
                template = GetJTemplate();
            }
            GeneralClass gc                   = new GeneralClass();
            string       content              = gc.ReadTemplate(template);
            IDictionary <string, string> dic  = gc.GetField(sqlPath);
            IDictionary <string, string> list = gc.GetFieldType(sqlPath, language);
            string tableDescripe              = gc.GetDescripe(sqlPath);

            content = content.
                      Replace("<%className%>", GetClassName(dic)).
                      Replace("<%allField%>", CreateAllField(list, language, dic)).
                      Replace("<%classContent%>", CreateClassContent(list, language)).
                      Replace("<%packageName%>", packageName).
                      Replace("<%tableName%>", GeneralClass.GetTableName(dic)).
                      Replace("<%tableVarName%>", GeneralClass.GetTableName(dic).ToLower()).
                      Replace("<%creater%>", create).
                      Replace("<%tableDescripe%>", gc.GetDescripe(sqlPath)).
                      Replace("<%actionName%>", GeneralClass.GetActionName(dic)).
                      Replace("<%actionVarName%>", GeneralClass.GetActionVarName(dic)).
                      Replace("<%createTime%>", DateTime.Now.ToString());
            byte[] by = Encoding.Default.GetBytes(content);
            if (language != "JAVA")
            {
                //gc.WriteToFile(savePath + "\\action\\" + GetTableCode(dic) + ".cs", by);
            }
            else
            {
                OutJFile(dic, by);
            }
        }
 public override void OutJFile(IDictionary <string, string> dic, byte[] by)
 {
     GeneralClass.WriteToFile(savePath + "\\service\\" + GeneralClass.GetActionName(dic) + "Service.java", by);
 }
Esempio n. 6
0
        public virtual void Run(CInputInfo info)
        {
            GetInfo(info);
            string template = "";
            if (language != "JAVA")
            {
                //template = "CEntityTemplate.txt";
            }
            else
            {
                template = GetJTemplate();
            }
            GeneralClass gc = new GeneralClass();
            string content = gc.ReadTemplate(template);
            IDictionary<string, string> dic = gc.GetField(sqlPath);
            IDictionary<string, string> list = gc.GetFieldType(sqlPath, language);
            string tableDescripe = gc.GetDescripe(sqlPath);

            content = content.
                        Replace("<%className%>", GetClassName(dic)).                                 //
                        Replace("<%allField%>", CreateAllField(list, language, dic)).                //
                        Replace("<%classContent%>", CreateClassContent(list, language)).             //
                        Replace("<%packageName%>", packageName).                                     //
                        Replace("<%tableName%>", GeneralClass.GetTableName(dic)).                    //AABB02A
                        Replace("<%tableVarName%>", GeneralClass.GetTableName(dic).ToLower()).       //
                        Replace("<%creater%>", create).                                              //
                        Replace("<%tableDescripe%>", gc.GetDescripe(sqlPath)).                       //
                        Replace("<%actionName%>", GeneralClass.GetActionName(dic)).                  //User
                        Replace("<%actionVarName%>", GeneralClass.GetActionVarName(dic)).            //user
                        Replace("<%createTime%>", DateTime.Now.ToString());                          //
            byte[] by = Encoding.Default.GetBytes(content);
            if (language != "JAVA")
            {
                //gc.WriteToFile(savePath + "\\action\\" + GetTableCode(dic) + ".cs", by);
            }
            else
            {
                OutJFile(dic,by);
            }
        }
 public override void OutJFile(IDictionary <string, string> dic, byte[] by)
 {
     GeneralClass.WriteToFile(savePath + "\\SqlMap.txt", by, true, true);
 }
 /// <summary>
 /// 替换<%tableCode%>
 /// </summary>
 /// <param name="list"></param>
 /// <returns></returns>
 private string GetTableCode(IDictionary <string, string> list)
 {
     return(GeneralClass.GetTableCode(list));
 }
Esempio n. 9
0
 public override void OutJFile(IDictionary <string, string> dic, byte[] by)
 {
     GeneralClass.WriteToFile(savePath + "\\bean\\" + GetTableCode(dic) + ".java", by);
 }
Esempio n. 10
0
 public override void OutJFile(IDictionary <string, string> dic, byte[] by)
 {
     GeneralClass.WriteToFile(savePath + "\\controller\\" + GeneralClass.GetActionName(dic) + "Controller.java", by);
 }
Esempio n. 11
0
 /// <summary>
 /// 替换<%actionName%>
 /// </summary>
 /// <param name="list"></param>
 /// <returns></returns>
 private string GetActionName(IDictionary <string, string> list)
 {
     return(GeneralClass.GetActionName(list));
 }
Esempio n. 12
0
 /// <summary>
 /// 替换<%tableName%>
 /// </summary>
 /// <returns></returns>
 protected string GetTableName(IDictionary <string, string> dic)
 {
     return(GeneralClass.GetTableCode(dic));
 }
Esempio n. 13
0
 public override void OutJFile(IDictionary <string, string> dic, byte[] by)
 {
     GeneralClass.WriteToFile(savePath + "\\dao\\sqlmap\\" + GeneralClass.GetActionName(dic) + "DaoImpl.java", by);
 }