Ejemplo n.º 1
0
        private void cms_NewAction_Click(object sender, EventArgs e)
        {
            try
            {
                frmActionSetting fas = new frmActionSetting();
                fas.ShowDialog();
                if (fas.Cancel == "Y")
                {
                    return;
                }
                string Action             = fas.Action;
                string RemoteFileOrFolder = fas.RemoteFileOrFolder;
                string RemoteIsFolder     = fas.RemoteIsFolder;
                string LocalFileOrFolder  = fas.LocalFileOrFolder;
                string LocalIsFolder      = fas.LocalIsFolder;

                dgvStepDetail.Rows.Add(new object[] { "0", Action, RemoteFileOrFolder, RemoteIsFolder, LocalFileOrFolder, LocalIsFolder });

                RefreshActionStep();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        private void dgvStepDetail_DoubleClick(object sender, EventArgs e)
        {
            if (dgvStepDetail.Rows.Count == 0)
            {
                return;
            }
            if (dgvStepDetail.SelectedRows.Count == 0)
            {
                return;
            }
            try
            {
                int row = dgvStepDetail.SelectedRows[0].Index;

                frmActionSetting fas = new frmActionSetting(dgvStepDetail.SelectedRows[0].Cells["Action"].Value.ToString(),
                                                            dgvStepDetail.SelectedRows[0].Cells["RemoteFileFolder"].Value.ToString(),
                                                            dgvStepDetail.SelectedRows[0].Cells["RemoteIsFolder"].Value.ToString(),
                                                            dgvStepDetail.SelectedRows[0].Cells["LocalFileFolder"].Value.ToString(),
                                                            dgvStepDetail.SelectedRows[0].Cells["LocalIsFolder"].Value.ToString());
                fas.ShowDialog();

                if (fas.Cancel == "Y")
                {
                    return;
                }
                string Action             = fas.Action;
                string RemoteFileOrFolder = fas.RemoteFileOrFolder;
                string RemoteIsFolder     = fas.RemoteIsFolder;
                string LocalFileOrFolder  = fas.LocalFileOrFolder;
                string LocalIsFolder      = fas.LocalIsFolder;

                dgvStepDetail.Rows[row].Cells["Action"].Value           = Action;
                dgvStepDetail.Rows[row].Cells["RemoteFileFolder"].Value = RemoteFileOrFolder;
                dgvStepDetail.Rows[row].Cells["RemoteIsFolder"].Value   = RemoteIsFolder;
                dgvStepDetail.Rows[row].Cells["LocalFileFolder"].Value  = LocalFileOrFolder;
                dgvStepDetail.Rows[row].Cells["LocalIsFolder"].Value    = LocalIsFolder;

                RefreshActionStep();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }