Controller.ControllerServico.Carregar C# (CSharp) Method

Carregar() public static method

Carregando as informações de um trabalhos
public static Carregar ( int NumeroOs ) : Servico
NumeroOs int Numero os.
return Model.Ordem_de_Servico.Servico
        public static Servico Carregar(int NumeroOs)
        {
            DataTable tabela = new DataTable("Trabalhos");
            Spartacus.Database.Generic database;
            Spartacus.Database.Command cmd = new Spartacus.Database.Command();

            cmd.v_text = "Select * from Trabalhos where OrdemDeServico = #idOS#";
            cmd.AddParameter("idOS", Spartacus.Database.Type.INTEGER);
            cmd.SetValue("idOS", NumeroOs.ToString());

            try
            {
                database = new Spartacus.Database.Sqlite(DB.GetStrConection());

                tabela = database.Query(cmd.GetUpdatedText(), "Trabalhos");
            }
            catch (Spartacus.Database.Exception ex)
            {
                ControllerArquivoLog.GeraraLog(ex);
            }

            return PreencherTrabalho(tabela);
        }