示例#1
0
        BigNumber [] VectorReadASBigNum(string ID, string WarningNAs)
        {
            //读单列
            int ColNum = 0;

            for (int i = 0; i < Form1.S.dataGridView1.ColumnCount; i++)
            {
                if (Form1.S.dataGridView1.Columns[i].Name == ID)
                {
                    ColNum = i;
                    break;
                }
            }
            int AllRowCounts = Form1.S.dataGridView1.RowCount - 1;

            char[] separator  = { ',' };
            int    IsNOTEmpty = 0;
            string Temp;

            foreach (char EachChar in WarningNAs)
            {
                if (EachChar == 'N')
                {
                    IsNOTEmpty++;
                }
            }
            string[] SkipRow        = WarningNAs.Split(separator);
            int      DataRows_Count = 0;
            int      IsEmpty        = 0;

            BigNumber [] DataChose = new BigNumber [IsNOTEmpty];
            for (int i = 0; i < AllRowCounts; i++)
            {
                IsEmpty = 0;
                foreach (string EachRow in SkipRow)
                {
                    if (EachRow.Trim() == i.ToString())
                    {
                        IsEmpty = 1;
                    }
                }
                if (IsEmpty == 0)
                {
                    Temp = Form1.S.dataGridView1.Rows[i].Cells[ColNum].Value.ToString();
                    //MessageBox.Show("第" + i + "行的变量的值为:" + Temp);
                    DataChose[DataRows_Count] = new BigNumber(Temp.Trim());
                    DataRows_Count++;
                }
            }
            return(DataChose);
        }
示例#2
0
        public void RemoveColumn(Column column)
        {
            if (!RootRow.RowValues.ContainsKey(column))
            {
                throw new InvalidOperationException("Column not added to outline.");
            }

            var removedValues = new Dictionary <Row, object>();

            foreach (var row in EachRow.Concat(new[] { RootRow }))
            {
                removedValues.Add(row, row[column]);
                row.RowValues.Remove(column);
            }
            ColumnRemoved?.Invoke(this, new ColumnRemovedEventArgs(column, removedValues));
        }
示例#3
0
        /// <summary>
        /// Adds a column to this outline, with optional data.
        /// Generally, row data will be provided when we are undoing an operation that deleted a column, and we
        /// want to restore all of the old data before we notify listeners about the restored column.
        /// </summary>
        /// <param name="column"></param>
        /// <param name="rowValues"></param>
        public void AddColumn(Column column, IDictionary <Row, object> rowValues = null)
        {
            if (RootRow.RowValues.ContainsKey(column))
            {
                throw new InvalidOperationException("Column already added to outline.");
            }

            foreach (var row in EachRow.Concat(new[] { RootRow }))
            {
                row.RowValues.Add(column, column.DefaultValue);
                if (rowValues != null && rowValues.TryGetValue(row, out object value))
                {
                    row.RowValues[column] = value;
                }
            }
            ColumnAdded?.Invoke(this, new ColumnAddedEventArgs(column));
        }
        protected void btn_Delete_CheckedItem_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow EachRow in gview_AccountTransaction.Rows)
            {
                CheckBox EachCheckBox = (CheckBox)EachRow.FindControl("chk_TransactionID");

                if (EachCheckBox.Checked)
                {
                    int RecordID = int.Parse(((Label)EachRow.FindControl("lbl_TransactionID")).Text);

                    AccountTransaction TheAccountTransaction = new AccountTransaction();
                    TheAccountTransaction.TransactionID = RecordID;

                    int ProcReturnValue = AccountTransactionManagement.GetInstance.DeleteAccountTransaction(TheAccountTransaction, RecordID);
                }
                BindGridView();
            }
        }
示例#5
0
        double[] VectorRead(string ID, string WarningNAs)
        {
            //读单列
            int ColNum = 0;

            for (int i = 0; i < dataGridView_subset.ColumnCount; i++)
            {
                if (dataGridView_subset.Columns[i].Name == ID)
                {
                    ColNum = i;
                    break;
                }
            }
            int AllRowCounts = dataGridView_subset.RowCount - 1;

            /*string[] DataReady = new string[AllRowCounts];
             * string EmptyRowStr = "";
             * int CountEmpty = 0;
             * for (int i = 0;i < AllRowCounts ;i++){
             *  if (dataGridView_subset.Rows[i].Cells[ColNum].Value == null){
             *      EmptyRowStr = EmptyRowStr + "," + i.ToString();
             *      CountEmpty ++;
             *  }
             *  else if (dataGridView_subset.Rows[i].Cells[ColNum].Value.ToString().Trim() == ""){
             *      EmptyRowStr = EmptyRowStr + "," + i.ToString();
             *      CountEmpty ++;
             *  }
             * }*/
            //int CountEmpty = 0;
            char [] separator  = { ',' };
            int     IsNOTEmpty = 0;
            string  Temp;

            foreach (char EachChar in WarningNAs)
            {
                if (EachChar == 'N')
                {
                    IsNOTEmpty++;
                }
            }
            //MessageBox.Show("IsNotEmpty = " + IsNOTEmpty);
            //MessageBox.Show("WarningNAs: " + WarningNAs);
            string [] SkipRow        = WarningNAs.Split(separator);
            int       DataRows_Count = 0;
            int       IsEmpty        = 0;

            double[] DataChose = new double[IsNOTEmpty];
            for (int i = 0; i < AllRowCounts; i++)
            {
                IsEmpty = 0;
                foreach (string EachRow in SkipRow)
                {
                    if (EachRow.Trim() == i.ToString())
                    {
                        IsEmpty = 1;
                    }
                }
                if (IsEmpty == 0)
                {
                    Temp = dataGridView_subset.Rows[i].Cells[ColNum].Value.ToString();
                    //MessageBox.Show("第" + i + "行的变量的值为:" + Temp);
                    DataChose[DataRows_Count] = Convert.ToDouble(Temp.Trim());
                    DataRows_Count++;
                }
            }
            return(DataChose);
        }