Ejemplo n.º 1
0
 public void setSougiSeikyuWin(SougiSeikyuWin wnd)
 {
     m_wnd       = wnd;
     m_sExecPath = m_wnd.m_sExecPath;
     m_libCmn    = m_wnd.m_libCmn;
     m_libCanvas = m_wnd.m_libCanvas;
     m_libOdbc   = m_wnd.m_libOdbc;
 }
Ejemplo n.º 2
0
 public void SetSougiWin(SougiWin wnd)
 {
     m_wndSougi       = wnd;
     m_wndSougiSeikyu = null;
 }
Ejemplo n.º 3
0
 public void SetSougiSeikyuWin(SougiSeikyuWin wnd)
 {
     m_wndSougi       = null;
     m_wndSougiSeikyu = wnd;
 }
Ejemplo n.º 4
0
        private void btnSeikyuWin_Click(object sender, RoutedEventArgs e)
        {
            int         max, idx;
            DataRowView dataRowView;
            string      sId, sNo;
            int         nLine;

            string[]       ary;
            string         seikyu, busyo;
            string         sRecs;
            SougiSeikyuWin sougiSeikyuWin;
            string         sData, sDatas;

            sRecs  = "";
            sDatas = "";
            max    = dgHanbai.SelectedItems.Count;
            if (max == 0)
            {
                MessageBox.Show("請求書印刷対象の行が選択されていません。", "確認", MessageBoxButton.OK);
                return;
            }
            dataRowView = (DataRowView)dgHanbai.SelectedItems[0];
            sId         = dataRowView.Row[2].ToString();
            sNo         = dataRowView.Row[0].ToString();
            nLine       = m_libCmn.StrToInt(sNo) - 1;
            sData       = getCsvElement(nLine);
            ary         = sData.Split(',');
            seikyu      = ary[14];
            busyo       = ary[15];
            if (ary[14] == "" && ary[15] == "")
            {
                MessageBox.Show("請求先が設定されていません。", "確認", MessageBoxButton.OK);
                return;
            }
            for (idx = 0; idx < max; idx++)
            {
                dataRowView = (DataRowView)dgHanbai.SelectedItems[idx];
                sId         = dataRowView.Row[2].ToString();
                sNo         = dataRowView.Row[0].ToString();
                nLine       = m_libCmn.StrToInt(sNo) - 1;
                sData       = getCsvElement(nLine);
                ary         = sData.Split(',');
                if (ary[14] == "" && ary[15] == "")
                {
                    MessageBox.Show("請求先が設定されていません。", "確認", MessageBoxButton.OK);
                    return;
                }
                if (seikyu == ary[14] && busyo == ary[15])
                {
                    if (idx != 0)
                    {
                        sRecs  = sRecs + ",";
                        sDatas = sDatas + "\n";
                    }
                    sRecs  = sRecs + sId;
                    sDatas = sDatas + sData;
                }
                else
                {
                    MessageBox.Show("異なる請求先が設定されています。", "確認", MessageBoxButton.OK);
                    return;
                }
            }
            sougiSeikyuWin = new SougiSeikyuWin();
            sougiSeikyuWin.SetMainWindow(this);
            sougiSeikyuWin.SetRecsCsv(sRecs);
            sougiSeikyuWin.SetRecsElement(sDatas);
            Point pt = this.PointToScreen(new Point(0.0d, 0.0d));

            sougiSeikyuWin.Left  = pt.X;
            sougiSeikyuWin.Top   = pt.Y - 24;
            sougiSeikyuWin.Owner = this;
            sougiSeikyuWin.ShowDialog();

            updateDataGrid();
        }