Beispiel #1
0
        private string insertSql(string principalTable, List <AttributManager> attibutMan)
        {
            string          request = "INSERT INTO `" + principalTable + "`(";
            AttributManager last    = attibutMan.Last();

            foreach (AttributManager result in attibutMan)
            {
                if (!result.getIsPrimary())
                {
                    if (!result.Equals(last))
                    {
                        request += " `" + result.getNameInDb() + "`,";
                    }
                    else
                    {
                        request += " `" + result.getNameInDb() + "`)";
                    }
                }
            }

            request += " VALUES (";

            foreach (AttributManager result in this.attributsDb)
            {
                if (!result.getIsPrimary())
                {
                    if (!result.Equals(last))
                    {
                        request += " ' . $" + this.name + "->get" + result.getName() + "() . ',";
                    }
                    else
                    {
                        request += " ' . $" + this.name + "->get" + result.getName() + "() . ')";
                    }
                }
            }

            return(request);
        }
Beispiel #2
0
 /**
  * Add attribut to the classUpdater
  * param
  * Attribut @att
  *
  * return void
  */
 public void addAttributDb(AttributManager att)
 {
     this.attributsDb.Add(att);
 }