예제 #1
0
        private string GetSwitchCustomFields(DataTable dt)
        {
            string mainTemplate = string.Empty;

            foreach (DataRow dr in dt.Rows)
            {
                if (!dr["Name"].ToString().StartsWith("VERSION_"))
                {
                    string template = ManageTemplate.GetTemplate("Snippet/SwithcCustomFields.ico");

                    template = template.Replace("***FIELDNAME***", GetPublic(dr["Name"].ToString()));
                    string fieldType = "FieldType.String";
                    switch (dr["type"].ToString())
                    {
                    case "Date":
                    case "DateTime":
                    case "DateTime?": fieldType = "FieldType.Date"; break;

                    case "int":
                    case "decimal":
                    case "double":
                    case "Int16":
                    case "Int64":
                    case "float": fieldType = "FieldType.Numeric"; break;

                    case "bool": fieldType = "FieldType.Bool"; break;
                    }
                    template     = template.Replace("***FIELDTYPE***", fieldType);
                    mainTemplate = string.Concat(mainTemplate, "\n\n", template);
                }
            }

            return(mainTemplate);
        }
예제 #2
0
        private static string BuildStoredProcedureListBusiness(DataTable completeStoredProcedures, string tableName, string type)
        {
            string storedFunctions = string.Empty;
            string storedName      = string.Empty;
            string functionName    = string.Empty;
            string template        = string.Empty;

            string parameterListHeader = string.Empty;
            string parameterListCall   = string.Empty;

            string headerInterface = string.Empty;
            string allTemplate     = string.Empty;

            storedName   = completeStoredProcedures.Rows[0]["Table"].ToString();
            functionName = storedName.Replace(string.Concat("_", tableName, "_"), string.Empty);

            foreach (DataRow parameter in completeStoredProcedures.Rows)
            {
                if (parameterListHeader != string.Empty)
                {
                    parameterListHeader = string.Concat(parameterListHeader, ", ");
                }
                parameterListHeader = string.Concat(parameterListHeader, parameter["Type"], " ", GetPrivate(parameter["Name"].ToString()));

                if (parameterListCall != string.Empty)
                {
                    parameterListCall = string.Concat(parameterListCall, ", ");
                }
                parameterListCall = string.Concat(parameterListCall, GetPrivate(parameter["Name"].ToString()));
            }

            template = string.Empty;


            if (Session.Modality == Modality.ThreeLayer)
            {
                if (storedName.StartsWith("GetCollection"))
                {
                    template = ManageTemplate.GetTemplate("2015ThreeLayer//GetCollectionTemplate.ico");
                }
                if (storedName.StartsWith("GetItem"))
                {
                    template = ManageTemplate.GetTemplate("2015ThreeLayer//GetItemTemplate.ico");
                }
            }

            template = template.Replace("***ClassName***", tableName);
            template = template.Replace("#StoredName#", storedName);
            template = template.Replace("***FunctionName***", functionName);
            template = template.Replace("***parameterListHeader***", parameterListHeader);
            template = template.Replace("***ParameterListCall***", parameterListCall);

            allTemplate = string.Concat(allTemplate, template);

            return(allTemplate);
        }
예제 #3
0
        private string GetLabel(string templateRow, string fieldName)
        {
            string labelTemplate = OpenRow(templateRow);

            labelTemplate = string.Concat(labelTemplate, ManageTemplate.GetTemplate("WebTemplate\\label.ico"));
            labelTemplate = labelTemplate.Replace("***Name***", fieldName);

            labelTemplate = string.Concat(labelTemplate, "</td><td>");

            return(string.Concat(templateRow, labelTemplate));
        }
예제 #4
0
        public bool BuildNull()
        {
            string template = ManageTemplate.GetTemplate("Null.ico");

            template = template.Replace("***NameSpace***", Session.NamespaceDataLayer);
            if (ManageTemplate.WriteTemplate(Session.Folder, template, "Null", null))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #5
0
        private static string BuildStoredProcedureList(DataTable completeStoredProcedures, string tableName, string type)
        {
            string storedFunctions = string.Empty;
            string storedName      = string.Empty;
            string functionName    = string.Empty;
            string template        = string.Empty;

            string parameterListHeader    = string.Empty;
            string parameterListBody      = string.Empty;
            string parameterListCall      = string.Empty;
            string parameterListSubHeader = string.Empty;

            string headerInterface = string.Empty;
            string allTemplate     = string.Empty;

            storedName   = completeStoredProcedures.Rows[0]["Table"].ToString();
            functionName = storedName.Replace(string.Concat("_", tableName, "_"), string.Empty);

            foreach (DataRow parameter in completeStoredProcedures.Rows)
            {
                if (parameterListHeader != string.Empty)
                {
                    parameterListHeader = string.Concat(parameterListHeader, ", ");
                }
                parameterListHeader = string.Concat(parameterListHeader, parameter["Type"], " ", GetPrivate(parameter["Name"].ToString()));

                if (parameterListCall != string.Empty)
                {
                    parameterListCall = string.Concat(parameterListCall, ", ");
                }
                parameterListCall = string.Concat(parameterListCall, "parameter", parameter["Name"]);

                if (parameterListSubHeader != string.Empty)
                {
                    parameterListSubHeader = string.Concat(parameterListSubHeader, ", ");
                }
                parameterListSubHeader = string.Concat(parameterListSubHeader, GetPrivate(parameter["Name"].ToString()));

                string suffixTable = string.Empty;
                if (storedName.StartsWith("GetCollection"))
                {
                    suffixTable = "Collection";
                }
                headerInterface = string.Concat(tableName, suffixTable, " ", functionName, "(", parameterListHeader, ");");
            }

            template = string.Empty;

            parameterListBody = GetParameters(completeStoredProcedures, storedName);

            if (Session.Modality.Equals(Modality.Professional))
            {
                if (storedName.StartsWith("GetCollection"))
                {
                    template = ManageTemplate.GetTemplate("Professional//GetCollectionTemplate.ico");
                }
                if (storedName.StartsWith("GetItem"))
                {
                    template = ManageTemplate.GetTemplate("Professional//GetItemTemplate.ico");
                }
            }
            else
            {
                if (storedName.StartsWith("GetCollection"))
                {
                    template = ManageTemplate.GetTemplate("Simple//GetCollectionTemplate.ico");
                }
                if (storedName.StartsWith("GetItem"))
                {
                    template = ManageTemplate.GetTemplate("Simple//GetItemTemplate.ico");
                }

                if (storedName.Equals(string.Format(Session.GetCustomItemSql, tableName)))
                {
                    template = ManageTemplate.GetTemplate("Simple//GetItemTemplate.ico");
                }
                if (storedName.Equals(string.Format(Session.GetCustomCollectionSql, tableName)))
                {
                    template = ManageTemplate.GetTemplate("Simple//GetCollectionTemplate.ico");
                }
            }

            //if (allTemplate.Equals(string.Empty)) template.Substring(2, template.Length - 8);

            template = template.Replace("***ClassName***", tableName);
            template = template.Replace("#StoredName#", storedName);
            template = template.Replace("***FunctionName***", functionName);
            template = template.Replace("***parameterListHeader***", parameterListHeader);
            template = template.Replace("***ParameterListBody***", parameterListBody);
            template = template.Replace("***ParameterListCall***", parameterListCall);

            allTemplate = string.Concat(allTemplate, template);

            if (type.Equals("Interface"))
            {
                return(headerInterface);
            }

            if (type.Equals("Manager"))
            {
                string templateManager = string.Empty;
                if (storedName.StartsWith("GetItem"))
                {
                    templateManager = ManageTemplate.GetTemplate("TemplateManagerBodyGetItem.ico");
                }

                if (storedName.StartsWith("GetCollection"))
                {
                    templateManager = ManageTemplate.GetTemplate("TemplateManagerBodyGetCollection.ico");
                }

                //string templateManager = ManageTemplate.GetTemplate("TemplateManagerBody.ico");
                templateManager = templateManager.Replace("***ClassName***", tableName);
                templateManager = templateManager.Replace("***FunctionName***", functionName);
                templateManager = templateManager.Replace("***parameterListHeader***", parameterListHeader);
                templateManager = templateManager.Replace("***parameterListSubHeader***", parameterListSubHeader);
                return(templateManager);
            }

            return(allTemplate);
        }
예제 #6
0
        public bool BuildTemplate(DataTable dt, Provider provider)
        {
            string    tableName = dt.Rows[0]["Table"].ToString().Trim();
            KeyColumn key       = new KeyColumn();

            key.Name     = dt.Rows[0]["Name"].ToString();
            key.NetType  = dt.Rows[0]["Type"].ToString();
            key.Sequence = 1;
            key.Type     = dt.Rows[0]["Type"].ToString();
            key.Size     = int.Parse(dt.Rows[0]["Length"].ToString());
            Dictionary <string, KeyColumn> keys = new Dictionary <string, KeyColumn>();

            keys.Add(key.Name, key);
            Session.Keys = keys;
            string keyType        = "int";
            string isAutomaticKey = "false";
            string typeKey        = string.Empty;

            if (Session.Keys.Count == 0)
            {
                return(false);
            }

            string privateField = string.Empty;

            if (Session.Framework == Framework.net20)
            {
                privateField = GetPrivateField(dt);
            }
            string publicField               = GetPublicField(dt);
            string mapping                   = GetMapping(dt);
            string parameters                = string.Empty; // GetParameters(dt, tableName);
            string parametersList            = string.Empty;
            string parametersListInsert      = string.Empty;
            string parametersListUpdate      = string.Empty;
            string parametersListDelete      = string.Empty;
            string parametersListClone       = string.Empty;
            string declarationParametersKeys = string.Empty;
            string parameterKeys             = string.Empty;
            string listParameterKeys         = string.Empty;
            string isNullKeys                = string.Empty;
            string parametersKeysWithOutType = string.Empty;
            string queryInsert               = string.Empty;
            string queryUpdate               = string.Empty;
            string queryDelete               = string.Empty;
            string fieldBoolean              = string.Empty;
            string queryByUpdVer             = string.Empty;
            string structureField            = string.Empty;
            string isSingleKey               = "true";

            if (Session.Keys.Count > 1)
            {
                isSingleKey = "false";
            }

            string template = string.Empty;

            template = ManageTemplate.GetTemplate("CrudTemplateAutoTask.ico");

            //parametersListInsert = GetParametersList(dt, tableName, false);
            //parametersListUpdate = GetParametersList(dt, tableName, false);
            //parametersListDelete = GetParametersList(dt, tableName, true);

            GetParametersListAll(dt, ref parametersListInsert, ref parametersListDelete, ref parametersListClone, ref parameters, provider);
            parametersListUpdate = parametersListInsert;
            SetAllKeys(ref declarationParametersKeys, ref listParameterKeys, ref parametersKeysWithOutType, ref isNullKeys, ref parameterKeys);
            structureField = GetStructure(dt);

            fieldBoolean = CustomBoolean.GetList();

            //declarationParametersKeys = SetDeclarationKeys();
            //parameterKeys = GetParametersDictionaryList(Session.Keys, tableName);
            //listParameterKeys = SetParametersKeys();
            //isNullKeys = SetNullKeysCondtition();

            template = template.Replace("#Version#", Session.Version);
            template = template.Replace("#Date#", System.DateTime.Now.ToString("dd/MM/yyyy"));

            template = template.Replace("#Owner#", Session.Owner);
            template = template.Replace("***NameSpace***", Session.NamespaceDataLayer);
            template = template.Replace("***ClassName***", tableName);
            template = template.Replace("***StructureField***", structureField);
            template = template.Replace("***PrivateField***", privateField);
            template = template.Replace("***PublicField***", publicField);
            template = template.Replace("***MappingDataReader***", mapping);
            template = template.Replace("***MappingDataTable***", mapping);
            template = template.Replace("***Parameters***", parameters);
            template = template.Replace("***KetType***", keyType);
            template = template.Replace("***isAutomaticKey***", isAutomaticKey);
            foreach (KeyValuePair <string, KeyColumn> kvp in Session.Keys)
            {
                template = template.Replace("***TableKey***", kvp.Key);
                if (!kvp.Value.NetType.Equals("String"))
                {
                    template = template.Replace("***TableKeyType***", string.Concat(kvp.Value.NetType, ".Parse"));
                }
                else
                {
                    template = template.Replace("***TableKeyType***", string.Empty);
                }
                break;
            }

            template = template.Replace("***DeclarationParameterKeys***", declarationParametersKeys);
            template = template.Replace("***ParameterKeys***", parameterKeys);
            template = template.Replace("***ListParameterKeys***", listParameterKeys);

            template = template.Replace("***ParametersListInsert***", parametersListInsert);
            template = template.Replace("***ParametersListUpdate***", parametersListUpdate);
            template = template.Replace("***ParametersListDelete***", parametersListDelete);
            template = template.Replace("***ParametersListClone***", parametersListClone);

            template = template.Replace("***Collection***", Session.GetCollectionFunction);
            //template = template.Replace("#GetCollectionSql#", GetViewSql(dt, tableName, true));
            //template = template.Replace("#GetCollectionSqlWithOutOrder#", GetViewSql(dt, tableName, false));
            template = template.Replace("#GetCollectionByKeys#", "GetCollectionByKeys");
            template = template.Replace("***FieldBoolean***", fieldBoolean);
            template = template.Replace("***IsSingleKey***", isSingleKey);
            template = template.Replace("***TypeKey***", keyType);

            if (Session.SuperClass)
            {
                string    minorField            = string.Empty;
                string    tableNameRelationship = string.Empty;
                DataTable dtRelationship        = GetDatatableSqlBase.GetRelationship(tableName);
                foreach (DataRow drRelationship in dtRelationship.Rows)
                {
                    if (!tableNameRelationship.Equals(drRelationship["REFDTBNAME"].ToString()))
                    {
                        tableNameRelationship = drRelationship["REFDTBNAME"].ToString();
                        DataTable dtMinor = GetDatatableSqlBase.GetSchema(drRelationship["REFDTBNAME"].ToString());
                        minorField = string.Concat(minorField, GetPublicFieldForSuperClass(dtMinor, tableNameRelationship));
                    }
                    tableNameRelationship = drRelationship["REFDTBNAME"].ToString();
                }

                template = template.Replace("***SuperClass***", minorField);
                template = template.Replace("***DeclareRelationship***", GetDeclareRelationship(tableName));
                template = template.Replace("***DeclareIndex***", GetDeclareIndex(tableName));
            }
            else
            {
                template = template.Replace("***SuperClass***", string.Empty);
                template = template.Replace("***DeclareRelationship***", string.Empty);
                template = template.Replace("***DeclareIndex***", string.Empty);
            }

            //GetSql(dt, tableName, ref queryInsert, ref queryUpdate, ref queryDelete);
            //template = template.Replace("#GetByCodeSql#", GetByCodeSql(dt, tableName));
            //template = template.Replace("#GetByCodeSqlUpdVer#", GetByCodeSqlUpdVer(dt, tableName));

            template = template.Replace("***SWITCHCUSTOMFIELDS***", GetSwitchCustomFields(dt));
            template = template.Replace("***FIELDENUM***", GetFieldEnum(dt));

            template = template.Replace("***InsertSql***", queryInsert);
            template = template.Replace("#UpdateSql#", queryUpdate);
            template = template.Replace("#DeleteSql#", queryDelete);
            template = template.Replace("***Insert***", string.Format(Session.InsertFunction, tableName));
            template = template.Replace("#InsertKey#", "InsertKey");
            template = template.Replace("***Update***", string.Format(Session.UpdateFunction, tableName));
            template = template.Replace("***Delete***", string.Format(Session.DeleteFunction, tableName));
            template = template.Replace("***Read***", string.Format(Session.ReadFunction, tableName));
            template = template.Replace("***GetCollection***", string.Format(Session.GetCollectionFunction, tableName));
            template = template.Replace("***GetByCode***", string.Format(Session.GetByCodeFunction, tableName));
            template = template.Replace("***IsUnknown***", Session.IsUnknown);
            template = template.Replace("***IsUnknownCondtition***", isNullKeys);

            template = template.Replace("***CheckExist***", string.Empty);

            bool isValid = false;

            if (!(ManageTemplate.WriteTemplate(Session.Folder, template, string.Concat(tableName, ""), null)))
            {
                return(false);
            }
            //{
            //    #region Class Plus

            //    //if (Session.CreateCustomClass)
            //    //{
            //    //    template = ManageTemplate.GetTemplate("CrudTemplatePlusSqlBase.ico");

            //    //    template = template.Replace("#Version#", Session.Version);
            //    //    template = template.Replace("#Date#", System.DateTime.Now.ToString("dd/MM/yyyy"));
            //    //    template = template.Replace("***NameSpace***", Session.Namespace);
            //    //    template = template.Replace("***ClassName***", tableName);
            //    //    template = template.Replace("***Collection***", Session.GetCollectionFunction);
            //    //    template = template.Replace("***Insert***", string.Format(Session.InsertFunction, tableName));
            //    //    template = template.Replace("#InsertKey#", "InsertKey");
            //    //    template = template.Replace("***Update***", string.Format(Session.UpdateFunction, tableName));
            //    //    template = template.Replace("***Delete***", string.Format(Session.DeleteFunction, tableName));
            //    //    template = template.Replace("***Read***", string.Format(Session.ReadFunction, tableName));
            //    //    template = template.Replace("***GetCollection***", string.Format(Session.GetCollectionFunction, tableName));
            //    //    template = template.Replace("#GetCollectionByKeys#", "GetCollectionByKeys");
            //    //    template = template.Replace("***GetByCode***", string.Format(Session.GetByCodeFunction, tableName));
            //    //    template = template.Replace("***IsUnknown***", Session.IsUnknown);
            //    //    template = template.Replace("***DeclarationParameterKeys***", declarationParametersKeys);
            //    //    template = template.Replace("***DeclarationParameterKeysWithOutType***", parametersKeysWithOutType);

            //    //    if (!ManageTemplate.WriteTemplate(Session.Folder, template, tableName, null)) return false;
            //    //}

            //    //template = ManageTemplate.GetTemplate("Interface.ico");

            //    //template = template.Replace("#Version#", Session.Version);
            //    //template = template.Replace("#Date#", System.DateTime.Now.ToString("dd/MM/yyyy"));
            //    //template = template.Replace("***NameSpace***", Session.Namespace);
            //    //template = template.Replace("***ClassName***", tableName);

            //    //if (ManageTemplate.WriteTemplate(Session.Folder, template, string.Concat("I", tableName), null)) return true;
            //    //else return false;

            //    #endregion

            //    return false;
            //}
            return(true);
        }
예제 #7
0
        public bool BuildControlsPage(string nameSpace, ArrayList tables, string pathfile, SqlConnection connection)
        {
            bool result = false;

            foreach (DataTable dt in tables)
            {
                string getData = string.Empty;
                string setData = string.Empty;
                string templatePopulateList = string.Empty;

                string tableName = dt.Rows[0]["Table"].ToString().Trim();

                if (getData.Equals(string.Empty))
                {
                    if (Session.Modality == Modality.Professional)
                    {
                        if (getData.Equals(string.Empty))
                        {
                            getData = string.Concat("\t\titem = Manager", tableName, ".GetByKeyuni(Key);\n");
                        }
                    }
                    if (Session.Modality == Modality.Easy)
                    {
                        //if (getData.Equals(string.Empty)) getData = "\t\titem = item.GetByKeyuni(Key);\n";
                    }
                }

                string template = "<table>";

                foreach (DataRow dr in dt.Rows)
                {
                    if ((!dr["Name"].Equals(Session.TableKey) && (!dr["Name"].Equals("Keyuni")) && (!dr["Name"].Equals("Timespan"))))
                    {
                        string templateControl = string.Empty;
                        string tableLink       = string.Empty;

                        #region GerValue

                        string name     = dr["Name"].ToString();
                        string type     = dr["Type"].ToString();
                        string dbType   = dr["DbType"].ToString();
                        int    length   = (int)dr["Length"];
                        bool   nullable = (bool)dr["Nullable"];

                        bool   isSearch        = false;
                        int    searchPosition  = 0;
                        bool   isDetail        = false;
                        int    detailPosition  = 0;
                        string descriptionName = string.Empty;

                        GetDatatableSqlServer.GetPlusInformation(tableName, name, ref descriptionName, ref isSearch, ref searchPosition, ref isDetail, ref detailPosition);

                        if (descriptionName.Equals(string.Empty))
                        {
                            descriptionName = name;
                        }

                        #endregion

                        switch (type)
                        {
                        case "decimal":
                        case "int":
                            if (type.Equals("int"))
                            {
                                tableLink = GetInfoFieldSqlServer.IsForeignKeySimple(tableName, name);
                            }
                            if (!tableLink.Equals(string.Empty))
                            {
                                templateControl = GetLabel(templateControl, name, descriptionName);
                                templateControl = string.Concat(templateControl, ManageTemplate.GetTemplate("WebTemplate//dropdownlist.ico"));
                                templateControl = templateControl.Replace("***Name***", name);
                                getData         = string.Concat(getData, WriteGetDataControl(name, type, WebControl.DropDownList));
                                setData         = string.Concat(setData, WriteSetDataControl(name, type, WebControl.DropDownList, nullable));
                                string nameTable    = name.Replace("Code", string.Empty);
                                string populateList = ManageTemplate.GetTemplate("WebTemplate//populateList.ico");
                                populateList         = populateList.Replace("***Name***", nameTable);
                                templatePopulateList = string.Concat(templatePopulateList, populateList);
                                break;
                            }
                            else
                            {
                                templateControl = GetLabel(templateControl, name, descriptionName);
                                templateControl = string.Concat(templateControl, ManageTemplate.GetTemplate("WebTemplate//textbox.ico"));
                                templateControl = templateControl.Replace("***Name***", name);
                                templateControl = templateControl.Replace("#Length#", length.ToString());
                                templateControl = templateControl.Replace("#SkinId#", GetSkinByLength(length));
                                getData         = string.Concat(getData, WriteGetDataControl(name, type, WebControl.TextBox));
                                setData         = string.Concat(setData, WriteSetDataControl(name, type, WebControl.TextBox, nullable));
                            }
                            break;

                        case "string":
                            templateControl = GetLabel(templateControl, name, descriptionName);
                            templateControl = string.Concat(templateControl, ManageTemplate.GetTemplate("WebTemplate//textbox.ico"));
                            templateControl = templateControl.Replace("***Name***", name);
                            templateControl = templateControl.Replace("#Length#", length.ToString());
                            templateControl = templateControl.Replace("#SkinId#", GetSkinByLength(length));
                            getData         = string.Concat(getData, WriteGetDataControl(name, type, WebControl.TextBox));
                            setData         = string.Concat(setData, WriteSetDataControl(name, type, WebControl.TextBox, nullable));
                            break;

                        case "System.DateTime":
                            templateControl = GetLabel(templateControl, name, descriptionName);
                            templateControl = string.Concat(templateControl, ManageTemplate.GetTemplate("WebTemplate//calendar.ico"));
                            templateControl = templateControl.Replace("***Name***", name);
                            templateControl = templateControl.Replace("#SkinId#", GetSkinByLength(length));
                            getData         = string.Concat(getData, WriteGetDataControl(name, type, WebControl.Calendar));
                            setData         = string.Concat(setData, WriteSetDataControl(name, type, WebControl.Calendar, nullable));
                            break;
                        }

                        if ((!nullable))
                        {
                            string templateRequiredFieldValidator = string.Empty;
                            templateRequiredFieldValidator = string.Concat(ManageTemplate.GetTemplate("WebTemplate//requiredFieldValidator.ico"));
                            templateRequiredFieldValidator = templateRequiredFieldValidator.Replace("***Name***", name);
                            templateControl = string.Concat(templateControl, "&nbsp;", templateRequiredFieldValidator);
                        }

                        if (!templateControl.Equals(string.Empty))
                        {
                            templateControl = CloseRow(templateControl);
                        }

                        template = string.Concat(template, templateControl);
                    }
                }
                template = string.Concat(template, "</table>");

                if (ManageTemplate.WriteTemplate(string.Concat(pathfile, "WebControls//"), template, tableName, ".aspx"))
                {
                    result = true;
                }
                else
                {
                    result = false;
                }

                #region GerData


                string templateGetData = string.Concat(ManageTemplate.GetTemplate("WebTemplate//getData.ico"));
                templateGetData = templateGetData.Replace("***Body***", getData);

                string templateSetData = string.Concat(ManageTemplate.GetTemplate("WebTemplate//setData.ico"));
                templateSetData = templateSetData.Replace("***Body***", setData);

                string finallyTemplate = string.Concat(templateGetData, "\n\n", templateSetData);



                bool pageEasy = true;
                if (pageEasy)
                {
                    string templateHtml = string.Concat(ManageTemplate.GetTemplate("WebForm//pageListDetail.aspx"));
                    templateHtml = templateHtml.Replace("***Name***", tableName);
                    templateHtml = templateHtml.Replace("#WebControls#", template);

                    if (ManageTemplate.WriteTemplate(string.Concat(pathfile, "WebControls//Page//"), templateHtml, tableName, "ListDetail.aspx"))
                    {
                        result = true;
                    }

                    string templateCode = string.Concat(ManageTemplate.GetTemplate("WebForm//pageListDetail.aspx.ico"));
                    templateCode = templateCode.Replace("***Name***", tableName);
                    templateCode = templateCode.Replace("#GetData#", getData);
                    templateCode = templateCode.Replace("#SetData#", setData);
                    templateCode = templateCode.Replace("#PopulateList#", templatePopulateList);

                    if (ManageTemplate.WriteTemplate(string.Concat(pathfile, "WebControls//Page//"), templateCode, tableName, "ListDetail.aspx.ico"))
                    {
                        result = true;
                    }
                }
                else
                {
                    string templateHtml = string.Concat(ManageTemplate.GetTemplate("WebForm//pageDetail.aspx"));
                    templateHtml = templateHtml.Replace("***Name***", tableName);
                    templateHtml = templateHtml.Replace("#WebControls#", template);

                    if (ManageTemplate.WriteTemplate(string.Concat(pathfile, "WebControls//Page//"), templateHtml, tableName, "Detail.aspx"))
                    {
                        result = true;
                    }

                    string templateCode = string.Concat(ManageTemplate.GetTemplate("WebForm//pageDetail.aspx.ico"));
                    templateCode = templateCode.Replace("***Name***", tableName);
                    templateCode = templateCode.Replace("#GetData#", getData);
                    templateCode = templateCode.Replace("#SetData#", setData);
                    templateCode = templateCode.Replace("#PopulateList#", templatePopulateList);

                    if (ManageTemplate.WriteTemplate(string.Concat(pathfile, "WebControls//Page//"), templateCode, tableName, "Detail.aspx.ico"))
                    {
                        result = true;
                    }
                }

                #endregion
            }
            return(true);
        }