Exemplo n.º 1
0
        private void docBuildAllInfo(frmDocument frm, List<string> str)
        {
            DateTime date = new DateTime();
            date = DateTime.Parse(dgvOne.CurrentRow.Cells[4].Value.ToString());

            str.Add("BuildAllInfo");
            str.Add(dgvOne.CurrentRow.Cells[0].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[1].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[2].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[3].Value.ToString());
            str.Add(date.ToShortDateString());
            str.Add(dgvOne.CurrentRow.Cells[5].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[6].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[7].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[8].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[9].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[10].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[11].Value.ToString());
            if (bool.Parse(dgvOne.CurrentRow.Cells[12].Value.ToString()) == true)
            {
                str.Add("Есть");
            }
            else
            {
                str.Add("Отсутствует");
            }
            if (bool.Parse(dgvOne.CurrentRow.Cells[13].Value.ToString()) == true)
            {
                str.Add("Есть");
            }
            else
            {
                str.Add("Отсутствует");
            }
            if(bool.Parse(dgvOne.CurrentRow.Cells[14].Value.ToString()) == true)
            {
                str.Add("Есть");
            }
            else
            {
                str.Add("Отсутствует");
            }

            str.Add(dgvOne.CurrentRow.Cells[15].Value.ToString());

            frm.doc(str);
        }
Exemplo n.º 2
0
        private void docLiter(frmDocument frm, List<string> str)
        {
            str.Add("Liter");
            str.Add(dgvOne.CurrentRow.Cells[0].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[1].Value.ToString());

            if (dgvOne.CurrentRow.Cells[2].Value.ToString() == "1")
            {
                str.Add("Основной");
            }
            else
            {
                str.Add("Дополнительный");
            }

            str.Add(dgvOne.CurrentRow.Cells[3].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[4].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[5].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[6].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[7].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[8].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[9].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[10].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[11].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[12].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[13].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[14].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[15].Value.ToString());

            frm.doc(str);
        }
Exemplo n.º 3
0
        private void вДокументToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                string table = dgvOne.DataSource.ToString();
                frmDocument frm = new frmDocument();
                List<string> str = new List<string>();

                switch (table)
                {
                    case "Build":
                        docBuildShot(frm, str);
                        break;
                    case "Liter":
                        docLiter(frm, str);
                        break;
                    case "BuildAllInfo":
                        docBuildAllInfo(frm, str);
                        break;
                }
                frm.Show();
            }
            catch (Exception)
            {
                MessageBox.Show("Не открыта таблица", "Ошибка чтения данных из таблицы", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            }
        }
Exemplo n.º 4
0
        private void docBuildShot(frmDocument frm, List<string> str)
        {
            DateTime date = DateTime.Parse(dgvOne.CurrentRow.Cells[4].Value.ToString());

            str.Add("Build");
            str.Add(dgvOne.CurrentRow.Cells[0].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[1].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[2].Value.ToString());
            str.Add(dgvOne.CurrentRow.Cells[3].Value.ToString());
            str.Add(date.ToShortDateString());

            frm.doc(str);
        }