ab56a9bcf7
SVN-Revision: r240
146 lines
5.0 KiB
C#
146 lines
5.0 KiB
C#
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;
|
|
|
|
namespace WindowsFormsApplication2
|
|
{
|
|
/// <summary>
|
|
/// c#库被调用统一接口类
|
|
///
|
|
/// </summary>
|
|
|
|
public sealed class DllBaseClass : IForm
|
|
{
|
|
|
|
public DllBaseClass()
|
|
{
|
|
|
|
}
|
|
public static string Goperatorname = "";
|
|
public static string Gjtid = "0";
|
|
public static string GjtName = "";
|
|
public static string workshop = "";
|
|
public static string planlistid = "";
|
|
public static string YzProductid = "";
|
|
public static int YsHour = 0;
|
|
public static int jtlsj = 0;
|
|
public DllBaseClass(string[] obj)
|
|
{
|
|
try
|
|
{
|
|
FrmMain main = new FrmMain();
|
|
this.SubForm = main;
|
|
main.Model = new DynamicDemoModel(obj);
|
|
|
|
Goperatorname = obj[2];
|
|
planlistid = obj[5];
|
|
Gjtid = obj[6];
|
|
YzProductid = obj[7];
|
|
|
|
main.t1.Text = obj[0] + "->" + obj[1] + "->" + obj[2] + "->" + obj[3] + "->" + obj[4];
|
|
// 对应右键惨淡参数1
|
|
main.t2.Text = obj[5] + "->" + obj[6] + "->" + obj[7];
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogUtil.WriteError("--参数错误-->" + obj.ToString(), ex);
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// 窗口
|
|
/// </summary>
|
|
public Form SubForm { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 类库-入口类
|
|
/// </summary>
|
|
public class DynamicDemoModel : DynamicModel
|
|
{
|
|
/// <summary>
|
|
/// 主键值
|
|
/// </summary>
|
|
/// <value>The object identifier.</value>
|
|
public string ObjectId { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 是否隐藏半成品上机
|
|
/// </summary>
|
|
/// <value>The object identifier.</value>
|
|
public bool HideTabPage { get; private set; }
|
|
|
|
/// <summary>
|
|
/// 是否隐藏余料上机
|
|
/// </summary>
|
|
/// <value>The object identifier.</value>
|
|
public bool HideExcessStockTabPage { get; private set; }
|
|
|
|
/// <summary>
|
|
/// 材料上机Sql
|
|
/// </summary>
|
|
/// <value>The object identifier.</value>
|
|
public string MaterialOnMachineSql { get; private set; }
|
|
/// <summary>
|
|
/// 扫码控件禁用手动输入
|
|
/// </summary>
|
|
/// <value>The object identifier.</value>
|
|
public bool ProhibitManualinput { get; private set; }
|
|
|
|
/// <summary>
|
|
/// 初始化动态链接库参数
|
|
/// </summary>
|
|
/// <param name="args">The arguments.</param>
|
|
public DynamicDemoModel(string[] args)
|
|
: base(args)
|
|
{
|
|
// 入口参数前面5个参数系统自动增加分别是(窗口名称、用户ID、用户名称、权限(0\1)、当前窗口的模块编号)
|
|
if (args.Length > 5 && !string.IsNullOrWhiteSpace(args[5]) && !"0".Equals(args[5]))
|
|
{
|
|
base.ModuleId = Convert.ToInt32(args[5]);
|
|
}
|
|
// 参数6对应右键菜单的参数1,比如需要传入调用模块的模块编号,一次类推为当前模块需要使用的一些参数
|
|
if (args.Length > 6 && !string.IsNullOrWhiteSpace(args[6]))
|
|
{
|
|
base.ModuleCode = args[6];
|
|
}
|
|
//参数7
|
|
if (args.Length >= 11 && !string.IsNullOrWhiteSpace(args[11]))
|
|
{
|
|
HideTabPage = "1".Equals(args[11]);
|
|
}
|
|
//参数8
|
|
if (args.Length >= 12 && !string.IsNullOrWhiteSpace(args[12]))
|
|
{
|
|
HideExcessStockTabPage = "1".Equals(args[12]);
|
|
}
|
|
//参数9
|
|
if (args.Length >= 13 && !string.IsNullOrWhiteSpace(args[13]))
|
|
{
|
|
MaterialOnMachineSql = args[13];
|
|
}
|
|
//参数10
|
|
if (args.Length > 14 && !string.IsNullOrWhiteSpace(args[14]))
|
|
{
|
|
ProhibitManualinput = "1".Equals(args[14]+"");
|
|
}
|
|
//this.IsView = args[6];
|
|
//this.ObjectId = args[7];
|
|
//this.ParentKey = args.Length > 8 ? args[8] : string.Empty;
|
|
//this.ParentValue = args.Length > 9 ? args[9] : string.Empty;
|
|
//this.ControlSql = args.Length > 10 && !string.IsNullOrWhiteSpace(args[10]) ? args[10].TrimStart('#') : string.Empty;
|
|
//this.SearchObject = args.Length > 13 ? args[13] : string.Empty;
|
|
//this.DataObj = args.Length > 14 ? args[14] : string.Empty;
|
|
//// UnionKey、UnionValue 此2个值通过程序传递,外部调用无法传递
|
|
//this.UnionKey = args.Length > 15 ? args[15] : string.Empty;
|
|
//this.UnionValue = args.Length > 16 ? args[16] : string.Empty;
|
|
//this.SaveState = args.Length > 17 ? args[17] : string.Empty;
|
|
}
|
|
}
|
|
}
|