Beispiel #1
0
 private void LoadConstantsFromDb()
 {
     cbxJob.DisplayMemberPath      = "Serial_Customer_Machine";
     cbxJob.SelectedValuePath      = "Serial_Customer_Machine";
     cbxTaskType.DisplayMemberPath = "Id";
     cbxTaskType.SelectedValuePath = "Id";
     cbxTimeCode.DisplayMemberPath = "Code_Description";
     cbxTimeCode.SelectedValuePath = "Code_Description";
     cbxSection.DisplayMemberPath  = "SectionNumber_SectionDescription";
     cbxSection.SelectedValuePath  = "Number_Section";
     foreach (TimesheetCode timesheetCode in queries.TimesheetCodeAll())
     {
         cbxTimeCode.Items.Add(timesheetCode);
     }
     foreach (TaskType taskType in queries.TaskTypesAll())
     {
         cbxTaskType.Items.Add(taskType);
     }
     foreach (Project project in queries.ProjectAll())
     {
         if (functions.IntToBool(project.IsOpen) ? true : functions.IntToBool(project.IsWarrantyOpen))
         {
             cbxJob.Items.Add(project);
         }
     }
     myConnection.Close();
 }
Beispiel #2
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;
     }
 }
Beispiel #3
0
 public AdminTools_EditProject()
 {
     InitializeComponent();
     cbxSerialNumber.ItemsSource = queries.ProjectAll();
     allTaskTypes = queries.TaskTypesAll();
     cbxSerialNumber.DisplayMemberPath = "Serial_Customer_Machine";
     lbxSections_TaskTypes_ActNumber.DisplayMemberPath = "ActNum_Id";
     lbxSections_TaskTypes_Unused.DisplayMemberPath    = "Id";
 }
        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;
        }