Пример #1
0
    public TextField(Column c, string v)
    {
        this.ID = c.ColumnName;

        this.panel = Builder.GetPanel(c);
        TableCell cell2 = ((System.Web.UI.WebControls.Table)panel.Controls[0]).Rows[0].Cells[1];
        TextBox   txt   = new TextBox();

        txt.ID              = this.ID + "_value";
        txt.CssClass        = "TextBox";
        txt.ValidationGroup = "modify";
        txt.Text            = v;
        if (c.ImgWidth != 0)
        {
            txt.Width = new Unit(c.ImgWidth);
        }
        if (!string.IsNullOrEmpty(c.StringFormat))
        {
            txt.Text = string.Format(c.StringFormat, txt.Text);
        }
        cell2.Controls.Add(txt);

        if (c.Required)
        {
            cell2.Controls.Add(Validatas.GetRequired(c));
        }
        if (c.Range)
        {
            cell2.Controls.Add(Validatas.GetRange(c));
        }
    }
Пример #2
0
    public DateTimeField(Column c, string v)
    {
        this.ID = c.ColumnName;

        this.panel = Builder.GetPanel(c);
        TableCell cell2 = ((System.Web.UI.WebControls.Table)panel.Controls[0]).Rows[0].Cells[1];
        TextBox   txt   = new TextBox();

        txt.ID              = this.ID + "_value";
        txt.CssClass        = "DateTime";
        txt.ValidationGroup = "modify";
        if (!string.IsNullOrEmpty(v))
        {
            txt.Text = v;
        }
        else
        {
            txt.Text = DateTime.Now.ToString();
        }
        txt.ReadOnly = true;

        string scripttxt = "$(document).ready(function() {Date.format = 'yyyy-mm-dd';$(function(){$('#" + c.ColumnName + "_value" + "').datePicker({ startDate: '1996-01-01' });});});";
        //string scripttxt = "$(document).ready(function() {$(\"#" + c.ColumnName + "_values\").datepicker();}";
        Literal lit = Builder.GetScirpt(c, scripttxt);

        if (!string.IsNullOrEmpty(c.StringFormat))
        {
            txt.Text = string.Format(c.StringFormat, DateTime.Parse(txt.Text));
        }
        else
        {
            txt.Text = DateTime.Parse(txt.Text).ToString();
        }
        cell2.Controls.Add(txt);
        //cell2.Controls.Add(btn);
        //cell2.Controls.Add(html);
        cell2.Controls.Add(lit);

        if (c.Required)
        {
            cell2.Controls.Add(Validatas.GetRequired(c));
        }
        if (c.Range)
        {
            cell2.Controls.Add(Validatas.GetRange(c));
        }
    }
Пример #3
0
    public EditorField(Column c, string v)
    {
        this.ID = c.ColumnName;

        this.panel = Builder.GetPanel(c);
        TableCell cell2 = ((System.Web.UI.WebControls.Table)panel.Controls[0]).Rows[0].Cells[1];

        FredCK.FCKeditorV2.FCKeditor editor = new FredCK.FCKeditorV2.FCKeditor();
        editor.ID     = c.ColumnName + "_value";
        editor.Value  = v;
        editor.Height = 460;


        cell2.Controls.Add(editor);//把编辑器对象添加到页面上。

        if (c.Required)
        {
            cell2.Controls.Add(Validatas.GetRequired(c));
        }
    }
Пример #4
0
    public TemplateFields(Column c, string v, Control ctrl)
    {
        this.ID = c.ColumnName;

        this.panel = Builder.GetPanel(c);
        TableCell   cell2 = ((System.Web.UI.WebControls.Table)panel.Controls[0]).Rows[0].Cells[1];
        HiddenField hide  = new HiddenField();

        hide.Value = v;
        hide.ID    = c.ColumnName + "_hide";
        ctrl.ID    = c.ColumnName + "_template";
        cell2.Controls.Add(hide);
        cell2.Controls.Add(ctrl);

        if (c.Required)
        {
            cell2.Controls.Add(Validatas.GetRequired(c));
        }
        if (c.Range)
        {
            cell2.Controls.Add(Validatas.GetRange(c));
        }
    }