Ejemplo n.º 1
0
        //リストダブルクリック
        private void m_addressslist_MouseDoubleClick_1(object sender, MouseEventArgs e)
        {
            ListView.SelectedIndexCollection item = m_addressslist.SelectedIndices;

            MailaddressDS mailDt = new MailaddressDS();
            string        kubun  = this.m_addressslist.Items[item[0]].SubItems[0].Text;

            if (0 <= kubun.IndexOf("オペレータ"))
            {
                mailDt.kubun = "1";
            }
            else
            {
                mailDt.kubun = "2";
            }

            mailDt.opetantouno = this.m_addressslist.Items[item[0]].SubItems[1].Text;
            mailDt.addressNo   = this.m_addressslist.Items[item[0]].SubItems[2].Text;

            mailDt.user_tantou_name = this.m_addressslist.Items[item[0]].SubItems[3].Text;
            mailDt.username         = this.m_addressslist.Items[item[0]].SubItems[4].Text;

            mailDt.mailAddress = this.m_addressslist.Items[item[0]].SubItems[5].Text;
            mailDt.addressname = this.m_addressslist.Items[item[0]].SubItems[6].Text;
            mailDt.chk_date    = this.m_addressslist.Items[item[0]].SubItems[7].Text;
            mailDt.chk_name_id = this.m_addressslist.Items[item[0]].SubItems[8].Text;

            add_Disp(mailDt);
        }
Ejemplo n.º 2
0
        //オペレータの表示
        private void add_Disp(MailaddressDS addressDt)
        {
            string kubunstr = "";

            if (addressDt.kubun == "1")
            {
                kubunstr = "1:オペレータ";
            }
            else if (addressDt.kubun == "2")
            {
                kubunstr = "2:カスタマ担当者";
            }

            m_kubun.Text        = kubunstr;
            m_userid.Text       = addressDt.opetantouno;
            m_addressno.Text    = addressDt.addressNo;
            m_username.Text     = addressDt.user_tantou_name;
            m_Customername.Text = addressDt.username;

            m_address.Text     = addressDt.mailAddress;
            m_addressname.Text = addressDt.addressname;

            m_update.Text    = addressDt.chk_date;
            m_updateOpe.Text = addressDt.chk_name_id;
        }
Ejemplo n.º 3
0
        private void mailtempleteInsert(ListView m_listviewobj)
        {
            this.return_address = new List <MailaddressDS>();
            foreach (ListViewItem item in m_listviewobj.SelectedItems)
            {
                MailaddressDS mailDS = new MailaddressDS();
                mailDS.kubun            = item.Text;
                mailDS.opetantouno      = item.SubItems[1].Text;
                mailDS.user_tantou_name = item.SubItems[2].Text;
                mailDS.addressNo        = item.SubItems[4].Text;

                mailDS.mailAddress = item.SubItems[5].Text;
                mailDS.addressname = item.SubItems[6].Text;
                mailDS.chk_name_id = loginDS.opeid;
                this.return_address.Add(mailDS);
            }
            this.Close();
        }
Ejemplo n.º 4
0
        //メールアドレスのダブルクリック
        private void m_addressslist_DoubleClick(object sender, EventArgs e)
        {
            ListView.SelectedIndexCollection item = m_addressslist.SelectedIndices;

            Form_mailDetail addressDetail = new Form_mailDetail();

            addressDetail.con = con;


            MailaddressDS mailDt = new MailaddressDS();

            mailDt.kubun       = "1";
            mailDt.opetantouno = this.m_openo.Text;
            mailDt.addressNo   = this.m_addressslist.Items[item[0]].SubItems[0].Text;
            //mailDt.userno = this.m_addressslist.Items[item[0]].SubItems[1].Text;
            mailDt.mailAddress = this.m_addressslist.Items[item[0]].SubItems[1].Text;
            mailDt.addressname = this.m_addressslist.Items[item[0]].SubItems[2].Text;
            mailDt.chk_date    = this.m_addressslist.Items[item[0]].SubItems[3].Text;
            mailDt.chk_name_id = this.m_addressslist.Items[item[0]].SubItems[4].Text;

            addressDetail.addresssDS = mailDt;
            addressDetail.loginDS    = loginDS;
            addressDetail.Show();
        }
Ejemplo n.º 5
0
        //送信メールを追加する。
        private int insertSendAddress(int templeteno, MailaddressDS adds, String csv, string ToCcBcc)
        {
            //DB接続
            NpgsqlCommand cmd;

            try
            {
                string addressno   = adds.addressNo;
                string opetantouno = adds.opetantouno;
                string kubun       = adds.kubun;

                if (con.FullState != ConnectionState.Open)
                {
                    con.Open();
                }
                Int32 rowsaffected;
                //データ登録
                cmd = new NpgsqlCommand(@"insert into mail_send_address (kubun,opetantouno,toccbcc,addressno,templateno,chk_name_id) 
                    values ( :kubun,:opetantouno,:toccbcc,:addressno,:templateno,:chk_name_id)", con);
                cmd.Parameters.Add(new NpgsqlParameter("kubun", DbType.String)
                {
                    Value = kubun
                });
                cmd.Parameters.Add(new NpgsqlParameter("opetantouno", DbType.Int32)
                {
                    Value = Int32.Parse(opetantouno)
                });
                cmd.Parameters.Add(new NpgsqlParameter("toccbcc", DbType.String)
                {
                    Value = ToCcBcc
                });
                cmd.Parameters.Add(new NpgsqlParameter("addressno", DbType.Int32)
                {
                    Value = Int32.Parse(addressno)
                });
                cmd.Parameters.Add(new NpgsqlParameter("templateno", DbType.Int32)
                {
                    Value = templeteno
                });
                cmd.Parameters.Add(new NpgsqlParameter("chk_name_id", DbType.String)
                {
                    Value = m_idlabel.Text
                });


                rowsaffected = cmd.ExecuteNonQuery();


                if (rowsaffected != 1)
                {
                    MessageBox.Show("送信メールを登録できませんでした。", "メールテンプレート登録");
                    return(-1);
                }
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
                if (0 <= msg.IndexOf("mail_send_address_pkc"))
                {
                    msg = "To Cc Bccで同じ宛先を登録することはできません。";
                }

                MessageBox.Show("メールテンプレート登録時エラー " + msg);
                return(-1);
            }


            return(1);
        }
Ejemplo n.º 6
0
        //メール送信アドレス
        public int  make_sendaddress(int tempno)
        {
            string        csv;
            int           ret       = 1;
            MailaddressDS addressds = new MailaddressDS();

            //Toのとき
            for (int i = 0; i < this.m_To_list.Items.Count; i++)
            {
                addressds.addressname      = this.m_To_list.Items[i].SubItems[0].Text;
                addressds.mailAddress      = this.m_To_list.Items[i].SubItems[1].Text;
                addressds.user_tantou_name = this.m_To_list.Items[i].SubItems[2].Text;
                csv = this.m_To_list.Items[i].Tag.ToString();
                string[] stArray = csv.Split(',');
                addressds.addressNo = stArray[0];
                string ss = "";
                if (stArray[1] != "")
                {
                    if (stArray[1] == "オペレータ")
                    {
                        ss = "1";
                    }
                    else if (stArray[1] == "担当者")
                    {
                        ss = "2";
                    }
                }
                addressds.kubun       = ss;
                addressds.opetantouno = stArray[2];

                ret = insertSendAddress(tempno, addressds, csv, "To");
                if (ret == -1)
                {
                    return(-1);
                }
            }

            //Ccのとき
            for (int i = 0; i < this.m_Cc_list.Items.Count; i++)
            {
                addressds.addressname      = this.m_Cc_list.Items[i].SubItems[0].Text;
                addressds.mailAddress      = this.m_Cc_list.Items[i].SubItems[1].Text;
                addressds.user_tantou_name = this.m_Cc_list.Items[i].SubItems[2].Text;
                csv = this.m_Cc_list.Items[i].Tag.ToString();
                string[] stArray = csv.Split(',');
                addressds.addressNo = stArray[0];
                string ss = "";
                if (stArray[1] != "")
                {
                    if (stArray[1] == "オペレータ")
                    {
                        ss = "1";
                    }
                    else if (stArray[1] == "担当者")
                    {
                        ss = "2";
                    }
                }
                addressds.kubun       = ss;
                addressds.opetantouno = stArray[2];

                ret = insertSendAddress(tempno, addressds, csv, "Cc");
                if (ret == -1)
                {
                    return(-1);
                }
            }
            //Bccのとき
            for (int i = 0; i < this.m_Bcc_list.Items.Count; i++)
            {
                addressds.addressname      = this.m_Bcc_list.Items[i].SubItems[0].Text;
                addressds.mailAddress      = this.m_Bcc_list.Items[i].SubItems[1].Text;
                addressds.user_tantou_name = this.m_Bcc_list.Items[i].SubItems[2].Text;
                csv = this.m_Bcc_list.Items[i].Tag.ToString();
                string[] stArray = csv.Split(',');
                addressds.addressNo = stArray[0];
                string ss = "";
                if (stArray[1] != "")
                {
                    if (stArray[1] == "オペレータ")
                    {
                        ss = "1";
                    }
                    else if (stArray[1] == "担当者")
                    {
                        ss = "2";
                    }
                }
                addressds.kubun       = ss;
                addressds.opetantouno = stArray[2];

                ret = insertSendAddress(tempno, addressds, csv, "Cc");
                if (ret == -1)
                {
                    return(-1);
                }
            }


            return(ret);
        }
Ejemplo n.º 7
0
        //メールアドレス情報を更新する
        private int updatemailaddress(string templete_no, NpgsqlConnection con, NpgsqlTransaction transaction)
        {
            string        csv;
            int           ret       = 1;
            MailaddressDS addressds = new MailaddressDS();

            //とりあえず今あるものは消す
            if (DeletedSendAddress(templete_no, con, transaction) != 1)
            {
                //                    MessageBox.Show("メールテンプレートの更新(送信先メールアドレス削除)に失敗しました。","");
                //                  return -1;
            }

            //Toのとき
            for (int i = 0; i < this.m_To_list.Items.Count; i++)
            {
                addressds.addressname = this.m_To_list.Items[i].SubItems[0].Text;
                addressds.mailAddress = this.m_To_list.Items[i].SubItems[1].Text;
                string kubunstr = this.m_To_list.Items[i].SubItems[2].Text;
                csv = this.m_To_list.Items[i].Tag.ToString();
                string[] stArray = csv.Split(',');
                addressds.addressNo = stArray[0];
                string ss = "";
                if (kubunstr != "")
                {
                    if (kubunstr == "オペレータ")
                    {
                        ss = "1";
                    }
                    else if (kubunstr == "担当者")
                    {
                        ss = "2";
                    }
                }
                addressds.kubun       = ss;
                addressds.opetantouno = stArray[2];

                ret = updateSendAddress(m_tempno.Text, addressds, csv, "To", transaction);
                if (ret == -1)
                {
                    return(-1);
                }
            }

            //Ccのとき
            for (int i = 0; i < this.m_Cc_list.Items.Count; i++)
            {
                addressds.addressname = this.m_Cc_list.Items[i].SubItems[0].Text;
                addressds.mailAddress = this.m_Cc_list.Items[i].SubItems[1].Text;
                string kubunstr = this.m_Cc_list.Items[i].SubItems[2].Text;
                csv = this.m_Cc_list.Items[i].Tag.ToString();
                string[] stArray = csv.Split(',');
                addressds.addressNo = stArray[0];
                string ss = "";
                if (kubunstr != "")
                {
                    if (kubunstr == "オペレータ")
                    {
                        ss = "1";
                    }
                    else if (kubunstr == "担当者")
                    {
                        ss = "2";
                    }
                }
                addressds.kubun       = ss;
                addressds.opetantouno = stArray[2];

                ret = updateSendAddress(m_tempno.Text, addressds, csv, "Cc", transaction);
                if (ret == -1)
                {
                    return(-1);
                }
            }
            //Bccのとき
            for (int i = 0; i < this.m_Bcc_list.Items.Count; i++)
            {
                addressds.addressname = this.m_Bcc_list.Items[i].SubItems[0].Text;
                addressds.mailAddress = this.m_Bcc_list.Items[i].SubItems[1].Text;
                string kubunstr = this.m_Bcc_list.Items[i].SubItems[2].Text;
                csv = this.m_Bcc_list.Items[i].Tag.ToString();
                string[] stArray = csv.Split(',');
                addressds.addressNo = stArray[0];
                string ss = "";
                if (kubunstr != "")
                {
                    if (kubunstr == "オペレータ")
                    {
                        ss = "1";
                    }
                    else if (kubunstr == "担当者")
                    {
                        ss = "2";
                    }
                }
                addressds.kubun       = ss;
                addressds.opetantouno = stArray[2];

                ret = updateSendAddress(m_tempno.Text, addressds, csv, "Bcc", transaction);
                if (ret == -1)
                {
                    return(-1);
                }
            }

            return(ret);
        }
Ejemplo n.º 8
0
        //表示
        private void DispMailtemplete(mailTempleteDS maildt)
        {
            m_tempno.Text       = maildt.templateno;
            m_templetename.Text = maildt.template_name;
            m_subject.Text      = maildt.subject;
            m_body.Text         = maildt.body;

            m_account.Text = maildt.account;

            m_update.Text    = maildt.chk_date;
            m_updateOpe.Text = maildt.chk_name_id;
            m_temp1.Text     = maildt.attach1;
            m_temp2.Text     = maildt.attach2;
            m_temp3.Text     = maildt.attach3;
            m_temp4.Text     = maildt.attach4;
            m_temp5.Text     = maildt.attach5;

            Dictionary <string, string> address = new Dictionary <string, string>();
            List <String> toList  = new List <String>();
            List <String> CcList  = new List <String>();
            List <String> BccList = new List <String>();

            //宛先の表示
            foreach (mailsendaddressDS ms in mailsendaddressDSList)
            {
                MailaddressDS addressds = new MailaddressDS();

                string tocc = "";
                tocc = ms.toccbcc;

                if (tocc != "")
                {
                    if (tocc == "To")
                    {
                        ListViewItem lvi;

                        lvi = m_To_list.Items.Add(ms.addressname);
                        lvi.SubItems.Add(ms.mailaddress);

                        //1:オペレータ 2:カスタマ担当者
                        if (ms.kubun == "1")
                        {
                            lvi.SubItems.Add("オペレータ");
                        }
                        //2:カスタマ担当者
                        else if (ms.kubun == "2")
                        {
                            lvi.SubItems.Add("担当者");
                        }

                        //非表示項目
                        lvi.Tag = ms.addressno + "," + ms.kubun + "," + ms.opetantouno;
                    }
                    if (tocc == "Cc")
                    {
                        ListViewItem lvi;
                        lvi = m_Cc_list.Items.Add(ms.addressname);
                        lvi.SubItems.Add(ms.mailaddress);

                        //1:オペレータ 2:カスタマ担当者
                        if (ms.kubun == "1")
                        {
                            lvi.SubItems.Add("オペレータ");
                        }
                        //2:カスタマ担当者
                        else if (ms.kubun == "2")
                        {
                            lvi.SubItems.Add("担当者");
                        }

                        //非表示項目
                        lvi.Tag = ms.addressno + "," + ms.kubun + "," + ms.opetantouno;
                    }

                    if (tocc == "Bcc")
                    {
                        ListViewItem lvi;
                        lvi = m_Bcc_list.Items.Add(ms.addressname);
                        lvi.SubItems.Add(ms.mailaddress);
                        //1:オペレータ 2:カスタマ担当者
                        if (ms.kubun == "1")
                        {
                            lvi.SubItems.Add("オペレータ");
                        }
                        //2:カスタマ担当者
                        else if (ms.kubun == "2")
                        {
                            lvi.SubItems.Add("担当者");
                        }

                        //非表示項目
                        lvi.Tag = ms.addressno + "," + ms.kubun + "," + ms.opetantouno;
                    }
                }
            }
        }