public static bool IsTimeFormatForOut(System.Data.DataTable i_Table, Webb.Collections.Int32Collection i_Rows, string fieldName) { bool bResult = false; if (!i_Table.Columns.Contains(fieldName)) { return(false); } foreach (int i_RowIndex in i_Rows) { object objValue = i_Table.Rows[i_RowIndex][fieldName]; if (objValue == null || objValue is System.DBNull) { continue; } string strValue = objValue.ToString(); if (strValue.Contains(":")) { return(true); } } return(bResult); }
private void RemoveItem() { if (this.lstSelected.SelectedItems.Count == 0) { return; } foreach (string strField in this.lstSelected.SelectedItems) { this.lstAll.Items.Add(strField); } Webb.Collections.Int32Collection selected = new Webb.Collections.Int32Collection(); foreach (int index in this.lstSelected.SelectedIndices) { selected.Add(index); } for (int i = this.lstSelected.Items.Count - 1; i >= 0; i--) { if (!selected.Contains(i)) { continue; } this.lstSelected.Items.RemoveAt(i); } }
public void SetHeadGridLine(WebbTable table, Webb.Collections.Int32Collection HeaderRowsArray) { int rows = table.GetRows(); int cols = table.GetColumns(); if (this.GridLine || HeaderRowsArray.Count <= 0 || cols <= 0 || rows <= 0) { return; } int maxH = (int)HeaderRowsArray[0], minH = (int)HeaderRowsArray[0]; foreach (int hrow in HeaderRowsArray) //Get the Max rowindex and min rowindex of HeaderRows { maxH = Math.Max(maxH, hrow); minH = Math.Min(minH, hrow); } for (int i = minH; i <= maxH; i++) { if (i >= rows) { return; } for (int j = 0; j < cols; j++) { IWebbTableCell bordercell = table.GetCell(i, j); bordercell.CellStyle.Sides = DevExpress.XtraPrinting.BorderSide.None; if (i == minH) { bordercell.CellStyle.Sides |= DevExpress.XtraPrinting.BorderSide.Top; } if (j == 0) { bordercell.CellStyle.Sides |= DevExpress.XtraPrinting.BorderSide.Left; } if (j == cols - 1) { bordercell.CellStyle.Sides |= DevExpress.XtraPrinting.BorderSide.Right; } if (i == maxH) { bordercell.CellStyle.Sides |= DevExpress.XtraPrinting.BorderSide.Bottom; } if (i == minH && this.ColsToMerge.Contains(j)) { bordercell.CellStyle.Sides |= DevExpress.XtraPrinting.BorderSide.Bottom;; } if (j < this.ColCount && i < maxH) { HeaderCell hc = GetCell(i, j); if (j + hc.MergerdCount - 1 == cols - 1) { bordercell.CellStyle.Sides |= DevExpress.XtraPrinting.BorderSide.Right; } ; } } } }
public static int Lcm(Webb.Collections.Int32Collection arr) { int nRet = 1; foreach (int i in arr) { nRet = m(nRet, i); } return(nRet); }
private void C_PBPreview_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { ChartBase chart = null; if (this._DesignerForm != null && this._DesignerForm.ExControlView is WebbChartExView) { //12-16-2008@Scott WebbChartExView chartView = this._DesignerForm.ExControlView as WebbChartExView; System.Data.DataTable table = chartView.ExControl.GetDataSource(); if (table == null) { chart = Setting.CreateChart(View.ExControl.GetDataSource(), null); } else { Webb.Collections.Int32Collection rows = chartView.Filter.GetFilteredRows(table); if (chartView.ExControl != null) { if (chartView.ExControl.Report != null) { rows = chartView.ExControl.Report.Filter.GetFilteredRows(table, rows); //2009-5-25 11:02:57@Simon Add this Code } } chart = Setting.CreateChart(View.ExControl.GetDataSource(), rows); } } else { chart = Setting.CreateChart(View.ExControl.GetDataSource(), null); } if (chart != null) { chart.Draw(e.Graphics, this.C_PBPreview.ClientRectangle); } }
public VideoPlayBackArgs(DataSet i_DataSource, Webb.Collections.Int32Collection i_Rows) { DataSource = null; //i_DataSource; //one slow reason RowIndicators = i_Rows; }
public ArrayList GetMaxValues(SectionFilter OneValueScFilter, SectionFilterCollection repeatFilters) { DataTable i_Table = this.GetDataSource(); bool allpercent = true; ArrayList maxNames = new ArrayList(); if (OneValueScFilter == null) { return(maxNames); } foreach (Data.Series series in this.WebbChartExView.Settings.SeriesCollection) { if (!series.SeriesLabel.Percent) { allpercent = false; break; } } float MaxDataPoint = 0f; float[] DataValues = new float[repeatFilters.Count]; for (int i = 0; i < repeatFilters.Count; i++) { SectionFilter scfilter = repeatFilters[i]; Webb.Collections.Int32Collection InnerRows = new Webb.Collections.Int32Collection(); Webb.Collections.Int32Collection OutterRows = this.DenominatorFilter.GetFilteredRows(i_Table); OutterRows.CopyTo(InnerRows); InnerRows = OneValueScFilter.Filter.GetFilteredRows(i_Table, InnerRows); InnerRows = scfilter.Filter.GetFilteredRows(i_Table, InnerRows); //Added this code at 2008-12-26 12:22:40@Simon float datapoint = 0f; if (allpercent) { if (OutterRows.Count > 0) { datapoint = InnerRows.Count / (float)OutterRows.Count; } } else { datapoint = InnerRows.Count; } if (MaxDataPoint < datapoint) { MaxDataPoint = datapoint; } DataValues[i] = datapoint; } for (int i = 0; i < DataValues.Length; i++) { if (DataValues[i] == MaxDataPoint) { maxNames.Add(repeatFilters[i].FilterName); } } return(maxNames); }