protected void saveData(CommandEvent evt) { List<Filter> list = new List<Filter>(); foreach(DataGridViewRow row in dgvCEFilters.Rows) { if(row.IsNewRow) { continue; } list.Add(new Filter() { Guid = (string)row.Cells[dgvCEFiltersColumnGuid.Name].Value, CustomIn = (string)row.Cells[dgvCEFiltersColumnCustomIn.Name].Value, CustomOut = (string)row.Cells[dgvCEFiltersColumnCustomOut.Name].Value, Description = (string)row.Cells[dgvCEFiltersColumnDescription.Name].Value, Id = Convert.ToInt32(row.Cells[dgvCEFiltersColumnId.Name].Value), Cancel = Convert.ToBoolean(row.Cells[dgvCEFiltersColumnCancel.Name].Value), Pre = Convert.ToBoolean(row.Cells[dgvCEFiltersColumnPre.Name].Value), Post = Convert.ToBoolean(row.Cells[dgvCEFiltersColumnPost.Name].Value), }); } evt.Filters = list.ToArray(); }
protected void commandEvent(CommandEvent item) { try { if(cmd.exec(item, SolutionEventType.CommandEvent)) { Log.Info("[CommandEvent] finished: '{0}'", item.Caption); } Status._.add(SolutionEventType.CommandEvent, StatusType.Success); } catch(Exception ex) { Log.Error("CommandEvent error: '{0}'", ex.Message); } Status._.add(SolutionEventType.CommandEvent, StatusType.Fail); }
protected void renderData(CommandEvent evt) { dgvCEFilters.Rows.Clear(); if(evt.Filters == null) { return; } foreach(IFilter f in evt.Filters) { dgvCEFilters.Rows.Add(f.Guid, f.Id, f.CustomIn, f.CustomOut, f.Description, f.Cancel, f.Pre, f.Post); } }