Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Procedencia procedencia = db.Procedencias.Find(id);

            db.Procedencias.Remove(procedencia);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ProcedenciaID,valor")] Procedencia procedencia)
 {
     if (ModelState.IsValid)
     {
         db.Entry(procedencia).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(procedencia));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "ProcedenciaID,valor")] Procedencia procedencia)
        {
            if (ModelState.IsValid)
            {
                db.Procedencias.Add(procedencia);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(procedencia));
        }
        public ProcedenciaCursosItemView(Procedencia procedencia)
        {
            _dbContext = new ApplicationDbContext();

            Correctas = new Dictionary <int, int>();
            Total     = new Dictionary <int, int>();

            Procedencia = procedencia;

            Prepare();
        }
Exemplo n.º 5
0
        public void PrepararDados()
        {
            List <Parametros> condicoes = new List <Parametros>();

            if (Codigo != -1)
            {
                condicoes.Add(new Parametros("Codigo", Codigo.ToString(), TipoDeDadosBD.numerico, OperadorComparativo.EQUALS));
            }

            if (!string.IsNullOrEmpty(Tipo))
            {
                condicoes.Add(new Parametros("Tipo", Tipo, TipoDeDadosBD.character, OperadorComparativo.EQUALS));
            }

            if (!string.IsNullOrEmpty(Produto.ToString()))
            {
                condicoes.Add(new Parametros("Produto_Nome", Produto, TipoDeDadosBD.character, OperadorComparativo.EQUALS));
            }

            if (!string.IsNullOrEmpty(Procedencia.ToString()))
            {
                condicoes.Add(new Parametros("Procedencia", Procedencia, TipoDeDadosBD.character, OperadorComparativo.EQUALS));
            }

            if (!string.IsNullOrEmpty(Destino.ToString()))
            {
                condicoes.Add(new Parametros("Destino", Destino, TipoDeDadosBD.character, OperadorComparativo.EQUALS));
            }

            if (!string.IsNullOrEmpty(Placa.ToString()))
            {
                condicoes.Add(new Parametros("Veiculo_Placa", Placa, TipoDeDadosBD.character, OperadorComparativo.EQUALS));
            }

            if (DataBrutoIni < DataBrutoFim)
            {
                condicoes.Add(new Parametros("Data_Bruto", DataBrutoIni + "|" + DataBrutoFim, TipoDeDadosBD.data, OperadorComparativo.BETWEEN));
            }

            if (DataTaraIni < DataTaraFim)
            {
                condicoes.Add(new Parametros("Data_Tara", DataTaraIni + "|" + DataTaraFim, TipoDeDadosBD.data, OperadorComparativo.BETWEEN));
            }

            if (DataTicketIni < DataTicketFim)
            {
                condicoes.Add(new Parametros("Data_Ticket", DataTicketIni + "|" + DataTicketFim, TipoDeDadosBD.data, OperadorComparativo.BETWEEN));
            }

            Dados = Comando.Default.executaComando(TipoDeComando.Select, "Ticket", condicoes, null);
        }
Exemplo n.º 6
0
        // GET: Procedencias/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Procedencia procedencia = db.Procedencias.Find(id);

            if (procedencia == null)
            {
                return(HttpNotFound());
            }
            return(View(procedencia));
        }
Exemplo n.º 7
0
    protected void btPesq_Click(object sender, EventArgs e)
    {
        string _rh = txbRh.Text;

        using (OdbcConnection cnn = new OdbcConnection(ConfigurationManager.ConnectionStrings["HospubConn"].ToString()))
        {
            OdbcCommand cmm = cnn.CreateCommand();
            cmm.CommandText = "Select ib6prontuar, ib6pnome, ib6compos, ib6municip, ib6telef, ib6dtnasc, ib6lograd, ib6numero, ib6complem, ib6bairro from intb6 where ib6regist = " + _rh;
            cnn.Open();
            OdbcDataReader dr = cmm.ExecuteReader();
            if (dr.Read())
            {
                lbRF.Text          = dr.GetString(0);
                lbNome.Text        = dr.GetString(1) + dr.GetString(2);
                lbProcedencia.Text = Procedencia.getProcedencia(dr.GetString(3));

                string tel = dr.GetString(4).TrimStart('0');
                if (tel != "")
                {
                    if (tel.Length.Equals(8))
                    {
                        tel = tel.Substring(0, 4) + "-" + tel.Substring(4, 4);
                    }
                    else if (tel.Length.Equals(9))
                    {
                        tel = tel.Substring(0, 5) + "-" + tel.Substring(5, 4);
                    }
                }
                lbTel.Text     = tel;
                lbIdade.Text   = calcidade.getIdade(dr.GetString(5)).ToString() + " anos";;
                lblograd.Text  = dr.GetString(6);
                lbnumero.Text  = dr.GetString(7);
                lbcomplem.Text = dr.GetString(8);
                lbbairro.Text  = dr.GetString(9);

                dr.Close();
            }
        }

        //Pesquisa Histórico de Consultas
        GridView1.DataSource = AgendaPass1.gridCarregaAgendaPass(_rh);
        GridView1.DataBind();

        // Consultas Marcadas
        GridView2.DataSource = AgendaMarcada.gridCarregaAgenda(_rh);
        GridView2.DataBind();

        GridView3.DataSource = AgendaDemanda.gridCarregaAgendaDemanda(_rh);
        GridView3.DataBind();
    }
    protected void btPesq_Click(object sender, EventArgs e)
    {
        GridView6.SelectedIndex = -1;
        GridView6.DataBind();
        string dtHoje = DateTime.Now.Date.Day.ToString().PadLeft(2, '0') + "/" + DateTime.Now.Date.Month.ToString().PadLeft(2, '0') + "/" + DateTime.Now.Date.Year.ToString().PadLeft(2, '0');

        txbdtSol.Text = dtHoje;

        Button1.Enabled = true;
        Button2.Enabled = false;
        string _rh = txbRh.Text.TrimStart('0');

        LimpaCampos();

        txbdtSol.Text = dtHoje;
        txbSus.Text   = Sus(_rh);
        txbTel2.Text  = "";
        txbTel3.Text  = "";
        txbTel4.Text  = "";



        //*************data e hora do início de uso do painel contando apartir da pesquisa do rh
        lbDateIni.Text = DateTime.Now.ToString();

        //*********************************************
        chbRetorno.Checked = true;
        chbRegul.Checked   = false;
        try
        {
            using (OdbcConnection cnn = new OdbcConnection(ConfigurationManager.ConnectionStrings["HospubConn"].ToString()))
            {
                OdbcCommand cmm = cnn.CreateCommand();
                cmm.CommandText = "Select ib6prontuar, ib6pnome, ib6compos, ib6municip, ib6telef, ib6dtnasc, ib6lograd, ib6numero, ib6complem, ib6bairro from intb6 where ib6regist = " + _rh;
                cnn.Open();
                OdbcDataReader dr = cmm.ExecuteReader();
                if (dr.Read())
                {
                    lbRF.Text          = dr.GetString(0);
                    lbNome.Text        = dr.GetString(1) + dr.GetString(2);
                    lbProcedencia.Text = Procedencia.getProcedencia(dr.GetString(3));

                    string tel = dr.GetString(4).TrimStart('0');
                    if (tel != "")
                    {
                        if (tel.Length.Equals(8))
                        {
                            tel          = tel.Substring(0, 4) + "-" + tel.Substring(4, 4);
                            txbTel1.Text = "(11)  0" + tel;
                        }
                        else if (tel.Length.Equals(9))
                        {
                            tel          = tel.Substring(0, 5) + "-" + tel.Substring(5, 4);
                            txbTel1.Text = "(11) " + tel;
                        }
                        else if (tel.Length.Equals(10))
                        {
                            tel          = "(" + tel.Substring(0, 2) + ") 0" + tel.Substring(2, 4) + "-" + tel.Substring(6, 4);
                            txbTel1.Text = tel;
                        }
                        else if (tel.Length.Equals(11))
                        {
                            tel          = "(" + tel.Substring(0, 2) + ") " + tel.Substring(2, 5) + "-" + tel.Substring(7, 4);
                            txbTel1.Text = tel;
                        }
                    }
                    lbTel.Text     = tel;
                    lbIdade.Text   = calcidade.getIdade(dr.GetString(5)).ToString() + " anos";;
                    lblograd.Text  = dr.GetString(6);
                    lbnumero.Text  = dr.GetString(7);
                    lbcomplem.Text = dr.GetString(8);
                    lbbairro.Text  = dr.GetString(9);


                    dr.Close();
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Número de RH inexistente.');", true);
                    txbRh.Text = "";
                    LimpaCampos();
                    dtHoje        = DateTime.Now.Date.Day.ToString().PadLeft(2, '0') + "/" + DateTime.Now.Date.Month.ToString().PadLeft(2, '0') + "/" + DateTime.Now.Date.Year.ToString().PadLeft(2, '0');
                    txbdtSol.Text = dtHoje;
                    return;
                }

                //Colocar uma função para buscar os telefones no Banco de Dados Geral_Treina

                using (SqlConnection cnn1 = new SqlConnection(ConfigurationManager.ConnectionStrings["SqlServices"].ToString()))
                {
                    SqlCommand cmm1 = cnn1.CreateCommand();
                    cmm1.CommandText = "SELECT  telefone2,telefone3,telefone4 FROM [Geral_Treina].[dbo].[Telefones_Adicionais] where rh = '" + _rh + "'";
                    cnn1.Open();

                    SqlDataReader drTel = cmm1.ExecuteReader();
                    if (drTel.Read())
                    {
                        txbTel2.Text = drTel.GetString(0);
                        txbTel3.Text = drTel.GetString(1);
                        txbTel4.Text = drTel.GetString(2);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            string erro = ex.Message;
        }
        ddlEspec.Focus();
    }
Exemplo n.º 9
0
 public QuesoAzul(string descripcion, int cantidad, Procedencia procedencia) : this(descripcion, cantidad)
 {
     this.procedencia = procedencia;
 }