SVN r643
SVN-Revision: r643
This commit is contained in:
@@ -80,7 +80,7 @@ namespace Lskj.PubBomImport
|
||||
InitGridColumns();
|
||||
InitMulitControl();
|
||||
InitDataSource();
|
||||
if (showTypeValue == 0 || showTypeValue == 3 || showTypeValue == 33 || showTypeValue == 4 || showTypeValue == 44 || showTypeValue == 5 || showTypeValue == 55 || (showTypeValue > 0 && showType))
|
||||
if (showTypeValue == 0 || showTypeValue == 2 || showTypeValue == 3 || showTypeValue == 33 || showTypeValue == 4 || showTypeValue == 44 || showTypeValue == 5 || showTypeValue == 55 || (showTypeValue > 0 && showType))
|
||||
{
|
||||
OnBtnImportClick(null, null);
|
||||
}
|
||||
@@ -286,33 +286,60 @@ namespace Lskj.PubBomImport
|
||||
// this.Close();
|
||||
// }
|
||||
//}
|
||||
//else if (Model.ShowType.Equals("2"))
|
||||
//{
|
||||
// OpenFileDialog dialog = new OpenFileDialog();
|
||||
// dialog.InitialDirectory = Properties.Settings.Default.LastSelectFolder;
|
||||
// dialog.Title = "选择导入文件";
|
||||
// dialog.Filter = "Excel文件(*.xlsx)|*.xlsx|Excel文件(*.xls)|*.xls";
|
||||
// DialogResult dialogResult = dialog.ShowDialog();
|
||||
// if (dialogResult == DialogResult.OK)
|
||||
// {
|
||||
// Properties.Settings.Default.LastSelectFolder = Path.GetDirectoryName(dialog.FileName);
|
||||
// string dirPath = dialog.FileName;
|
||||
// FrmProgress frmProgress = new FrmProgress();
|
||||
// frmProgress.frmMain = this;
|
||||
// frmProgress.ImportTimer.Tick += (ts, te) =>
|
||||
// {
|
||||
// frmProgress.ImportTimer.Enabled = false;
|
||||
// frmProgress.StartImportInMxFile(dirPath);
|
||||
// };
|
||||
// frmProgress.ImportTimer.Enabled = true;
|
||||
// frmProgress.ShowDialog();
|
||||
// frmProgress.Dispose();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this.Close();
|
||||
// }
|
||||
//}
|
||||
else if (Model.ShowType.Equals("2"))//一级BOM上传
|
||||
{
|
||||
BomImpRtnModel bomImpRtnModel = new BomImpRtnModel()
|
||||
{
|
||||
ShowType = Model.ShowType,
|
||||
AfterBomFieldName = Model.AfterBomFieldName,
|
||||
CanSave = true
|
||||
};
|
||||
FormDialogModel dialogModel = new FormDialogModel()
|
||||
{
|
||||
DialogDllName = "Lskj.PubBomImport.dll",
|
||||
PubDialogType = DialogType.PubAddRecord,
|
||||
ReturnTag = bomImpRtnModel
|
||||
};
|
||||
this.Tag = dialogModel;
|
||||
DataTable sourceTable = StaticControl.RightMenuGridView.GridControl.DataSourceTable();
|
||||
if (sourceTable.Columns.Contains("BomFieldNameDir"))
|
||||
{
|
||||
List<DataRow> selectRows = new List<DataRow>();
|
||||
foreach (DataRow sourceRow in sourceTable.Rows)
|
||||
{
|
||||
if (sourceRow.RowState == DataRowState.Deleted)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string fileName = sourceRow[Model.AfterBomFieldName] + "";
|
||||
string dirPath = sourceRow["BomFieldNameDir"] + "";
|
||||
selectRows.Add(sourceRow);
|
||||
}
|
||||
if (selectRows.Count > 0)
|
||||
{
|
||||
FrmProgress frmProgress = new FrmProgress();
|
||||
frmProgress.frmMain = this;
|
||||
frmProgress.Model = Model;
|
||||
frmProgress.ImportTimer.Tick += (ts, te) =>
|
||||
{
|
||||
frmProgress.ImportTimer.Enabled = false;
|
||||
frmProgress.StartImportInFirstFiles(selectRows);
|
||||
};
|
||||
frmProgress.ImportTimer.Enabled = true;
|
||||
DialogResult dialogResult = frmProgress.ShowDialog();
|
||||
bomImpRtnModel.CanSave = dialogResult == DialogResult.OK;
|
||||
frmProgress.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
else if (Model.ShowType.Equals("3"))//新增多个QD文件或图纸文件
|
||||
{
|
||||
BomImpRtnModel bomImpRtnModel = new BomImpRtnModel()
|
||||
|
||||
Reference in New Issue
Block a user