/// <summary> /// Handles the Click event of the BtnAdd control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void BtnAdd_Click(object sender, EventArgs e) { var frmEditMediaPath = new FrmEditMediaPath(FrmEditMediaPath.MediaPathActionType.Add, new MediaPathModel()); frmEditMediaPath.ShowDialog(this); grdViewMain.RefreshData(); // ButRefresh_Click(null, null); }
/// <summary> /// Handles the Click event of the BtnAdd control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void BtnAdd_Click(object sender, EventArgs e) { MediaPathDBFactory.AddNewRecord(); var frmEditMediaPath = new FrmEditMediaPath(FrmEditMediaPath.MediaPathActionType.Add); frmEditMediaPath.ShowDialog(this); grdViewMain.RefreshData(); // ButRefresh_Click(null, null); }
/// <summary> /// The edit current row. /// </summary> private void EditCurrentRow() { var selectedRows = this.grdViewMain.GetSelectedRows(); if (selectedRows.Length == 0) { return; } var frmEditMediaPath = new FrmEditMediaPath( FrmEditMediaPath.MediaPathActionType.Edit, this.grdViewMain.GetRow(selectedRows[0]) as MediaPathModel); frmEditMediaPath.ShowDialog(this); }
/// <summary> /// The edit current row. /// </summary> private void EditCurrentRow() { int[] selectedRows = this.grdViewMain.GetSelectedRows(); if (selectedRows.Length == 0) { return; } MediaPathDBFactory.EditRecord(this.grdViewMain.GetRow(selectedRows[0]) as MediaPathModel); var frmEditMediaPath = new FrmEditMediaPath(FrmEditMediaPath.MediaPathActionType.Edit); frmEditMediaPath.ShowDialog(this); }