protected void btnAddIncident_Click(object sender, EventArgs e) { if (this.IsValid) { ObjectDataSource3.InsertParameters["CustomerID"].DefaultValue = ddlCustomers.SelectedValue; ObjectDataSource3.InsertParameters["ProductCode"].DefaultValue = ddlProducts.SelectedValue.Trim(); ObjectDataSource3.InsertParameters["Title"].DefaultValue = txtTitle.Text; ObjectDataSource3.InsertParameters["Description"].DefaultValue = txtDescription.Text; try { ObjectDataSource3.Insert(); ddlCustomers.SelectedValue = "-1"; ddlProducts.SelectedValue = "-1"; txtTitle.Text = ""; txtDescription.Text = ""; } catch (Exception ex) { //lblError.Text = "A database error has occurred. <br /><br />" + // "Message: " + ex.Message; Session["Exception"] = ex; Response.Redirect("~/ErrorPages/ErrorMessage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if ((Session["equipValue"].ToString() == "")) { ObjectDataSource3.SelectMethod = "SelectAll"; } else if (Session["equipValue"].ToString() == "search") { ObjectDataSource3.SelectMethod = "selectSearch"; //Passar chamadoValue como parâmetro SessionParameter empid = new SessionParameter(); empid.Name = "modelo"; empid.Type = TypeCode.String; empid.SessionField = "equipb"; ObjectDataSource3.SelectParameters.Add(empid); ObjectDataSource3.DataBind(); } Session["equipValue"] = ""; }
protected void Button1_Click(object sender, EventArgs e) { ObjectDataSource3.DataBind(); ObjectDataSource3.Select(); GridView1.EmptyDataText = "No se encontro el registro."; GridView1.DataSourceID = "ObjectDataSource3"; //Mensaje01.Text = "si entra aquin"; //GridView1.DataBind(); }
// Boolean blnBanderaDescuentoAfectado = false; protected void Page_Load(object sender, EventArgs e) { String error = Utilis.validaPermisos(Session, NUMFUNCION); if (!error.Equals("")) { Response.Redirect(error); } //// determinar si el usuario tiene los permisos para aceptar una cotizacion con descuento. //String error2 = Utilis.validaPermisos(Session, 18); //if (error2.Equals("")) //{ // blnBanderaDescuentoAfectado = true; //} if (!IsPostBack) { ObjectDataSource3.DataBind(); ObjectDataSource3.Select(); GridView1.DataBind(); } }