private void _Count_Radio(System.Web.UI.ControlCollection objcol, string radname) { try { int iID; int iNO; foreach (object obj in objcol) { System.Type itype = obj.GetType(); if (itype.Namespace == "Ext.Net" || itype.Namespace == "System.Web.UI.HtmlControls") { switch (itype.Name) { case "HtmlForm": System.Web.UI.HtmlControls.HtmlForm htmlform = (System.Web.UI.HtmlControls.HtmlForm)obj; _Count_Radio(htmlform.Controls, radname); break; case "Viewport": Ext.Net.Viewport viewport = (Ext.Net.Viewport)obj; _Count_Radio(viewport.Controls, radname); break; case "FormPanel": Ext.Net.FormPanel formpanel = (Ext.Net.FormPanel)obj; _Count_Radio(formpanel.Controls, radname); break; case "Panel": Ext.Net.Panel panel = (Ext.Net.Panel)obj; _Count_Radio(panel.Controls, radname); break; case "TabPanel": Ext.Net.TabPanel tabpanel = (Ext.Net.TabPanel)obj; _Count_Radio(tabpanel.Controls, radname); break; case "Container": Ext.Net.Container container = (Ext.Net.Container)obj; _Count_Radio(container.Controls, radname); break; case "FieldSet": Ext.Net.FieldSet fieldset = (Ext.Net.FieldSet)obj; _Count_Radio(fieldset.Controls, radname); break; case "ContentContainer": Ext.Net.ContentContainer contentcontainer = (Ext.Net.ContentContainer)obj; _Count_Radio(contentcontainer.Controls, radname); break; case "RadioGroup": Ext.Net.RadioGroup radioGroup = (Ext.Net.RadioGroup)obj; _Count_Radio(radioGroup.Controls, radname); break; case "Radio": Ext.Net.Radio radio = (Ext.Net.Radio)obj; string[] s = radio.ID.Split('_'); iID = Convert.ToInt16(s[1]); iNO = Convert.ToInt16(s[2]); if (iID > 1 && iID < 38) { if (radio.Value.Equals(true)) { iSCORE = iSCORE + iNO - 1; } } break; case "": break; } } } } catch (Exception ex) { _ErrorMsgShow(ex.Message.ToString()); } }
/// <summary> /// /// </summary> public RadioGroup.Builder RadioGroup(RadioGroup component) { return(new RadioGroup.Builder(component)); }
private void InitComponent() { #region Button btnAddUser = new Button { ID = "btnAddUser", Text = "Add User", Icon = Icon.UserAdd }; btnDelete = new Button { ID = "btnDelete", Text = "Delete User", Icon = Icon.UserDelete }; #endregion Button #region Card txtUserName = new TextField { ID = "txtUserName", EmptyText = "Enter username", Flex = 1, LabelWidth = 80, FieldLabel = "Username", AllowBlank = false }; txtFullName = new TextField { ID = "txtFullName", EmptyText = "Enter full name", Flex = 1, LabelWidth = 80, FieldLabel = "Full name", AllowBlank = false }; cbgCinema = new CheckboxGroup { ID = "cbgCinema", FieldLabel = "Cinema", ColumnsNumber = 3, Cls = "x-check-group-alt" }; cboLocation = new ComboBox { ID = "cboLocation", FieldLabel = "Location", EmptyText = "Enter Location", Flex = 1, LabelWidth = 80, AllowBlank = false }; cboBatch = new ComboBox { ID = "cboBatch", EmptyText = "Enter Batch", Flex = 1, LabelWidth = 80, FieldLabel = "Batch", AllowBlank = false }; rdgRole = new RadioGroup { ID = "rdgRole", FieldLabel = "Role", ColumnsNumber = 1, Items = { new Radio { ID = "rdoAdmin", BoxLabel = "Admin", Value = "Admin", InputValue = "Admin" }, new Radio { ID = "rdoFnb", BoxLabel = "F&B", Value = "FnB", InputValue = "FnB" }, new Radio { ID = "rdoAccSite", BoxLabel = "Accounting Site", Value = "AccSite", InputValue = "AccSite", Checked = true }, new Radio { ID = "rdoCM", BoxLabel = "Cinema Manager", Value = "CM", InputValue = "CM" } } }; cboCompanyCard = new ComboBox { ID = "cboCompanyCard", EmptyText = "Enter company", Flex = 1, LabelWidth = 80, FieldLabel = "Company", AllowBlank = false }; #endregion #region Account strUsername = new Store { ID = "strUsername", Model = { new Model { Fields = { new ModelField { Name = "Account" }, new ModelField { Name = "Fullname" }, } } } }; cboUsername = new Ext.Net.ComboBox { DataIndex = "Account", Name = "Account", LabelWidth = 80, Anchor = "100%", FieldLabel = "Account", ID = "cboUsername", SelectOnFocus = true, AllowBlank = false, MsgTarget = MessageTarget.Side, DisplayField = "Account", ValueField = "Account", PageSize = 100, }; cboUsername.Store.Add(strUsername); cboUsername.ListConfig = new BoundList { Width = 320, Height = 300, ItemSelector = ".x-boundlist-item", Tpl = new XTemplate { Html = string.Format(@" <Html> <tpl for="".""> <tpl if=""[xindex] == 1""> <table class=""cbStates-list""> <tr> <th style =""font-weight: bold;padding: 3px;background: #3892d3"">{0}</th> <th style =""font-weight: bold;padding: 3px;background: #3892d3"">{1}</th> </tr> </tpl> <tr class=""x-boundlist-item""> <td style=""padding:3px;"">{{{0}}}</td> <td style=""padding:3px;"">{{{1}}}</td> </tr> <tpl if=""[xcount-xindex]==0""> </table> </tpl> </tpl> </Html>" , "Account", "Fullname") } }; cboUsername.Triggers.Add(new FieldTrigger { Icon = TriggerIcon.Clear, HideTrigger = true }); #endregion Account #region Permission strPermission = new Store { ID = "strPermission", Model = { new Model { Fields = { new ModelField { Name = "UID" }, new ModelField { Name = "Company" }, new ModelField { Name = "Username" }, new ModelField { Name = "Page" }, new ModelField { Name = "Action" }, new ModelField { Name = "Allow" } } } } }; grdPermission = new GridPanel { ID = "grdPermission", BodyCls = "line-body-border", CtCls = "line-border", Title = "Permissions List", Height = 250, ColumnModel = { Columns = { new Column { DataIndex = "UID", Text = "UID", Width = 0 }, new Column { DataIndex = "Company", Text = "Company", MinWidth = 100, Flex = 1 }, new Column { DataIndex = "Username", Text = "Username", Width = 100 }, new Column { DataIndex = "Page", Text = "Page", Width = 120 }, new Column { DataIndex = "Action", Text = "Action", MinWidth = 150, Flex = 1 }, new Column { DataIndex = "Allow", Text = "Allow", Width = 100 }, } }, BottomBar = { new PagingToolbar { HideRefresh = true } }, SelectionModel = { new RowSelectionModel { Mode = SelectionMode.Single } } }; grdPermission.Store.Add(strPermission); #endregion Permission #region GLXAccount strGLXAccount = new Store { ID = "strGLXAccount", Model = { new Model { Fields = { new ModelField { Name = "UID" }, new ModelField { Name = "Account" }, new ModelField { Name = "Company" } } } } }; grdGLXAccount = new GridPanel { ID = "grdGLXAccount", BodyCls = "line-body-border", CtCls = "line-border", Title = "Company List", Height = 250, ColumnModel = { Columns = { new Column { DataIndex = "UID", Text = "UID", Width = 0 }, new Column { DataIndex = "Company", Text = "Company", Width = 100, Flex = 1 }, } }, BottomBar = { new PagingToolbar { HideRefresh = true } }, SelectionModel = { new RowSelectionModel { Mode = SelectionMode.Single } } }; grdGLXAccount.Store.Add(strGLXAccount); #endregion GLXAccount #region LocationAndAccount strLocationAndAccount = new Store { ID = "strLocationAndAccount", Model = { new Model { Fields = { new ModelField { Name = "UID" }, new ModelField { Name = "Account" }, new ModelField { Name = "Location" } } } } }; grdLocationAndAccount = new GridPanel { ID = "grdLocationAndAccount", BodyCls = "line-body-border", CtCls = "line-border", Title = "Location List", Height = 220, ColumnModel = { Columns = { new Column { DataIndex = "UID", Text = "UID", Width = 0 }, new Column { DataIndex = "Location", Text = "Location", Width = 100, Flex = 1 }, } }, BottomBar = { new PagingToolbar { HideRefresh = true } }, SelectionModel = { new RowSelectionModel { Mode = SelectionMode.Single } } }; grdLocationAndAccount.Store.Add(strLocationAndAccount); #endregion #region Worksheet strWorksheet = new Store { ID = "strWorksheet", Model = { new Model { Fields = { new ModelField { Name = "UID" }, new ModelField { Name = "Worksheet Template Name" }, new ModelField { Name = "Name" }, new ModelField { Name = "Description" }, new ModelField { Name = "Template Type" }, new ModelField { Name = "Recurring" }, new ModelField { Name = "Company" }, new ModelField { Name = "Account" }, } } } }; grdWorksheet = new GridPanel { ID = "grdWorksheet", BodyCls = "line-body-border", CtCls = "line-border", Title = "Worksheet List", Height = 220, ColumnModel = { Columns = { new Column { DataIndex = "UID", Text = "UID", Width = 0 }, new Column { DataIndex = "Company", Text = "Company", Width = 150 }, new Column { DataIndex = "Name", Text = "Name", Width = 100 }, new Column { DataIndex = "Description", Text = "Description", Width = 120, Flex = 1 }, new Column { DataIndex = "Account", Text = "Account", Width = 100 }, } }, BottomBar = { new PagingToolbar { HideRefresh = true } }, SelectionModel = { new RowSelectionModel { Mode = SelectionMode.Single } } }; grdWorksheet.Store.Add(strWorksheet); #endregion #region FormPanel frmHeader = new FormPanel { Collapsed = false, Collapsible = true, Region = Region.North, Layout = "HBox", Items = { new FormPanel { Layout = "Anchor", Flex = 1, BodyPaddingSummary = "10 10 10 10", Border = false, Items = { cboUsername } }, new FormPanel { Layout = "Anchor", Flex = 1, BodyPaddingSummary = "10 10 10 10", Border = false } }, TopBar = { new Toolbar { Items = { btnAddUser, btnDelete } } } }; frmGrid = new FormPanel { Layout = "HBoxLayout", Region = Region.Center, Header = true, BodyPaddingSummary = "5,5,5,5", Items = { new Panel { BodyPadding = 5, Layout = "VBoxLayout", Flex = 2, Region = Region.Center, LayoutConfig ={ new Ext.Net.VBoxLayoutConfig { Align = VBoxAlign.Stretch } }, Items = { grdPermission, grdWorksheet } }, new Panel { BodyPaddingSummary = "5,5,5,5", Layout = "Fit", Flex = 1, Region = Region.East, Items = { new Panel { Items ={ grdGLXAccount, grdLocationAndAccount } } } } } }; #endregion FormPanel this.ID = "pageMain"; this.Layout = "BorderLayout"; this.Items.AddRange(new ItemsCollection <Ext.Net.AbstractComponent> { frmGrid, frmHeader }); }
/// <summary> /// metodo que carrega as pesquisas existentes /// </summary> private void CarregarPesquisas() { foreach (PesquisaOpiniaoVO p in Pesquisas) { FieldSet fds = new FieldSet() { AutoWidth = true, AutoHeight = true, Title = p.Pergunta, TitleCollapse = true, Collapsible = true, Collapsed = false, AnimCollapse = true }; Hidden hdf = new Hidden() { ID = "hdf_" + p.Id, Value = p.Id.ToString() }; Ext.Net.RadioGroup group = new RadioGroup() { AutoWidth=true, ColumnsNumber = 1, GroupName = "group_" + p.Id, ID="group_"+p.Id, InvalidText="Selecione uma resposta.", AllowBlank = !(p.Status == StatusPesquisa.Iniciada), MsgTarget = MessageTarget.Side }; foreach (RespostaVO r in p.Respostas) { Radio radio = new Radio() { BoxLabel = r.Descricao, HideLabel = true, AutoWidth = true, MinWidth = 150, ID = "radio_"+r.Id, Checked = r.Usuarios.Any(x=> x.Id == UsuarioLogado.Id) }; group.Items.Add(radio); } fds.Items.Add(hdf); fds.Items.Add(group); if (p.Status == StatusPesquisa.Finalizada && p.MostrarResultado) { Ext.Net.Button btnGrafico = new Ext.Net.Button("Resultado"); //btnGrafico.DirectEvents.Click.EventMask = new EventMask() { Msg = "Abrindo gráfico...", ShowMask = true, Target = MaskTarget.Page }; btnGrafico.ID = "btnGrafico" + p.Id; btnGrafico.Listeners.Click.Handler = "Ext.net.DirectMethods.VisualizarGrafico('" + p.Id + "');"; btnGrafico.Icon = Ext.Net.Icon.ChartBar; btnGrafico.Disabled = !hdfVisualizarGraficoResponderPesquisas.Value.ToInt32().ToBoolean(); Toolbar toolbar = new Toolbar(); toolbar.Add(btnGrafico); fds.TopBar.Add(toolbar); } group.Disabled = !(p.Status == StatusPesquisa.Iniciada); fds.AddTo(frmPesquisas); } }