Ejemplo n.º 1
0
 private void LoadConstantsFromDb()
 {
     cbxProject.DisplayMemberPath       = "Serial_Customer_Machine";
     cbxProject.SelectedValuePath       = "Serial_Customer_Machine";
     cbxTimesheetCode.DisplayMemberPath = "Code_Description";
     cbxTimesheetCode.SelectedValuePath = "Code_Description";
     foreach (TimesheetCode timesheetCode in queries.TimesheetCodeAll())
     {
         cbxTimesheetCode.Items.Add(timesheetCode);
     }
     foreach (string str in queries.TaskTypes())
     {
         cbxTaskType.Items.Add(str);
     }
     foreach (Project project in queries.ProjectAll())
     {
         cbxProject.Items.Add(project);
     }
     if (user_Defaults.TimesheetCode != null)
     {
         cbxTimesheetCode.SelectedValue = user_Defaults.TimesheetCode.Code_Description;
     }
     if (!string.IsNullOrEmpty(user_Defaults.TaskType))
     {
         cbxTaskType.SelectedValue = user_Defaults.TaskType;
     }
     if (user_Defaults.Project != null)
     {
         cbxProject.SelectedValue = user_Defaults.Project.Serial_Customer_Machine;
     }
 }
 private void LoadConstantsFromDb()
 {
     cbxJob.DisplayMemberPath      = "Serial_Customer_Machine";
     cbxJob.SelectedValuePath      = "Serial_Customer_Machine";
     cbxTimeCode.DisplayMemberPath = "Code_Description";
     cbxTimeCode.SelectedValuePath = "Code_Description";
     cbxSection.DisplayMemberPath  = "SectionNumber_SectionDescription";
     cbxSection.SelectedValuePath  = "SectionNumber_SectionDescription";
     foreach (TimesheetCode timesheetCode in queries.TimesheetCodeAll())
     {
         cbxTimeCode.Items.Add(timesheetCode);
     }
     foreach (string str in queries.TaskTypes())
     {
         cbxTaskType.Items.Add(str);
     }
     foreach (Project project in queries.ProjectAll())
     {
         if ((functions.IntToBool(project.IsOpen) ? true : functions.IntToBool(project.IsWarrantyOpen)))
         {
             cbxJob.Items.Add(project);
         }
     }
     sectionsAll = queries.Sections();
     myConnection.Close();
 }
Ejemplo n.º 3
0
 public void RefreshListBox_TaskTypes()
 {
     unusedTaskTypes = allTaskTypes;
     usedTaskTypes   = new List <TaskType>();
     if (lbxSections.SelectedItem != null)
     {
         Section selectedItem = lbxSections.SelectedItem as Section;
         foreach (TaskType taskType in queries.TaskTypes(selectedItem))
         {
             usedTaskTypes.Add(taskType);
             unusedTaskTypes = (
                 from X in unusedTaskTypes
                 where X.Id != taskType.Id
                 select X).ToList <TaskType>();
         }
     }
     else
     {
         usedTaskTypes = null;
     }
     lbxSections_TaskTypes_ActNumber.ItemsSource = usedTaskTypes;
     lbxSections_TaskTypes_Unused.ItemsSource    = unusedTaskTypes;
 }
Ejemplo n.º 4
0
        private void LoadConstantsFromDB()
        {
            List <string> userDisplayOptions = new List <string>()
            {
                "Show Approvees",
                "Show Active Users",
                "Show All Users"
            };

            List <string> datePresetDisplayOptions = new List <string>()
            {
                "Use Custom Range",
                "Today",
                "Week To Date",
                "Month To Date",
                "Year To Date"
            };

            datePreset.ItemsSource   = datePresetDisplayOptions;
            datePreset.SelectedIndex = 0;

            userSelect.ItemsSource   = userDisplayOptions;
            userSelect.SelectedIndex = 0;

            LoadUsersRules();
            availableTables = new List <string>()
            {
                "Not Submitted",
                "Submitted, Not Approved",
                "Approved",
                "Archived"
            };

            table.ItemsSource = availableTables;
            foreach (TimesheetCode timesheetCode in queries.TimesheetCodeAll())
            {
                timesheet_code.Items.Add(timesheetCode);
            }
            foreach (string str in queries.TaskTypes())
            {
                task_type.Items.Add(str);
            }
            foreach (Project project in queries.ProjectAll())
            {
                if (functions.IntToBool(project.IsOpen))
                {
                    projectSelect.Items.Add(project.Number_Serial);
                }
            }
            timesheet_code.DisplayMemberPath = "Code_Description";
            timesheet_code.SelectedValuePath = "Code";

            colNames = new List <string>();

            foreach (PropertyInfo prop in typeof(Entry).GetProperties())
            {
                colNames.Add(prop.Name);
            }

            columns.ItemsSource = colNames;
        }