Пример #1
0
        private void AddNewRowToLwTask(object sender, EventArgs e)
        {
            try
            {
                tasksRow newRow = tTable.NewtasksRow();

                string newInvoiceCode = (string)dgvTask.Rows[MouseOverCurrentRow].Cells[0].Value;

                string value = Regex.Replace(newInvoiceCode, "[A-Za-z ]", "");
                int    parsedValue;
                if (string.IsNullOrWhiteSpace(value))
                {
                    parsedValue = 0;
                }
                else
                {
                    parsedValue = int.Parse(value);
                }

                newRow.invoiceCode = (parsedValue + 1).ToString();
                newRow.status      = 0;
                newRow.activityID  = _passingActivityID;
                tTable.Rows.Add(newRow);
                this.dgvTask.Sort(this.dgvTask.Columns[0], ListSortDirection.Ascending);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #2
0
 public tasksRowChangeEvent(tasksRow row, global::System.Data.DataRowAction action)
 {
     this.eventRow    = row;
     this.eventAction = action;
 }