Exemple #1
0
        // 原価マスタデータを得る
        private void chooseCostMasterData(int lNo)
        {
            CostData cmds = FormCostList.ReceiveItems(cmd);

            if (cmds == null)
            {
                return;
            }

            loadCostMasterData(dataGridView1.Rows[lNo], cmds);
        }
Exemple #2
0
        private void chooseCostData(DataGridViewRow dgvRow)
        {
            if (cmd == null)
            {
                return;
            }
            CostData cmds = FormCostList.ReceiveItems(cmd);

            if (cmds == null)
            {
                return;
            }

            // cmdsからtcdを作り直す場合は次の2Lineのコメントを外す。
            //ListFormDataOp lo = new ListFormDataOp();
            //tcd = lo.SelectTaskCodeNameFromOsWkReport( cmds.CostCode, dateTimePickerEx1.Value );

            dispCostData(cmds, dgvRow);
        }
Exemple #3
0
        private void chooseCostData()
        {
            if (cmd == null)
            {
                MessageBox.Show("対象となる原価データはありません");
                return;
            }

            CostData cmds = FormCostList.ReceiveItems(cmd);

            if (cmds == null)
            {
                return;
            }
            dispSubcontractor(cmds);

            // カレントディレクトリを指定された原価コード名称のフォルダーとする。ただし存在しなければ作成する。
            //folderName = Folder.MyDocuments() + @"\" + labelItemCode.Text + textBoxItem.Text;
            //folderName = @"C:\WorkReport\" + labelItemCode.Text + textBoxItem.Text;
            folderName = @"C:\WorkReport\" + Convert.ToString(comboBoxOffice.SelectedValue)
                         + Convert.ToString(comboBoxDepart.SelectedValue) + labelItemCode.Text + textBoxItem.Text;
            if (!System.IO.Directory.Exists(folderName))
            {
                Func <DialogResult> dialogCreateFolder = DMessage.DialogCreateFolder;
                if (dialogCreateFolder() == DialogResult.No)
                {
                    return;
                }
                System.IO.Directory.CreateDirectory(folderName);
                MessageBox.Show("'" + folderName + "'を作成しました。");

                Folder.CopyFolder(Folder.MyDocuments() + appFolder, folderName + binFolder, true);
                //Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(Folder.MyDocuments() + appFolder, folderName + binFolder,
                //    Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing);

                ///// Create Shortcut
                string shortcutPath = System.IO.Path.Combine(folderName, labelItemCode.Text + textBoxItem.Text + @"内訳書入力.lnk");
                //string targetPath = folderName + appFolder + sourceApp;
                string targetPath = folderName + binFolder + sourceApp;
                // WshShellを作成
                Type    t     = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8"));
                dynamic shell = Activator.CreateInstance(t);
                // WshShortcutを作成
                var shortcut = shell.CreateShortcut(shortcutPath);
                // リンク先
                shortcut.TargetPath = targetPath;
                //shortcut.WorkingDirectory = folderName + appFolder + @"\Release";
                shortcut.WorkingDirectory = folderName + binFolder + @"\Release";
                // ショートカットを作成
                shortcut.Save();
                // 後始末
                System.Runtime.InteropServices.Marshal.FinalReleaseComObject(shortcut);
                System.Runtime.InteropServices.Marshal.FinalReleaseComObject(shell);
            }
            if (!System.IO.File.Exists(folderName + partnerFile))
            {
                writeSubcontractFile();
            }

            checkExistingTaskData();
            checkExistingCostData();
        }