Exemplo n.º 1
0
        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                // 確認
                if (MessageBox.Show("削除してよろしいですか?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
                {
                    return;
                }

                // 削除
                guideDataSet.メール定型文Row r = dts.メール定型文.Single(a => a.ID == fMode.ID);
                r.Delete();
            }
            catch (Exception ex)
            {
                MessageBox.Show("データの削除に失敗しました" + Environment.NewLine + ex.Message);
            }
            finally
            {
                // 削除をコミット
                adp.Update(dts.メール定型文);

                // データテーブルにデータを読み込む
                adp.Fill(dts.メール定型文);

                // データグリッドビューにデータを再表示します
                GridViewShow(dg);

                // 画面データ消去
                DispInitial();
            }
        }
Exemplo n.º 2
0
        /// -------------------------------------------------------
        /// <summary>
        ///     マスターの内容を画面に表示する </summary>
        /// <param name="sTemp">
        ///     マスターインスタンス</param>
        /// -------------------------------------------------------
        private void ShowData(guideDataSet.メール定型文Row s)
        {
            fMode.ID = s.ID;

            txtSubject.Text = s.件名;

            if (s.種別 > 0)
            {
                comboBox1.SelectedIndex = s.種別 - 1;
            }

            txtComment.Text  = s.前文;
            txtComment2.Text = s.後文;

            //linkLabel2.Visible = true;
            //linkLabel1.Visible = true;
            linkLabel2.Enabled = true;
            linkLabel1.Enabled = true;
        }
Exemplo n.º 3
0
        /// ---------------------------------------------------------------------
        /// <summary>
        ///     グリッドビュー行選択時処理 </summary>
        /// ---------------------------------------------------------------------
        private void GridEnter()
        {
            int rx = dg.SelectedRows[0].Index;

            // IDを取得
            int rID = utility.StrtoZero(dg[colID, rx].Value.ToString());

            // 対象となるデータテーブルROWを取得します
            guideDataSet.メール定型文Row sQuery = dts.メール定型文.Single(a => a.ID == rID);

            if (!sQuery.HasErrors)
            {
                // モードステータスを「編集モード」にします
                fMode.Mode = global.FORM_EDITMODE;
            }
            else
            {
                MessageBox.Show(dg[0, rx].Value.ToString() + "がキー不在です:データの読み込みに失敗しました", "データ取得エラー", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 4
0
        private void makeSendMail()
        {
            int mCnt = 0;

            for (int i = 0; i < dg1.RowCount; i++)
            {
                if (dg1["C_Check", i].Value.ToString() == "True")
                {
                    mCnt++;
                }
            }

            if (mCnt > 0)
            {
                // メール内容
                txtFrom.Enabled    = true;
                txtCc.Enabled      = true;
                txtBcc.Enabled     = true;
                txtSubject.Enabled = true;
                txtText.Enabled    = true;
                checkBox1.Enabled  = true;

                //
                guideDataSet.メール設定Row r = dts.メール設定.Single(a => a.ID == global.mailKey);

                if (!r.HasErrors)
                {
                    txtFrom.Text = r.メールアドレス;
                    txtCc.Text   = string.Empty;
                    txtBcc.Text  = string.Empty;

                    // メール定型文を呼び出す
                    StringBuilder         cSB = new StringBuilder(); // メール文面
                    mail.frmMailComSelect frm = new mail.frmMailComSelect(global.MLCOMMENT_IRAI);
                    frm.ShowDialog();
                    int mailComID = frm.mID;

                    if (mailComID != 0)
                    {
                        guideDataSet.メール定型文Row cr = dts.メール定型文.Single(a => a.ID == mailComID);

                        if (!cr.HasErrors)
                        {
                            // 件名
                            txtSubject.Text = cr.件名 + " " + selNum.ToString();

                            // 前文
                            cSB.Append(cr.前文).Append(Environment.NewLine);

                            // 内容
                            cSB.Append("依頼番号:").Append(selNum.ToString()).Append(Environment.NewLine).Append(Environment.NewLine);
                            cSB.Append("稼働日:").Append(dateTimePicker2.Value.ToLongDateString()).Append(Environment.NewLine).Append(Environment.NewLine);
                            cSB.Append("依頼元:").Append(cmbIrai.Text).Append(" 様").Append(Environment.NewLine).Append(Environment.NewLine);
                            cSB.Append("内容:").Append(txtName.Text).Append(Environment.NewLine).Append(Environment.NewLine);
                            cSB.Append("特記事項:").Append(txtMemo.Text).Append(Environment.NewLine).Append(Environment.NewLine);

                            // 後文
                            cSB.Append(cr.後文).Append(Environment.NewLine);

                            // 署名を付加
                            cSB.Append(r.署名);

                            // メール文章
                            txtText.Text = cSB.ToString();

                            // メール送信ボタン
                            linkLabel5.Visible = true;
                            linkLabel6.Visible = true;
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("メール送信対象者がいません", "確認", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
        }
Exemplo n.º 5
0
        ///----------------------------------------------------------
        /// <summary>
        ///     メール作成 </summary>
        ///----------------------------------------------------------
        private void makeSendMail()
        {
            // メール内容
            txtFrom.Enabled    = true;
            txtCc.Enabled      = true;
            txtBcc.Enabled     = true;
            txtSubject.Enabled = true;
            txtText.Enabled    = true;

            //
            guideDataSet.メール設定Row r = dts.メール設定.Single(a => a.ID == global.mailKey);

            if (!r.HasErrors)
            {
                txtFrom.Text = r.メールアドレス;
                txtCc.Text   = string.Empty;
                txtBcc.Text  = string.Empty;

                // メール定型文を呼び出す
                StringBuilder    cSB = new StringBuilder(); // メール文面
                frmMailComSelect frm = null;

                if (comboBox2.SelectedIndex == 0)
                {
                    frm = new frmMailComSelect(global.MLCOMMENT_KETTEI);
                }
                else if (comboBox2.SelectedIndex == 1)
                {
                    frm = new frmMailComSelect(global.MLCOMMENT_KOTOWARI);
                }

                frm.ShowDialog();
                int mailComID = frm.mID;

                if (mailComID != 0)
                {
                    guideDataSet.メール定型文Row cr = dts.メール定型文.Single(a => a.ID == mailComID);

                    if (!cr.HasErrors)
                    {
                        // 件名
                        txtSubject.Text = cr.件名;

                        // 前文
                        cSB.Append(cr.前文).Append(Environment.NewLine);

                        // 内容
                        cSB.Append("依頼番号:").Append(txtIraiNum.Text).Append(Environment.NewLine).Append(Environment.NewLine);
                        cSB.Append("稼働日:").Append(DateTime.Parse(txtWdate.Text).ToLongDateString()).Append(Environment.NewLine).Append(Environment.NewLine);
                        cSB.Append("依頼元:").Append(txtIrai.Text).Append(" 様").Append(Environment.NewLine).Append(Environment.NewLine);
                        cSB.Append("内容:").Append(txtName.Text).Append(Environment.NewLine).Append(Environment.NewLine);
                        cSB.Append("特記事項:").Append(txtMemo.Text).Append(Environment.NewLine).Append(Environment.NewLine);

                        // 後文
                        cSB.Append(cr.後文).Append(Environment.NewLine);

                        // 署名を付加
                        cSB.Append(r.署名);

                        // メール文章
                        txtText.Text = cSB.ToString();

                        // メール送信ボタン
                        linkLabel6.Visible = true;
                        linkLabel5.Visible = true;

                        // 組合員名自動不可
                        checkBox1.Checked = true;
                    }
                }
            }
        }