private void toolStripButtonEdit_Click(object sender, EventArgs e) { int ret = Errors.SUCCESS; log.Debug("-- toolStripButtonEdit_Click()"); this.actionBeforeStartDisableAllActions(); log.Debug("lpa: " + ProfileManagerBusinessLayer.listProfileViewToString(this.lpa)); log.Debug("lpd: " + ProfileManagerBusinessLayer.listProfileViewToString(this.lpd)); ProfileViewData pvd = getSelected(this.lpa, this.lpd); ProfileViewData newProf = new ProfileViewData(); FormProfileEditor editor = new FormProfileEditor(); editor.ShowDialog(); if (!editor.wasCancelled()) { newProf.name = editor.getName(); newProf.color = editor.getColor(); if (pvd != null) { string errMsg = ""; ret = this.managerBusinessLayer.action_updateProfile(newProf, pvd, out errMsg); this.analyzeReturn(ret, errMsg); } // * POST ACTION FORM UPDATE this.postActionUpdate(); this.updateToolStripButtons(); } else { log.Debug("** Edit process was CANCELLED!"); } }
private void fillDataGrids() { log.Debug("-- fillDataGrids"); if (ENABLE_TESTING) { this.lpd = this.managerBusinessLayer.test_getDesactivated(0); this.lpa = this.managerBusinessLayer.test_getActive(0); } else { this.managerBusinessLayer.reloadProfiles(); this.lpd = this.managerBusinessLayer.getDesactivatedProfiles(); this.lpa = this.managerBusinessLayer.getActiveProfiles(); log.Debug("fillDataGrids >> lpd:" + ProfileManagerBusinessLayer.listProfileViewToString(this.lpd)); log.Debug("fillDataGrids >> lpa:" + ProfileManagerBusinessLayer.listProfileViewToString(this.lpa)); } // update allowed actions this.bindingSourceActive.DataSource = this.lpa; this.bindingSourceDesactivated.DataSource = this.lpd; this.loadDatagrid(ref this.dataGridViewDesactivated, ref this.bindingSourceDesactivated, ref this.panelDesactivatedGrid, ref lpd, this.dataGridViewDesactivated_CellMouseClick); this.loadDatagrid(ref this.dataGridViewActive, ref this.bindingSourceActive, ref this.panelActivatedGrid, ref lpa, this.dataGridViewActive_CellMouseClick); this.updateToolStripButtons(); }