Пример #1
0
 public void Update()
 {
     DGR.ItemsSource             = null;
     CB_People.ItemsSource       = null;
     CB_ReportPeople.ItemsSource = null;
     using (var db = new ResourceModel())
     {
         DGR.ItemsSource             = db.GetResource();
         CB_People.ItemsSource       = db.GetPeople();
         CB_ReportPeople.ItemsSource = db.GetPeople();
     }
 }
Пример #2
0
 public void Update()
 {
     DGR.ItemsSource             = null;
     CB_WorkingGroup.ItemsSource = null;
     CB_People.ItemsSource       = null;
     using (var db = new ResourceModel())
     {
         DGR.ItemsSource             = db.GetComputer();
         CB_WorkingGroup.ItemsSource = db.GetWorking_Group();
         CB_People.ItemsSource       = db.GetPeople();
     }
 }
Пример #3
0
        public void Update()
        {
            DGR.ItemsSource             = null;
            CB_Department.ItemsSource   = null;
            CB_Organization.ItemsSource = null;
            CB_Position.ItemsSource     = null;

            using (var db = new ResourceModel())
            {
                DGR.ItemsSource             = db.GetPeople();
                CB_Department.ItemsSource   = db.GetDepartment();
                CB_Organization.ItemsSource = db.GetOrganization();
                CB_Position.ItemsSource     = db.GetPosition();
            }
        }
Пример #4
0
        private void Update()
        {
            List <OperatorModel> models = new List <OperatorModel>();

            DGR.ItemsSource = null;
            using (var db = new ResourceModel())
            {
                foreach (var op in db.GetOperator())
                {
                    if (op.UserStatus != "user")
                    {
                        models.Add(new OperatorModel()
                        {
                            OperatorID = op.OperatorID,
                            Login      = op.Login,
                            Password   = op.Password,
                            People     = op.People,
                            PeopleID   = op.PeopleID,
                            UserStatus = op.UserStatus.Remove(op.UserStatus.Length - 1)
                        });
                    }
                    else
                    {
                        models.Add(new OperatorModel()
                        {
                            OperatorID = op.OperatorID,
                            Login      = op.Login,
                            Password   = op.Password,
                            People     = op.People,
                            PeopleID   = op.PeopleID,
                            UserStatus = op.UserStatus
                        });
                    }
                }
                DGR.ItemsSource       = models;
                CB_People.ItemsSource = db.GetPeople();
            }
        }
Пример #5
0
        private void SearchOperator_Click(object sender, RoutedEventArgs e)
        {
            List <OperatorModel> models = new List <OperatorModel>();

            using (var db = new ResourceModel())
            {
                foreach (var op in db.SearchOperator(TB_Login.Text, CB_Status.Text))
                {
                    if (op.UserStatus != "user")
                    {
                        models.Add(new OperatorModel()
                        {
                            OperatorID = op.OperatorID,
                            Login      = op.Login,
                            Password   = op.Password,
                            People     = op.People,
                            PeopleID   = op.PeopleID,
                            UserStatus = op.UserStatus.Remove(op.UserStatus.Length - 1)
                        });
                    }
                    else
                    {
                        models.Add(new OperatorModel()
                        {
                            OperatorID = op.OperatorID,
                            Login      = op.Login,
                            Password   = op.Password,
                            People     = op.People,
                            PeopleID   = op.PeopleID,
                            UserStatus = op.UserStatus
                        });
                    }
                }
                DGR.ItemsSource       = models;
                CB_People.ItemsSource = db.GetPeople();
            }
        }