124 lines
3.4 KiB
C#
124 lines
3.4 KiB
C#
/******************************
|
|
* 说明:PubSpec 模块
|
|
* 创建人:龚宇超
|
|
* 创建日期:2018-01-02
|
|
* 修改人:
|
|
* 修改日期:
|
|
* 修改备注:
|
|
* 版本:1.0.0.0
|
|
******************************/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Lskj.Util;
|
|
using Lskj.Business;
|
|
using System.Windows.Forms;
|
|
using Lskj.Model;
|
|
using DevExpress.XtraGrid.Views.Grid;
|
|
using Newtonsoft.Json.Linq;
|
|
using Newtonsoft.Json;
|
|
using System.Data;
|
|
using Lskj.Business.Impl;
|
|
|
|
namespace Lskj.PubBomImportNew
|
|
{
|
|
/// <summary>
|
|
/// PubSpec 模块
|
|
/// </summary>
|
|
public class DllBaseClass : IForm
|
|
{
|
|
public DllBaseClass()
|
|
{
|
|
|
|
}
|
|
public DllBaseClass(string[] obj)
|
|
{
|
|
try
|
|
{
|
|
FrmMain2 main = new FrmMain2();
|
|
this.SubForm = main;
|
|
main.Model = new DynamicBomImportNew(obj);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogUtil.WriteError("Lskj.PubSpecialImport.dll--参数错误-->" + obj.ToString(), ex);
|
|
}
|
|
}
|
|
public Form SubForm { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// PubSpecialImport入库参数
|
|
/// </summary>
|
|
public class DynamicBomImportNew : DynamicModel
|
|
{
|
|
/// <summary>
|
|
/// 模块编号
|
|
/// </summary>
|
|
public string UnionModelCode = "";
|
|
/// <summary>
|
|
/// 主键名
|
|
/// </summary>
|
|
public string primkey = "";
|
|
/// <summary>
|
|
/// 主键值
|
|
/// </summary>
|
|
public string keyvalue = "";
|
|
/// <summary>
|
|
/// 起始行号
|
|
/// </summary>
|
|
public string stratRowHand = "";
|
|
/// <summary>
|
|
/// 终止条件
|
|
/// </summary>
|
|
public string endRowHand = "";
|
|
/// <summary>
|
|
/// 附件节点
|
|
/// </summary>
|
|
public string speciesNo = "";
|
|
|
|
public DynamicBomImportNew(string[] args)
|
|
: base(args)
|
|
{
|
|
if (args.Length > 5 && !string.IsNullOrWhiteSpace(args[5]))
|
|
{
|
|
UnionModelCode = args[5] + "";
|
|
}
|
|
if (args.Length > 6 && !string.IsNullOrWhiteSpace(args[6]))
|
|
{
|
|
primkey = args[6] + "";
|
|
}
|
|
if (args.Length > 7 && !string.IsNullOrWhiteSpace(args[7]))
|
|
{
|
|
keyvalue = args[7] + "";
|
|
}
|
|
if (args.Length > 8 && !string.IsNullOrWhiteSpace(args[8]))
|
|
{
|
|
stratRowHand = args[8] + "";
|
|
}
|
|
if (args.Length > 9 && !string.IsNullOrWhiteSpace(args[9]))
|
|
{
|
|
endRowHand = args[9] + "";
|
|
}
|
|
if (args.Length > 10 && !string.IsNullOrWhiteSpace(args[10]))
|
|
{
|
|
speciesNo = args[10] + "";
|
|
}
|
|
if (!string.IsNullOrEmpty(args[args.Length - 1]))
|
|
{
|
|
try
|
|
{
|
|
JObject rowObject = JsonConvert.DeserializeObject<JObject>(args[args.Length - 1]);
|
|
JArray jArray = new JArray();
|
|
jArray.Add(rowObject);
|
|
DataTable dataTable = JsonConvert.DeserializeObject<DataTable>(JsonConvert.SerializeObject(jArray));
|
|
this.MaintabFocusedRow = dataTable.Rows[0];
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|