Пример #1
0
        void editTask()
        {
            if (dataGridView1.CurrentRow == null)
            {
                return;
            }

            using (var fae = new FormAddEdit())
            {
                fae.ArxSMSName      = dataGridView1.CurrentRow.Cells["nameDataGridViewTextBoxColumn"].Value.ToString();
                fae.ArxSMSTelephone = dataGridView1.CurrentRow.Cells["telephoneDataGridViewTextBoxColumn"].Value.ToString();
                fae.ArxSMSText      = dataGridView1.CurrentRow.Cells["textDataGridViewTextBoxColumn"].Value.ToString();
                fae.ArxSMSScript    = dataGridView1.CurrentRow.Cells["scriptDataGridViewTextBoxColumn"].Value.ToString();
                fae.formTitle       = "Edit task";

                fae.ShowDialog();

                if (fae.DialogResult != DialogResult.OK)
                {
                    return;
                }

                var taskRow = ((DataRowView)dataGridView1.CurrentRow.DataBoundItem).Row;

                taskRow["Name"]      = fae.ArxSMSName;
                taskRow["Telephone"] = fae.ArxSMSTelephone;
                taskRow["Text"]      = fae.ArxSMSText;
                taskRow["Script"]    = fae.ArxSMSScript;

                saveDataSet();
            }
        }
Пример #2
0
        void addTask()
        {
            using (var fae = new FormAddEdit())
            {
                fae.ArxSMSName = "";
                fae.ArxSMSTelephone = "";
                fae.ArxSMSText = "";
                fae.ArxSMSScript = "";

                fae.formTitle = "New task";

                if (fae.ShowDialog() == DialogResult.OK)
                {
                    var newRow = dataSet1.Tables["SMS"].NewRow();

                    newRow["Name"] = fae.ArxSMSName;
                    newRow["Telephone"] = fae.ArxSMSTelephone;
                    newRow["Text"] = fae.ArxSMSText;
                    newRow["Script"] = fae.ArxSMSScript;

                    dataSet1.Tables["SMS"].Rows.Add(newRow);
                }
            }
        }
Пример #3
0
        void addTask()
        {
            using (var fae = new FormAddEdit())
            {
                fae.ArxSMSName      = "";
                fae.ArxSMSTelephone = "";
                fae.ArxSMSText      = "";
                fae.ArxSMSScript    = "";

                fae.formTitle = "New task";

                if (fae.ShowDialog() == DialogResult.OK)
                {
                    var newRow = dataSet1.Tables["SMS"].NewRow();

                    newRow["Name"]      = fae.ArxSMSName;
                    newRow["Telephone"] = fae.ArxSMSTelephone;
                    newRow["Text"]      = fae.ArxSMSText;
                    newRow["Script"]    = fae.ArxSMSScript;

                    dataSet1.Tables["SMS"].Rows.Add(newRow);
                }
            }
        }
Пример #4
0
        void editTask()
        {
            if (dataGridView1.CurrentRow == null) return;

            using (var fae = new FormAddEdit())
            {
                fae.ArxSMSName = dataGridView1.CurrentRow.Cells["nameDataGridViewTextBoxColumn"].Value.ToString();
                fae.ArxSMSTelephone = dataGridView1.CurrentRow.Cells["telephoneDataGridViewTextBoxColumn"].Value.ToString();
                fae.ArxSMSText = dataGridView1.CurrentRow.Cells["textDataGridViewTextBoxColumn"].Value.ToString();
                fae.ArxSMSScript = dataGridView1.CurrentRow.Cells["scriptDataGridViewTextBoxColumn"].Value.ToString();
                fae.formTitle = "Edit task";

                fae.ShowDialog();

                if (fae.DialogResult != DialogResult.OK) return;

                var taskRow = ((DataRowView)dataGridView1.CurrentRow.DataBoundItem).Row;

                taskRow["Name"] = fae.ArxSMSName;
                taskRow["Telephone"] = fae.ArxSMSTelephone;
                taskRow["Text"] = fae.ArxSMSText;
                taskRow["Script"] = fae.ArxSMSScript;

                saveDataSet();
            }
        }