Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //MessageBox.Show("");
            if (comboBox1.Text == string.Empty)
            {
                MessageBox.Show("Выберите отдел фондодержателя!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (comboBox2.Text == string.Empty)
            {
                MessageBox.Show("Выберите год!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (comboBox3.Text == string.Empty)
            {
                MessageBox.Show("Выберите акт!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            List <string> l           = new List <string>();
            List <Book>   ListOfBooks = reader_.GetBooksOnAct(comboBox3.SelectedItem.ToString());

            if (ListOfBooks == null)
            {
                MessageBox.Show("Указанный акт не содержит книг!");
                return;
            }
            if (Book.CountAllWOFFInvs(ListOfBooks) != reader_.GetInvsCountOnAct(comboBox3.Text))
            {
                if (MessageBox.Show("Не совпадает количесвто фактически списываемых инвентарей(" + Book.CountAllWOFFInvs(ListOfBooks) + ") с указанным в акте(" + reader_.GetInvsCountOnAct(comboBox3.Text) + "). Продолжить?", "Внимание", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }
            }
            MSWordInserter          wrd    = new MSWordInserter(this.Base);
            KeyValuePair <int, int> counts = wrd.AddBooksToTableTemplate(ListOfBooks, comboBox3.SelectedItem.ToString(), comboBox1.SelectedItem.ToString());

            wrd.CreateAct(this.comboBox3.SelectedItem.ToString(),
                          comboBox1.SelectedItem.ToString(),
                          counts.Key, counts.Value,
                          (int)numericUpDown1.Value,
                          reader_.GetTransferDirection(comboBox3.SelectedItem.ToString()),
                          reader_.GetCause(comboBox3.SelectedItem.ToString())
                          );
        }
Exemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            MSWordInserter ms = new MSWordInserter("BJVVV");

            ms.CreateAct("123", "department", 100, 12, 14, "makulature", "old");
        }