Esempio n. 1
0
 public void Excluir()
 {
     if (IdFunc > 0)
     {
         Controle.ExecutaSQL("DELETE FROM Funcionarios WHERE Id_Func=" + IdFunc.ToString().Trim());
     }
 }
Esempio n. 2
0
 public void GravaDemissao()
 {
     if (Demissao == 1)
     {
         Controle.ExecutaSQL("Update Funcionarios set Demissao=1,DtDemissao=Convert(DateTime,'" + DtDemissao.ToShortDateString() + "',103),MotivoDemissao='" + MotivoDemissao.Trim() + "' WHERE ID_FUNC=" + IdFunc.ToString());
     }
     else
     {
         Controle.ExecutaSQL("Update Funcionarios set Demissao=0,DtDemissao=Null,MotivoDemissao='' WHERE ID_FUNC=" + IdFunc.ToString());
     }
 }
Esempio n. 3
0
        private Stmt Module()
        {
            //Static Function & Class Only
            bool isStatic = false;

            while (Except(Tag.STATIC))
            {
                if (ExceptGrammar(Tag.FUNCTION))
                {
                    Word     n    = look as Word;
                    Function func = new Function(n.Line);
                    Stmt.LastFunction = func;
                    ExceptGrammar(Tag.IDENTITY);
                    NextScopeName = n.lexeme;

                    SymbolTable parent = top;
                    SymbolTable fc     = new SymbolTable(top, NextScopeName);

                    //point TOP scope to func scope
                    top = fc;
                    //add param define
                    Params p = Params();

                    //set new identity to func
                    Id i = new IdFunc(func, n, parent, ReserveType.Function, used, isStatic);
                    //add to parent scope
                    parent.Add(n.lexeme, i);

                    // initial func first for call-self
                    func.Init(p, null, i);

                    //parser code-blocks
                    Stmt b = Block(false);

                    //add func-addr width
                    used += ReserveType.Function.Width;

                    //full initial func
                    func.Init(p, b, i);

                    //restore scope
                    top = parent;

                    Stmt.LastFunction = Stmt.Null;
                    return(new Seq(func, new EndScope(look.Line, fc)));
                }
                else
                {
                    isStatic = true;
                }
            }

            if (Except(Tag.CLASS))
            {
                return(null);
            }

            if (isStatic)
            {
                ExceptGrammar(Tag.CLASS, Tag.FUNCTION);
            }
            return(null);
        }