Ejemplo n.º 1
0
        private void buttonAddTask_Click(object sender, EventArgs e)
        {
            TaskProp xx = new TaskProp();

            if (xx.ShowDialog() == DialogResult.OK)
            {
                AddNewTaskFromFromControl(xx.taskControlParam);
            }
        }
Ejemplo n.º 2
0
        private void buttonEditTask_Click(object sender, EventArgs e)
        {
            if (dataGridViewTasks.RowCount == 0 || dataGridViewTasks.CurrentRow == null)
            {
                return;
            }
            try
            {
                TaskProp xx = new TaskProp();

                xx.taskControlParam.Source =
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][0].ToString();

                xx.taskControlParam.Destination =
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][1].ToString();

                xx.taskControlParam.SyncType =
                    c_SyncProcess.ConvertStringToType(AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][3].ToString());

                xx.taskControlParam.IgnoredFolders =
                    (string[])AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][4];

                xx.taskControlParam.DeleteIgnoreFolders =
                    (bool)AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][5];

                xx.taskControlParam.SourceArchive =
                    (cc_AppConf.e_Archive_Type)AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][6];

                xx.taskControlParam.DetinationArchive =
                    (cc_AppConf.e_Archive_Type)AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][7];


                if (xx.ShowDialog() == DialogResult.OK)
                {
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][0] = xx.taskControlParam.Source;
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][1] = xx.taskControlParam.Destination;
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][2] = 0;
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][3] = c_SyncProcess.SyncTypeNames[(int)xx.taskControlParam.SyncType];
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][4] = xx.taskControlParam.IgnoredFolders;
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][5] = xx.taskControlParam.DeleteIgnoreFolders;
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][6] = xx.taskControlParam.SourceArchive;
                    AppConf.conf.CurrentConf.Tasks.Tables[0].Rows[dataGridViewTasks.CurrentRow.Index][7] = xx.taskControlParam.DetinationArchive;
                }
            }
            catch (Exception ex)
            {
                ErrorWorkProc.ErrorProcess(ex);
            }
        }