Ejemplo n.º 1
0
        private void FormLoad(object sender, EventArgs e)
        {
#if !MONO
            TasksListView.SetExStyles();
#endif
            SourceTextChanged(null, EventArgs.Empty);
            sourceTextBox.Focus();
        }
Ejemplo n.º 2
0
 public void CollapseSlideInPane()
 {
     TasksListView.SelectedIndex = -1;
     //TasksListView.Margin = new Thickness(10, 10, 10, 0);
     TasksListView.SetValue(Grid.ColumnSpanProperty, 2);
     //EmptyAddTaskDisplayPanel.SetValue(Grid.ColumnSpanProperty, 2);
     TopPanel.SetValue(Grid.ColumnSpanProperty, 2);
     SlideInPane.Visibility = Visibility.Collapsed;
 }
Ejemplo n.º 3
0
 private void ShowSlideInPane()
 {
     //TasksListView.Margin = new Thickness(0, 0, 0, 0);
     TasksListView.SetValue(Grid.ColumnSpanProperty, 1);
     //EmptyAddTaskDisplayPanel.SetValue(Grid.ColumnSpanProperty, 1);
     if (tasks.Count > 0)
     {
         TopPanel.SetValue(Grid.ColumnSpanProperty, 1);
     }
     SlideInPane.Visibility = Visibility.Visible;
 }
Ejemplo n.º 4
0
        private void StartImport(Configuration.Configuration config)
        {
            // clean the plate
            TasksListView.Items.Clear();
            TasksListView.Groups.Clear();

            // build the configuration object and then the loader

            BulkLoader loader = BulkLoader.Create(config);


            // since we want to track progress of tasks, lets
            // get an aggregated list of tasks from the loader's jobs
            List <BulkCopyTask> tasks = new List <BulkCopyTask>();

            loader.Jobs.ForEach(j => j.Tasks.ForEach(tasks.Add));

            // add a list group for each site being loaded.
            // TODO: relocate targets to the loader
            config.Targets.ForEach(t => TasksListView.Groups.Add(new ListViewGroup(t.Name, t.Name)));

            // create the list items and event handler
            tasks.ForEach(t =>
            {
                ListViewItem item = new ListViewItem();

                item.SubItems.Add(t.Table);
                item.SubItems.Add("");
                item.SubItems.Add("");
                item.SubItems.Add("");

                TasksListView.Items.Add(item);
                item.Group = TasksListView.Groups[t.Site];

                t.RowsInserted += (ss, eee) => TasksListView.Invoke(() => UpdateTaskItem(t, item, eee));
            });


            // set up the import completion handler
            loader.Jobs.Complete += (ss, ee) => ImportButton.Invoke(() =>
            {
                ImportButton.Text    = "Import";
                ImportButton.Enabled = true;
                panel1.Enabled       = true;
                _timer.Stop();
                long count = loader.Jobs.Select(j => j.Tasks.Sum(t => t.Count)).Sum();


                StatusLabel.Text =
                    string.Format((_abort ? Resources.Rs_ImpAbort : Resources.Rs_ImpComplete) + "\r\n",
                                  count.ToString("#,##0"),
                                  _timer.ElapsedMilliseconds / 1000f / 60f);
            });


            // start the job

            _timer.Reset();
            _timer.Start();
            ImportButton.Text = "Abort";
            new Thread(() => loader.ProcessJobs(config)).Start();
        }
Ejemplo n.º 5
0
        void TasksLoad()
        {
            string find;
            int    priorityID;
            int    stateID;

            DateTime?startDate = null,
                    endDate    = null;

            if (!string.IsNullOrEmpty(dpStart.Value))
            {
                startDate = DateTime.Parse(dpStart.Value);
            }

            if (!string.IsNullOrEmpty(dpEnd.Value))
            {
                endDate = DateTime.Parse(dpEnd.Value);
            }

            if (txtSearchTask.Text == string.Empty)
            {
                find = string.Empty;
            }
            else
            {
                find = txtSearchTask.Text;
            }

            priorityID = int.Parse(ddlTaskPriority.SelectedValue);
            stateID    = int.Parse(ddlTaskState.SelectedValue);

            SqlConnection  sqlConnection1 = new SqlConnection(TasksSqldataSource.ConnectionString);
            SqlDataAdapter da             = new SqlDataAdapter();
            SqlCommand     cmd            = new SqlCommand();
            DataTable      dt             = new DataTable();

            try
            {
                cmd.CommandText = "[task].[sp_search_tasks]";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = sqlConnection1;

                cmd.Parameters.AddWithValue("@find", find);
                cmd.Parameters.AddWithValue("@user", User.Identity.Name);
                cmd.Parameters.AddWithValue("@priorityID", priorityID);
                cmd.Parameters.AddWithValue("@stateID", stateID);

                cmd.Parameters.Add("@startDate", SqlDbType.DateTime).Value = startDate;
                cmd.Parameters.Add("@endDate", SqlDbType.DateTime).Value   = endDate;

                cmd.Parameters.AddWithValue("@MyTasks", chkToggleButton.Checked);


                da.SelectCommand = cmd;

                da.Fill(dt);

                TasksListView.DataSourceID = string.Empty;
                TasksListView.DataSource   = dt;
                TasksListView.DataBind();
            }
            catch (Exception exp)
            {
                ErrorLabel.Text    = "Error a ejecutar busqueda.. : " + exp.Message;
                ErrorLabel.Visible = true;
            }
        }
Ejemplo n.º 6
0
 public void RefreshTask(ZTask task)
 {
     tasks.Add(task);
     TasksListView.ScrollIntoView(task);
     TasksListView.SelectedItem = task;
 }