public void DeleteEntryTest(TicketData td, UserData ud) { DataEditor dataEditor = new DataEditor(); var result = dataEditor.DeleteEntry(td.EntryId.ToString(), ud); Assert.IsTrue(result); }
public void MapBG_Edit(object element, ClassBoxViewModel.EditElementOp op) { string elementName = "MapBG"; DataEditForm frmData = new DataEditForm(); frmData.Title = DataEditor.GetWindowTitle(ZoneManager.Instance.CurrentGround.AssetName, elementName, element, typeof(MapBG), new object[0]); DataEditor.LoadClassControls(frmData.ControlPanel, ZoneManager.Instance.CurrentGround.AssetName, elementName, typeof(MapBG), new object[0], element, true); frmData.SelectedOKEvent += () => { element = DataEditor.SaveClassControls(frmData.ControlPanel, elementName, typeof(MapBG), new object[0], true); op(element); frmData.Close(); }; frmData.SelectedCancelEvent += () => { frmData.Close(); }; DevForm form = (DevForm)DiagManager.Instance.DevEditor; form.GroundEditForm.RegisterChild(frmData); frmData.Show(); }
public DataEditor GetDataEditorForFile(ProjectFile file) { var vm = new DataEditor_ViewModel(this, file); var win = new DataEditor(vm); return(win); }
public void TextureMap_EditItem(object key, object element, DictionaryBoxViewModel.EditElementOp op) { string elementName = "TextureMap[" + key.ToString() + "]"; DataEditForm frmData = new DataEditForm(); frmData.Title = DataEditor.GetWindowTitle(ZoneManager.Instance.CurrentMap.AssetName, elementName, element, typeof(AutoTile), new object[0]); DataEditor.LoadClassControls(frmData.ControlPanel, ZoneManager.Instance.CurrentMap.AssetName, elementName, typeof(AutoTile), new object[0], element, true); frmData.SelectedOKEvent += () => { element = DataEditor.SaveClassControls(frmData.ControlPanel, elementName, typeof(AutoTile), new object[0], true); op(key, element); frmData.Close(); }; frmData.SelectedCancelEvent += () => { frmData.Close(); }; DevForm form = (DevForm)DiagManager.Instance.DevEditor; form.MapEditForm.RegisterChild(frmData); frmData.Show(); }
static void Main(string[] args) { while (true) { LoginMenu NewMenu = new LoginMenu(); User User = NewMenu.LoginScreen(); if (User.Rank == UserRank.SuperAdmin) { SuperAdmin User1 = new SuperAdmin(User.Username, UserRank.SuperAdmin); Menus NewMenu1 = new Menus(); NewMenu1.SuperAdminMenu(User1); } else if (User.Rank == UserRank.SuperUser) { SuperUser User1 = new SuperUser(User.Username, UserRank.SuperUser); Menus NewMenu2 = new Menus(); NewMenu2.SuperUserMenu(User1); } else if (User.Rank == UserRank.DataEditor) { DataEditor User1 = new DataEditor(User.Username, UserRank.DataEditor); Menus NewMenu3 = new Menus(); NewMenu3.DataEditorMenu(User1); } else { DataViewer User1 = new DataViewer(User.Username, UserRank.DataViewer); Menus NewMenu4 = new Menus(); NewMenu4.DataViewerMenu(User1); } } }
/// <summary> /// Adds the JS required for the DataType Grid /// </summary> /// <param name="ctl">The grid control.</param> public static void AddJsDtgClientDependencies(this DataEditor ctl) { ctl.RegisterEmbeddedClientResource("uComponents.DataTypes.DataTypeGrid.Scripts.jquery.dataTables.min.js", ClientDependencyType.Javascript); ctl.RegisterEmbeddedClientResource("uComponents.DataTypes.Shared.Resources.Scripts.jquery.ucomponents.js", ClientDependencyType.Javascript); ctl.RegisterEmbeddedClientResource("uComponents.DataTypes.Shared.Resources.Scripts.jquery.ucomponents.dictionary.js", ClientDependencyType.Javascript); ctl.RegisterEmbeddedClientResource("uComponents.DataTypes.DataTypeGrid.Scripts.DTG_DataEditor.js", ClientDependencyType.Javascript); }
public void Events_EditItem(int index, object element, CollectionBoxViewModel.EditElementOp op) { string elementName = "Events[" + index + "]"; DataEditForm frmData = new DataEditForm(); frmData.Title = DataEditor.GetWindowTitle(ZoneManager.Instance.CurrentMap.AssetName, elementName, element, typeof(SingleCharEvent), new object[0]); DataEditor.LoadClassControls(frmData.ControlPanel, ZoneManager.Instance.CurrentMap.AssetName, elementName, typeof(SingleCharEvent), new object[0], element, true); frmData.SelectedOKEvent += () => { element = DataEditor.SaveClassControls(frmData.ControlPanel, elementName, typeof(SingleCharEvent), new object[0], true); op(index, element); frmData.Close(); }; frmData.SelectedCancelEvent += () => { frmData.Close(); }; DevForm form = (DevForm)DiagManager.Instance.DevEditor; form.MapEditForm.RegisterChild(frmData); frmData.Show(); }
private void editNonSpellDataToolStripMenuItem_Click(object sender, EventArgs e) { DataEditor DE = new DataEditor(); DE.InitializeComponent(); DE.Show(); }
private void buttonOK_Click(object sender, EventArgs e) { try { if (listBox1.SelectedIndex >= 0) { DataEditor de = (DataEditor)Activator.CreateInstance((Type)(listBox1.Items[listBox1.SelectedIndex])); DlgSetEditorAttributes dlg = de.GetDataDialog(SelectedEditor); if (dlg != null) { dlg.SetEditorAttributes(SelectedEditor); if (dlg.ShowDialog(this) == DialogResult.OK) { SetSelection(de); this.DialogResult = DialogResult.OK; } } else { this.DialogResult = DialogResult.OK; } } } catch (Exception err) { MessageBox.Show(err.Message); } }
/// <summary> /// Posts edited ticket data entry to DataEditor service /// </summary> /// <param name="td">TicketData instance from edit form</param> /// <returns>Index View</returns> public async Task <ViewResult> PostEdit(TicketData td) { try { Authorize(); } catch (HttpResponseException e) { return(View("Error", Utility.CreateHttpErrorView(e, "You do not have the permissions to view this page"))); } try { DataEditor de = new DataEditor(); UserData loggedInUser = Auth0APIClient.GetUserData(User.Claims.First().Value); de.PostEditor(td, loggedInUser); RecordRetriever rr = new RecordRetriever(); var res = rr.RetrieveRecords(1000); return(View("Index", res)); } catch (HttpResponseException e) { ServerErrorViewModel error = await Utility.CreateServerErrorView(e); return(View("ServerError", error)); } catch (Exception e) { var guid = ExceptionReporter.DumpException(e); ErrorViewModel error = Utility.CreateBasicExceptionView(e, guid); return(View("Error", error)); } }
protected override void OnClone(DataEditor cloned) { base.OnClone(cloned); WebDataEditor wd = cloned as WebDataEditor; wd.SetHolder(_holder); }
private void DE_CellChanged(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0 && e.RowIndex != -1) { _dataEditorHelper.MultyCheck(e.RowIndex); DataEditor.CommitEdit(DataGridViewDataErrorContexts.Commit); } }
public override DlgSetEditorAttributes GetDataDialog(DataEditor current) { if (DataEditor.DelegateGetCheckedListDialog != null) { return(DataEditor.DelegateGetCheckedListDialog(current, this)); } return(null); }
public Controller() { db = new DataAccess(); customers = new BindingList <Customer>(); manager = new DataEditor(); OutputBox_list = new BindingList <string>(); EventsLog = new BindingList <string>(); }
public override void SetEditorAttributes(DataEditor current) { DataEditorLookupDB ddb = current as DataEditorLookupDB; if (ddb != null) { } }
public void Modify(ulong guildId, DataEditor modifier) { _guildData.LockedRef(coll => { var data = GetData(guildId); modifier(data); Save(data); }); }
protected override void OnClone(DataEditor cloned) { DataEditorDatetime ed = cloned as DataEditorDatetime; if (ed != null) { ed.UseLargeDialogue = this.UseLargeDialogue; } }
public override DlgSetEditorAttributes GetDataDialog(DataEditor current) { DataEditorDatetime ded = current as DataEditorDatetime; if (ded == null) { ded = new DataEditorDatetime(); } return(new DlgSelectorOptionDateTime(ded)); }
protected override void OnClone(DataEditor cloned) { DataEditorLookupDB obj = cloned as DataEditorLookupDB; obj._qry = (EasyQuery)Query.Clone(); if (valuesMaps != null) { obj.valuesMaps = (DataBind)valuesMaps.Clone(); } }
protected override void OnDrawItem(DrawItemEventArgs e) { if (e.Index >= 0 && e.Index < this.Items.Count) { bool selected = ((e.State & DrawItemState.Selected) != 0); DataEditor item = this.Items[e.Index] as DataEditor; if (item != null) { Rectangle rcBK = new Rectangle(e.Bounds.Left, e.Bounds.Top, 1, this.ItemHeight); if (e.Bounds.Width > this.ItemHeight) { rcBK.Width = e.Bounds.Width - this.ItemHeight; rcBK.X = this.ItemHeight; if (selected) { e.Graphics.FillRectangle(Brushes.LightBlue, rcBK); } else { e.Graphics.FillRectangle(Brushes.White, rcBK); } } Rectangle rc = new Rectangle(e.Bounds.Left, e.Bounds.Top, this.ItemHeight, this.ItemHeight); float w = (float)(e.Bounds.Width - this.ItemHeight); if (w > 0) { RectangleF rcf = new RectangleF((float)(rc.Left + this.ItemHeight + 2), (float)(rc.Top), w, (float)this.ItemHeight); if (selected) { e.Graphics.DrawString(item.ToString(), this.Font, Brushes.White, rcf); } else { e.Graphics.DrawString(item.ToString(), this.Font, Brushes.Black, rcf); } } e.Graphics.DrawImage(item.Icon, rc); } else { if (selected) { e.Graphics.FillRectangle(Brushes.LightBlue, e.Bounds); } else { e.Graphics.FillRectangle(Brushes.White, e.Bounds); } if (this.Items[e.Index] != null) { e.Graphics.DrawString(this.Items[e.Index].ToString(), this.Font, Brushes.Black, e.Bounds.Left, e.Bounds.Top); } } } }
public DlgEditNameValueList(DataEditor editor) : base(editor) { InitializeComponent(); WebDataEditorLookup delk = editor as WebDataEditorLookup; if (delk != null) { LoadData(delk.values); } }
public static DlgSetEditorAttributes GetDatabaseLookupDataDialog(DataEditor current, DataEditor caller) { DataEditorLookupDB dbe0 = caller as DataEditorLookupDB; if (dbe0 != null) { DataEditorLookupDB dbe = current as DataEditorLookupDB; if (dbe == null) { dbe = new DataEditorLookupDB(); dbe.valuesMaps.AdditionalJoins = dbe0.valuesMaps.AdditionalJoins; } else { if (dbe0.valuesMaps.AdditionalJoins != null) { for (int i = 0; i < dbe0.valuesMaps.AdditionalJoins.Count; i++) { if (string.IsNullOrEmpty(dbe0.valuesMaps.AdditionalJoins[i].Source)) { string val = dbe.valuesMaps.GetMappedField(dbe0.valuesMaps.AdditionalJoins[i].Target); if (!string.IsNullOrEmpty(val)) { dbe0.valuesMaps.AdditionalJoins[i].Source = val; } } } dbe.valuesMaps.AdditionalJoins = dbe0.valuesMaps.AdditionalJoins; } } return(new DlgDataEditDatabaseLookup(dbe)); } else { WebDataEditorLookupDB wd0 = caller as WebDataEditorLookupDB; if (wd0 != null) { WebDataEditorLookupDB wd = current as WebDataEditorLookupDB; if (wd == null) { wd = (WebDataEditorLookupDB)wd0.Clone(); } else { if (wd0.FieldsMap != null) { wd.FieldsMap = wd0.FieldsMap; } } return(new DlgDataEditDatabaseLookup(wd)); } } return(null); }
public XiliumMarkdownDeepFormatter(DataEditor dataEditor, Options options) : base(dataEditor, options) { this._instance = new Xilium.MarkdownDeep.Markdown(); this._instance.SafeMode = this.Options.SafeMode; this._instance.ExtraMode = this.Options.ExtraMode; this._instance.MarkdownInHtml = this.Options.MarkdownInHtml; this._instance.AutoHeadingIDs = this.Options.AutoHeadingIDs; this._instance.NewWindowForExternalLinks = this.Options.NewWindowForExternalLinks; this._instance.NewWindowForLocalLinks = this.Options.NewWindowForLocalLinks; this._instance.NoFollowLinks = this.Options.NoFollowLinks; }
protected override void OnClone(DataEditor cloned) { base.OnClone(cloned); WebDataEditorLookupDB obj = (WebDataEditorLookupDB)cloned; obj.SqlString = SqlString; if (FieldsMap != null) { obj.FieldsMap = (StringMapList)FieldsMap.Clone(); } obj.ConnectionID = ConnectionID; }
protected override void OnClone(DataEditor cloned) { DataEditorLookup obj = cloned as DataEditorLookup; if (values != null) { obj.values = new string[values.Length]; for (int i = 0; i < values.Length; i++) { obj.values[i] = values[i]; } } }
private void btn_CopyFiles_Click(object sender, EventArgs e) { DataEditor.CommitEdit(DataGridViewDataErrorContexts.Commit); if (String.IsNullOrEmpty(tb_Out.Text)) { btn_SelOut_Click(sender, e); } _fileProcessor.CopyFiles(); //TaskProgressForm form = new TaskProgressForm(); //form.ShowDialog(); }
public static DlgSetEditorAttributes GetCheckedListDataDialog(DataEditor current, DataEditor caller) { WebDataEditorCheckedListbox c = current as WebDataEditorCheckedListbox; WebDataEditorCheckedListbox u = caller as WebDataEditorCheckedListbox; if (c == null) { c = (WebDataEditorCheckedListbox)caller.Clone(); } DlgDataEditorCheckedListbox dlg = new DlgDataEditorCheckedListbox(c); return(dlg); }
private void onClose() { int n = SelectedIndex; if (n >= 0) { Selector = Items[n] as DataEditor; } else { Selector = null; } _edSvc.CloseDropDown(); }
protected override void OnClone(DataEditor cloned) { base.OnClone(cloned); WebDataEditorLookup obj = cloned as WebDataEditorLookup; if (values != null) { obj.values = new Dictionary <string, string>(); foreach (KeyValuePair <string, string> kv in values) { obj.values.Add(kv.Key, kv.Value); } } }
public void SetSelection(DataEditor editor) { if (editor != null) { Type t = editor.GetType(); for (int i = 0; i < Items.Count; i++) { if (t.Equals(Items[i].GetType())) { SelectedIndex = i; break; } } } }
/// <summary> /// Initializes a new instance of the <see cref="DataTypeLoadEventArgs"/> class. /// </summary> /// <param name="grid">The grid.</param> /// <param name="container">The container.</param> public DataTypeLoadEventArgs(DataEditor grid, Control container) { this.Grid = grid; this.Container = container; }
/// <summary> /// Initializes a new instance of the <see cref="DataTypeSaveEventArgs" /> class. /// </summary> /// <param name="grid">The grid.</param> /// <param name="action">The action.</param> public DataTypeSaveEventArgs(DataEditor grid, DataTypeAction action) { this.Grid = grid; this.Action = action; }