Example #1
0
        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (tabControl1.SelectedIndex == 0)
            {
                GridviewSet.ShowData(dataGridView2, sDay, eDay);
            }

            switch (tabControl1.SelectedIndex)
            {
            case 0:
                GridviewSet.ShowData(dataGridView2, sDay, eDay);
                dataGridView2.CurrentCell = null;
                break;

            case 1:
                dataGridView1.CurrentCell = null;
                button6.Enabled           = false;
                button7.Enabled           = false;

                if (dataGridView1.RowCount > 0)
                {
                    button8.Enabled = true;
                }
                else
                {
                    button8.Enabled = false;
                }

                break;

            default:
                break;
            }
        }
Example #2
0
        private void frmHaifuShijiSUb_Load(object sender, EventArgs e)
        {
            //ウィンドウズ最小サイズ
            Utility.WindowsMinSize(this, this.Size.Width, this.Size.Height);

            //配布フラグをONにする
            Utility.FlgOnOff(FLG_ON);

            // 日付カレンダー用の開始日から終了日を取得
            sDay = dts.配布エリア.Where(a => a.配布指示ID == 0 && a.ステータス == 0).Min(a => a.受注1Row.配布開始日);
            eDay = dts.配布エリア.Where(a => a.配布指示ID == 0 && a.ステータス == 0).Max(a => a.受注1Row.配布終了日);

            TimeSpan ts   = eDay - sDay;
            double   days = ts.TotalDays;

            // 最長100日とします
            if (days > 100)
            {
                days = 100;
                eDay = sDay.AddDays(days);
            }

            //画面設定
            GridviewSet.Setting(dataGridView2, dts, jAdp, aAdp, sDay, days);
            GridviewSet.Setting2(dataGridView1);
            GridviewSet.ShowData(dataGridView2, sDay, eDay);
            dataGridView2.CurrentCell = null; //選択状態を回避する
        }
Example #3
0
        private void button5_Click(object sender, EventArgs e)
        {
            int rb = 0;

            //if (MessageBox.Show("チラシ在庫管理表を表示します。よろしいですか?", MESSAGE_CAPTION, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
            //    return;

            if (radioButton1.Checked)
            {
                rb = 0;
            }
            else
            {
                rb = 1;
            }

            GridviewSet.ShowData(dataGridView2, int.Parse(txtYear.Text), int.Parse(txtMonth.Text), rb, txtChirashiName.Text, Utility.strToInt64(txtsOrderNum.Text));
            dataGridView2.CurrentCell = null;

            if (dataGridView2.RowCount == 0)
            {
                MessageBox.Show("該当データがありませんでした", MESSAGE_CAPTION);
                button1.Enabled = false;
            }
            else
            {
                button1.Enabled = true;
            }
        }
Example #4
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == -1)
            {
                MessageBox.Show("対象チラシを選択してください");
                comboBox1.Focus();
                return;
            }

            try
            {
                Cursor.Current = Cursors.WaitCursor;    //カーソルを待機表示

                GridviewSet.ShowData(dataGridView2, comboBox1.SelectedIndex, txtCName.Text);
                dataGridView2.CurrentCell = null;
                dataGridView1.RowCount    = 0;

                button1.Enabled = false;
                label1.Text     = "【ポスティング詳細】";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Example #5
0
        private void frmHaifuShijiSUb_Load(object sender, EventArgs e)
        {
            ShowData();

            GridviewSet.Setting(dataGridView1);
            GridviewSet.ShowData(dataGridView1, int.Parse(_ID.ToString()));
        }
Example #6
0
        private void button5_Click(object sender, EventArgs e)
        {
            int officeID = 0;

            if (checkBox1.Checked == true)
            {
                if (comboBox1.SelectedIndex == -1)
                {
                    MessageBox.Show("事業所を選択してください", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    comboBox1.Focus();
                    return;
                }
                else
                {
                    //事業所コード
                    Utility.ComboOffice cmb1 = new Utility.ComboOffice();
                    cmb1     = (Utility.ComboOffice)comboBox1.SelectedItem;
                    officeID = cmb1.ID;
                }
            }

            //画面表示
            GridviewSet.ShowData(dataGridView2, Convert.ToDateTime(dateTimePicker1.Value.ToShortDateString()), officeID, comboBox1);
            dataGridView2.CurrentCell = null;

            if (dataGridView2.RowCount > 0)
            {
                button1.Enabled = true;
            }
        }
Example #7
0
        private void button6_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 0)
            {
                MessageBox.Show("未配布情報データが選択されていません", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (MessageBox.Show("選択された " + dataGridView1.SelectedRows.Count.ToString() + "件の未配布情報を削除します。よろしいですか?", "削除確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                dataGridView1.CurrentCell = null;
                return;
            }

            foreach (DataGridViewRow r in dataGridView1.SelectedRows)
            {
                int aID;
                aID = int.Parse(dataGridView1[0, r.Index].Value.ToString(), System.Globalization.NumberStyles.Any);

                //レコード削除
                Control.未配布情報 dArea = new Control.未配布情報();

                if (dArea.DataDelete(aID) == false)
                {
                    MessageBox.Show("削除に失敗しました。ID:" + aID.ToString(), MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                dArea.Close();
            }

            //未配布情報再表示
            GridviewSet.ShowData(dataGridView1, int.Parse(_ID.ToString()));
        }
Example #8
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (fDataCheck() == true)
                {
                    Control.支給控除 sCon = new Control.支給控除();

                    switch (fMode.Mode)
                    {
                    case 0:     //新規登録
                        if (MessageBox.Show("新規登録します。よろしいですか?", "登録確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                        {
                            sCon.Close();
                            return;
                        }

                        if (sCon.DataInsert(cMaster) == true)
                        {
                            MessageBox.Show("新規登録されました", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("新規登録に失敗しました", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        }

                        break;

                    case 1:     //更新
                        if (MessageBox.Show("更新します。よろしいですか?", "更新確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                        {
                            sCon.Close();
                            return;
                        }

                        if (sCon.DataUpdate(cMaster) == true)
                        {
                            MessageBox.Show("更新されました", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("更新に失敗しました", "支給控除", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        }

                        break;
                    }

                    sCon.Close();

                    DispClear();

                    GridviewSet.ShowData(dataGridView1);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "更新処理", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Example #9
0
        private void frmHaifuShijiSUb_Load(object sender, EventArgs e)
        {
            //ウィンドウズ最小サイズ
            Utility.WindowsMinSize(this, this.Size.Width, this.Size.Height);

            //グリッド定義
            GridviewSet.Setting(dataGridView2);
            GridviewSet.ShowData(dataGridView2);
            dataGridView2.CurrentCell = null; //選択状態を回避する
        }
Example #10
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            DateTime StartDate;
            DateTime EndDate;
            int      ShainID;

            try
            {
                if (comboBox1.SelectedIndex == -1)
                {
                    MessageBox.Show("担当者を選択してください", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (tDate.Checked == false)
                {
                    StartDate = Convert.ToDateTime("1900/01/01");
                }
                else
                {
                    StartDate = Convert.ToDateTime(tDate.Value.ToShortDateString());
                }

                if (tDate2.Checked == false)
                {
                    EndDate = Convert.ToDateTime("9999/12/31");
                }
                else
                {
                    EndDate = Convert.ToDateTime(tDate2.Value.ToShortDateString());
                }

                if (comboBox1.SelectedIndex == -1)
                {
                    ShainID = 0;
                }
                else
                {
                    Utility.ComboShain cmb1 = new Utility.ComboShain();
                    cmb1    = (Utility.ComboShain)comboBox1.SelectedItem;
                    ShainID = cmb1.ID;
                }

                GridviewSet.ShowData(dataGridView1, StartDate, EndDate, ShainID, label5, label6);

                if (dataGridView1.RowCount > 0)
                {
                    btnPrn.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "選択", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Example #11
0
        private void button5_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;   // 2019/02/13

            GridviewSet.ShowData(dataGridView2, Convert.ToDateTime(dateTimePicker1.Value.ToShortDateString()), Convert.ToDateTime(dateTimePicker2.Value.ToShortDateString()), txtsName.Text);
            dataGridView2.CurrentCell = null;
            dataGridView1.RowCount    = 0;

            this.Cursor = Cursors.Default;  // 2019/02/13

            button1.Enabled = false;
        }
Example #12
0
        private void button5_Click(object sender, EventArgs e)
        {
            frmHaifuShijiSUb3 frm3 = new frmHaifuShijiSUb3(MIHAIFU_ADD);

            frm3.FID = int.Parse(lblID.Text); //配布エリアID
            frm3.Add = lblAdd.Text;           //配布先住所

            frm3.ShowDialog();

            //再表示
            GridviewSet.ShowData(dataGridView1, int.Parse(_ID.ToString()));
        }
Example #13
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            int tYear, tMonth;

            try
            {
                if (Utility.NumericCheck(txtYear.Text) == false)
                {
                    MessageBox.Show("対象年は数字で入力してください", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtYear.Focus();
                    return;
                }

                if (Utility.NumericCheck(txtMonth.Text) == false)
                {
                    MessageBox.Show("対象月は数字で入力してください", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtMonth.Focus();
                    return;
                }

                if (int.Parse(txtMonth.Text, System.Globalization.NumberStyles.Any) < 1 || int.Parse(txtMonth.Text, System.Globalization.NumberStyles.Any) > 12)
                {
                    MessageBox.Show("対象月が正しくありません", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtMonth.Focus();
                    return;
                }

                //当月
                tYear  = int.Parse(txtYear.Text, System.Globalization.NumberStyles.Any);
                tMonth = int.Parse(txtMonth.Text, System.Globalization.NumberStyles.Any);

                //データ表示
                GridviewSet.ShowData(dataGridView1, tYear, tMonth);

                //見出し書き換え
                //dataGridView1.Columns[1].HeaderText = zMonth.ToString() + "月度実績";
                //dataGridView1.Columns[2].HeaderText = tMonth.ToString() + "月度実績";
                //dataGridView1.Columns[5].HeaderText = zMonth.ToString() + "月度収支";
                //dataGridView1.Columns[6].HeaderText = tMonth.ToString() + "月度収支";
                //dataGridView1.Columns[9].HeaderText = zMonth.ToString() + "月配布員";
                //dataGridView1.Columns[10].HeaderText = tMonth.ToString() + "月配布員";

                if (dataGridView1.RowCount > 0)
                {
                    btnPrn.Enabled  = true;
                    button1.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "選択", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Example #14
0
        private void GridEnter()
        {
            frmHaifuShijiSUb3 frm3 = new frmHaifuShijiSUb3(MIHAIFU_UPDATE);

            frm3.ID  = int.Parse(dataGridView1[0, dataGridView1.SelectedRows[0].Index].Value.ToString());
            frm3.Add = lblAdd.Text;     //配布先住所

            //編集画面表示
            frm3.ShowDialog();

            //再表示
            GridviewSet.ShowData(dataGridView1, int.Parse(_ID.ToString()));
        }
Example #15
0
        private void form_Load(object sender, EventArgs e)
        {
            //ウィンドウズ最小サイズ
            Utility.WindowsMinSize(this, this.Size.Width, this.Size.Height);

            //グリッド定義
            GridviewSet.Setting(dataGridView1);
            GridviewSet.ShowData(dataGridView1);

            DispClear();

            //配布指示画面からの呼び出しのとき
            if (ShowStatus == 1)
            {
                dateTimePicker1.Value = F_hDate;
                txthCode.Text         = F_配布員ID.ToString();
                lblName.Text          = F_配布員名;
            }
        }
Example #16
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("稼働日数一覧を表示します。よろしいですか?", MESSAGE_CAPTION, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
            {
                return;
            }

            GridviewSet.ShowData(dataGridView2, int.Parse(txtYear.Text), int.Parse(txtMonth.Text), int.Parse(txtDays.Text));
            dataGridView2.CurrentCell = null;

            if (dataGridView2.RowCount == 0)
            {
                MessageBox.Show("該当者はありませんでした", MESSAGE_CAPTION);
                button1.Enabled = false;
            }
            else
            {
                button1.Enabled = true;
            }
        }
Example #17
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            //削除確認
            if (MessageBox.Show("削除します。よろしいですか?", "削除確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }

            //データ削除
            Control.支給控除 sCon = new Control.支給控除();
            if (sCon.DataDelete(cMaster.ID) == true)
            {
                MessageBox.Show("削除されました", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            sCon.Close();

            DispClear();

            GridviewSet.ShowData(dataGridView1);
        }
Example #18
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (Utility.NumericCheck(txtYear.Text) == false)
                {
                    txtYear.Focus();
                    throw new Exception("年は数字で入力してください");
                }

                if (Utility.NumericCheck(txtMonth.Text) == false)
                {
                    txtMonth.Focus();
                    throw new Exception("月は数字で入力してください");
                }

                if ((int.Parse(txtMonth.Text) < 1) || (int.Parse(txtMonth.Text) > 12))
                {
                    txtMonth.Focus();
                    throw new Exception("月が正しくありません");
                }

                //カレンダー対象月表示
                dateTimePicker1.Enabled = true;
                dateTimePicker1.Value   = DateTime.Parse(txtYear.Text + "/" + txtMonth.Text + "/01");

                //日付別天候表示
                GridviewSet.ShowData(dataGridView1, int.Parse(txtYear.Text), int.Parse(txtMonth.Text));

                //入力開放
                dateTimePicker1.Enabled = true;
                comboBox1.Enabled       = true;
                btnUpdate.Enabled       = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
        }
Example #19
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            int officeID, tYear, tMonth, zYear, zMonth;

            try
            {
                if (comboBox1.SelectedIndex == -1)
                {
                    MessageBox.Show("事業所を選択してください", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    comboBox1.Focus();
                    return;
                }

                if (Utility.NumericCheck(txtYear.Text) == false)
                {
                    MessageBox.Show("対象年は数字で入力してください", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtYear.Focus();
                    return;
                }

                if (Utility.NumericCheck(txtMonth.Text) == false)
                {
                    MessageBox.Show("対象月は数字で入力してください", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtMonth.Focus();
                    return;
                }

                if (int.Parse(txtMonth.Text, System.Globalization.NumberStyles.Any) < 1 || int.Parse(txtMonth.Text, System.Globalization.NumberStyles.Any) > 12)
                {
                    MessageBox.Show("対象月が正しくありません", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtMonth.Focus();
                    return;
                }

                //当月
                tYear  = int.Parse(txtYear.Text, System.Globalization.NumberStyles.Any);
                tMonth = int.Parse(txtMonth.Text, System.Globalization.NumberStyles.Any);

                //前月
                if (tMonth == 1)
                {
                    zYear  = tYear - 1;
                    zMonth = 12;
                }
                else
                {
                    zYear  = tYear;
                    zMonth = tMonth - 1;
                }

                //事業所コード
                Utility.ComboOffice cmb1 = new Utility.ComboOffice();
                cmb1     = (Utility.ComboOffice)comboBox1.SelectedItem;
                officeID = cmb1.ID;

                //データ表示
                GridviewSet.ShowData(dataGridView1, tYear, tMonth, zYear, zMonth, officeID);

                //見出し書き換え
                dataGridView1.Columns[2].HeaderText  = zMonth.ToString() + "月度実績";
                dataGridView1.Columns[3].HeaderText  = tMonth.ToString() + "月度実績";
                dataGridView1.Columns[6].HeaderText  = zMonth.ToString() + "月度収支";
                dataGridView1.Columns[7].HeaderText  = tMonth.ToString() + "月度収支";
                dataGridView1.Columns[10].HeaderText = zMonth.ToString() + "月配布員";
                dataGridView1.Columns[11].HeaderText = tMonth.ToString() + "月配布員";

                if (dataGridView1.RowCount > 0)
                {
                    btnPrn.Enabled  = true;
                    button1.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "選択", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Example #20
0
 private void button2_Click(object sender, EventArgs e)
 {
     GridviewSet.ShowData(dataGridView2, int.Parse(txtYear.Text.ToString()), int.Parse(txtMonth.Text.ToString()));
     dataGridView2.CurrentCell = null; //選択状態を回避する
 }
Example #21
0
 private void frmHaifuShijiSUb_Load(object sender, EventArgs e)
 {
     GridviewSet.Setting(dataGridView2);
     GridviewSet.ShowData(dataGridView2);
     dataGridView2.CurrentCell = null; //選択状態を回避する
 }
Example #22
0
 private void button5_Click_1(object sender, EventArgs e)
 {
     GridviewSet.ShowData(dataGridView2, txtCName.Text);
     dataGridView2.CurrentCell = null;
     dataGridView1.RowCount    = 0;
 }
Example #23
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (fDataCheck() == true)
                {
                    Control.天候 cTenkou = new Control.天候();

                    switch (fMode.Mode)
                    {
                    case 0:     //新規登録
                        if (MessageBox.Show("新規登録します。よろしいですか?", "登録確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                        {
                            cTenkou.Close();
                            return;
                        }

                        if (cTenkou.DataInsert(cMaster) == true)
                        {
                            MessageBox.Show("新規登録されました", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("新規登録に失敗しました", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        }

                        break;

                    case 1:     //更新
                        if (MessageBox.Show("更新します。よろしいですか?", "更新確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                        {
                            cTenkou.Close();
                            return;
                        }

                        if (cTenkou.DataUpdate(cMaster) == true)
                        {
                            MessageBox.Show("更新されました", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("更新に失敗しました", MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        }

                        break;
                    }

                    cTenkou.Close();

                    //日付別天候表示
                    GridviewSet.ShowData(dataGridView1, int.Parse(txtYear.Text), int.Parse(txtMonth.Text));

                    //天候コンボリロード
                    Utility.ComboTenkou.load(comboBox1);

                    comboBox1.Text = "";

                    //DispClear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "更新処理", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }