public Columns.Item AddItemColumn(String Name, String Label, Int32 Width, Model.Query Query) { Columns.Item col = new Columns.Item(this, Name, Label, Width, Query); col.PropertyChanged += Column_PropertyChanged; this.Columns.Add(col); return(col); }
static void Main(string[] args) { // Connect to Server Model.Server server = new Model.Server("http://localhost/11SP9"); // Load Solution server.LoadAssembly("Aras.Model.Design"); // Get Database Model.Database database = server.Database("Development"); // Start Session Model.Session session = database.Login("admin", IO.Server.PasswordHash("innovator")); // Find Document Model.Query docquery = session.Query("Document"); docquery.Select = "item_number,name,description"; Model.Design.Document document = (Model.Design.Document)docquery.Store.First(); using (Transaction trans = session.BeginTransaction()) { document.Update(trans); document.Name = "Test"; trans.Commit(true); } }
private void SelectValue() { if (this.Dialog == null) { if (this.Binding != null) { // Create Search Dialog this.Dialog = new Dialogs.Search(this, ((Model.Properties.Item) this.Binding).Store); } else { Model.Query query = this.Session.Model.Query(((Model.PropertyTypes.Item) this.PropertyType).ValueType); query.Select = ((Model.PropertyTypes.Item) this.PropertyType).ValueType.SearchSelect + ",keyed_name"; // Create Search Dialog this.Dialog = new Dialogs.Search(this, query.Store); } // Watch for changes in selection this.Dialog.Grid.Selected.ListChanged += Selected_ListChanged; } // Open Search Dialog this.Dialog.Open = true; }
internal override Boolean MatchQuery(Model.Query Query) { if (((Model.Queries.Relationship)Query).Parent.BranchID.Equals(this.ParentBranchID)) { return(base.MatchQuery(Query)); } else { return(false); } }
public Column AddColumn(Model.PropertyType PropertyType, Model.Query Query) { Column ret = null; switch (PropertyType.GetType().Name) { case "Boolean": ret = this.AddBooleanColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Date": ret = this.AddDateColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Decimal": ret = this.AddDecimalColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Federated": ret = this.AddFederatedColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Integer": ret = this.AddIntegerColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Item": ret = this.AddItemColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth, Query); break; case "List": ret = this.AddListColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Sequence": ret = this.AddSequenceColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "String": ret = this.AddStringColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Text": ret = this.AddTextColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; default: throw new Model.Exceptions.ArgumentException("PropertyType not implemented: " + PropertyType.GetType().Name); } return(ret); }
protected override void AfterBindingChanged() { base.AfterBindingChanged(); // Reset Query this._query = null; // Load Columns this.LoadColumns(); // Load Rows this.RefreshControl(); }
internal virtual Boolean MatchQuery(Model.Query Query) { if (this.Superceded == -1) { if (Query.Condition != null) { return(this.MatchCondition(Query.Condition)); } else { return(true); } } else { return(false); } }
private void QueriesForm_FormClosing(object sender, FormClosingEventArgs e) { var result = MessageBox.Show("Сохранить?", "Закрытие формы", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result == DialogResult.Cancel) { e.Cancel = true; return; } if (result == DialogResult.Yes) { Query query = new Model.Query(this.QueryName); //add selected attr + joins var selectedAttributes = listBoxSelected.Items.Cast <string>().ToArray(); var joinedTables = listBoxJoins.Items.Cast <string>().ToArray(); query.QueryText = "" + string.Join(",", selectedAttributes) + "|" + string.Join(",", joinedTables); //add where clause query.QueryText += "|" + cmbItems1.SelectedIndex + "," + cmbOperations1.SelectedIndex + "," + txbValues1.Text + "," + cmbJoins1.SelectedIndex; query.QueryText += "|" + cmbItems2.SelectedIndex + "," + cmbOperations2.SelectedIndex + "," + txbValues2.Text + "," + cmbJoins2.SelectedIndex; query.QueryText += "|" + cmbItems3.SelectedIndex + "," + cmbOperations3.SelectedIndex + "," + txbValues3.Text + ","; if (needToAdd) { metaDbContainer.QuerySet.Add(query); metaDbContainer.SaveChanges(); } else { var oldQuery = metaDbContainer.QuerySet.Where(x => x.Name == query.Name).FirstOrDefault(); metaDbContainer.QuerySet.Remove(oldQuery); metaDbContainer.QuerySet.Add(query); metaDbContainer.SaveChanges(); } } ((MainForm)Parent.Parent).LoadTreeView(); }
internal Item(Grid Grid, System.String Name, System.String Label, Int32 Width, Model.Query Query) : base(Grid, Name, Label, Width) { this.Query = Query; }