Files
lserp_cs_6.0/其他程序/xNewMyFormDesigner/Program.cs
T
2026-07-18 15:32:50 +08:00

111 lines
5.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.IO;
namespace NewMyFormDesigner
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
{
MyFormDesigner myFormDesigner = new MyFormDesigner();
//myFormDesigner.FrmKey = "{D50D2D31-2120-4AE5-9F27-6F363AB6E76C}";//B32C9D6E-EB85-4CE1-9B81-2B22EDF2D125 56F43621-6C15-4BDD-8870-98D235ECAB91
//myFormDesigner.SelectSQL = @"select b.orderid,b.id as fieldid,fieldname,username1 as username,
// fieldsqltag as fieldtypeid,defaultdate as defaultValue
// from p_systemDlltab a
// left join p_systemwordbooktab b on a.DllCoid=b.tab where a.formkey='{D50D2D31-2120-4AE5-9F27-6F363AB6E76C}' and fieldsqltag<>3 and username1 is not null and isnull(addVisible,0)=0";
//myFormDesigner.updateSQL = @"update p_systemwordbooktab set controlleft=b.controlleft ,controlTop=b.controlTop, controlHeight=b.controlHeight,controlWidth=b.controlWidth, tabOrder=b.tabOrder from p_systemControlLocation b where p_systemwordbooktab.formKey=b.formKey and p_systemwordbooktab.id=b.fieldId and b.formkey='{D50D2D31-2120-4AE5-9F27-6F363AB6E76C}'";
//myFormDesigner.ServerName = "110.185.161.104:5236";
//myFormDesigner.DatabaseName = "LSERP_JTCS";
//myFormDesigner.AccountNumber = "lserpAdmin";
//myFormDesigner.Password = "DWlserp1101";//XDerp20210411%
//MessageBox.Show(args.Length + "");
//MessageBox.Show("1:"+args[0]);
//System.Windows.Forms.Clipboard.SetText(args[0]);
//MessageBox.Show("2:"+args[1]);
//System.Windows.Forms.Clipboard.SetText(args[1]);
//MessageBox.Show("3:" + args[2]);
//System.Windows.Forms.Clipboard.SetText(args[2]);
//MessageBox.Show("4:" + args[3]);
//--------------------------------------------
myFormDesigner.FrmKey = args[0];
myFormDesigner.SelectSQL = args[1];
myFormDesigner.updateSQL = args[2];
if (args.Length >= 4)
{
string LinkString = args[3] + "";
string[] Links = LinkString.Split('^');
if (Links.Length >= 4)
{
myFormDesigner.ServerName = Links[0];
myFormDesigner.DatabaseName = Links[1];
myFormDesigner.AccountNumber = Links[2];
myFormDesigner.Password = Links[3];
}
}
if (args.Length > 3 && !string.IsNullOrEmpty(args[3]))
{
// 打开基础档案设计界面
if ("1".Equals(args[3]))
{
myFormDesigner.SelectSQL = @"select b.orderid,b.id as fieldid,fieldname,username1 as username,
fieldsqltag as fieldtypeid,defaultdate as defaultValue
from p_systemDlltab a
left join p_systemwordbooktab b on a.DllCoid=b.tab where a.formkey='" + myFormDesigner.FrmKey + "' and fieldsqltag<>3 and username1 is not null and isnull(addVisible,0)=0";
myFormDesigner.updateSQL = @"update p_systemwordbooktab set controlleft=b.controlleft ,controlTop=b.controlTop, controlHeight=b.controlHeight,controlWidth=b.controlWidth, tabOrder=b.tabOrder
from p_systemControlLocation b where p_systemwordbooktab.formKey=b.formKey and p_systemwordbooktab.id=b.fieldId and b.formkey='" + myFormDesigner.FrmKey + "'";
}
else if ("2".Equals(args[3]))
{
// 打开单据设计界面
myFormDesigner.SelectSQL = @"select b.orderid,b.id as fieldid,sysname,username as username,
fieldTypeId as fieldtypeid,defaultValue as defaultValue
from p_systembilltype a
left join P_systembillinfo b on a.typecode=b.typecode where a.formkey='" + myFormDesigner.FrmKey + "' and fieldTypeId<>3 and userName is not null";
myFormDesigner.updateSQL = @"update P_systembillinfo set controlleft=b.controlleft ,controlTop=b.controlTop, controlHeight=b.controlHeight,controlWidth=b.controlWidth, tabOrder=b.tabOrder
from p_systemControlLocation b where P_systembillinfo.formKey=b.formKey and P_systembillinfo.id=b.fieldId and b.formkey='" + myFormDesigner.FrmKey + "'";
}
}
//MessageBox.Show(args[0]);
//System.Windows.Forms.Clipboard.SetText(args[0]);
//MessageBox.Show(args[1]);
//System.Windows.Forms.Clipboard.SetText(args[1]);
//MessageBox.Show(args[2]);
//System.Windows.Forms.Clipboard.SetText(args[2]);
File.WriteAllLines("myformDesinger.txt", args);
Application.Run(myFormDesigner);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}