private void GVDSC_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e) { iGiaThu = 0; int[] seledtedCell = GVDSC.GetSelectedRows(); foreach (int ac in seledtedCell) { iGiaThu += int.Parse(GVDSC.GetRowCellValue(ac, GVDSC.Columns["SoTienBaoLuu"]).ToString()); } GVDSC.InvalidateFooter(); }
private void GVDSC_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e) { if (e.Column.FieldName == "SoTienBaoLuu") { e.Info.DisplayText = iGiaThu.ToString("#,##0"); } else if (e.Column.FieldName == "MaCho") { e.Info.DisplayText = GVDSC.GetSelectedRows().Count().ToString(); } }
private void btnLuu_Click(object sender, EventArgs e) { int seledtedCell = GVDSC.GetSelectedRows().Count(); List <O_BAOCAOCTNH> lst = new List <O_BAOCAOCTNH>(); if (seledtedCell > 0) { for (int i = 0; i < seledtedCell; i++) { O_KHACHSAN gd = GVDSC.GetRow(GVDSC.GetSelectedRows()[i]) as O_KHACHSAN; O_BAOCAOCTNH bc = new O_BAOCAOCTNH(); bc.LoaiGiaoDich = 2; bc.IDGDLienKet = gd.ID; bc.IDCTNganHang = ID; bc.SoTien = 0 - gd.SoTienBaoLuu; bc.Thu = _nCC; bc.Code = gd.MaCho; lst.Add(bc); } (Owner as frmNHCTThem).DSSOVE(lst); Close(); } }