private void tdbgQuikUpdate_BeforeUpdate(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e) { DataRow dr = mdsUpdates.Tables[0].Rows[tdbgQuikUpdate.Bookmark]; int tmpID; int tmpBM; decimal bHrs; decimal perc; decimal eHrs; decimal rHrs; tmpBM = tdbgQuikUpdate.Bookmark; // added to allow for the sort CurrencyManager cm; System.Data.DataView dv; System.Data.DataRowView drv; System.Data.DataRow dr2; int row; row = tdbgQuikUpdate.RowBookmark(tdbgQuikUpdate.Bookmark); cm = (CurrencyManager)this.BindingContext[tdbgQuikUpdate.DataSource, tdbgQuikUpdate.DataMember]; dv = (DataView)cm.List; drv = (System.Data.DataRowView)cm.List[row]; dr2 = drv.Row; tmpID = Convert.ToInt32(dr["ID"]); bHrs = Convert.ToDecimal(dr["BudgetHrs"]); try //******************Try Catch block added 6/11/2015 { rHrs = Convert.ToDecimal(dr["RemainingHrs"]); } catch { MessageBox.Show("Field Cannot be empty, default value=0"); return; } int tmpID2 = Convert.ToInt32(dr2["ID"]); decimal bHrs2 = Convert.ToDecimal(dr2["BudgetHrs"]); decimal rHrs2 = Convert.ToDecimal(dr2["RemainingHrs"]); //perc = CBDrawingLog.GetPercentComplete(bHrs, rHrs); //eHrs = CBDrawingLog.GetEarnedHrs(bHrs, rHrs); //dr["PercentComplete"] = perc; //dr["EarnedHrs"] = eHrs; //CBDrawingLog.UpdateHours(tmpID, bHrs, perc, eHrs, rHrs); // changed to allow for the sort perc = CBDrawingLog.GetPercentComplete(bHrs2, rHrs2); eHrs = CBDrawingLog.GetEarnedHrs(bHrs2, rHrs2); dr2["PercentComplete"] = perc; dr2["EarnedHrs"] = eHrs; CBDrawingLog.UpdateHours(tmpID2, bHrs2, perc, eHrs, rHrs2); TotalHours(); }
private void c1TrueDBGrid1_SelChange(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e) { // this event is fired when the selection is about to change (usually in response to a row or column change) // setting e.Cancel prevents the collection from being cleared if (!_changingSelection) { e.Cancel = true; } }
private void TdgDocumento_BeforeInsert(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e) { //validar el maximo de productos por boleta if (TdgDocumento.RowCount > 9) { MessageBox.Show("Solo se admite 10 productos por Comprobante. Para los proximos productos debera crear otra Comprobante", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); e.Cancel = true; } CalcularTotales(); }
private void tdbgHours_BeforeDelete(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e) { if (MessageBox.Show("Are you sure you wish to delete the current line?", "Delete Hours", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { DataRow dr = moPCN.PCNData.PCNHours.Rows[tdbgHours.Bookmark]; DataRow dd = moPCN.PCNData.PCNHoursDeleted.NewRow(); dd["ID"] = dr["ID"]; moPCN.PCNData.PCNHoursDeleted.Rows.Add(dd); } else { e.Cancel = true; } }
private void c1TrueDBGrid1_OnScroll(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e) { this.listBox1.Visible = false; }
private void TdgMateriasPrimas_BeforeUpdate(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e) { CalculateFooter(); }
private void TdgDocumento_BeforeUpdate(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e) { CalcularTotales(); }