public static Templates GetOne(int IdTemplate)
 {
     SqlCommand cb = new SqlCommand("GetTemplates");
     DataAccess db = new DataAccess();
     cb.Parameters.AddWithValue("@IdTemplate", IdTemplate);
     return DbSet<Templates>.RowToT(db.GetTable(cb).Rows[0]);
 }
 public static List<EntityFields> GetAll(int Id)
 {
     DataAccess db = new DataAccess();
     SqlCommand cb = new SqlCommand("GetAllEntityFields");
     cb.Parameters.AddWithValue("@Id", Id);
     return GenericCodeFirst.DbSet<EntityFields>.TableToListT(db.GetTable(cb));
 }
 public static void Delete(int IdTemplate)
 {
     SqlCommand cb = new SqlCommand("RemoveTemplates");
     DataAccess db = new DataAccess();
     cb.Parameters.AddWithValue("@IdTemplate", IdTemplate);
     db.EjecutarSp(cb);
 }
 public static DataType GetOne(int Id)
 {
     SqlCommand cb = new SqlCommand("GetDataType");
     DataAccess db = new DataAccess();
     cb.Parameters.AddWithValue("@Id", Id);
     return DbSet<DataType>.RowToT(db.GetTable(cb).Rows[0]);
 }
 public static EntityFields GetOne(int Id)
 {
     SqlCommand cb = new SqlCommand("GetEntityFields");
     DataAccess db = new DataAccess();
     cb.Parameters.AddWithValue("@Id", Id);
     return GenericCodeFirst.DbSet<EntityFields>.RowToT(db.GetTable(cb).Rows[0]);
 }
示例#6
0
        public static Entity GetOneByName(string name)
        {
            SqlCommand cb = new SqlCommand("GetEntityByName");
            DataAccess db = new DataAccess();
            cb.Parameters.AddWithValue("@name", name);

            return GenericCodeFirst.DbSet<Entity>.RowToT(db.GetTable(cb).Rows[0]);
        }
 public void Update()
 {
     SqlCommand cb = new SqlCommand("UpdateTemplates");
     DataAccess db = new DataAccess();
     cb.Parameters.AddWithValue("@IdTemplate", IdTemplate);
     cb.Parameters.AddWithValue("@Nombre", Nombre);
     cb.Parameters.AddWithValue("@Contenido", Contenido);
     db.EjecutarSp(cb);
 }
 public void Insert()
 {
     SqlCommand cb = new SqlCommand("AddDataType");
     DataAccess db = new DataAccess();
     cb.Parameters.AddWithValue("@CSharpType", CSharpType);
     cb.Parameters.AddWithValue("@SqlType", SqlType);
     cb.Parameters.AddWithValue("@IdTipo", IdTipo);
     db.EjecutarSp(cb);
 }
示例#9
0
 public void Insert()
 {
     SqlCommand cb = new SqlCommand("AddEntity");
     DataAccess db = new DataAccess();
     cb.Parameters.AddWithValue("@Name", Name);
     cb.Parameters.AddWithValue("@Version", Version);
     cb.Parameters.AddWithValue("@Modification", Modification);
     db.EjecutarSp(cb);
 }
 public void Insert()
 {
     SqlCommand cb = new SqlCommand("AddEntityFields");
     DataAccess db = new DataAccess();
     cb.Parameters.AddWithValue("@EntityId", EntityId);
     cb.Parameters.AddWithValue("@Name", Name);
     cb.Parameters.AddWithValue("@DataType", DataType);
     cb.Parameters.AddWithValue("@Length", Length);
     db.EjecutarSp(cb);
 }
示例#11
0
 public void Insert()
 {
     SqlCommand cb = new SqlCommand("AddTemplates");
     DataAccess db = new DataAccess();
     cb.Parameters.AddWithValue("@Nombre", Nombre);
     cb.Parameters.AddWithValue("@Contenido", Contenido);
     SqlParameter p = new SqlParameter("@NewId", System.Data.SqlDbType.Int);
     p.Direction = System.Data.ParameterDirection.Output;
     cb.Parameters.Add(p);
     db.EjecutarSp(cb);
     this.IdTemplate = (int)p.Value;
 }
示例#12
0
        public static bool Exist(string name)
        {
            SqlCommand cb = new SqlCommand("GetEntityByName");
            DataAccess db = new DataAccess();
            cb.Parameters.AddWithValue("@name", name);

            if (db.GetTable(cb).Rows.Count >= 1)
                return true;
            else
                return false;

        }
示例#13
0
 public static List<Templates> GetAll()
 {
     DataAccess db = new DataAccess();
     SqlCommand cb = new SqlCommand("GetAllTemplates");
     return DbSet<Templates>.TableToListT(db.GetTable(cb));
 }
示例#14
0
 public static List<DataType> GetAll()
 {
     DataAccess db = new DataAccess();
     SqlCommand cb = new SqlCommand("GetAllDataType");
     return DbSet<DataType>.TableToListT(db.GetTable(cb));
 }
示例#15
0
 public static List<Entity> GetAll()
 {
     DataAccess db = new DataAccess();
     SqlCommand cb = new SqlCommand("GetAllEntity");
     return GenericCodeFirst.DbSet<Entity>.TableToListT(db.GetTable(cb));
 }