Exemplo n.º 1
0
        private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                DataTable DT;
                DataRow   New_row;
                if (Server.GetServer.DataBase("uit")
                    .ExecuteCommand("select * from rz_naim_cherch where naim = '" + tmp.Naim + "' and cherch = '"
                                    + tmp.Cherch + "'").Count == 0)
                {
                    DT         = Server.GetServer.DataBase("uit").Table("select * from rz_naim_cherch").LoadTableFromServer();
                    New_row    = DT.NewRow();
                    New_row[0] = tmp.Naim;
                    New_row[1] = tmp.Cherch;
                    DT.Rows.Add(New_row);
                    Server.GetServer.DataBase("uit").Table("select * from rz_naim_cherch").UpdateServerData(DT);
                }
                if (Server.GetServer.DataBase("uit")
                    .ExecuteCommand("select * from rz_ser_nom_naim where ser_nom = '" + textbox.Text
                                    + "' and naim = '" + tmp.Naim + "'").Count == 0)
                {
                    DT         = Server.GetServer.DataBase("uit").Table("select * from rz_ser_nom_naim").LoadTableFromServer();
                    New_row    = DT.NewRow();
                    New_row[0] = textbox.Text;
                    New_row[1] = tmp.Naim;
                    DT.Rows.Add(New_row);
                    Server.GetServer.DataBase("uit").Table("select * from rz_ser_nom_naim").UpdateServerData(DT);
                }

                SlugebZapiska FL = new SlugebZapiska(tmp.Nom_sz, textbox.Text);
                FL.Show();
                this.Close();
            }
        }
 private void listBox_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if ((sender as DataGrid).SelectedItem != null)
     {
         SlugebZapiska SZ = new SlugebZapiska((e.OriginalSource as TextBlock).Text);
         SZ.Show();
     }
 }
Exemplo n.º 3
0
 private void ComboBox_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (combo_box.SelectedItem == null)
         {
             combo_box.SelectedItem = combo_box.Items.CurrentItem;
         }
         else
         {
             SlugebZapiska SZ = new SlugebZapiska(combo_box.SelectedItem.ToString());
             SZ.Show();
             this.Close();
         }
     }
 }
Exemplo n.º 4
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            Server.GetServer.DataBase("uit").Table("select * from rz_plan_rabot")
            .UpdateServerData(Converter.ToSave(Rows));
            IsSave = true;
            string Nom_sz = (main_table.SelectedItem as RowPlanViewModal).Nom_sz;

            if (References.GetReferences.IsSerInReference((main_table.SelectedItem as RowPlanViewModal).Ser_nom))
            {
                switch ((sender as MenuItem).Header as string)
                {
                case "Дерево дефектации":
                    Tree_defect TD = new Tree_defect(Nom_sz);
                    TD.Show();
                    break;

                case "Цеха":
                    Work_shop WS = new Work_shop(Nom_sz);
                    WS.Show();
                    break;

                case "Служебная записка":
                    if (Nom_sz == (main_table.SelectedItem as RowPlanViewModal).Ser_nom)
                    {
                        CreateWindowNumberSZ_OUP Nom_sz_enter = new CreateWindowNumberSZ_OUP();
                        Nom_sz_enter.ShowDialog();
                        Nom_sz = Nom_sz_enter.Return_nom_sz();
                    }
                    if (Nom_sz != null)
                    {
                        SlugebZapiska FL = new SlugebZapiska(Nom_sz);
                        FL.Show();
                    }
                    break;
                }
            }
        }
Exemplo n.º 5
0
        private void MenuItem_Click_3(object sender, RoutedEventArgs e)
        {
            SlugebZapiska FL = new SlugebZapiska(Rows[Rows.Count - 1].Nom_sz + 1);

            FL.Show();
        }