示例#1
0
        private void btnJYU_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms.Cast <Form>().Any(form => form.Name == "生産予定入力"))
            {
                Application.OpenForms["生産予定入力"].Hide();
            }
            if (Application.OpenForms.Cast <Form>().Any(form => form.Name == "一覧確認"))
            {
                Application.OpenForms["一覧確認"].Hide();
            }
            if (Application.OpenForms.Cast <Form>().Any(form => form.Name == "確定受注入力"))
            {
                Application.OpenForms["確定受注入力"].Show();
                Application.OpenForms["確定受注入力"].Activate();
                if (Application.OpenForms.Cast <Form>().Any(form => form.Name == "図番マスター"))
                {
                    if (Application.OpenForms["図番マスター"].Visible)
                    {
                        Application.OpenForms["図番マスター"].Hide();
                    }
                }
            }
            else
            {
                確定受注入力 f1 = new 確定受注入力();
                f1.StartPosition = FormStartPosition.Manual;

                f1.Show(this);

                if (Application.OpenForms.Cast <Form>().Any(form => form.Name == "図番マスター"))
                {
                    if (Application.OpenForms["図番マスター"].Visible)
                    {
                        Application.OpenForms["図番マスター"].Hide();
                    }
                }
            }
            //this.Close();
        }
示例#2
0
        /// <summary>
        /// 使ってない
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvIchiran_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            string cyuno  = dgvIchiran.Rows[e.RowIndex].Cells[1].Value.ToString();
            string zuban  = dgvIchiran.Rows[e.RowIndex].Cells[2].Value.ToString();
            string sname  = dgvIchiran.Rows[e.RowIndex].Cells[3].Value.ToString();
            string kisyu  = dgvIchiran.Rows[e.RowIndex].Cells[4].Value.ToString();
            string tanka  = dgvIchiran.Rows[e.RowIndex].Cells[5].Value.ToString();
            string cyusu  = dgvIchiran.Rows[e.RowIndex].Cells[6].Value.ToString();
            string cyudt  = dgvIchiran.Rows[e.RowIndex].Cells[7].Value.ToString();
            string nouki  = dgvIchiran.Rows[e.RowIndex].Cells[8].Value.ToString();
            string tokcd  = dgvIchiran.Rows[e.RowIndex].Cells[9].Value.ToString();
            string noucd  = dgvIchiran.Rows[e.RowIndex].Cells[10].Value.ToString();
            string nounyu = "19850726";

            string nam   = nouki.Substring(0, 4);
            string thang = nouki.Substring(5, 2);
            string ngay  = nouki.Substring(8, 2);

            nouki = nam + thang + ngay;

            string nam1   = cyudt.Substring(0, 4);
            string thang1 = cyudt.Substring(5, 2);
            string ngay1  = cyudt.Substring(8, 2);

            cyudt = nam1 + thang1 + ngay1;

            tokcd = tokcd.Substring(0, 3);

            noucd = noucd.Substring(0, 3);
            if (cbxJyuchyuu.SelectedItem.ToString().Equals("確定受注"))
            {
                if (Application.OpenForms.Cast <Form>().Any(form => form.Name == "確定受注入力"))
                {
                    確定受注入力 f1 = (確定受注入力)Application.OpenForms["確定受注入力"];
                    f1.Show();
                    f1.Activate();
                    f1.updateRecord(cyuno, zuban, sname, kisyu, tanka, cyusu, cyudt, nouki, nounyu, tokcd, noucd);
                }
                else
                {
                    確定受注入力 f1 = new 確定受注入力();
                    f1.Show();
                    f1.updateRecord(cyuno, zuban, sname, kisyu, tanka, cyusu, cyudt, nouki, nounyu, tokcd, noucd);
                }
            }
            else
            {
                if (Application.OpenForms.Cast <Form>().Any(form => form.Name == "生産予定入力"))
                {
                    生産予定入力 f1 = (生産予定入力)Application.OpenForms["生産予定入力"];
                    f1.Show();
                    f1.Activate();
                    f1.updateRecord(zuban, sname, kisyu, tanka, cyusu, cyudt, nounyu, tokcd, noucd);
                }
                else
                {
                    生産予定入力 f1 = new 生産予定入力();
                    f1.Show();
                    f1.updateRecord(zuban, sname, kisyu, tanka, cyusu, cyudt, nounyu, tokcd, noucd);
                }
            }
        }