Inheritance: CheckboxBase, IPostBackEventHandler, ICheckBoxControl
Beispiel #1
0
 protected void SelectChangeTextState(Ext.Net.Radio radio1, Ext.Net.Radio radio2, Ext.Net.TextField text)
 {
     if (radio1.Checked || radio2.Checked)
     {
         text.Hidden = false;
     }
     else
     {
         text.Hidden = true;
     }
 }
Beispiel #2
0
 protected void SelectChangeTextState(Ext.Net.Radio radio1, Ext.Net.Radio radio2, Ext.Net.Label label)
 {
     if (radio1.Checked || radio2.Checked)
     {
         label.Hidden = false;
     }
     else
     {
         label.Hidden = true;
     }
 }
Beispiel #3
0
        //protected void Btn_Close_Click(object sander, DirectEventArgs e)
        //{
        //    X.Redirect("Dialysis_0h_08.aspx?editmode=list");
        //}

        protected void SelectChangeTextState(Ext.Net.Radio radio, Ext.Net.TextField text)
        {
            if (radio.Checked == true)
            {
                text.Hidden = false;
            }
            else
            {
                text.Hidden = true;
            }
        }
Beispiel #4
0
        public override string XGetDesignTimeHtml()
        {
            StringWriter   writer     = new StringWriter(CultureInfo.CurrentCulture);
            HtmlTextWriter htmlWriter = new HtmlTextWriter(writer);

            Radio c = (Radio)this.Control;

            object[] args = new object[7];
            args[0] = c.ClientID;
            args[1] = c.Checked.ToString().ToLower();
            args[5] = c.StyleSpec;
            args[6] = "x-form-radio x-form-field " + c.Cls;

            LiteralControl ctrl = new LiteralControl(string.Format(this.Html, args));

            ctrl.RenderControl(htmlWriter);

            return(writer.ToString());
        }
Beispiel #5
0
        protected override void AfterItemAdd(Observable item)
        {
            base.AfterItemAdd(item);

            Radio radio = (Radio)item;

            if (!this.DesignMode && this.AutomaticGrouping)
            {
                string groupName = this.GroupName.IsEmpty()
                                   ? this.ClientID + "_Group"
                                   : this.GroupName;

                RadioColumn rCol = radio as RadioColumn;

                if (rCol != null)
                {
                    foreach (Component comp in rCol.Items)
                    {
                        Radio radioItem = comp as Radio;

                        if (radioItem != null && (radioItem.Name.IsEmpty() || this.AutomaticGrouping))
                        {
                            radioItem.SuspendScripting();
                            radioItem.Name = groupName;
                            radioItem.ResumeScripting();
                        }
                    }
                }
                else
                {
                    if (radio.Name.IsEmpty() || this.AutomaticGrouping)
                    {
                        radio.SuspendScripting();
                        radio.Name = groupName;
                        radio.ResumeScripting();
                    }
                }
            }
        }
Beispiel #6
0
        protected override void AfterItemAdd(Observable item)
        {
            base.AfterItemAdd(item);

            if (!this.DesignMode && this.AutomaticGrouping)
            {
                Radio radio = item as Radio;

                string groupName = this.GroupName.IsEmpty()
                                   ? this.ClientID + "_Group"
                                   : this.GroupName;

                if (radio != null)
                {
                    if (radio.Name.IsEmpty() || this.AutomaticGrouping)
                    {
                        radio.SuspendScripting();
                        radio.Name = groupName;
                        radio.ResumeScripting();
                    }
                }
                else if (item is IItems)
                {
                    IItems items = (IItems)item;
                    foreach (Observable comp in items.ItemsList)
                    {
                        Radio radioItem = comp as Radio;

                        if (radioItem != null && (radioItem.Name.IsEmpty() || this.AutomaticGrouping))
                        {
                            radioItem.SuspendScripting();
                            radioItem.Name = groupName;
                            radioItem.ResumeScripting();
                        }
                    }
                }
            }
        }
 /// <summary>
 ///
 /// </summary>
 public Radio.Builder Radio(Radio component)
 {
     return(new Radio.Builder(component));
 }
        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());
            }
        }
        private string _Get_Column_Value(string[] sel, DataRow selrow)
        {
            string rtn_str = "";

            for (int i = 1; i < sel.Length; i++)
            {
                string colName = sel[i];
                if (colName.Equals("info_date"))
                {
                    rtn_str = selrow[colName].ToString() + "、";
                }
                if (colName.Equals("section"))
                {
                    rtn_str = selrow[colName].ToString() + "、";
                }
                if (colName.Equals("bed_no"))
                {
                    rtn_str = selrow[colName].ToString() + "、";
                }
                else
                {
                    switch (colName.Substring(0, 3))
                    {
                    case "dat":
                        rtn_str += selrow[colName].ToString() + "、";
                        break;

                    case "txt":
                        rtn_str += selrow[colName].ToString() + "、";
                        break;

                    case "are":
                        rtn_str += selrow[colName].ToString() + "、";
                        break;

                    case "num":
                        rtn_str += selrow[colName].ToString() + "、";
                        break;

                    case "cbo":
                        break;

                    case "opt":
                        string optVal = selrow[colName].ToString();
                        string optsel = colName + "_" + optVal.ToString();
                        if (_haTable.ContainsKey(optsel))
                        {
                            Ext.Net.Radio radio = (Ext.Net.Radio)_objTable[optsel];
                            rtn_str += radio.BoxLabel + "、";
                        }
                        break;

                    case "chk":
                        string chkVal = selrow[colName].ToString();
                        for (int x = 1; x <= chkVal.Length; x++)
                        {
                            if (chkVal.Substring(x - 1, 1).Equals("1"))
                            {
                                string chksel = colName + "_" + x.ToString();
                                if (_haTable.ContainsKey(chksel))
                                {
                                    Ext.Net.Checkbox checkbox = (Ext.Net.Checkbox)_objTable[chksel];
                                    rtn_str += checkbox.BoxLabel + "、";
                                }
                            }
                        }
                        break;
                    }
                }
            }

            if (rtn_str.Length > 0)
            {
                rtn_str = rtn_str.Substring(0, rtn_str.Length - 1);
            }
            return(rtn_str);
        }
 /// <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);
     }
 }