예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                //if (MessageBox.Show("Перед зачислением будет произведен поиск и удаление повторяющихся записей,\nвсе найденные записи будут полностью удалены из очереди!\nХотите продолжить?", "Предупреждение", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
                if (MessageBox.Show("Произвести зачисление в детские сады?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                {
                    //FindAndDeletePovtor(); Временно отключена до выяснения необходимости удаления повторяющихся объектов

                    int[] kodi = new int[dataGridView2.Rows.Count];
                    for (int i = 0; i < dataGridView2.Rows.Count; i++)
                    {
                        kodi[i] = Convert.ToInt32(dataGridView2.Rows[i].Cells["kodinfodDataGridViewTextBoxColumn"].Value);
                        DataTable dt_info = getFullInfoTableAdapter.GetData(kodi[i]);
                        info_rebenokTableAdapter.SetZachislen(true, kodi[i]);
                        info_o_zachislenTableAdapter.Insert(kodi[i], dt_info.Rows[0]["fam"].ToString(), dt_info.Rows[0]["ima"].ToString(), dt_info.Rows[0]["otch"].ToString(), Convert.ToInt32(dt_info.Rows[0]["kod_ou"]), null, null, DateTime.Parse(dt_info.Rows[0]["data_rozhden"].ToString()), dateTimePicker1.Value, false, dt_info.Rows[0]["adress"].ToString(), dt_info.Rows[0]["telefon"].ToString(), dt_info.Rows[0]["name_lgot"].ToString());
                    }
                    Form_report_putevka f_rep = new Form_report_putevka();
                    f_rep.Owner = this;
                    f_rep.kodi = kodi;
                    f_rep.variant = 3;
                    f_rep.ShowDialog();
                    Form1 f_1 = (Form1)this.Owner;
                    f_1.Form1_Load(null, EventArgs.Empty);
                    Close();
                }
            }
            catch (Exception ex)
            {
                of.ErrorInfoToFile(ex);
            }
        }
예제 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
               // textBox_kod_reb.Text = "94";
                if (textBox_kod_reb.Text != "")
                {
                    print_uvedomTableAdapter.Delete();
                    this.print_uvedomTableAdapter.Fill(this.electronOcheredDataSet.print_uvedom);
                    this.info_rebenokTableAdapter.Fill(this.electronOcheredDataSet.info_rebenok);
                    this.info_registrationTableAdapter.Fill(this.electronOcheredDataSet.info_registration);
                    this.info_predstavitelTableAdapter.Fill(this.electronOcheredDataSet.info_predstavitel);
                    DataRow[] dr = electronOcheredDataSet.info_registration.Select("kod_info_d=" + textBox_kod_reb.Text);

                    DateTime dat = (DateTime)info_rebenokTableAdapter.GetDataRozhden(Convert.ToInt32(textBox_kod_reb.Text));
                    DateTime[] dat_min_max = GetMinMaxDate(dat);
                    int nom_po_v = -1;

                    for (int i = 0; i < dr.Length; i++)
                    {
                        int nom = Convert.ToInt32(info_rebenokTableAdapter.GetNomO(Convert.ToInt32(textBox_kod_reb.Text), Convert.ToInt32(dr[i]["kod_ou"])));
                        DataRow[] dr_reb = electronOcheredDataSet.info_rebenok.Select("kod_info_d=" + textBox_kod_reb.Text);
                        DataRow[] dr_rod = electronOcheredDataSet.info_predstavitel.Select("kod_info_predst=" + Convert.ToInt32(dr_reb[0]["kod_predstavitel"]));

                        if (dat_min_max != null)
                        {
                            nom_po_v = Convert.ToInt32(info_rebenokTableAdapter.GetKodPoV(Convert.ToInt32(textBox_kod_reb.Text), dat_min_max[1], dat_min_max[0], Convert.ToInt32(dr[i]["kod_ou"])));
                        }
                        print_uvedomTableAdapter.Insert(Convert.ToInt32(textBox_kod_reb.Text), nom, nom_po_v, dr_reb[0]["fam"].ToString(), dr_reb[0]["ima"].ToString(), dr_reb[0]["otch"].ToString(), DateTime.Parse(dr_reb[0]["data_rozhden"].ToString()), dr_rod[0]["fam_p"].ToString(), dr_rod[0]["ima_p"].ToString(), dr_rod[0]["otch_p"].ToString(), ouTableAdapter.GetNamePoKod(Convert.ToInt32(dr[i]["kod_ou"])), DateTime.Parse(dr[i]["date_reg"].ToString()));
                    }
                    Form_report_putevka f_rep = new Form_report_putevka();
                    f_rep.Owner = this;
                    f_rep.kod = textBox_kod_reb.Text;
                    f_rep.nom_ob = 1;//nom
                    f_rep.nom_po_v = nom_po_v;
                    f_rep.variant = 4;
                    f_rep.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                of.ErrorInfoToFile(ex);
            }
        }
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (textBox1.Text != "")
         {
             DataTable dt_info = getFullInfoTableAdapter.GetData(Convert.ToInt32(textBox1.Text));
             info_rebenokTableAdapter.SetZachislen(true, Convert.ToInt32(textBox1.Text));
             info_o_zachislenTableAdapter.Insert(Convert.ToInt32(textBox1.Text), dt_info.Rows[0]["fam"].ToString(), dt_info.Rows[0]["ima"].ToString(), dt_info.Rows[0]["otch"].ToString(), Convert.ToInt32(dt_info.Rows[0]["kod_ou"]), (int)comboBox2.SelectedValue, null, DateTime.Parse(dt_info.Rows[0]["data_rozhden"].ToString()), DateTime.Now, false, dt_info.Rows[0]["adress"].ToString(), dt_info.Rows[0]["telefon"].ToString(), dt_info.Rows[0]["name_lgot"].ToString());
             FillDataTable();
             Form_report_putevka f_rep = new Form_report_putevka();
             f_rep.Owner = this;
             f_rep.kod = textBox1.Text;
             f_rep.variant = 0;
             f_rep.ShowDialog();
             textBox1.Text = "";
         }
         else
         {
             MessageBox.Show("Не выбрана не одна запись,\nперед зачислением, необходимо выбрать запись\n дважды щелкнув по ней.", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         of.ErrorInfoToFile(ex);
     }
 }
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         Form_report_putevka f_rep = new Form_report_putevka();
         f_rep.Owner = this;
         f_rep.kod = textBox1.Text;
         f_rep.variant = 1;
         f_rep.ShowDialog();
     }
     catch (Exception ex)
     {
         of.ErrorInfoToFile(ex);
     }
 }
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     try
     {
         dataGridView1.EndEdit();
         infoozachislenBindingSource.EndEdit();
         int kol = 0;
         for (int i = 0; i < dataGridView1.Rows.Count; i++)
         {
             if ((bool)dataGridView1.Rows[i].Cells["rasmotrenoDataGridViewCheckBoxColumn"].Value == true)
             {
                 kol++;
             }
         }
         int[] kodi = new int[kol];
         kol = 0;
         for (int i = 0; i < dataGridView1.Rows.Count; i++)
         {
             if ((bool)dataGridView1.Rows[i].Cells["rasmotrenoDataGridViewCheckBoxColumn"].Value == true)
             {
                 kodi[kol] = Convert.ToInt32(dataGridView1.Rows[i].Cells["kodrebenokDataGridViewTextBoxColumn"].Value);
                 kol++;
             }
         }
         this.info_o_zachislenTableAdapter.Update(this.electronOcheredDataSet.info_o_zachislen);
         Form_report_putevka f_rep = new Form_report_putevka();
         f_rep.Owner = this;
         f_rep.kodi = kodi;
         f_rep.variant = 2;
         if (kodi.Length > 0 && !Convert.ToBoolean(toolStripComboBox1.SelectedIndex))
             f_rep.ShowDialog();
         info_o_zachislenTableAdapter.Fill(this.electronOcheredDataSet.info_o_zachislen, Convert.ToBoolean(toolStripComboBox1.SelectedIndex));
     }
     catch (Exception ex)
     {
         of.ErrorInfoToFile(ex);
     }
 }
예제 #6
0
 private void общийСписокToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form_report_putevka f_rep = new Form_report_putevka();
     //f_rep.Owner = this;
     f_rep.name_ou = toolStripComboBox1.Text;
     //f_rep.nom_ob = 1;//nom
     //f_rep.nom_po_v = nom_po_v;
     f_rep.variant = 5;
     f_rep.ShowDialog();
 }