public void ButtonClick()
 {
     window.ex.ExecuteWithoutRedaer("update repairorders set datestart='" + Convert.ToDateTime(window.ChangeDateStartOfRepairOrder.SelectedDate).Year + "-" + Convert.ToDateTime(window.ChangeDateStartOfRepairOrder.SelectedDate).Month + "-" + Convert.ToDateTime(window.ChangeDateStartOfRepairOrder.SelectedDate).Day + "' ,dateend='" + Convert.ToDateTime(window.ChangeDateEndOfRepairOrder.SelectedDate).Year + "-" + Convert.ToDateTime(window.ChangeDateEndOfRepairOrder.SelectedDate).Month + "-" + Convert.ToDateTime(window.ChangeDateEndOfRepairOrder.SelectedDate).Day + "', state='" + window.ChangeStatOfRepairOrder.SelectedItem.ToString().Split(' ')[1] + "', repairorders.desc='" + window.ChangeDescOfRepairOrder.Text + "',costofdetails=" + window.ChangeCostOfDetailsOfRepairOrder.Text.Replace(',', '.').Replace("₴", "") + " where idrepairorders=" + window.repairOrderForChange);
     window.hd.HideAll();
     window.RepairOrdersGrid.Visibility = Visibility.Visible;
     DataGridUpdater.RepairOrdersDataGridUpdate(window);
 }
Exemple #2
0
 public void ButtonClick()
 {
     if (window.AddClientOfRepairOrder.SelectedItem == null)
     {
         MessageBox.Show("Клиент не выбран"); return;
     }
     if (window.AddDeviceOfRepairOrder.SelectedItem == null)
     {
         MessageBox.Show("Устройство не выбрано"); return;
     }
     window.ex.ExecuteWithoutRedaer("INSERT INTO `repairorders`(`idclients`,`iddevices`,`datestart`,`dateend`,`state`,`desc`)VALUES((select idclients from clients where name='" + window.AddClientOfRepairOrder.SelectedItem.ToString() + "'),(select iddevices from devices where title='" + window.AddDeviceOfRepairOrder.SelectedItem.ToString() + "'),'" + Convert.ToDateTime(window.AddDateStartOfRepairOrder.SelectedDate).Year + "-" + Convert.ToDateTime(window.AddDateStartOfRepairOrder.SelectedDate).Month + "-" + Convert.ToDateTime(window.AddDateStartOfRepairOrder.SelectedDate).Day + "','" + Convert.ToDateTime(window.AddDateEndOfRepairOrder.SelectedDate).Year + "-" + Convert.ToDateTime(window.AddDateEndOfRepairOrder.SelectedDate).Month + "-" + Convert.ToDateTime(window.AddDateEndOfRepairOrder.SelectedDate).Day + "','Принят','" + window.AddDescOfRepairOrder.Text + "')");
     window.hd.HideAll();
     window.RepairOrdersGrid.Visibility = Visibility.Visible;
     DataGridUpdater.RepairOrdersDataGridUpdate(window);
 }
Exemple #3
0
        public void ButtonClick()
        {
            DataRowView DRV = window.RepairOrdersDataGrid.SelectedItem as DataRowView;

            if (DRV == null)
            {
                MessageBox.Show("Удаление прервано, Вы не выбрали запись для удаления."); return;
            }
            DataRow DR = DRV.Row;

            object[] arr = DR.ItemArray;
            window.ex.ExecuteWithoutRedaer("delete from repairorders where idrepairorders=" + arr[0]);
            window.ex.ExecuteWithoutRedaer("delete from repairorders_malfunctions where idrepairorders=" + arr[0]);
            DataGridUpdater.RepairOrdersDataGridUpdate(window);
        }
Exemple #4
0
 public void MenuClick()
 {
     window.hd.HideAll();
     window.RepairOrdersGrid.Visibility = Visibility.Visible;
     DataGridUpdater.RepairOrdersDataGridUpdate(window);
 }