提交 228b9cdc authored 作者: 彭寒菲's avatar 彭寒菲

,,

上级 a67aa0c5
...@@ -216,8 +216,6 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -216,8 +216,6 @@ namespace LF.K3.SCM.BusinessPlugin
} }
} }
//验证字段 //验证字段
public int verification(string str, string str1) public int verification(string str, string str1)
{ {
...@@ -239,7 +237,8 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -239,7 +237,8 @@ namespace LF.K3.SCM.BusinessPlugin
return mc; return mc;
} }
List<string> strl = new List<string>();//编号 List<string> strl = new List<string>();//编号
//替换
//替换
public string replace() public string replace()
{ {
string front = this.Model.GetValue("F_qaz_Text").ToString();//需替换掉的字段 string front = this.Model.GetValue("F_qaz_Text").ToString();//需替换掉的字段
...@@ -309,7 +308,6 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -309,7 +308,6 @@ namespace LF.K3.SCM.BusinessPlugin
List<SqlObject> sqllist = new List<SqlObject>(); List<SqlObject> sqllist = new List<SqlObject>();
for (int i = 0; i < strl.Count; i++) for (int i = 0; i < strl.Count; i++)
{ {
var abc = strl[i].ToString();
string sql = @"update t_BD_MATERIAL set F_QAZ_REMARK='" + str2[i].ToString() + "' where FNUMBER='" + strl[i] + "'"; string sql = @"update t_BD_MATERIAL set F_QAZ_REMARK='" + str2[i].ToString() + "' where FNUMBER='" + strl[i] + "'";
sqllist.Add(new SqlObject(sql, new List<SqlParam>())); sqllist.Add(new SqlObject(sql, new List<SqlParam>()));
} }
...@@ -317,12 +315,12 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -317,12 +315,12 @@ namespace LF.K3.SCM.BusinessPlugin
var a = DBUtils.ExecuteBatch(this.Context, sqllist); var a = DBUtils.ExecuteBatch(this.Context, sqllist);
if (a > 0) if (a > 0)
{ {
return "1"; return "1";//成功返回1
} }
} }
} }
} }
return "2"; return "2";//失败返回2
} }
} }
......
...@@ -31,10 +31,13 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -31,10 +31,13 @@ namespace LF.K3.SCM.BusinessPlugin
{ {
DataTable dtexcel; DataTable dtexcel;
private string _filePath; private string _filePath;
//int CFnum;
// int Excelsum;
int jg; int jg;
DataTable sbtab; DataTable sbtab;//失败数据
public override void AfterBindData(EventArgs e)
{
this.EnableButton("FImportDate", false);
base.AfterBindData(e);
}
public override void BeforeDoOperation(BeforeDoOperationEventArgs e) public override void BeforeDoOperation(BeforeDoOperationEventArgs e)
{ {
...@@ -44,7 +47,7 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -44,7 +47,7 @@ namespace LF.K3.SCM.BusinessPlugin
Impoort(); Impoort();
if (this.IsNotNull()) if (this.IsNotNull())
{ {
if (jg == 1) if (jg == 1)//成功
{ {
string fileName = string.Format("{0}_{1}.xls", this.View.BillBusinessInfo.GetForm().Name, DateTime.Now.ToString("yyyyMMddHHmmssff")); string fileName = string.Format("{0}_{1}.xls", this.View.BillBusinessInfo.GetForm().Name, DateTime.Now.ToString("yyyyMMddHHmmssff"));
ExcelOperation excelHelper = new ExcelOperation(this.View); ExcelOperation excelHelper = new ExcelOperation(this.View);
...@@ -80,7 +83,7 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -80,7 +83,7 @@ namespace LF.K3.SCM.BusinessPlugin
} }
return; return;
} }
else else//失败
{ {
this.View.ShowMessage("数据异常"); this.View.ShowMessage("数据异常");
} }
...@@ -91,6 +94,7 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -91,6 +94,7 @@ namespace LF.K3.SCM.BusinessPlugin
} }
} }
} }
//下载文件弹窗
protected new void DownLoadFile(string url) protected new void DownLoadFile(string url)
{ {
DynamicFormShowParameter param = new DynamicFormShowParameter(); DynamicFormShowParameter param = new DynamicFormShowParameter();
...@@ -100,11 +104,7 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -100,11 +104,7 @@ namespace LF.K3.SCM.BusinessPlugin
param.CustomParams.Add("url", url); param.CustomParams.Add("url", url);
this.View.ShowForm(param); this.View.ShowForm(param);
} }
public override void AfterBindData(EventArgs e)
{
this.EnableButton("FImportDate", false);
base.AfterBindData(e);
}
//自定义方法,判断是否上传Excel表格 //自定义方法,判断是否上传Excel表格
private bool IsNotNull() private bool IsNotNull()
...@@ -121,7 +121,7 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -121,7 +121,7 @@ namespace LF.K3.SCM.BusinessPlugin
return true; return true;
} }
//选择文件触发
public override void CustomEvents(CustomEventsArgs e) public override void CustomEvents(CustomEventsArgs e)
{ {
if (e.Key.EqualsIgnoreCase("FFileUpdate")) if (e.Key.EqualsIgnoreCase("FFileUpdate"))
...@@ -199,7 +199,7 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -199,7 +199,7 @@ namespace LF.K3.SCM.BusinessPlugin
dt.TableName = taball; dt.TableName = taball;
//Excel数据批量导入表中 //Excel数据批量导入表中
DBServiceHelper.BulkInserts(this.Context, string.Empty, string.Empty, dt); DBServiceHelper.BulkInserts(this.Context, string.Empty, string.Empty, dt);
//定义输出参数 //定义输入输出参数
string xznum = ""; string xznum = "";
SqlParam sqlParam1 = new SqlParam("@TableName", KDDbType.String, taball); SqlParam sqlParam1 = new SqlParam("@TableName", KDDbType.String, taball);
SqlParam sqlParam2 = new SqlParam("@TableNamecg", KDDbType.String, tabcg);//失败 SqlParam sqlParam2 = new SqlParam("@TableNamecg", KDDbType.String, tabcg);//失败
...@@ -229,6 +229,7 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -229,6 +229,7 @@ namespace LF.K3.SCM.BusinessPlugin
{ {
jg = -1; jg = -1;
} }
//查出失败数据
string sqldata = $@"/*dialect*/ select [失败原因],[创建人],[货品代号],[名称],[规格],[主单位],[大类],[中类],[预设仓库],[品牌],[12NC],[SKU],[CK编码], [接头数量],[接头型号] string sqldata = $@"/*dialect*/ select [失败原因],[创建人],[货品代号],[名称],[规格],[主单位],[大类],[中类],[预设仓库],[品牌],[12NC],[SKU],[CK编码], [接头数量],[接头型号]
,[线缆长度(米)],[材质],[长],[宽],[高],[拼板数],[开模图号],[每模穴数],[单模日产],[使用范围],[调价物料类型],[发料是否取整],[物料分组] from {tabsb}"; ,[线缆长度(米)],[材质],[长],[宽],[高],[拼板数],[开模图号],[每模穴数],[单模日产],[使用范围],[调价物料类型],[发料是否取整],[物料分组] from {tabsb}";
sbtab = DBUtils.ExecuteDataSet(this.Context, sqldata).Tables[0]; sbtab = DBUtils.ExecuteDataSet(this.Context, sqldata).Tables[0];
...@@ -238,7 +239,7 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -238,7 +239,7 @@ namespace LF.K3.SCM.BusinessPlugin
strarr[1] = tabcg; strarr[1] = tabcg;
strarr[2] = tabsb; strarr[2] = tabsb;
strarr[3] = tabls; strarr[3] = tabls;
var abcc = DBServiceHelper.DeleteTemporaryTableName(this.Context, strarr); DBServiceHelper.DeleteTemporaryTableName(this.Context, strarr);
} }
//自定义方法,拼接临时表字段 //自定义方法,拼接临时表字段
private string GetCreateTmpTableNameSql(DataColumnCollection fieldColumn) private string GetCreateTmpTableNameSql(DataColumnCollection fieldColumn)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论