コード例 #1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            if (Session["rutaExcel"] == null)
            {
                pcError.ShowOnPageLoad = true;
                lblError.Text          = "Debe cargar la grilla";
            }
            else
            {
                DataTable tabla = OpenExcelFile(Session["rutaExcel"].ToString());
                if (tabla.Rows.Count > 0)
                {
                    string rta = ControladorGeneral.InsertarActualizarContratosMarcosPorTabla(tabla);

                    if (rta != "ok")
                    {
                        pcError.ShowOnPageLoad = true;
                        lblError.Text          = rta;
                    }

                    Session["rutaExcel"] = null;
                }
            }
        }