Beispiel #1
0
        protected void BIndDataBusq()
        {
            DataTable DtB = new DataTable();

            Cnx.SelecBD();
            using (SqlConnection sqlConB = new SqlConnection(Cnx.GetConex()))
            {
                if (!TxtBusqMon.Text.Trim().Equals("") && !TxtBusqAno.Text.Trim().Equals("") && !TxtBusqMes.Text.Trim().Equals(""))
                {
                    sqlConB.Open();
                    using (SqlCommand SC = new SqlCommand("EXEC SP_Pantalla_Moneda 3, @Mnd, @Yr, @Mn,'','',0,0,0,@ICC,'01-01-1','01-01-1'", sqlConB))
                    {
                        SC.Parameters.AddWithValue("@Mnd", TxtBusqMon.Text.Trim());
                        SC.Parameters.AddWithValue("@Yr", TxtBusqAno.Text.Trim());
                        SC.Parameters.AddWithValue("@Mn", TxtBusqMes.Text.Trim());
                        SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]);
                        SqlDataAdapter DAB = new SqlDataAdapter(SC);
                        DAB.SelectCommand = SC;
                        DAB.Fill(DtB);
                        if (DtB.Rows.Count > 0)
                        {
                            GrdDatosH.DataSource = DtB; GrdDatosH.DataBind();
                        }
                        else
                        {
                            DtB.Rows.Add(DtB.NewRow());
                            GrdDatosH.DataSource = DtB;
                            GrdDatosH.DataBind();
                            GrdDatosH.Rows[0].Cells.Clear();
                            GrdDatosH.Rows[0].Cells.Add(new TableCell());
                            DataRow[] Result = Idioma.Select("Objeto= 'SinRegistros'");
                            foreach (DataRow row in Result)
                            {
                                GrdDatosH.Rows[0].Cells[0].Text = row["Texto"].ToString();
                            }
                            GrdDatosH.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center;
                        }
                    }
                }
            }
        }
Beispiel #2
0
 protected void IbtCloseHist_Click(object sender, ImageClickEventArgs e)
 {
     TxtBusqMon.Text      = ""; TxtBusqAno.Text = ""; TxtBusqMes.Text = "";
     GrdDatosH.DataSource = null; GrdDatosH.DataBind(); MultVw.ActiveViewIndex = 0;
 }