protected void nb_ItemClick(object source, DevExpress.Web.ASPxNavBar.NavBarItemEventArgs e) { ASPxNavBar navbar = source as ASPxNavBar; ASPxLabel lbl = Page.FindControl("lbl") as ASPxLabel; ASPxSplitter splitter = Page.FindControl("splitter") as ASPxSplitter; UserControl topgrid = splitter.FindControl("cbpTop").FindControl("topgrid") as UserControl; UserControl bottomgrid = splitter.FindControl("cbpBottom").FindControl("bottomgrid") as UserControl; ASPxGridView grid1 = null, grid2 = null; if (topgrid != null) { grid1 = topgrid.FindControl("grid1") as ASPxGridView; } if (bottomgrid != null) { grid2 = bottomgrid.FindControl("grid2") as ASPxGridView; } if (e.Item.Name == "itm32") { StringBuilder result = new StringBuilder(); if (grid1 != null) { result.AppendFormat("grid1 exists, current page is {0}", grid1.PageIndex + 1); } if (grid2 != null) { Object[] values = (Object[])grid2.GetRowValues(grid2.VisibleStartIndex + 1, new String[] { "Id", "Name", "Text" }); result.AppendFormat("<br />grid2 exists, the second visible row values are <span style=\"Color: Red;\">{0}, {1}, {2}</span>", values[0], values[1], values[2]); } lbl.Text = result.ToString(); } }
private void Frame_ProcessActionContainer(object sender, ProcessActionContainerEventArgs e) { if (e.ActionContainer is NavigationActionContainer) { ASPxNavBar navBar = ((NavigationActionContainer)e.ActionContainer).NavigationControl as ASPxNavBar; if (navBar != null) { // Customize the main ASPxNavBar control. navBar.EnableAnimation = true; foreach (NavBarGroup group in navBar.Groups) { group.Expanded = false; //foreach (NavBarItem item in group.Items) //{ // if (item is NavBarTreeViewItem) // { // ASPxTreeView innerTreeView = ((NavBarTreeViewItem)item).TreeViewNavigationControl.Control; // // Customize the inner ASPxTreeView control inside the navigation group. // innerTreeView.ShowExpandButtons = false; // } //} } } else { ASPxTreeView mainTreeView = ((NavigationActionContainer)e.ActionContainer).NavigationControl as ASPxTreeView; if (mainTreeView != null) { // Customize the main ASPxTreeView control. mainTreeView.ShowExpandButtons = false; } } } }
private void ShowNavigationItemAction_CustomizeControl(object sender, DevExpress.ExpressApp.Actions.CustomizeControlEventArgs e) { ASPxNavBar navBar = e.Control as ASPxNavBar; if (navBar != null) { // Customize the main ASPxNavBar control. navBar.EnableAnimation = true; foreach (NavBarGroup group in navBar.Groups) { foreach (NavBarItem item in group.Items) { if (item is NavBarTreeViewItem) { ASPxTreeView innerTreeView = ((NavBarTreeViewItem)item).TreeViewNavigationControl.Control; // Customize the inner ASPxTreeView control inside the navigation group. innerTreeView.ShowExpandButtons = false; } } } } else { ASPxTreeView mainTreeView = e.Control as ASPxTreeView; if (mainTreeView != null) { // Customize the main ASPxTreeView control. mainTreeView.ShowExpandButtons = false; } } }
public static void BuildNavBarItems(this ASPxNavBar navbar, List <MenuInfo> menuitems) { string navUrl = string.Empty; // I use a Dictionary object to keep track of the Menu Groups Dictionary <string, NavBarGroup> navGroups = new Dictionary <string, NavBarGroup>(); // Clear the Items to start fresh. navbar.Groups.Clear(); foreach (MenuInfo m in menuitems) { navUrl = m.MenuUrl; // If the Key Exists in the Dictionary add the new Item to the items collection of that NavGroup if (navGroups.ContainsKey(m.MenuGroup)) { navGroups[m.MenuGroup].Items.Add(new NavBarItem(m.MenuText, m.MenuName, "", "")); } //navGroups[m.MenuGroup].Items.Add(new NavBarItem(m.MenuText, m.MenuName, navUrl, "")); else { // Otherwise we add a new navGroup to the Navbar collection, add the navbarItem to it and store it in the dictionary NavBarGroup navgroup = navbar.Groups.Add(m.MenuGroup, m.MenuGroup); navgroup.Items.Add(new NavBarItem(m.MenuText, m.MenuName, "", "")); //navgroup.Items.Add(new NavBarItem(m.MenuText, m.MenuName, navUrl, "")); navGroups.Add(m.MenuGroup, navgroup); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (HttpContext.Current.User.Identity.Name == "") { Response.Redirect("~/Account/Login.aspx"); return; } if (!IsPostBack) { if (Session["RegistrarAsignacion"] == null || Session["RegistrarAsignacion"] == "") { //Response.Redirect("~/Default.aspx", true); } else { lblIdAsignacion.Text = Session["RegistrarAsignacion"].ToString(); Session["RegistrarAsignacion"] = ""; } //NUEVA ASIGNACION if (lblIdAsignacion.Text == "0") { LimpiarCampos(); } else { CargarDatos(lblIdAsignacion.Text.Trim()); } } //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "active", "SetActiveMenu('RegistrarPago');", true); ASPxNavBar navMain = (this.Master.FindControl("LeftPanel").FindControl("nbMain") as ASPxNavBar); if (navMain != null) { navMain.Groups.FindByName("Asignaciones").Expanded = true; navMain.SelectedItem = navMain.Items.FindByName("RegistrarAsignacion"); } } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }
/// <summary> /// 执行数据导航页面的切换 /// </summary> public static void Switch( this ASPxNavBar bars, Control[] controls, Action <int, Control> switchHandle = null, Action <int, Control> unloadHandle = null, int activeIndex = 0) { // 加载中提示.. bars.ClientSideEvents.ItemClick = "function(s,e){ISEx.loadingPanel.show();}"; if (bars.Items.Count != controls.Length) { throw new ArgumentException("Controls count not matched with bar count.", "controls"); } foreach (var c in controls) { c.If <BaseControl>(cc => cc.ViewStateEx.Clear()); c.Visible = false; } bars.ItemClick += (s, e) => { for (int i = 0; i < controls.Length; i++) { if (e.Item.Index != i && unloadHandle != null) { unloadHandle(i, controls[i]); } controls[i].Visible = false; } controls[e.Item.Index].Visible = true; if (switchHandle != null) { switchHandle(e.Item.Index, controls[e.Item.Index]); } }; if (activeIndex < 0 || activeIndex >= controls.Length) { return; } bars.SelectedItem = bars.Items[activeIndex]; controls[activeIndex].Visible = true; }
protected void gridview_applykm_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail) { ASPxGridView mastergrid = sender as ASPxGridView; ASPxPageControl tabs = mastergrid.FindDetailRowTemplateControl(e.VisibleIndex, "tab_stepkhuyenmai") as ASPxPageControl; /* Setting for tab 1 */ ASPxNavBar navbar_info = tabs.TabPages[0].FindControl("navbar_info") as ASPxNavBar; ASPxFormLayout form_infoquyenloi = navbar_info.Groups[1].FindControl("form_infoquyenloi") as ASPxFormLayout; ASPxGridView gridview_hanghoatang = form_infoquyenloi.FindControl("gridview_hanghoatang") as ASPxGridView; gridview_hanghoatang.DataSource = new[] { new{ sequenceno = "01", productid = "SP00001", productname = "Hàng hóa 1", productunitid = "Hộp", lotid = "L00001", condition_buy = "5", condition_give = "1" }, new{ sequenceno = "02", productid = "SP00002", productname = "Hàng hóa 2", productunitid = "Hộp", lotid = "L00002", condition_buy = "10", condition_give = "1" }, new{ sequenceno = "03", productid = "SP00003", productname = "Hàng hóa 3", productunitid = "Thùng", lotid = "L00003", condition_buy = "100", condition_give = "1" }, }; gridview_hanghoatang.DataBind(); gridview_hanghoatang.Visible = true; ASPxLabel lbl_title_khuyenmai2 = form_infoquyenloi.FindControl("lbl_title_khuyenmai2") as ASPxLabel; lbl_title_khuyenmai2.Visible = true; ASPxGridView gridview_hanghoabonus = form_infoquyenloi.FindControl("gridview_hanghoabonus") as ASPxGridView; gridview_hanghoabonus.DataSource = new[] { new { TenQuaTang = "Phiếu Giảm Giá", GiaTri = "15.000", SoLuong = "2", ThanhTien = "30.000", MoTa = "NAAN Solution" }, new { TenQuaTang = "Gấu Bông", GiaTri = "15.000", SoLuong = "3", ThanhTien = "45.000", MoTa = "NAAN Solution" }, }; gridview_hanghoabonus.DataBind(); gridview_hanghoabonus.Visible = false; ASPxLabel lbl_title_khuyenmai3 = form_infoquyenloi.FindControl("lbl_title_khuyenmai3") as ASPxLabel; ASPxRoundPanel round_chietkhau = form_infoquyenloi.FindControl("round_chietkhau") as ASPxRoundPanel; round_chietkhau.Visible = false; lbl_title_khuyenmai3.Visible = false; /* Setting for tab 2 */ ASPxNavBar navbar_nextinfo = tabs.TabPages[1].FindControl("navi_nextinfo") as ASPxNavBar; form_infoquyenloi = navbar_nextinfo.Groups[1].FindControl("form_infoquyenloi") as ASPxFormLayout; gridview_hanghoatang = form_infoquyenloi.FindControl("gridview_hanghoatang") as ASPxGridView; gridview_hanghoatang.DataSource = new[] { new{ sequenceno = "01", productid = "SP00001", productname = "Hàng hóa 1", productunitid = "Hộp", lotid = "L00001", condition_buy = "5", condition_give = "1" }, new{ sequenceno = "02", productid = "SP00002", productname = "Hàng hóa 2", productunitid = "Hộp", lotid = "L00002", condition_buy = "10", condition_give = "1" }, new{ sequenceno = "03", productid = "SP00003", productname = "Hàng hóa 3", productunitid = "Thùng", lotid = "L00003", condition_buy = "100", condition_give = "1" }, }; gridview_hanghoatang.DataBind(); gridview_hanghoatang.Visible = false; lbl_title_khuyenmai2 = form_infoquyenloi.FindControl("lbl_title_khuyenmai2") as ASPxLabel; lbl_title_khuyenmai2.Visible = false; gridview_hanghoabonus = form_infoquyenloi.FindControl("gridview_hanghoabonus") as ASPxGridView; gridview_hanghoabonus.DataSource = new[] { new { TenQuaTang = "Phiếu Giảm Giá", GiaTri = "15.000", SoLuong = "2", ThanhTien = "30.000", MoTa = "NAAN Solution" }, new { TenQuaTang = "Gấu Bông", GiaTri = "15.000", SoLuong = "3", ThanhTien = "45.000", MoTa = "NAAN Solution" }, }; gridview_hanghoabonus.DataBind(); gridview_hanghoabonus.Visible = true; round_chietkhau = form_infoquyenloi.FindControl("round_chietkhau") as ASPxRoundPanel; round_chietkhau.Visible = true; } }
public static void BindData(ASPxNavBar navbar, DevExpress.Xpo.Session s, string objectname, string filter = "", params object[] parameter) { try { DynamicDataTableClassInfo classInfo = dynamicClasses[objectname]; if (classInfo != null) { XPServerCollectionSource ds = new XPServerCollectionSource(s, dynamicClasses[objectname], CriteriaOperator.Parse(filter, parameter)); navbar.DataSource = ds; } else throw new Exception(string.Format("Đối tượng {0} không tìm thấy trong database. Nếu không có dữ liệu hiển thị thì XPOProfiles để xem điều kiện lọc đúng chưa", objectname)); } catch (Exception ex) { SiAuto.Main.LogColored(Color.Red, "Loi BindData:" + ex.ToString()); throw ex; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["ReportName"] == null || Session["ReportName"] == "") { Response.Redirect("~/Default.aspx"); return; } if (HttpContext.Current.User.Identity.Name == "") { Response.Redirect("~/Account/Login.aspx"); return; } string ReportName = Session["ReportName"].ToString(); string IdentityUser = ""; string MsjSQL = ""; switch (ReportName) { case "PlanPago": if (Request.Params["RP"] == null || Request.Params["RP"] == "") { return; } int IdAsignacion = Convert.ToInt32(Request.Params["RP"].ToString()); Rpt_PlanPago RptPlanPago = new Rpt_PlanPago(); //FG.MakeRecordSet(Datos, "SELECT IdAsignacion, Proyecto, NumeroLote, AreaLote, Total, Prima, Beneficiario, NumeroCuota, FechaCuota, MesPagado, SaldoInicial, MontoMinimo, Saldo, Interes, TotalPagar, MontoPagado, FechaPago, Estado, Mora FROM dbo.FN_Asignacion_PlandePago(" + IdAsignacion + ") AS FN_Asignacion_PlandePago_1", ""); FG._NombreUsuario = HttpContext.Current.User.Identity.Name; IdentityUser = FG.CrearIdentificadorUsuario(FG._NombreUsuario); FG.MakeRecordSet(Datos, "EXEC SP_PlanPagoGenerar " + IdAsignacion + ", '" + IdentityUser + "'", ""); MsjSQL = FG.Obtener_MensajeSQL(IdentityUser); if (MsjSQL == "") { if (Datos.Tables[0].Rows.Count != 0) { RptPlanPago.DataSource = Datos; RptPlanPago.DataMember = "View_Reporte_PlanPago"; CargarDatosEmpresa(RptPlanPago); RptPlanPago.CreateDocument(); WebDocumentViewer.OpenReport(RptPlanPago); } } break; case "EstadoCuenta": ASPxNavBar navMain = (this.Master.FindControl("LeftPanel").FindControl("nbMain") as ASPxNavBar); if (navMain != null) { navMain.Groups.FindByName("Reportes").Expanded = true; navMain.SelectedItem = navMain.Items.FindByName("EstadoCuenta"); } Rpt_EstadoCuenta RptEstadoCuenta = new Rpt_EstadoCuenta(); if (Session["IdAsignacionEstadoCuenta"] != null && Session["IdAsignacionEstadoCuenta"] != "") { RptEstadoCuenta.Parameters["IdAsignacion"].Value = Convert.ToInt32(Session["IdAsignacionEstadoCuenta"]); } CargarDatosEmpresa(RptEstadoCuenta); RptEstadoCuenta.CreateDocument(); WebDocumentViewer.OpenReport(RptEstadoCuenta); break; case "TicketPago": if (Session["IdPagoTicket"] == null || Session["IdTicketPago"] == "") { return; } Rpt_TicketPago RptTicketPago = new Rpt_TicketPago(); int IdPago = Convert.ToInt32(Session["IdPagoTicket"]); FG._NombreUsuario = HttpContext.Current.User.Identity.Name; IdentityUser = FG.CrearIdentificadorUsuario(FG._NombreUsuario); FG.MakeRecordSet(Datos, "EXEC [SP_TicketPagoGenerar] " + IdPago + ",'" + IdentityUser + "'", ""); MsjSQL = FG.Obtener_MensajeSQL(IdentityUser); if (MsjSQL == "") { if (Datos.Tables[0].Rows.Count != 0) { RptTicketPago.DataSource = Datos; RptTicketPago.DataMember = "View_Reporte_TicketPago"; RptTicketPago.CreateDocument(); WebDocumentViewer.OpenReport(RptTicketPago); } } break; case "PagosFechas": Rpt_PagosFechas RptPagosFechas = new Rpt_PagosFechas(); string FiltroFechas = Session["FiltroFechas"].ToString(); FG._NombreUsuario = HttpContext.Current.User.Identity.Name; IdentityUser = FG.CrearIdentificadorUsuario(FG._NombreUsuario); if (FiltroFechas != "Todos") { FG.MakeRecordSet(Datos, "SELECT * FROM View_Pagos_Asignaciones WHERE convert(date,FechaRecibo) IN(" + FiltroFechas + ")", ""); } else { FG.MakeRecordSet(Datos, "SELECT * FROM View_Pagos_Asignaciones", ""); } MsjSQL = FG.Obtener_MensajeSQL(IdentityUser); if (MsjSQL == "") { if (Datos.Tables[0].Rows.Count != 0) { RptPagosFechas.DataSource = Datos; RptPagosFechas.DataMember = "View_Pagos_Asignaciones"; CargarDatosEmpresa(RptPagosFechas); RptPagosFechas.CreateDocument(); WebDocumentViewer.OpenReport(RptPagosFechas); } } break; case "Proforma": Rpt_Proforma RptProforma = new Rpt_Proforma(); int IdProforma = Convert.ToInt32(Session["IdProforma"]); RptProforma.Parameters["IdProforma"].Value = IdProforma; CargarDatosEmpresa(RptProforma); string Ruta = HttpContext.Current.Server.MapPath(@"~\Content\Imagenes\"); ((XRPictureBox)RptProforma.FindControl("xrPicture_Fecha", true)).ImageUrl = Ruta + "proforma2.png"; RptProforma.CreateDocument(); WebDocumentViewer.OpenReport(RptProforma); break; } }
protected void Page_Load(object sender, EventArgs e) { try { if (HttpContext.Current.User.Identity.Name == "") { Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { if ((Session["IdAsignacionPago"] == null && Session["IdPago"] == null) || (Session["IdAsignacionPago"] == "" && Session["IdPago"] == "")) { //Response.Redirect("Pagos.aspx", true); //return; } else { lblIdAsignacion.Text = Session["IdAsignacionPago"].ToString(); lblIdPago.Text = Session["IdPago"].ToString(); Session["IdAsignacionPago"] = ""; Session["IdPago"] = ""; } if (lblIdPago.Text == "" && lblIdAsignacion.Text == "") { LimpiarCampos("General"); HabilitarCampos(false); return; } if (lblIdPago.Text == "0") { LimpiarCampos("Detalle"); } else { CargarDatosPago(lblIdPago.Text); } if (lblIdAsignacion.Text == "0") { LimpiarCampos("General"); } else { CargarDatosAsignacion(lblIdAsignacion.Text); } Session["TicketImprimir"] = ""; //CargarDatosAsignacion(lblIdAsignacion.Text); } ASPxNavBar navMain = (this.Master.FindControl("LeftPanel").FindControl("nbMain") as ASPxNavBar); if (navMain != null) { navMain.Groups.FindByName("Pagos").Expanded = true; navMain.SelectedItem = navMain.Items.FindByName("RegistrarPago"); } if (Session["TicketImprimir"] != null && Session["TicketImprimir"] != "") { GenerarTicket(Convert.ToInt32(Session["TicketImprimir"])); } if (ComboBox_Moneda.Text == "Córdobas") { SpinEditTasaCambio.ClientEnabled = true; } else { SpinEditTasaCambio.ClientEnabled = false; } } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }