Пример #1
0
        private void AddPost(object sender)
        {
            var el = new PostViewModel {
                Name = "Новый пост", StartWorkTime = 8, EndWorkTime = 17
            };

            el.PropertyChanged += post_PropertyChanged;
            ListPost.Add(el);
            SelectedPost        = el;
            CompleteSaveEnabled = true;
            VisAddPost          = Visibility.Collapsed;
        }
Пример #2
0
        public void Add(Post post, bool checkExist = false)
        {
            if (checkExist)
            {
                if (isExistPost(post.Id))
                {
                    return;
                }
            }

            ListPost.Add(post);
            //System.Diagnostics.Debug.WriteLine ("Added Post: " + post.Title);
        }
Пример #3
0
 private void UpdatePosts()
 {
     ListTypePost.Clear();
     ListPost.Clear();
     if (_handler.SelectedDep != null)
     {
         foreach (var item in _handler.Model.PostTypes)
         {
             ListTypePost.Add(item);
         }
         foreach (var item in _handler.SelectedDep.Posts)
         {
             ListPost.Add(new PostViewModel(item));
         }
     }
 }
Пример #4
0
        private void DesigneAddPostOrders()
        {
            foreach (var dep in PersonalHandler.Instance.Model.Departments)
            {
                foreach (var post in dep.Posts)
                {
                    ListPost.Add(new PostViewModel
                    {
                        ID            = post.ID,
                        Name          = string.Format("{0} ({1})", post.Name, dep.Name),
                        StartWorkTime = post.TimeFrom,
                        EndWorkTime   = post.TimeTo
                    });
                }
            }

            //Orders.Add(new OrderViewModel
            //{
            //    ID = Orders.Count,
            //    PostID = 2,
            //    User = Users[0],
            //    Car = new DISP_Car { CarModel = new CarListBaseDataModel { CarNumber = "Demo1", Mark = "Audio", Model = "A3" } },
            //    DateWork = Date + new TimeSpan(12, 0, 0),
            //    IsChanged = false,
            //    IsCanMoveToUse = true
            //});
            //Orders.Add(new OrderViewModel
            //{
            //    ID = Orders.Count,
            //    PostID = 3,
            //    User = Users[1],
            //    Car = new DISP_Car { CarModel = new CarListBaseDataModel { CarNumber = "Demo2", Mark = "Audio", Model = "A4" } },
            //    DateWork = Date + new TimeSpan(13, 0, 0),
            //    IsChanged = false,
            //    IsCanMoveToUse = true
            //});
            //Orders.Add(new OrderViewModel
            //{
            //    ID = Orders.Count,
            //    PostID = 1,
            //    User = Users[2],
            //    Car = new DISP_Car { CarModel = new CarListBaseDataModel { CarNumber = "Demo3", Mark = "Audio", Model = "A5" } },
            //    DateWork = Date + new TimeSpan(14, 30, 0),
            //    IsChanged = false, InUse = true
            //});
        }