/// <summary>
 /// Altera dados na base de dados
 /// </summary>
 /// <param name="surveyssoa"></param>
 public void Editar(SurveyModel survey)
 {
     tb_survey surveyE = new tb_survey();
     Atribuir(survey, surveyE);
     unitOfWork.RepositorioSurvey.Editar(surveyE);
     unitOfWork.Commit(shared);
 }
 /// <summary>
 /// Insere um novo na base de dados
 /// </summary>
 /// <param name="surveyssoa">Dados do modelo</param>
 /// <returns>Chave identificante na base</returns>
 public int Inserir(SurveyModel survey)
 {
     tb_survey surveyE = new tb_survey();
     Atribuir(survey, surveyE);
     unitOfWork.RepositorioSurvey.Inserir(surveyE);
     unitOfWork.Commit(shared);
     return surveyE.id_Survey;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the tb_survey EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotb_survey(tb_survey tb_survey)
 {
     base.AddObject("tb_survey", tb_survey);
 }
 /// <summary>
 /// Create a new tb_survey object.
 /// </summary>
 /// <param name="id_Survey">Initial value of the id_Survey property.</param>
 /// <param name="tB_RESPONSAVEL_id_Responsavel">Initial value of the TB_RESPONSAVEL_id_Responsavel property.</param>
 /// <param name="titulo">Initial value of the Titulo property.</param>
 /// <param name="subtitulo">Initial value of the Subtitulo property.</param>
 /// <param name="data_Criacao">Initial value of the Data_Criacao property.</param>
 /// <param name="flag_ativo">Initial value of the flag_ativo property.</param>
 /// <param name="unicaResposta">Initial value of the UnicaResposta property.</param>
 /// <param name="randomizeQuestoes">Initial value of the RandomizeQuestoes property.</param>
 public static tb_survey Createtb_survey(global::System.Int32 id_Survey, global::System.Int32 tB_RESPONSAVEL_id_Responsavel, global::System.String titulo, global::System.String subtitulo, global::System.DateTime data_Criacao, global::System.Boolean flag_ativo, global::System.Boolean unicaResposta, global::System.Boolean randomizeQuestoes)
 {
     tb_survey tb_survey = new tb_survey();
     tb_survey.id_Survey = id_Survey;
     tb_survey.TB_RESPONSAVEL_id_Responsavel = tB_RESPONSAVEL_id_Responsavel;
     tb_survey.Titulo = titulo;
     tb_survey.Subtitulo = subtitulo;
     tb_survey.Data_Criacao = data_Criacao;
     tb_survey.flag_ativo = flag_ativo;
     tb_survey.UnicaResposta = unicaResposta;
     tb_survey.RandomizeQuestoes = randomizeQuestoes;
     return tb_survey;
 }
 /// <summary>
 /// Atribui dados do Survey Model para o Survey Entity
 /// </summary>
 /// <param name="surveyssoa">Objeto do modelo</param>
 /// <param name="survey">Entity survey da base de dados</param>
 private void Atribuir(SurveyModel survey, tb_survey surveyE)
 {
     surveyE.id_Survey = survey.id_Survey;
     surveyE.TB_RESPONSAVEL_id_Responsavel = survey.id_Responsavel;
     surveyE.Data_Criacao = survey.Data_Criacao;
     surveyE.Data_fim = survey.Data_fim;
     surveyE.Titulo = survey.Titulo;
     surveyE.Subtitulo = survey.Subtitulo;
     surveyE.flag_ativo = survey.flag_ativo;
     surveyE.RandomizeQuestoes = survey.RandomizeQuetsoes;
     surveyE.UnicaResposta = survey.UnicaResposta;
     surveyE.SenhaAcesso = survey.SenhaAcesso;
 }