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);
            }
        }
Esempio n. 2
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 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);
            }
        }
Esempio n. 4
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);
            }
        }