Ejemplo n.º 1
0
 public int AtualizaUsuarioDemanda(Demandas x)
 {
     if(x.DataFinalizada == null)
         return dbUsuarioDemanda.AtualizaDemandaStatus(DateTime.Parse(x.DataInicio), null, x.StatusDemanda, x.idDemanda);
     else
         return dbUsuarioDemanda.AtualizaDemandaStatus(DateTime.Parse(x.DataInicio), DateTime.Parse(x.DataFinalizada), x.StatusDemanda, x.idDemanda);
 }
Ejemplo n.º 2
0
 public bool IncluirDemanda(Demandas x)
 {
     try
     {
         dbDemandas.InserirDemanda(x.IdTipoDemanda, x.LogradouroDemanda, x.NumeroDemanda, x.ComplementoDemanda, x.BairroDemanda, x.DescricaoDemanda);
         return true;
     }
     catch (Exception)
     {
         return false;
         throw;
     }
     finally
     {
         dbDemandas.Connection.Close();
     }
 }
Ejemplo n.º 3
0
        protected void BtnConfirmar_Click(object sender, EventArgs e)
        {
            int i = 0;

            Demandas d = new Demandas();

            if (TxBairroOcorrencia.Text.Equals(""))
            {
                TxBairroOcorrencia.BackColor = Color.Yellow;
                i++;
            }
            if (TxNumeroOcorrencia.Text.Equals(""))
            {
                TxNumeroOcorrencia.BackColor = Color.Yellow;
                i++;
            }
            if (TxDescricaoDetalhada.Text.Equals(""))
            {
                TxDescricaoDetalhada.BackColor = Color.Yellow;
                i++;
            }
            if (TxLogradouroOcorrencia.Text.Equals(""))
            {
                TxLogradouroOcorrencia.BackColor = Color.Yellow;
                i++;
            }

            if (i > 0)
            {
                Response.Write("<script LANGUAGE='JavaScript' >alert('Preencha os campos faltosos')</script>");
            }
            else
            {
                d.BairroDemanda = TxBairroOcorrencia.Text.ToUpper();
                d.ComplementoDemanda = TxComplementoOcorrencia.Text.ToUpper();
                d.DescricaoDemanda = TxDescricaoDetalhada.Text.ToUpper();
                d.IdTipoDemanda = int.Parse(cbServicos.SelectedValue);
                d.LogradouroDemanda = TxLogradouroOcorrencia.Text.ToUpper();
                d.NumeroDemanda = int.Parse(TxNumeroOcorrencia.Text);
                d.InserirDemanda(d, LbCPFLogin.Text);
                Page_Load(sender, e);
            }
        }
Ejemplo n.º 4
0
        public Demandas PesquisaDemandaPorID(int iddemanda)
        {
            Demandas x = new Demandas();

            DataRow LinhaTabela = dbUsuarioDemanda.RetornaDemandaCadastradaPorID(iddemanda).Rows[0];

            x.DataCadastro = DateTime.Parse(LinhaTabela["DATACADASTRO"].ToString()).ToShortDateString();

            var aux = LinhaTabela["DATAINICIO"].ToString();

            if (!aux.Equals(""))
            {
                x.DataInicio = DateTime.Parse(LinhaTabela["DATAINICIO"].ToString()).ToShortDateString();
            }

            aux = LinhaTabela["DATAFIM"].ToString();

            if (!aux.Equals(""))
            {
                x.DataFinalizada = LinhaTabela["DATAFIM"].ToString();
            }

            return x;
        }
Ejemplo n.º 5
0
 public void AtualizarUsuarioDemanda(Demandas x)
 {
     bdDemandas.AtualizaUsuarioDemanda(x);
 }
Ejemplo n.º 6
0
 public void InserirDemanda(Demandas demanda, string cpf)
 {
     bdDemandas.IncluirDemanda(demanda);
     bdDemandas.IncluirUsuarioDemanda(cpf);
 }
Ejemplo n.º 7
0
 public void InserirDemanda(Demandas demanda, string cpf)
 {
     bdDemandas.IncluirDemanda(demanda);
     bdDemandas.IncluirUsuarioDemanda(cpf);
 }
Ejemplo n.º 8
0
 public void AtualizarUsuarioDemanda(Demandas x)
 {
     bdDemandas.AtualizaUsuarioDemanda(x);
 }