Exemple #1
0
        public void Save()
        {
            FastTrackPage page = this.Page as FastTrackPage;

            if (page != null)
            {
                PropertyInfo property = page.GetPropertyInfo(propertyName);
                if (property != null)
                {
                    if (page.IsReadOnlyProperty(property.Name))
                    {
                        return;
                    }
                }

                try
                {
                    object obj = page.SelectedObject;

                    if (obj != null)
                    {
                        if (property != null)
                        {
                            Type type = property.PropertyType;

                            page.SetPropertyValue(propertyName, Convert.ChangeType(this.Text, type));
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);

            FastTrackPage page = this.Page as FastTrackPage;

            if (page != null)
            {
                PropertyInfo property = page.GetPropertyInfo(page.SelectedPropertyName);
                if (property != null)
                {
                    if (page.IsListProperty(property.Name))
                    {
                        IList list = (IList)page.GetPropertyValue(property.Name);
                        list.Add(obj);
                    }
                    else
                    {
                        page.SetPropertyValue(property.Name, obj);
                    }

                    page.SaveObject(page.SelectedObject);

                    page.Response.Redirect(page.GetEditUrl(page.SelectedObject, ""));
                }
            }
        }
Exemple #3
0
        public void Initialize()
        {
            if (initialized)
            {
                return;
            }
            initialized = true;

            FastTrackPage page = this.Page as FastTrackPage;

            if (page != null)
            {
                PropertyInfo property = page.GetPropertyInfo(propertyName);
                if (property != null)
                {
                    if (page.IsReadOnlyProperty(property.Name))
                    {
                        this.ReadOnly = true;
                    }
                }

                if (!Page.IsPostBack)
                {
                    object value = page.GetPropertyValue(propertyName);

                    if (value != null)
                    {
                        this.Text = value.ToString();
                    }
                }
            }
        }
Exemple #4
0
        public void Save()
        {
            FastTrackPage page = this.Page as FastTrackPage;

            if (page != null)
            {
                PropertyInfo property = page.GetPropertyInfo(propertyName);
                if (property != null)
                {
                    if (page.IsReadOnlyProperty(property.Name))
                        return;
                }

                page.SetPropertyValue(propertyName, this.SelectedDate);
            }
        }
        public void Save()
        {
            FastTrackPage page = this.Page as FastTrackPage;

            if (page != null)
            {
                PropertyInfo property = page.GetPropertyInfo(propertyName);
                if (property != null)
                {
                    if (page.IsReadOnlyProperty(property.Name))
                    {
                        return;
                    }
                }

                page.SetPropertyNullStatus(propertyName, this.Checked);
            }
        }
Exemple #6
0
        public void Save()
        {
            FastTrackPage page = this.Page as FastTrackPage;

            if (page != null)
            {
                PropertyInfo property = page.GetPropertyInfo(propertyName);
                if (property != null)
                {
                    if (page.IsReadOnlyProperty(property.Name))
                    {
                        return;
                    }
                }

                page.SetPropertyValue(propertyName, Enum.Parse(property.PropertyType, this.SelectedItem.Text));
            }
        }
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);

            FastTrackPage page = this.Page as FastTrackPage;

            if (page != null)
            {
                PropertyInfo property = page.GetPropertyInfo(propertyName);
                if (property != null)
                {
                    Type type = property.PropertyType;
                    if (page.IsListProperty(property.Name))
                    {
                        type = page.GetListPropertyItemType(property.Name);
                    }
                    page.Response.Redirect(page.GetListUrl(type, this.listUrl, page.SelectedObject, propertyName));
                }
            }
        }
Exemple #8
0
        public void Initialize()
        {
            if (initialized)
            {
                return;
            }
            initialized = true;

            FastTrackPage page = this.Page as FastTrackPage;

            if (page != null)
            {
                if (!Page.IsPostBack)
                {
                    object value = page.GetPropertyValue(propertyName);

                    PropertyInfo property = page.GetPropertyInfo(propertyName);
                    if (property != null)
                    {
                        Type type = property.PropertyType;

                        Array values = Enum.GetValues(type);

                        foreach (object enumValue in values)
                        {
                            ListItem item = new ListItem(Enum.GetName(type, enumValue), enumValue.ToString());
                            this.Items.Add(item);
                            if (value != null)
                            {
                                if (value.Equals(enumValue))
                                {
                                    item.Selected = true;
                                }
                            }
                        }
                    }
                }
            }
        }