public Codular(string basepath, string v1, string v2, string v3 = "long", string v4 = "", string _formats = "", string v5 = "") { code = new StringBuilder(); this.basepath = basepath; this.v1 = v1; this.v2 = v2; this.v3 = v3; this.v4 = v4; this.v5 = v5; this.formats = _formats; fields = Stringer.Transform(v4); }
internal void SetArgs(string[] args) { classname = args[0]; classnameplural = args[1]; idtype = args[2]; fieldstext = args[3]; module = args[4]; mycase = args[5]; genfile = args[6]; workspace = args[7]; fields = Stringer.Transform(fieldstext); }
private void Paint(string txt, string title = "") { txt = txt.Replace("%H%", classname); txt = txt.Replace("%N%", classnameplural); txt = txt.Replace("%T%", idtype); txt = txt.Replace("%Z%", module); txt = txt.Replace("%z%", module.ToLower()); txt = txt.Replace("%h%", classname.ToLower()); txt = txt.Replace("%n%", classnameplural.ToLower()); txt = txt.Replace("%Y%", workspace); txt = txt.Replace("%Z1%", workspace); txt = txt.Replace("%P%", Stringer.Params(fields)); txt = txt.Replace("%V%", Stringer.Variables(fields)); txt = txt.Replace("%W%", Stringer.Variables(fields, "x")); txt = txt.Replace("%QJ%", Stringer.QueryJoins(fields)); txt = txt.Replace("%WT1%", Stringer.TableParams(fields, idtype, "SQLSERVER")); txt = txt.Replace("%WT2%", Stringer.TableParams(fields, idtype, "MYSQL")); txt = txt.Replace("%WT3%", Stringer.TableParams(fields, idtype, "POSTGRES")); txt = txt.Replace("%U%", Stringer.UpperVariables(fields)); txt = txt.Replace("%M%", Stringer.ModelVariables(fields)); txt = txt.Replace("%Q%", Stringer.QueryString(fields)); txt = txt.Replace("%F%", Stringer.Queryable(fields)); txt = txt.Replace("%F1%", Stringer.QueryableView(fields)); txt = txt.Replace("%FG%", Stringer.FactorMapper(fields)); txt = txt.Replace("%DV%", Stringer.DetailView(fields, formats)); txt = txt.Replace("%C%", Stringer.Properties(fields)); txt = txt.Replace("%C2%", Stringer.Properties(fields, 2)); txt = txt.Replace("%JM%", Stringer.JSModel(fields)); txt = txt.Replace("%TC%", Stringer.TableColumns(fields)); txt = txt.Replace("%J%", Stringer.JObjectHelper(fields)); txt = txt.Replace("%B%", Stringer.ViewBag(fields)); txt = txt.Replace("%D%", Stringer.Document(fields)); txt = txt.Replace("%G%", Stringer.Paginator(fields)); txt = txt.Replace("%TR%", Stringer.TableHeader(fields)); txt = txt.Replace("%TD%", Stringer.TableRow(fields)); txt = txt.Replace("%MM1%", Stringer.MigrationMapper(fields)); txt = txt.Replace("%MM2%", Stringer.MigrationMapper(fields, 2)); txt = txt.Replace("%SR%", Stringer.SearchFields(fields, formats)); txt = txt.Replace("%S%", Stringer.SaveFields(fields, formats)); txt = txt.Replace("'", "\""); txt = txt.Replace("`", "'"); code.AppendLine(title); code.AppendLine(txt); code.AppendLine(""); code.AppendLine("-------------------------------------------------"); code.AppendLine(""); }
private void Paint(string txt, string title = "") { txt = txt.Replace("%H%", v1); txt = txt.Replace("%N%", v2); txt = txt.Replace("%T%", v3); txt = txt.Replace("%Z%", v5); txt = txt.Replace("%z%", v5.ToLower()); txt = txt.Replace("%h%", v1.ToLower()); txt = txt.Replace("%n%", v2.ToLower()); txt = txt.Replace("%P%", Stringer.Params(fields)); txt = txt.Replace("%V%", Stringer.Variables(fields)); txt = txt.Replace("%W%", Stringer.Variables(fields, "x")); txt = txt.Replace("%WT1%", Stringer.TableParams(fields, v3, "SQLSERVER")); txt = txt.Replace("%WT2%", Stringer.TableParams(fields, v3, "MYSQL")); txt = txt.Replace("%WT3%", Stringer.TableParams(fields, v3, "POSTGRES")); txt = txt.Replace("%U%", Stringer.UpperVariables(fields)); txt = txt.Replace("%M%", Stringer.ModelVariables(fields)); txt = txt.Replace("%Q%", Stringer.QueryString(fields)); txt = txt.Replace("%F%", Stringer.Queryable(fields)); txt = txt.Replace("%F1%", Stringer.QueryableView(fields)); txt = txt.Replace("%FG%", Stringer.FactorMapper(fields)); txt = txt.Replace("%DV%", Stringer.DetailView(fields, formats)); txt = txt.Replace("%C%", Stringer.Properties(fields)); txt = txt.Replace("%JM%", Stringer.JSModel(fields)); txt = txt.Replace("%TC%", Stringer.TableColumns(fields)); txt = txt.Replace("%J%", Stringer.JObjectHelper(fields)); txt = txt.Replace("%B%", Stringer.ViewBag(fields)); txt = txt.Replace("%D%", Stringer.Document(fields)); txt = txt.Replace("%G%", Stringer.Paginator(fields)); txt = txt.Replace("%TR%", Stringer.TableHeader(fields)); txt = txt.Replace("%TD%", Stringer.TableRow(fields)); txt = txt.Replace("%SR%", Stringer.SearchFields(fields, formats)); txt = txt.Replace("%S%", Stringer.SaveFields(fields, formats)); txt = txt.Replace("'", "\""); txt = txt.Replace("`", "'"); code.AppendLine(title); code.AppendLine(txt); code.AppendLine(""); code.AppendLine("-------------------------------------------------"); code.AppendLine(""); }