Exemple #1
0
        private void gvSkipLogic_DoubleClick(object sender, EventArgs e)
        {
            var row = gvSkipLogic.GetDataRow(gvSkipLogic.FocusedRowHandle);

            if (row == null)
            {
                return;
            }
            using (var frm = new frmSkipLogic())
            {
                frm.Initialize(Services);
                frm.ProjectID = this.ProjectID;
                frm.Process(row);
                frm.SkipTo = row.Item("SkipTo");
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    gvSkipLogic.SetRowCellValue(gvSkipLogic.FocusedRowHandle, "SkipType", frm.SkipType);
                    gvSkipLogic.SetRowCellValue(gvSkipLogic.FocusedRowHandle, "SkipTo", frm.SkipTo);
                    gvSkipLogic.SetRowCellValue(gvSkipLogic.FocusedRowHandle, "EvaluatesExpression", frm.EvaluatesExpression);
                }
                gvSkipLogic.UpdateCurrentRow();
            }
        }
Exemple #2
0
        private void btnSkipLogic_Click(object sender, EventArgs e)
        {
            using (var frm = new frmSkipLogic())
            {
                frm.Initialize(Services);
                frm.Index     = gvSkipLogic.DataRowCount + 1;
                frm.ProjectID = this.ProjectID;
                frm.Process();
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    if (gSkipLogic.DataSource == null)
                    {
                        DataTable dt = new DataTable();
                        dt.Columns.Add("Index", typeof(string));
                        dt.Columns.Add("SkipType", typeof(string));
                        dt.Columns.Add("SkipTo", typeof(string));
                        dt.Columns.Add("EvaluatesExpression", typeof(string));
                        dt.Columns.Add("MessageError", typeof(string));
                        gSkipLogic.DataSource = dt;
                    }

                    gvSkipLogic.AddNewRow();

                    int rowHandle = gvSkipLogic.GetRowHandle(gvSkipLogic.DataRowCount);

                    if (gvSkipLogic.IsNewItemRow(rowHandle))
                    {
                        gvSkipLogic.SetRowCellValue(rowHandle, "Index", frm.Index);
                        gvSkipLogic.SetRowCellValue(rowHandle, "SkipType", frm.SkipType);
                        gvSkipLogic.SetRowCellValue(rowHandle, "SkipTo", frm.SkipTo);
                        gvSkipLogic.SetRowCellValue(rowHandle, "EvaluatesExpression", frm.EvaluatesExpression);
                    }
                    gvSkipLogic.UpdateCurrentRow();
                }
            }
        }