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); }
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(); } }
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); } }
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; }
public void AtualizarUsuarioDemanda(Demandas x) { bdDemandas.AtualizaUsuarioDemanda(x); }
public void InserirDemanda(Demandas demanda, string cpf) { bdDemandas.IncluirDemanda(demanda); bdDemandas.IncluirUsuarioDemanda(cpf); }
public void InserirDemanda(Demandas demanda, string cpf) { bdDemandas.IncluirDemanda(demanda); bdDemandas.IncluirUsuarioDemanda(cpf); }
public void AtualizarUsuarioDemanda(Demandas x) { bdDemandas.AtualizaUsuarioDemanda(x); }