protected void GridViewAlbaransver_SelectionChanged(object sender, EventArgs e) { string SerieAlbaran = Convert.ToString(GridViewAlbaransver.GetSelectedFieldValues("SerieAlbaran").Select(c => c).FirstOrDefault()); GridViewAlbaransverDetail.DataSource = AlbaranRepository.GetAlbaranosverDetail(SerieAlbaran); GridViewAlbaransverDetail.DataBind(); }
protected void GridViewAlbaransver_SelectionChanged(object sender, EventArgs e) { string SerieAlbaran = Convert.ToString(GridViewAlbaransver.GetSelectedFieldValues("SerieAlbaran").Select(c => c).FirstOrDefault()); GridViewAlbaransverDetail.DataSource = AlbaranRepository.GetAlbaranosverDetail(SerieAlbaran); GridViewAlbaransverDetail.DataBind(); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "divShow('#gridfamilia')", true); }
protected void Page_Load(object sender, EventArgs e) { if (Session["User"] == null) { if (Page.IsCallback) { ASPxWebControl.RedirectOnCallback("/Account/login.aspx"); } else { Response.Redirect("/Account/login.aspx"); } } // if (Request.Browser.IsMobileDevice) // { // if (Page.IsCallback) // { // ASPxWebControl.RedirectOnCallback("/mobile/Albaranes.aspx"); // } // else // { // Response.Redirect("/mobile/Albaranes.aspx"); // } // } DateTime?defecha = null; DateTime?afecha = null; if (!Page.IsPostBack) { Session["buttonclick"] = "date"; defecha = Convert.ToDateTime(fechahoy.ToString("01/MMM/yyy")); afecha = Convert.ToDateTime(DateTime.DaysInMonth(fechahoy.Year, fechahoy.Month) + "/" + fechahoy.Month + "/" + fechahoy.Year); } if ((dtfromDate.Date != null || dttoDate.Date != null) && Convert.ToString(Session["buttonclick"]) == "date") { defecha = dtfromDate.Date; afecha = dttoDate.Date; } var Cliente = (Clientes)Session["User"]; searchalbaran.Text = string.IsNullOrWhiteSpace(Request.QueryString["albarane"]) ? searchalbaran.Text : Request.QueryString["albarane"]; if (!string.IsNullOrEmpty(searchalbaran.Text)) { GridViewAlbaransver.DataSource = AlbaranRepository.GetAllAlbaranosver(searchalbaran.Text, "", Cliente.AutoCliente, null, null); } else { GridViewAlbaransver.DataSource = AlbaranRepository.GetAllAlbaranosver(searchalbaran.Text, "", Cliente.AutoCliente, defecha, afecha); } GridViewAlbaransver.DataBind(); string serieAlbaran = string.Empty; if (GridViewAlbaransver.GetSelectedFieldValues("SerieAlbaran").Count > 0) { serieAlbaran = Convert.ToString(GridViewAlbaransver.GetSelectedFieldValues("SerieAlbaran").Select(c => c).FirstOrDefault()); } else { serieAlbaran = Convert.ToString(GridViewAlbaransver.GetRowValues(0, "SerieAlbaran")); } GridViewAlbaransverDetail.DataSource = AlbaranRepository.GetAlbaranosverDetail(serieAlbaran); GridViewAlbaransverDetail.DataBind(); }