示例#1
0
        private void BindData()
        {
            TaskBLL TaskBL = new TaskBLL(connectionString);
            List<TaskViewModel> tasks = TaskBL.GetTaskInventory();
            Dictionary<int, string> CarID_Name = TaskBL.GetNameListFromCarTable();
            Dictionary<int, string> EmployeeID_Name = TaskBL.GetNameListFromEmployeeTable();
            string[] date_notime = new string[3];

            foreach (TaskViewModel element in tasks)
            {
                date_notime = element.DateAssigned.Split(' ');
                element.DateAssigned = date_notime[0];

                if (!String.IsNullOrEmpty(element.DateComplete))
                {
                    date_notime = element.DateComplete.Split(' ');
                    element.DateComplete = date_notime[0];
                }
            }

            SelectCar.DataSource = CarID_Name.Values;
            SelectCar.DataBind();

            AssignedEmployee.DataSource = EmployeeID_Name.Values;
            AssignedEmployee.DataBind();

            TaskList.DataSource = tasks;
            TaskList.DataBind();
        }
示例#2
0
        private void BindData()
        {
            TaskBLL TaskBL = new TaskBLL(connectionString);
            Dictionary <int, string> CarID_Name      = TaskBL.GetNameListFromCarTable();
            Dictionary <int, string> EmployeeID_Name = TaskBL.GetNameListFromEmployeeTable();

            SelectCar.DataSource = CarID_Name.Values;
            SelectCar.DataBind();

            AssignedEmployee.DataSource = EmployeeID_Name.Values;
            AssignedEmployee.DataBind();
        }