示例#1
0
        private void SaveDeadlineDateBn_Click(object sender, RoutedEventArgs e)
        {
            if (IsDeadlineEditMode)
            {
                if (StartDate_DatePicker.SelectedDate != null && EndDate_DatePicker.SelectedDate != null)
                {
                    var startDate = StartDate_DatePicker.SelectedDate.Value;
                    var endDate   = EndDate_DatePicker.SelectedDate.Value;

                    int leftDays    = (EndDate_DatePicker.SelectedDate.Value - DateTime.Now).Days;
                    var absLeftDays = Math.Abs(leftDays);

                    LeftDatesLabel.Content = leftDays < 0 ? $"{absLeftDays}일 지남" : $"{absLeftDays}일 남음";
                    XmlBusinessManager.SetDeadline(BusinessName, new Deadline(startDate, endDate));

                    BusinessMessageBox.Show($"데드라인을 {startDate.ToShortDateString()}에서 {endDate.ToShortDateString()}까지로 설정했습니다.",
                                            "데드라인 설정", MessageBoxButton.OK);
                }
                else
                {
                    BusinessMessageBox.Show("데드라인 설정이 잘 못 되었습니다 올바른 값을 입력해주세요.", "정보 입력", Error: true);
                }
                SaveDeadlineDateBn.Content    = "데드라인 설정";
                SaveDeadlineDateBn.Background = (Brush)BrushConv.ConvertFrom("#FFF06200");
            }
            else
            {
                SaveDeadlineDateBn.Content    = "변경 확인";
                SaveDeadlineDateBn.Background = (Brush)BrushConv.ConvertFrom("#FF00B439");
            }

            StartDate_DatePicker.IsEnabled = !IsDeadlineEditMode;
            EndDate_DatePicker.IsEnabled   = !IsDeadlineEditMode;
            IsDeadlineEditMode             = !IsDeadlineEditMode;
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            string businessXmlPath = "./user_business.xml";

            if (!File.Exists(businessXmlPath) || !XmlBusinessManager.Defects())
            {
                XmlBusinessManager.CreateBasic();
            }
        }
示例#3
0
 private void WorkItemListview_Loaded(object sender, RoutedEventArgs e)
 {
     if (TaskList)
     {
         WorkItemListview.ItemsSource = XmlBusinessManager.GetAllTasks(BusinessName);
     }
     else
     {
         WorkItemListview.ItemsSource = XmlBusinessManager.GetAllMemos(BusinessName);
     }
 }
示例#4
0
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            Result.Title           = TitleTextBox.Text;
            Result.Content         = ContentTextBox.Text;
            Result.BackgroundColor = BackgroundGrid.Background;

            XmlBusinessManager.CreateNewMemo(BusinessName, Result);

            BusinessMessageBox.Show("새 메모를 만들었습니다.", "메모 생성");

            this.Close();
        }
示例#5
0
        private void BusinessListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            Business selected = BusinessListView.SelectedItem as Business;

            if (selected == null)
            {
                return;
            }

            BusinessTitle.Text       = selected.BusinessTitle;
            BusinessProcessBar.Value = XmlBusinessManager.ReassignBusinessProgress(selected.BusinessTitle);
        }
示例#6
0
        public BusinessWindow(string businessName)
        {
            InitializeComponent();

            BusinessName        = businessName.Trim();
            WindowTitle.Content = BusinessName;

            MonthlySales_TextBlock.Text  = XmlBusinessManager.GetMonthlyAimSales(BusinessName).ToString();
            BusinessScale_TextBlock.Text = XmlBusinessManager.GetBusinessAimScale(BusinessName).ToString();

            DeadlineDatesInit(BusinessName);
            BusinessProgressBarInit(BusinessName);
            DirectoryInit(BusinessName);
        }
示例#7
0
        //Refreshing
        public void RefreshTaskListView()
        {
            List <WorkTask> tasks = XmlBusinessManager.GetAllTasks(BusinessName);

            if (tasks == null)
            {
                BusinessMessageBox.Show("업무 파일에 심각한 오류가 있습니다.", "에러", MessageBoxButton.OK, true);
            }
            BusinessProgressBar.Value = XmlBusinessManager.ReassignBusinessProgress(BusinessName);
            TitleTextbox.Text         = "";
            DescribeTextbox.Text      = "";
            TaskPriorityTextbox.Text  = "";
            SelectedTask             = null;
            TaskListView.ItemsSource = tasks;
        }
示例#8
0
        private void CreateNewTaskBtn_Click(object sender, RoutedEventArgs e)
        {
            if (TitleTextbox.Text != "" && DescribeTextbox.Text != "" && TaskPriorityTextbox.Text != "")
            {
                Result = new WorkTask(0, TitleTextbox.Text, DescribeTextbox.Text, TaskPriorityTextbox.Text);

                XmlBusinessManager.CreateNewTask(business, Result);
                BusinessMessageBox.Show($"새 업무, {Result.Title}를 생성 완료했습니다.", "업무 생성");
                this.Close();
            }
            else
            {
                BusinessMessageBox.Show("빈 칸을 채워주세요.", "정보 입력");
            }
        }
示例#9
0
        private void RefreshBusinessList()
        {
            try
            {
                IEnumerable <Business> businesses = XmlBusinessManager.GetBusinesses();
                var val          = XmlBusinessManager.GetTotalBusinessProgressAverage();
                int progressAver = val > 100 ? 100 : val;

                BusinessListView.ItemsSource    = businesses;
                ProgressAverBar.Value           = progressAver;
                AttainedBusinessPercentage.Text = progressAver == -1 ? "전체 0% 달성" : $"전체 {progressAver}% 달성";
            }
            catch
            {
                BusinessMessageBox.Show("목록을 불러오는데에 실패하였습니다. 프로그램 파일을 건드렸는지 확인 부탁드립니다.", "에러", MessageBoxButton.OK, Error: true);
            }
        }
示例#10
0
        private void DeleteTaskBtn_Click(object sender, RoutedEventArgs e)
        {
            if (SelectedTask == null)
            {
                BusinessMessageBox.Show("선택된 업무가 없습니다.", "삭제 실패");
                return;
            }
            else if (BusinessMessageBox.Show($"정말 {SelectedTask.Title}를 삭제하시겠습니까?", "삭제", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                XmlBusinessManager.DeleteTask(BusinessName, SelectedTask.Index);

                BusinessMessageBox.Show($"{SelectedTask.Title}에 대한 삭제가 완료되었습니다.", "삭제 완료");

                SelectedTask = null;

                RefreshTaskListView();
            }
        }
示例#11
0
        public void DeadlineDatesInit(string business)
        {
            StartDate_DatePicker.IsEnabled = false;
            EndDate_DatePicker.IsEnabled   = false;

            Deadline savedDates = XmlBusinessManager.GetDeadline(business);

            if (savedDates != null)
            {
                StartDate_DatePicker.SelectedDate = savedDates.Start == null ? StartDate_DatePicker.DisplayDate : savedDates.Start;
                EndDate_DatePicker.SelectedDate   = savedDates.End == null ? DateTime.Now : savedDates.End;

                int leftDays    = (EndDate_DatePicker.SelectedDate.Value - DateTime.Now).Days;
                var absLeftDays = Math.Abs(leftDays);

                LeftDatesLabel.Content = leftDays < 0 ? $"{absLeftDays}일 지남" : $"{absLeftDays}일 남음";
            }
        }
        private void SubmitBtn_Click(object sender, RoutedEventArgs e)
        {
            if (BusinessTitle.Text == "")
            {
                BusinessMessageBox.Show("비지니스명을 지어주세요", "정보 입력");
                return;
            }
            else if (XmlBusinessManager.ExistBusiness(BusinessTitle.Text))
            {
                BusinessMessageBox.Show("존재하는 비지니스입니다.", "정보 입력", Error: true);
                return;
            }

            b.BusinessTitle = BusinessTitle.Text.Trim();
            b.Degdate       = DateTime.Now.ToShortDateString();
            b.Progress      = 0;

            int bs = 0, ms = 0;

            if (int.TryParse(BusinessScale_Textbox.Text, out bs))
            {
                b.BusinessScale = bs;
            }
            else
            {
                BusinessMessageBox.Show("숫자만 입력해주세요", "정보 입력", Error: true);
                return;
            }

            if (int.TryParse(MonthlySales_Textbox.Text, out ms))
            {
                b.MonthlySales = ms;
            }
            else
            {
                BusinessMessageBox.Show("숫자만 입력해주세요", "정보 입력", Error: true);
                return;
            }

            XmlBusinessManager.CreateNewBusiness(b);

            this.Close();
        }
示例#13
0
        private void DeleteBusinessBtn_Click(object sender, RoutedEventArgs e)
        {
            if (BusinessTitle.Text == "")
            {
                BusinessMessageBox.Show("선택된 업무가 없습니다.", "업무 선택");
                return;
            }

            string msg = $"정말로 {BusinessTitle.Text}/{BusinessProcessBar.Value}% 를 삭제하시겠습니까?";

            if (BusinessMessageBox.Show(msg, "삭제", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                if (XmlBusinessManager.ExistBusiness(BusinessTitle.Text))
                {
                    XmlBusinessManager.DeleteBusiness(BusinessTitle.Text);
                    BusinessTitle.Text = "";

                    RefreshBusinessList();
                }
            }
        }
示例#14
0
        private void MemoStack_Loaded(object sender, RoutedEventArgs e)
        {
            var memos = XmlBusinessManager.GetSomeMemos(BusinessName, 5); //least three

            CreateMemoStacks(memos);
        }
示例#15
0
        private void EditTaskBtn_Click(object sender, RoutedEventArgs e)
        {
            if (SelectedTask == null)
            {
                BusinessMessageBox.Show("선택된 업무가 없습니다.", "업무 선택");
                return;
            }

            if (IsEditMode) //saving
            {
                EditTaskBtn.Content    = "수정";
                EditTaskBtn.Background = Brushes.Gray;

                if (SelectedTask.Title == TitleTextbox.Text &&
                    SelectedTask.Content == DescribeTextbox.Text &&
                    SelectedTask.Priority == TaskPriorityTextbox.Text &&
                    SelectedTask.Accomplished == AccomplishCheckBox.IsChecked)
                {
                    BusinessMessageBox.Show("변경사항이 없습니다.", "정보 변경");
                }
                else
                {
                    if (SelectedTask.Title != TitleTextbox.Text)
                    {
                        var nowPath = AppDomain.CurrentDomain.BaseDirectory;

                        if (Directory.Exists($@".\{BusinessName}\{SelectedTask.Title}"))
                        {
                            Directory.Move($@"{nowPath}{BusinessName}\{SelectedTask.Title}", $@"{nowPath}{BusinessName}\{TitleTextbox.Text}");
                        }

                        XmlBusinessManager.SetTaskTitle(BusinessName, SelectedTask.Index, TitleTextbox.Text);
                    }
                    if (SelectedTask.Content != DescribeTextbox.Text)
                    {
                        XmlBusinessManager.SetTaskDescribeText(BusinessName, SelectedTask.Index, DescribeTextbox.Text);
                    }
                    if (SelectedTask.Priority != TaskPriorityTextbox.Text)
                    {
                        XmlBusinessManager.SetTaskPriority(BusinessName, SelectedTask.Index, TaskPriorityTextbox.Text);
                    }
                    if (SelectedTask.Accomplished != AccomplishCheckBox.IsChecked)
                    {
                        XmlBusinessManager.SetTaskAccomplished(BusinessName, SelectedTask.Index, bool.Parse(AccomplishCheckBox.IsChecked.ToString()));
                    }

                    BusinessMessageBox.Show("변경 완료되었습니다.", "정보 변경");
                    RefreshTaskListView();
                }
            }
            else
            {
                EditTaskBtn.Background = Brushes.Green;
                EditTaskBtn.Content    = "변경 확인";
            }

            TitleTextbox.IsEnabled        = !TitleTextbox.IsEnabled;
            DescribeTextbox.IsEnabled     = !DescribeTextbox.IsEnabled;
            TaskPriorityTextbox.IsEnabled = !TaskPriorityTextbox.IsEnabled;
            AccomplishCheckBox.IsEnabled  = !AccomplishCheckBox.IsEnabled;
            AddFileBtn.IsEnabled          = !AddFileBtn.IsEnabled;
            IsEditMode = !IsEditMode;
        }
示例#16
0
        public void RefreshLeastMemoStacks(int howMany)
        {
            var memos = XmlBusinessManager.GetSomeMemos(BusinessName, howMany);

            CreateMemoStacks(memos);
        }
示例#17
0
 private void SetListToTaskBtn_Click(object sender, RoutedEventArgs e)
 {
     TaskList = true;
     WorkItemListview.ItemsSource = XmlBusinessManager.GetAllTasks(BusinessName);
 }
示例#18
0
 public void BusinessProgressBarInit(string business)
 {
     BusinessProgressBar.Value = XmlBusinessManager.GetBusinessProgress(business);
 }
示例#19
0
 private void SetListToMemoBtn_Cick(object sender, RoutedEventArgs e)
 {
     TaskList = false;
     WorkItemListview.ItemsSource = XmlBusinessManager.GetAllMemos(BusinessName);
 }