Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        public SpinnerField.Builder SpinnerField(SpinnerField component)
        {
#if MVC
            component.ViewContext = this.HtmlHelper != null ? this.HtmlHelper.ViewContext : null;
#endif
            return(new SpinnerField.Builder(component));
        }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 public SpinnerField.Builder SpinnerField(SpinnerField component)
 {
     return(new SpinnerField.Builder(component));
 }
Esempio n. 3
0
    /// <summary>
    /// Lấy fieldname và giá trị
    /// </summary>
    /// <param name="control"></param>
    /// <param name="value"></param>
    /// <returns></returns>
    private string GetFieldName(Ext.Net.Component control, ref object value)
    {
        switch (control.ToString())
        {
        case "Ext.Net.TextField":
            Ext.Net.TextField txtControl = (Ext.Net.TextField)control;
            value = txtControl.Text;
            if (!txtControl.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(txtControl.ID.Substring(txtControl.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Hidden":
            Ext.Net.Hidden hdfControl = (Ext.Net.Hidden)control;
            value = hdfControl.Text;
            if (!hdfControl.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(hdfControl.ID.Substring(hdfControl.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Checkbox":
            Ext.Net.Checkbox chk = (Ext.Net.Checkbox)control;
            value = chk.Checked == true ? 1 : 0;
            if (!chk.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(chk.ID.Substring(chk.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.DateField":
            Ext.Net.DateField dfDate = (Ext.Net.DateField)control;
            if (!SoftCore.Util.GetInstance().IsDateNull(dfDate.SelectedDate))
            {
                value = dfDate.SelectedDate.Month + "/" + dfDate.SelectedDate.Day + "/" + dfDate.SelectedDate.Year;
            }
            else
            {
                value = "";
            }
            if (!dfDate.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(dfDate.ID.Substring(dfDate.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.NumberField":
            Ext.Net.NumberField nbf = (Ext.Net.NumberField)control;
            value = nbf.Text;
            if (!nbf.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(nbf.ID.Substring(nbf.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.ComboBox":
            Ext.Net.ComboBox cbBox = (Ext.Net.ComboBox)control;
            value = cbBox.SelectedItem.Value;
            if (!cbBox.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(cbBox.ID.Substring(cbBox.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.SpinnerField":
            Ext.Net.SpinnerField spinnerField = (Ext.Net.SpinnerField)control;
            value = spinnerField.Text;
            if (!spinnerField.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(spinnerField.ID.Substring(spinnerField.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.TextArea":
            Ext.Net.TextArea txtArea = (Ext.Net.TextArea)control;
            value = txtArea.Text;
            if (!txtArea.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(txtArea.ID.Substring(txtArea.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Container":
            Ext.Net.Container cContainer = (Ext.Net.Container)control;
            GetChildControl(cContainer);
            break;

        case "Ext.Net.FieldSet":
            Ext.Net.FieldSet fieldSet = (Ext.Net.FieldSet)control;
            GetChildControl(fieldSet);
            break;

        case "Ext.Net.HtmlEditor":
            Ext.Net.HtmlEditor htmlEditor = (Ext.Net.HtmlEditor)control;
            value = htmlEditor.Text;
            if (!htmlEditor.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(htmlEditor.ID.Substring(htmlEditor.ID.IndexOf("_") + 1));
            }
        }
        return("");
    }