Esempio n. 1
0
        //登録データチェック
        private Boolean fDataCheck()
        {
            string str;
            double d;

            try
            {
                //登録モードのとき、コードをチェック
                if (fMode.Mode == 0)
                {
                    //// 数字か?
                    //if (txtCode.Text == null)
                    //{
                    //    this.txtCode.Focus();
                    //    throw new Exception("コードは数字で入力してください");
                    //}

                    //str = this.txtCode.Text;

                    //if (double.TryParse(str, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out d))
                    //{
                    //}
                    //else
                    //{
                    //    this.txtCode.Focus();
                    //    throw new Exception("コードは数字で入力してください");
                    //}

                    //// 未入力またはスペースのみは不可
                    //if ((this.txtCode.Text).Trim().Length < 1)
                    //{
                    //    this.txtCode.Focus();
                    //    throw new Exception("コードを入力してください");
                    //}

                    ////ゼロは不可
                    //if (Convert.ToInt32(this.txtCode.Text.ToString()) == 0)
                    //{
                    //    this.txtCode.Focus();
                    //    throw new Exception("ゼロは登録できません");
                    //}

                    ////登録済みコードか調べる
                    //string sqlStr;
                    //Control.会社情報 Kaisha = new Control.会社情報();
                    //OleDbDataReader dr;

                    //sqlStr = " where ID = " + txtCode.Text.ToString();
                    //dr = Kaisha.FillBy(sqlStr);

                    //if (dr.HasRows == true)
                    //{
                    //    txtCode.Focus();
                    //    dr.Close();
                    //    Kaisha.Close();
                    //    throw new Exception("既に登録済みのコードです");
                    //}

                    //dr.Close();
                    //Kaisha.Close();
                }

                //会社名チェック
                if (txtName.Text.Trim().Length < 1)
                {
                    txtName.Focus();
                    throw new Exception("会社名を入力してください");
                }

                //金融機関コード
                if (txtBankCode.Text.ToString().Trim() != "")
                {
                    str = this.txtBankCode.Text.ToString();

                    if (double.TryParse(str, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out d))
                    {
                    }
                    else
                    {
                        this.txtBankCode.Focus();
                        throw new Exception("金融機関コードは数字で入力してください");
                    }
                }

                //支店コード
                if (txtShitenCode.Text.ToString().Trim() != "")
                {
                    str = this.txtShitenCode.Text.ToString();

                    if (double.TryParse(str, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out d))
                    {
                    }
                    else
                    {
                        this.txtShitenCode.Focus();
                        throw new Exception("支店コードは数字で入力してください");
                    }
                }

                //口座種別チェック
                if (comboBox1.SelectedIndex == -1)
                {
                    comboBox1.Focus();
                    throw new Exception("口座種別を選択してください");
                }

                //口座番号:数字か?
                if (txtNumber.Text == null)
                {
                    this.txtNumber.Focus();
                    throw new Exception("口座番号は数字で入力してください");
                }

                str = this.txtNumber.Text;

                if (double.TryParse(str, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out d))
                {
                }
                else
                {
                    this.txtNumber.Focus();
                    throw new Exception("口座番号は数字で入力してください");
                }

                if (txtSheet.Text != string.Empty)
                {
                    if (!System.IO.File.Exists(txtSheet.Text))
                    {
                        this.txtSheet.Focus();
                        throw new Exception(txtSheet.Text + " は存在しません。存在するファイルを登録してください。");
                    }
                }


                //クラスにデータセット
                //cMaster.ID = Convert.ToInt32(txtCode.Text.ToString());
                cMaster.会社名   = txtName.Text.ToString();
                cMaster.代表者氏名 = txtDaihyo.Text.ToString();
                cMaster.役職名   = txtYaku.Text.ToString();
                cMaster.電話番号  = txtTel.Text.ToString();
                cMaster.FAX番号 = txtFax.Text.ToString();
                cMaster.住所1   = txtAddress1.Text.ToString();
                cMaster.住所2   = txtAddress2.Text.ToString();

                if (mtxtZipCode.Text.ToString().Replace("-", "").Trim() == "")
                {
                    cMaster.郵便番号 = "";
                }
                else
                {
                    cMaster.郵便番号 = mtxtZipCode.Text.ToString();
                }

                cMaster.メールアドレス = txtEmail.Text.ToString();
                cMaster.部署名     = txtBusho.Text.ToString();
                cMaster.担当者名    = txtTantou.Text.ToString();
                cMaster.特記事項1   = txtMemo1.Text.ToString();
                cMaster.特記事項2   = txtMemo2.Text.ToString();
                cMaster.依頼人コード  = txtIraiCode.Text.ToString();
                cMaster.依頼人名    = txtIraiName.Text.ToString();
                cMaster.金融機関コード = txtBankCode.Text.ToString();
                cMaster.金融機関名   = txtBankName.Text.ToString();
                cMaster.支店コード   = txtShitenCode.Text.ToString();
                cMaster.支店名     = txtShitenName.Text.ToString();

                Utility.ComboKouza cmb1 = new Utility.ComboKouza();
                cmb1         = (Utility.ComboKouza)comboBox1.SelectedItem;
                cMaster.口座種別 = cmb1.ID;
                cMaster.口座番号 = txtNumber.Text.ToString();

                if (txtFlg.Visible == true)
                {
                    cMaster.配布フラグ = int.Parse(txtFlg.Text);
                }

                if (fMode.Mode == 0)
                {
                    cMaster.登録年月日 = DateTime.Today;
                }
                cMaster.更年月日         = DateTime.Today;
                cMaster.郵便番号CSVパス    = txtZipPath.Text;
                cMaster.受注確定書入力シートパス = txtSheet.Text;

                return(true);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, MESSAGE_CAPTION + "保守", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }
        }
Esempio n. 2
0
        //登録データチェック
        private Boolean fDataCheck()
        {
            string str;
            double d;

            try
            {
                //登録モードのとき、コードをチェック
                if (fMode.Mode == 0)
                {
                    // 数字か?
                    if (txtCode.Text == null)
                    {
                        this.txtCode.Focus();
                        throw new Exception("コードは数字で入力してください");
                    }

                    str = this.txtCode.Text;

                    if (double.TryParse(str, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out d))
                    {
                    }
                    else
                    {
                        this.txtCode.Focus();
                        throw new Exception("コードは数字で入力してください");
                    }

                    // 未入力またはスペースのみは不可
                    if ((this.txtCode.Text).Trim().Length < 1)
                    {
                        this.txtCode.Focus();
                        throw new Exception("コードを入力してください");
                    }

                    //ゼロは不可
                    if (Convert.ToInt32(this.txtCode.Text.ToString()) == 0)
                    {
                        this.txtCode.Focus();
                        throw new Exception("ゼロは登録できません");
                    }

                    //登録済みコードか調べる
                    string          sqlStr;
                    Control.配布員     Staff = new Control.配布員();
                    OleDbDataReader dr;

                    sqlStr = " where ID = " + txtCode.Text.ToString();
                    dr     = Staff.FillBy(sqlStr);

                    if (dr.HasRows == true)
                    {
                        txtCode.Focus();
                        dr.Close();
                        Staff.Close();
                        throw new Exception("既に登録済みのコードです");
                    }

                    dr.Close();
                    Staff.Close();
                }

                //名称チェック
                if (txtName1.Text.Trim().Length < 1)
                {
                    txtName1.Focus();
                    throw new Exception("氏名を入力してください");
                }

                ////支払形態チェック
                //if (cmbShiharai.SelectedIndex == -1)
                //{
                //    cmbShiharai.Focus();
                //    throw new Exception("支払形態を選択してください");
                //}

                ////事業所チェック
                //if (cmbShozoku.SelectedIndex == -1)
                //{
                //    cmbShozoku.Focus();
                //    throw new Exception("事業所を選択してください");
                //}

                //金融機関コード
                if (txtBankCode.Text.ToString().Trim() != "")
                {
                    str = this.txtBankCode.Text.ToString();

                    if (double.TryParse(str, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out d))
                    {
                    }
                    else
                    {
                        this.txtBankCode.Focus();
                        throw new Exception("金融機関コードは数字で入力してください");
                    }
                }

                // 支店コード
                if (txtShitenCode.Text.ToString().Trim() != "")
                {
                    str = this.txtShitenCode.Text.ToString();

                    if (double.TryParse(str, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out d))
                    {
                    }
                    else
                    {
                        this.txtShitenCode.Focus();
                        throw new Exception("支店コードは数字で入力してください");
                    }
                }

                // マイナンバー
                if (txtMyNumber.Text != string.Empty)
                {
                    if (Utility.strToLong(txtMyNumber.Text) == 0)
                    {
                        this.txtShitenCode.Focus();
                        throw new Exception("マイナンバーは数字で入力してください");
                    }

                    if (txtMyNumber.Text.Length != 12)
                    {
                        this.txtShitenCode.Focus();
                        throw new Exception("マイナンバーは数字で12桁入力してください");
                    }
                }

                //クラスにデータセット
                cMaster.ID   = Convert.ToInt32(txtCode.Text.ToString());
                cMaster.氏名   = txtName1.Text.ToString();
                cMaster.フリガナ = txtFuri.Text.ToString();

                if (mtxtZipCode.Text.ToString().Replace("-", "").Trim() == "")
                {
                    cMaster.郵便番号 = "";
                }
                else
                {
                    cMaster.郵便番号 = mtxtZipCode.Text.ToString();
                }

                cMaster.住所     = txtAddress.Text.ToString();
                cMaster.携帯電話番号 = txtMobile.Text.ToString();
                cMaster.自宅電話番号 = txtTel.Text.ToString();
                cMaster.PCアドレス = txteMail.Text.ToString();
                cMaster.携帯アドレス = txteMailm.Text.ToString();

                if (iDate.Checked == false)
                {
                    cMaster.登録日 = "";
                }
                else
                {
                    cMaster.登録日 = iDate.Value.ToShortDateString();
                }

                if (chkKinmu.Checked == true)
                {
                    cMaster.勤務区分 = 1;
                }
                else
                {
                    cMaster.勤務区分 = 0;
                }

                if (chkGaitou.Checked == true)
                {
                    cMaster.街頭配布区分 = 1;
                }
                else
                {
                    cMaster.街頭配布区分 = 0;
                }

                cMaster.街頭配布備考 = txtGaitouMemo.Text.ToString();
                cMaster.支払区分   = cmbShiharai.Text;

                if (cmbShozoku.SelectedIndex == -1)
                {
                    cMaster.事業所コード = 0;
                }
                else
                {
                    Utility.ComboOffice cmb1 = new Utility.ComboOffice();
                    cmb1           = (Utility.ComboOffice)cmbShozoku.SelectedItem;
                    cMaster.事業所コード = cmb1.ID;
                }

                cMaster.金融機関コード = txtBankCode.Text.ToString().Trim();
                cMaster.金融機関名   = txtBank.Text.ToString();

                if (txtBankFuri.Text.ToString().Length > 15)
                {
                    cMaster.金融機関名カナ = txtBankFuri.Text.ToString().Substring(0, 15);
                }
                else
                {
                    cMaster.金融機関名カナ = txtBankFuri.Text.ToString();
                }

                cMaster.支店コード = txtShitenCode.Text.ToString().Trim();
                cMaster.支店名   = txtShiten.Text.ToString();

                if (txtShitenFuri.Text.ToString().Length > 15)
                {
                    cMaster.支店名カナ = txtShitenFuri.Text.ToString().Substring(0, 15);
                }
                else
                {
                    cMaster.支店名カナ = txtShitenFuri.Text.ToString();
                }

                if (cmbShubetsu.SelectedIndex == -1)
                {
                    cMaster.口座種別 = 0;
                }
                else
                {
                    Utility.ComboKouza cmb2 = new Utility.ComboKouza();
                    cmb2         = (Utility.ComboKouza)cmbShubetsu.SelectedItem;
                    cMaster.口座種別 = cmb2.ID;
                }

                cMaster.口座番号   = txtKouza.Text.ToString();
                cMaster.口座名義カナ = txtMeigi.Text.ToString();
                cMaster.備考     = txtMemo.Text.ToString();

                if (fMode.Mode == 0)
                {
                    cMaster.登録年月日 = DateTime.Now;
                    cMaster.更年月日  = DateTime.Now;
                }
                else
                {
                    cMaster.更年月日 = DateTime.Now;
                }

                cMaster.マイナンバー = txtMyNumber.Text;      // 2015/07/16
                cMaster.ユーザーID = global.loginUserID;    // 2015/07/16

                return(true);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, MESSAGE_CAPTION + "保守", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }
        }
Esempio n. 3
0
        //登録データチェック
        private Boolean fDataCheck()
        {
            string str;
            double d;

            try
            {
                //登録モードのとき、コードをチェック
                if (fMode.Mode == 0)
                {
                    //// 数字か?
                    //if (txtCode.Text == null)
                    //{
                    //    this.txtCode.Focus();
                    //    throw new Exception("コードは数字で入力してください");
                    //}

                    //str = this.txtCode.Text;

                    //if (double.TryParse(str, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out d))
                    //{
                    //}
                    //else
                    //{
                    //    this.txtCode.Focus();
                    //    throw new Exception("コードは数字で入力してください");
                    //}

                    //// 未入力またはスペースのみは不可
                    //if ((this.txtCode.Text).Trim().Length < 1)
                    //{
                    //    this.txtCode.Focus();
                    //    throw new Exception("コードを入力してください");
                    //}

                    ////ゼロは不可
                    //if (Convert.ToInt32(this.txtCode.Text.ToString()) == 0)
                    //{
                    //    this.txtCode.Focus();
                    //    throw new Exception("ゼロは登録できません");
                    //}

                    ////登録済みコードか調べる
                    //string sqlStr;
                    //Control.振込口座 Kouza = new Control.振込口座();
                    //OleDbDataReader dr;

                    //sqlStr = " where ID = " + txtCode.Text.ToString();
                    //dr = Kouza.FillBy(sqlStr);

                    //if (dr.HasRows == true)
                    //{
                    //    txtCode.Focus();
                    //    dr.Close();
                    //    Kouza.Close();
                    //    throw new Exception("既に登録済みのコードです");
                    //}

                    //dr.Close();
                    //Kouza.Close();
                }

                //金融機関名チェック
                if (txtName1.Text.Trim().Length < 1)
                {
                    txtName1.Focus();
                    throw new Exception("金融機関名を入力してください");
                }

                //支店名チェック
                if (txtName2.Text.Trim().Length < 1)
                {
                    txtName2.Focus();
                    throw new Exception("支店名を入力してください");
                }

                //口座種別チェック
                if (comboBox1.SelectedIndex == -1)
                {
                    comboBox1.Focus();
                    throw new Exception("口座種別を選択してください");
                }

                //口座番号:数字か?
                if (txtNumber.Text == null)
                {
                    this.txtNumber.Focus();
                    throw new Exception("口座番号は数字で入力してください");
                }

                str = this.txtNumber.Text;

                if (double.TryParse(str, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out d))
                {
                }
                else
                {
                    this.txtNumber.Focus();
                    throw new Exception("口座番号は数字で入力してください");
                }

                // 未入力またはスペースのみは不可
                if ((this.txtNumber.Text).Trim().Length < 1)
                {
                    this.txtNumber.Focus();
                    throw new Exception("口座番号を入力してください");
                }

                //口座名義チェック
                if (txtMeigi.Text.Trim().Length < 1)
                {
                    txtMeigi.Focus();
                    throw new Exception("口座名義を入力してください");
                }

                ////ゼロは不可
                //if (Convert.ToInt32(this.txtCode.Text.ToString()) == 0)
                //{
                //    this.txtCode.Focus();
                //    throw new Exception("ゼロは登録できません");
                //}

                //クラスにデータセット
                //cMaster.ID = Convert.ToInt32(txtCode.Text.ToString());
                cMaster.金融機関名 = txtName1.Text.ToString();
                cMaster.支店名   = txtName2.Text.ToString();

                Utility.ComboKouza cmb1 = new Utility.ComboKouza();
                cmb1         = (Utility.ComboKouza)comboBox1.SelectedItem;
                cMaster.口座種別 = cmb1.ID;

                cMaster.口座番号 = txtNumber.Text.ToString();
                cMaster.口座名義 = txtMeigi.Text.ToString();

                if (fMode.Mode == 0)
                {
                    cMaster.登録年月日 = DateTime.Today;
                }
                cMaster.更年月日 = DateTime.Today;

                return(true);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, MESSAGE_CAPTION + "保守", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }
        }