Esempio n. 1
0
 private void AddTableDesc(CTableM table, string desc)
 {
     if (table == null)
     {
         throw new ArgumentNullException("La tabla a describir no puede ser nula");
     }
     table.Desc = desc;
 }
Esempio n. 2
0
        public CTableM AddTable(string Name, string singularTitle = null, string pluralTitle = null, EGender gender = EGender.male)
        {
            CTableM result = new CTableM(Name, singularTitle, pluralTitle, gender);

            this.ActualTable = result;
            this.lTable.Add(result);
            return(result);
        }
Esempio n. 3
0
        private void AddUniqueConstraint(CTableM table, string[] fieldNames)
        {
            List <CFieldM> lFields = new List <CFieldM>();

            foreach (string name in fieldNames)
            {
                lFields.Add(table.FindField(name));
            }
            AddUniqueConstraint(table, lFields);
        }
Esempio n. 4
0
 private void ColocaTablaEnOrden(List <CTableM> listaOriginal, CTableM cTableM, List <CTableM> listaOrdenada)
 {
     listaOriginal.Remove(cTableM);
     foreach (CRelationM relacion in cTableM.lRelation)
     {
         string  NombreTablaConLaQueSeRelaciona = relacion.tableDestination;
         CTableM tablaRelacionada = listaOriginal.Find(x => x.Name.Equals(NombreTablaConLaQueSeRelaciona));
         if (tablaRelacionada != null)                  //Si la tabla relacionada aún está en la lista de tablas a ordenar
         //Meter antes en la lista de ordenadas
         {
             ColocaTablaEnOrden(listaOriginal, tablaRelacionada, listaOrdenada);
         }
     }
     listaOrdenada.Add(cTableM);
 }
Esempio n. 5
0
 public CFieldM(CTableM table, string name, string title, SqlDbType td, int lenght, bool isPrimaryKey, bool isNullable, bool isIdentity, int defaultWidth = 100, bool showInGrid = true)
 {
     if ((td == SqlDbType.VarChar) && (lenght == 0))
     {
         throw new Exception($"Error: No se puede tener un campo de tipo VarChar con longitud 0. Tabla {table.Name} campo {name}");
     }
     this.Table        = table;
     this.Name         = name;
     this.Title        = title;
     this._td          = td;
     this.Lenght       = lenght;
     this.IsNullable   = isNullable;
     this.IsIdentity   = isIdentity;
     this.DefaultWidth = defaultWidth;
     this.ShowInGrid   = showInGrid;
 }
Esempio n. 6
0
 public CUniqueConstraintM(CTableM table, List <CFieldM> lFields)
 {
     this.Table   = table;
     this.LFields = lFields;
 }
Esempio n. 7
0
 private void AddUniqueConstraint(CTableM table, List <CFieldM> lFields)
 {
     CUniqueConstraintM u = new CUniqueConstraintM(table, lFields);
 }