コード例 #1
0
 protected void BtnMayor_Click(object sender, EventArgs e)
 {
     BtnMayor.CssClass   = "btn btn-primary";
     BtnSubComp.CssClass = "btn btn-outline-primary";
     ViewState["Tipo"]   = "MY";
     BindPn("MY");
     BindSn("");
     TxtDesc.Text         = "";
     GrdHistor.DataSource = null;
     GrdHistor.DataBind();
 }
コード例 #2
0
        protected void BindHistorico()
        {
            PerfilesGrid();
            Idioma = (DataTable)ViewState["TablaIdioma"];
            DataTable DtB = new DataTable();

            Cnx.SelecBD();
            using (SqlConnection sqlConB = new SqlConnection(Cnx.GetConex()))
            {
                string VbTxtSql = " EXEC SP_PANTALLA_Formulario_Historico 10,@E,@T,'','',0,0,0,@ICC,'01-01-01','01-01-01','01-01-01'";
                sqlConB.Open();
                using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlConB))
                {
                    SC.Parameters.AddWithValue("@T", ViewState["Tipo"]);
                    SC.Parameters.AddWithValue("@E", DdlSN.Text.Trim());
                    SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]);
                    using (SqlDataAdapter DAB = new SqlDataAdapter())
                    {
                        try
                        {
                            DAB.SelectCommand = SC;
                            DAB.Fill(DtB);
                            if (DtB.Rows.Count > 0)
                            {
                                GrdHistor.DataSource = DtB;
                                GrdHistor.DataBind();
                            }
                            else
                            {
                                GrdHistor.DataSource = null;
                                GrdHistor.DataBind();
                            }
                        }
                        catch (Exception Ex)
                        {
                            DataRow[] Result = Idioma.Select("Objeto= 'MensIncovCons'");
                            foreach (DataRow row in Result)
                            {
                                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + row["Texto"].ToString() + "');", true);
                            }                                                                                                                                       //

                            Cnx.UpdateErrorV2(Session["C77U"].ToString(), ViewState["PFileName"].ToString().Trim(), "UPDATE Detalle PPT", Ex.StackTrace.Substring(Ex.StackTrace.Length > 300 ? Ex.StackTrace.Length - 300 : 0, 300), Ex.Message, Session["77Version"].ToString(), Session["77Act"].ToString());
                        }
                    }
                }
            }
        }