123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace RedmineOracle
- {
- /// <summary>
- /// Логика взаимодействия для pgLRP.xaml
- /// </summary>
- public partial class pgLRP : Page
- {
- OracleWork ow;
- int id;
- int check;
- string currSt;
- ListIstIssues li;
- List<OracleWork.StatusInfo> statuses;
- public pgLRP(int id)
- {
- InitializeComponent();
- check = 0;
- this.id = id;
- ow = new OracleWork();
- li = new ListIstIssues();
- DataContext = ow.CurrentLRP(id);
- statuses = ow.getAllStatus(ow.CurrentLRP(id).Status);
- cbStatus.ItemsSource = ow.getAllStatus(ow.CurrentLRP(id).Status);
- cbStatus.SelectedValuePath = "idStatus";
- cbStatus.DisplayMemberPath = "statusName";
- cbStatus.SelectedIndex = 0;
- currSt = cbStatus.SelectedValue.ToString();
- lbComm.ItemsSource = ow.CreateListComm(id);
- tbIdIss.Text = ow.FindRmIssue(id.ToString());
- if (tbIdIss.Text != "Н/З")
- LoadPages.rmFrame.Navigate(new pgIssue(Convert.ToInt32(tbIdIss.Text), true));
- ListInfo.lbForum = lbComm;
- }
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- ow.insertComm(Convert.ToInt32(tbId.Text), tbSComm.Text, tbComm.Text);
- lbComm.ItemsSource = ow.CreateListComm(id);
- tbIdIss.Text = ow.FindRmIssue(id.ToString());
- if (tbIdIss.Text != "Н/З")
- LoadPages.rmFrame.Navigate(new pgIssue(Convert.ToInt32(tbIdIss.Text), true));
- }
- private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
- {
- TextBlock tb = sender as TextBlock;
- string id = tb.Uid;
- new windDrpFile(id).ShowDialog();
- }
- private void AddCommToRM(object sender, MouseButtonEventArgs e)
- {
- }
- private void btnCreateIss_Click(object sender, RoutedEventArgs e)
- {
- new windCreateIssLRP(tbId.Text, tbMiniInf.Text, tbFullInf.Text, tbModule.Text).ShowDialog();
- tbIdIss.Text = ow.FindRmIssue(id.ToString());
- if (tbIdIss.Text != "Н/З")
- LoadPages.rmFrame.Navigate(new pgIssue(Convert.ToInt32(tbIdIss.Text), true));
- }
- private void btnInsert_Click(object sender, RoutedEventArgs e)
- {
- Button btn = sender as Button;
- int idDRP = Convert.ToInt32(btn.Uid);
- MessageBoxResult result = MessageBox.Show("Внести изменнения?", "Внесение изменений", MessageBoxButton.YesNo, MessageBoxImage.Information);
- if (result == MessageBoxResult.Yes)
- {
- if (tbIdIss.Text != "Н/З")
- {
- ListIstIssues li = new ListIstIssues();
- li.AddNewComm(Convert.ToInt32(tbIdIss.Text), ow.InserCommToRB(idDRP));
- ListInfo.lbRedmine.ItemsSource = li.listNotes(Convert.ToInt32(tbIdIss.Text));
- }
- else
- MessageBox.Show("Для данной проблемы нет связной задачи !");
- }
- }
- private void tbDonFile_MouseDown(object sender, MouseButtonEventArgs e)
- {
- TextBlock tb = sender as TextBlock;
- string id = tb.Uid;
- new windLRPFile(id).ShowDialog();
- }
- private void btnRefreshComm_Click(object sender, RoutedEventArgs e)
- {
- ow = new OracleWork();
- lbComm.ItemsSource = ow.CreateListComm(id);
- }
- private void cbStatus_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (check > 0)
- {
- MessageBoxResult result = MessageBox.Show("Внести изменнения?", "Внесение изменений", MessageBoxButton.YesNo, MessageBoxImage.Information);
- if (result == MessageBoxResult.Yes)
- {
- OracleWork.StatusInfo curr = statuses.FirstOrDefault(x => x.idStatus == currSt);
- OracleWork.StatusInfo newS = statuses.FirstOrDefault(x => x.idStatus == cbStatus.SelectedValue.ToString());
- string currS = curr.statusName;
- string newSt = newS.statusName;
- ow.updateStatus(tbId.Text, currS, newSt, cbStatus.SelectedValue.ToString());
- currSt = cbStatus.SelectedValue.ToString();
- }
- else
- {
- check = 0;
- cbStatus.SelectedIndex = 0;
- }
- check++;
- }
- check++;
- }
- }
- }
|