public override void SetValue(LayoutE layout, ItemAttribute ia) { TextMode = TextBoxMode.MultiLine; Height = 200; base.SetValue(layout, ia); }
public virtual ItemAttribute GetValue(ItemAttributes list, ItemAttribute ia) { ItemAttributes list2 = new ItemAttributes(ia.Cxt, ia.TableName, ia.ItemID, ia.AttributeID); foreach (ListItem li in Items) { bool contains = list2.Contains(ia.AttributeID, li.Value); if (li.Selected && !contains) // selected but no in db { ItemAttribute.AddToList(list, ia.ItemID, ia.AttributeID, li.Value); } else if (!li.Selected && contains) // not selected but in db { ItemAttribute iax = list2.Get(ia.AttributeID, li.Value); list.DataTable.ImportRow(iax.DataRow); DataRow row = list.DataTable.Rows[list.DataTable.Rows.Count - 1]; row.AcceptChanges(); row.Delete(); // mark deleted } } return null; }
private void InitControl(LayoutE layout, ItemAttribute ia) { Enabled = layout != LayoutE.View; Visible = true; ia.Attribute.Kvs.SetProperties(this); }
public virtual ItemAttribute GetValue(ItemAttributes list, ItemAttribute ia) { ia.Value1 = Text; list.Add(ia); return ia; }
public ItemAttribute GetValue(ItemAttributes list, ItemAttribute ia) { ia.Value1 = Value; list.Add(ia); return ia; }
private void InitControl(LayoutE layout, ItemAttribute ia) { Enabled = layout != LayoutE.View; Visible = true; DataValueField = "AttributeID"; DataTextField = "Name"; DataSource = ia.Attribute.Children.DataTable; DataBind(); }
public virtual void SetValue(LayoutE layout, ItemAttribute ia) { if (layout == LayoutE.Edit && ia.IsNew) { Value = ia.DefaultValue; } else { Value = ia.Value1; } }
public virtual void SetValue(LayoutE layout, ItemAttribute ia) { if (!Page.IsPostBack) { InitControl(layout, ia); } ListItem li = Items.FindByValue(ia.Value1); if (li != null) { li.Selected = true; } }
private void InitControl(LayoutE layout, ItemAttribute ia) { Items.Clear(); if (StartYear == 0) { StartYear = DateTime.Now.Year + StartYearFromCurrent; if (StartYearCurrent) { StartYear = DateTime.Now.Year; } } if (EndYear == 0) { EndYear = DateTime.Now.Year + EndYearFromCurrent; if (EndYearCurrent) { EndYear = DateTime.Now.Year; } } if (EndYear < StartYear) { throw new Exception("EndYear [" + EndYear + "] can not be less than StartYear [" + StartYear + "]"); } for (int i = StartYear; i <= EndYear; i++) { base.Items.Add(new ListItem(i.ToString(), i.ToString())); } if (SelectCurrentYear) { ListItem item = new ListItem(DateTime.Now.Year.ToString(), DateTime.Now.Year.ToString()); if (Items.Contains(item)) { SelectedIndex = Items.IndexOf(item); } } DefaultItemText = "Select Year"; DefaultItemValue = ""; }
public virtual void SetValue(LayoutE layout, ItemAttribute ia) { if (!Page.IsPostBack) { InitControl(layout, ia); } ItemAttributes list = new ItemAttributes(ia.Cxt, ia.TableName, ia.ItemID, ia.AttributeID); for (int i = 0; i < list.Count; i++) { ItemAttribute iax = new ItemAttribute(ia.Cxt, list[i]); ListItem li = Items.FindByValue(iax.Value1); if (li != null) { li.Selected = true; } } }
public virtual void GetFilter(SearchQuery q, ItemAttribute ia) { GetFilter(q, ia, Items); }
public virtual string GetText(ItemAttribute ia) { return RsDropDownList.GetTextControl(ia); }
public virtual void GetFilter(SearchQuery q, ItemAttribute ia) { RsDropDownList.GetFilter(q, ia, SelectedValue); }
public virtual string GetText(ItemAttribute ia) { return ia.Value1; }
public virtual string GetText(ItemAttribute ia) { return ia.Value1 == "1" ? "(x)" : "( )"; }
public override string GetText(ItemAttribute ia) { return base.GetText(ia).Replace(Environment.NewLine, "<br/>"); }
public virtual void SetValue(LayoutE layout, ItemAttribute ia) { if (layout == LayoutE.Edit && ia.IsNew) { } else { } }
public virtual void GetFilter(SearchQuery q, ItemAttribute ia) { return; }
public virtual void SetValue(LayoutE layout, ItemAttribute ia) { ImageUrl = ia.Attribute.UrlAttributeImage; }
public override void GetFilter(SearchQuery q, ItemAttribute ia) { base.GetFilter(q, ia); }
public virtual void GetFilter(SearchQuery q, ItemAttribute ia) { RsTextBox.GetFilter(q, ia, Value); }
public static void GetFilter(SearchQuery q, ItemAttribute ia, ListItemCollection items) { string filter = ""; string pid = ""; foreach (ListItem item in items) { if (item.Selected) { pid = q.NextParamId; filter = BaseItem.FilterOr(filter, UStr.FilterInt32("AttributeID", pid)); q.SetParam(pid, item.Value); } } if (String.IsNullOrEmpty(filter)) { return; } filter = BaseItem.TrimOr(filter); q.AppendFilter(filter + "\n"); }
public override ItemAttribute GetValue(ItemAttributes list, ItemAttribute ia) { return base.GetValue(list, ia); }
public virtual string GetText(ItemAttribute ia) { StringBuilder s = new StringBuilder(); if (!Page.IsPostBack) { InitControl(LayoutE.Edit, ia); } ItemAttributes list = new ItemAttributes(ia.Cxt, ia.TableName, ia.ItemID, ia.AttributeID); for (int i = 0; i < list.Count; i++) { ItemAttribute iax = new ItemAttribute(ia.Cxt, list[i]); ListItem li = Items.FindByValue(iax.Value1); // TODO: don't use ListItem here s.AppendLine("[" + (li != null ? "√" : " ") + "] " + li.Text); } return s.ToString(); }
public override string GetText(ItemAttribute ia) { return base.GetText(ia); }
public virtual void SetValue(LayoutE layoutID, ItemAttribute ia) { }
public virtual void SetValue(LayoutE layoutID, ItemAttribute ia) { SetValue(ia.UrlFile(ShowNoImage)); }
public virtual string GetText(ItemAttribute ia) { return ia.Value1 == "1" ? "[√]" : "[ ]"; }
public virtual string GetText(ItemAttribute ia) { return ia.Name; }
public virtual void SetValue(LayoutE layout, ItemAttribute ia) { CausesValidation = true; Width = new Unit(99, UnitType.Percentage); MaxLength = ia.Attribute.ConfigAttributes.ToInt32(AttributeE.AttributeMaxLength); if (layout == LayoutE.Edit && ia.IsNew) { Text = ia.DefaultValue; } else { Text = ia.Value1; } }