Ejemplo n.º 1
0
        public void Excluir(Relator relator)
        {
            var strQuery = string.Format("DELETE FROM tblrelator WHERE idrelator={0}", relator.RelatorId);

            using (cnx = new ConexaoBD())
                cnx.CommNom(strQuery);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,NombreCompleto,Edad,AnosExperiencia,NumeroTelefono,Especialidad,CursoId")] Relator relator)
        {
            if (id != relator.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(relator);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RelatorExists(relator.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CursoId"] = new SelectList(_context.Cursos, "Id", "Nombre", relator.CursoId);
            return(View(relator));
        }
Ejemplo n.º 3
0
 public void Salvar(Relator relator)
 {
     if (relator.RelatorId > 0)
     {
         Alterar(relator);
     }
     else
     {
         Inserir(relator);
     }
 }
 public SearchItem_Between_Dto(Relator.Unary unary, Track.Property property, string phrase1, string phrase2)
     : base(unary, property, phrase1, phrase2)
 {
     Check.Require(
         property == Track.Property.Bpm || property == Track.Property.Year || property == Track.Property.Laenge, String.Format(
         "Argument must be of type {0}, {1}, {2}. It's of type {3}",
         Track.Property.Bpm.ToString(),
         Track.Property.Laenge.ToString(),
         Track.Property.Year.ToString(),
         property.ToString()));
 }
Ejemplo n.º 5
0
 public ASimpleRelation(Relator.Unary relator, params string[] propertyQueue)
     : base(relator)
 {
     Check.Require(propertyQueue != null, "Null argument.");
     /*
      * Kein Mensch wird diese Einschraenkung verstehen...
      */
     Check.Require(propertyQueue.Length > 1, "Collection lenght.");
     this.propertyQueue = propertyQueue;
     this.relata.Add(this);
 }
Ejemplo n.º 6
0
        private void Alterar(Relator relator)
        {
            var strQuery = "";

            strQuery += "UPDATE tblrelator SET ";
            strQuery += string.Format("nome='{0}', matricula='{1}', nomeguerra='{2}', consaud='{3}', lotacao='{4}', status={3} ",
                                      relator.Nome, relator.Matricula, relator.NomeGuerra, relator.ConsAud, relator.Lotacao, relator.Status.ToString());
            strQuery += "WHERE idrelator=" + relator.RelatorId.ToString();

            using (cnx = new ConexaoBD())
                cnx.CommNom(strQuery);
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Create([Bind("Id,NombreCompleto,Edad,AnosExperiencia,NumeroTelefono,Especialidad,CursoId")] Relator relator)
        {
            if (ModelState.IsValid)
            {
                _context.Add(relator);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CursoId"] = new SelectList(_context.Cursos, "Id", "Nombre", relator.CursoId);
            return(View(relator));
        }
Ejemplo n.º 8
0
        /// @todo Naming.
        public static ComplexRelation combine(Relator.Binary binaryRelator, ASimpleRelation s1, ASimpleRelation s2)
        {
            Check.Require(s1 != null && s2 != null, "No null arguments!");

            ComplexRelation s1_s2;

            if(binaryRelator == Relator.Binary.AND)
                s1_s2 = new ComplexRelation();
            else
                s1_s2 = new ComplexRelation(Relator.Binary.OR);

            s1_s2.addRelata(s1, s2);

            return s1_s2;
        }
Ejemplo n.º 9
0
        private void Inserir(Relator relator)
        {
            var strQuery = "";
            int id;
            var lid = new List <Relator>();

            lid       = ListAll();
            id        = lid[lid.Count - 1].RelatorId + 1;
            strQuery += "INSERT INTO tblrelator(idrelator, nome, matricula, nomeguerra, consaud, lotacao, status) ";
            strQuery += string.Format("VALUES ({0}, '{1}', '{2}', '{3}', '{4}', '{5}', {6})", id,
                                      relator.Nome, relator.Matricula, relator.NomeGuerra, relator.ConsAud, relator.Lotacao,
                                      relator.Status.ToString());

            using (cnx = new ConexaoBD())
                cnx.CommNom(strQuery);
        }
Ejemplo n.º 10
0
        public static ASimpleRelation getSimpleRelation(Relator.Unary unaryProperty, string searchPhrase, Track.Property trackProperty )
        {
            string mappedTrackPropertyPropertyAsString = Track.getChildPropertyAsString(trackProperty);

            if( trackProperty == Track.Property.Bpm || trackProperty == Track.Property.Year)
                return new IntSearch(
                    unaryProperty,
                    int.Parse(searchPhrase),
                    trackProperty.ToString(),
                    mappedTrackPropertyPropertyAsString );
            else
                return new StringSearch(
                    unaryProperty,
                    searchPhrase,
                    trackProperty.ToString(),
                    mappedTrackPropertyPropertyAsString );
        }
Ejemplo n.º 11
0
 private Relator One(DataTable dt, int pos)
 {
     if (dt.Rows.Count > 0)
     {
         var registro = new Relator()
         {
             RelatorId  = int.Parse(dt.Rows[pos]["idrelator"].ToString()),
             Nome       = dt.Rows[pos]["nome"].ToString(),
             Matricula  = dt.Rows[pos]["matricula"].ToString(),
             NomeGuerra = dt.Rows[pos]["nomeguerra"].ToString(),
             ConsAud    = dt.Rows[pos]["consaud"].ToString(),
             Lotacao    = dt.Rows[pos]["lotacao"].ToString(),
             Status     = int.Parse(dt.Rows[pos]["status"].ToString())
         };
         return(registro);
     }
     else
     {
         return(new Relator());
     }
 }
Ejemplo n.º 12
0
 public ARelation( Relator.Binary relator ) : this() {
     this.binaryRelator = relator;
 }
Ejemplo n.º 13
0
 public ARelation( Relator.Unary relator ) : this() {
     this.unaryRelator = relator;
 }
Ejemplo n.º 14
0
 public SearchItem_Like_Dto(Relator.Unary unary, Track.Property property, string searchPhrase)
     : base(unary, property, searchPhrase)
 {
 }
Ejemplo n.º 15
0
 public void setRelator(Relator relator)
 {
     this.relator = relator;
 }
Ejemplo n.º 16
0
 public ComplexRelation( Relator.Binary relator, params ARelation[] relata )
     : base(relator)
 {
     this.addRelata( relata );
 }
Ejemplo n.º 17
0
 public void Add(Class element)
 {
     Elements.Add(element.ClassName, element);
     Relator.Add(element.ClassName, RelatorId++);
 }
Ejemplo n.º 18
0
 public void setRelator(Relator relator)
 {
     this.relator = relator;
 }
Ejemplo n.º 19
0
 public static ASimpleRelation getSimpleRelation(Relator.Unary unaryProperty, Ending.Attribute attribute )
 {
     return new EndingAttributeSearch( unaryProperty, attribute, "dummy1", "dummy2");
 }
Ejemplo n.º 20
0
 public ASearchItemDto(Relator.Unary unary, Track.Property property, params string[] searchPhrase)
 {
     this.unaryRelator = unary;
     this.trackProperty = property;
     this.searchPhrase = searchPhrase;
 }
Ejemplo n.º 21
0
 public ComplexRelation( Relator.Binary relator )
     : base(relator)
 {
 }