提交当前本机整理版本

This commit is contained in:
cyf
2026-07-02 10:11:39 +00:00
parent c10a5d64c7
commit aacefa24f8
822 changed files with 196665 additions and 14263 deletions
@@ -477,4 +477,40 @@ namespace AfkDataService
// try
// {
// MySqlHelper._connection.Close();
//
// MySqlHelper._connection.Dispose();
// }
// catch (Exception)
// {
// }
// MySqlHelper._connection = null;
// }
// try
// {
// MySqlHelper._connection = new MySqlConnection(connStr);
// MySqlHelper._connection.Open();
// return true;
// }
// catch (Exception ex)
// {
// Console.WriteLine(ex.Message);
// }
// return false;
//}
#endregion
public void SendMessage(TextBox textBox, string message)
{
if (textBox.InvokeRequired)
{
textBox.Invoke(new Action(() =>
{
textBox.AppendText(message);
}));
}
else
{
textBox.AppendText(message);
}
}
#endregion
}
}
File diff suppressed because it is too large Load Diff
@@ -6,4 +6,31 @@ using System.Runtime.InteropServices;
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ExecPythonPDF")]
[assembly: Assemb
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ExecPythonPDF")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("cfb86248-5da9-4f84-b2bb-6044b62c1ddc")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -36,4 +36,28 @@ namespace ExecPythonPDF.Properties {
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static glo
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ExecPythonPDF.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
@@ -1,2 +1,26 @@
//------------------------------------------------------------------------------
// <a
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ExecPythonPDF.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
@@ -588,4 +588,32 @@ namespace ExecPythonPDF
int endLimit = nextMatch != null ? nextMatch.Index : content.Length;
int endP = p;
while (endP < endLimit && !char.IsWhiteSpace(content[endP])) endP++;
return content.Substring(p, endP - p).Trim();
}
}
// --- 工厂类 ---
public static class BankExtractorFactory
{
private static readonly Dictionary<string, BankExtractor> Extractors = new Dictionary<string, BankExtractor>
{
{ "中国银行", new BOCExtractor() },
{ "工商银行", new ICBCExtractor() },
{ "成都银行", new ChengduBankExtractor() },
{ "民生银行", new CMBCExtractor() },
{ "浙商银行", new CZBankExtractor() }
};
public static BankExtractor GetExtractor(string bankName) =>
Extractors.ContainsKey(bankName) ? Extractors[bankName] : null;
public static string IdentifyBank(string filename)
{
foreach (var key in Extractors.Keys)
if (filename.Contains(key)) return key;
return null;
}
}
}
@@ -11,4 +11,35 @@ namespace PDFApi.Controllers
[Route("Api/ProcessPDF")] // 自定义路由
public IHttpActionResult ProcessPDF([FromBody] PDFRequest request)
{
JObject rtnJobject = new JObject();
rtnJobject.Add("success", "false");
rtnJobject.Add("code", "0");
rtnJobject.Add("msg", "");
rtnJobject.Add("data", new JArray());
try
{
if (request != null)
{
rtnJobject = PDFConvert.ExecutePdfExtraction(request.FileUrl, request.FileName);
}
else
{
throw new Exception("空数据");
}
}
catch (Exception ex)
{
rtnJobject["success"] = "false";
rtnJobject["code"] = "0";
rtnJobject["msg"] = ex.Message;
}
return Ok(rtnJobject);
}
// 定义接收参数的实体类
public class PDFRequest
{
public string FileUrl { get; set; }
public string FileName { get; set; }
}
}
}
Binary file not shown.
@@ -1,8 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过下列特性集
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("PDFApi")]
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过下列特性集
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("PDFApi")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PDFApi")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
// 对 COM 组件不可见。如果需要
// 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
[assembly: Guid("dd0c73ce-e2c0-4fff-9a0f-3e40fce1d46a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订版本
//
// 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
// 方法是按如下所示使用 "*":
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+30 -1
View File
@@ -338,4 +338,33 @@ namespace GetApiData
this.Controls.Add(this.labelServerName);
this.Controls.Add(this.textBaseName);
this.Controls.Add(this.textServerName);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.MaximizeBox = false;
this.Name = "FrmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "蕊源同步工具";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Label label1;
private Label label2;
private TextBox k3appId;
private TextBox k3ServerName;
private Label label3;
private TextBox k3appSecret;
private Label label4;
private TextBox k3dbId;
private Label label5;
private TextBox k3userName;
private Label label6;
private TextBox k3number;
}
}
+33 -1
View File
@@ -585,4 +585,36 @@ namespace GetApiData
decimal famount = details.Sum(d => SafeToDecimal(d, "wms_ljoins_famount"));
string jsonDraft = apiClient.Draft("PRD_MORPT",
PRD_MORPTModel.CreateData(mainRow, details[0], $"{amount}", $"{famount}", moIdNo));
}
catch (Exception exRow)
{
resultText.AppendText(exRow.Message + "\r\n");
}
finally
{
StepProgress();
}
}
}
catch (Exception ex)
{
resultText.AppendText(ex.Message + "\r\n");
}
finally
{
resultText.AppendText("同步到金蝶结束!\r\n");
}
}
private static decimal SafeToDecimal(DataRow r, string col)
{
if (!r.Table.Columns.Contains(col)) return 0m;
string s = $"{r[col]}";
if (string.IsNullOrWhiteSpace(s)) return 0m;
return Convert.ToDecimal(s);
}
#endregion
}
}
@@ -12,4 +12,49 @@ namespace GetApiData.KingdeeModel
public string FSrcEntryId { get; set; }
public string FIsNew { get; set; }
public FMaterialId FMaterialId { get; set; }
public string FFinishQty { get; set; }
public string FQuaQty { get; set; }
public string FProductType { get; set; }
public FReportType FReportType { get; set; }
public FWorkshipId FWorkshipId { get; set; }
public FLot FLot { get; set; }
public string FSrcBillType { get; set; }
public string FMoBillNo { get; set; }
public string FSrcBillNo { get; set; }
public string FSrcInterId { get; set; }
public string FSrcEntrySeq { get; set; }
public string FMoId { get; set; }
public string FMoEntryId { get; set; }
public FBomId FBomId { get; set; }
public string FMOMAINENTRYID { get; set; }
public List<PRD_MORPTFEntity_LinkItem> FEntity_Link { get; set; }
public FEntityItem()
{
FMaterialId = new FMaterialId();
FReportType = new FReportType();
FLot = new FLot();
FWorkshipId = new FWorkshipId();
FBomId = new FBomId();
}
}
}
@@ -50,4 +50,38 @@ namespace GetApiData.KingdeeModel
string fEntity_Link_FRuleId = "PRD_MO2MORPT";
string fEntity_Link_FSTableName = "T_PRD_MOENTRY";
string fEntity_Link_FSBillId = ((billMainRow.Table.Columns.Contains("wms_mjoins_jdid") && !string.IsNullOrEmpty(string.Concat(billMainRow["wms_mjoins_jdid"]))) ? string.Concat(billMainRow["wms_mjoins_jdid"]) : "");
string fEntity_Link_FSId = ((billDetailRow.Table.Columns.C
string fEntity_Link_FSId = ((billDetailRow.Table.Columns.Contains("wms_ljoins_jdid") && !string.IsNullOrEmpty(string.Concat(billDetailRow["wms_ljoins_jdid"]))) ? string.Concat(billDetailRow["wms_ljoins_jdid"]) : "");
pRD_MORPTFEntity_LinkItem.FEntity_Link_FRuleId = fEntity_Link_FRuleId;
pRD_MORPTFEntity_LinkItem.FEntity_Link_FSTableName = fEntity_Link_FSTableName;
pRD_MORPTFEntity_LinkItem.FEntity_Link_FSBillId = fEntity_Link_FSBillId;
pRD_MORPTFEntity_LinkItem.FEntity_Link_FSId = fEntity_Link_FSId;
list2.Add(pRD_MORPTFEntity_LinkItem);
fEntityItem.FEntity_Link = list2;
list.Add(fEntityItem);
var value = new
{
Model = new
{
FBillNo = fBillNo,
FBillType = new
{
FNumber = "SCHBD01_SYS"
},
FDate = fDate,
FPrdOrgId = new
{
FNumber = "101"
},
FDocumentStatus = "C",
FWorkshipIdH = new
{
FNumber = fNumber
},
FDescription = fDescription,
FEntity = list
}
};
return JsonConvert.SerializeObject(value);
}
}
}
Binary file not shown.
@@ -6,4 +6,31 @@ using System.Runtime.InteropServices;
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("GetApiData")]
[assembly: Ass
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GetApiData")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("acb19ef7-f810-43f0-8d4d-7ee615f12af1")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -37,4 +37,34 @@ namespace GetApiData.Properties
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager Resou
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GetApiData.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -1 +1,29 @@
//------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GetApiData.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
+21 -1
View File
@@ -455,4 +455,24 @@ namespace LadfDataApp
private System.Windows.Forms.TextBox loginNameBox;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.RadioButton radioNext;
private System.Windows.Forms.P
private System.Windows.Forms.Panel panelFix;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.DateTimePicker fixEndDate;
private System.Windows.Forms.DateTimePicker fixStartDate;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.RadioButton radioFix;
private System.Windows.Forms.Panel panelNext;
private System.Windows.Forms.DateTimePicker nextStartDate;
private System.Windows.Forms.Label timeUnitLab;
private System.Windows.Forms.Label timeIntervalLab;
private System.Windows.Forms.TextBox timeIntervalBox;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox projectComboBox;
private System.Windows.Forms.Button linkBtn;
private System.Windows.Forms.Button startBtn;
private System.Windows.Forms.CheckBox checkHistory;
}
}
@@ -804,4 +804,42 @@ namespace LadfDataApp
public string GetStamp(DateTime dateTime)
{
TimeSpan tspan = dateTime.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0);
return Con
return Convert.ToInt64(tspan.TotalSeconds).ToString();
}
/// <summary>
/// 更新消息
/// </summary>
/// <param name="msg"></param>
private void UpdateMsg(string msg)
{
if (this.tipsTextBox.InvokeRequired)
{
this.tipsTextBox.Invoke(new Action(() =>
{
this.tipsTextBox.AppendText(msg);
}));
}
else
{
this.tipsTextBox.AppendText(msg);
}
}
/// <summary>
/// 清空消息
/// </summary>
private void ClearMsg()
{
if (this.tipsTextBox.InvokeRequired)
{
this.tipsTextBox.Invoke(new Action(() =>
{
this.tipsTextBox.Clear();
}));
}
else
{
this.tipsTextBox.Clear();
}
}
}
}
@@ -125,4 +125,29 @@ namespace LadfDataApp
builder.AppendFormat("{0}={1}", item.Key, item.Value);
i++;
}
}
byteRequest = Encoding.UTF8.GetBytes(builder.ToString());
httpWebRequest.ContentLength = byteRequest.Length;
}
Stream stream = httpWebRequest.GetRequestStream();
stream.Write(byteRequest, 0, byteRequest.Length);
stream.Close();
httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
result = streamReader.ReadToEnd();
streamReader.Close();
responseStream.Close();
cookieCollection = cookie.GetCookies(new Uri(url));
return httpWebResponse;
}
catch (Exception)
{
cookieCollection = null;
return httpWebResponse;
}
}
}
}
@@ -1,4 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.T
using System.Text;
namespace LadfDataApp
{
public class ProjectModel
{
public string projectId { get; set; }
public string name { get; set; }
public string delFlag { get; set; }
public string province { get; set; }
public string city { get; set; }
public string county { get; set; }
public string address { get; set; }
public string propertyOwner { get; set; }
public string constructionTime { get; set; }
public string acreage { get; set; }
public string typeId { get; set; }
public string state { get; set; }
public string enableTime { get; set; }
public string energyConsumption { get; set; }
public string imgUrl { get; set; }
public string remarks { get; set; }
public string contractor { get; set; }
public string propertyMgmt { get; set; }
public string projectTypeId { get; set; }
public string projectTypeName { get; set; }
}
}
Binary file not shown.
@@ -6,4 +6,31 @@ using System.Runtime.InteropServices;
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LadfDataApp")]
[assembly: Asse
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LadfDataApp")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("aa75c812-16a4-498c-bf4d-f1c2cb8e0015")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -37,4 +37,34 @@ namespace LadfDataApp.Properties
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager Resour
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LadfDataApp.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -1 +1,29 @@
//-------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LadfDataApp.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
@@ -563,4 +563,31 @@ namespace LadfDataApp
/// <param name="cmd">The command.</param>
/// <param name="Connection">The connection.</param>
/// <param name="trans">The trans.</param>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="cmdParms">The command parms.</param>
private static void PrepareCommand(SqlCommand cmd, SqlConnection Connection, SqlTransaction trans, CommandType cmdType, string cmdText, SqlParameter[] cmdParms)
{
if (Connection.State != ConnectionState.Open)
{
Connection.Open();
}
cmd.Connection = Connection;
cmd.CommandTimeout = CommandTimeout;
cmd.CommandText = cmdText;
if (trans != null)
{
cmd.Transaction = trans;
}
cmd.CommandType = cmdType;
if (cmdParms != null)
{
foreach (SqlParameter parameter in cmdParms)
{
cmd.Parameters.Add(parameter);
}
}
}
#endregion
}
}
+32 -1
View File
@@ -145,4 +145,35 @@ namespace Lskj.GetSecretKey
if (File.Exists(file))
{
string args = AESUtil.Decrypt(File.ReadAllText(file));
stri
string[] controlAfgs = args.Split('^');
if (controlAfgs != null && controlAfgs.Length == 5)
{
txtServerName.Text = controlAfgs[0];
txtDBName.Text = controlAfgs[1];
LoginName.Text = controlAfgs[2];
LoginPwd.Text = controlAfgs[3];
txtDays.Text = controlAfgs[4];
}
}
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void OnKeysDown(object sender, KeyEventArgs e)
{
TextEdit txtEdit = (TextEdit)sender;
if (e.KeyCode == Keys.Enter)
{
if (txtEdit.Name.Equals("LoginPwd"))
{
this.OnSetPanel_Click(sender, e);
}
else
{
SendKeys.Send("{Tab}");
}
}
}
}
}
+24 -1
View File
@@ -74,4 +74,27 @@ namespace Lskj.GetSecretKey
{
SqlHelper.ExecuteNonQuery(sqlNameStr);
this.oldUserName = this.userName;
}
string sqlPsdStr = "ALTER LOGIN {0} WITH PASSWORD = '{1}'";
sqlPsdStr = string.Format(sqlPsdStr, userName, passWord);
string nConnection = "Server={0};Database={1};Persist Security Info=True;User ID=" + userName + ";Password=" + oldPassWord + ";Connection Timeout=5;MultipleActiveResultSets=true";
nConnection = AESUtil.Encrypt(nConnection);
SqlHelper._connection = null;
if (DBConfig.Instance.CreateConnection(nConnection))
{
SqlHelper.ExecuteNonQuery(sqlPsdStr);
this.oldPassWord = passWord;
}
}
catch (Exception ex)
{
MessageUtil.Show(ex.Message);
return;
}
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}
}
+24 -1
View File
@@ -95,4 +95,27 @@ namespace Lskj.GetSecretKey
this.Appearance.Options.UseFont = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(336, 113);
this.Controls.Add(this.setPanel);
this.Controls.Add(this.userNameEdit);
this.Controls.Add(this.labelControl2);
this.Controls.Add(this.passWordEidt);
this.Controls.Add(this.labelControl1);
this.Name = "LoginFrm";
this.Text = "LoginFrm";
((System.ComponentModel.ISupportInitialize)(this.userNameEdit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.passWordEidt.Properties)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private DevExpress.XtraEditors.TextEdit userNameEdit;
private DevExpress.XtraEditors.LabelControl labelControl2;
private DevExpress.XtraEditors.TextEdit passWordEidt;
private DevExpress.XtraEditors.LabelControl labelControl1;
private System.Windows.Forms.Panel setPanel;
}
}
+22 -1
View File
@@ -429,4 +429,25 @@ namespace Lskj.GetSecretKey
this.ClientSize = new Size(360, 150);
this.MaximizeBox = false; this.MinimizeBox = false;
var lbl = new Label { Text = "重置口令:", AutoSize = true, Location = new Point(20, 30)
var lbl = new Label { Text = "重置口令:", AutoSize = true, Location = new Point(20, 30) };
txtCode = new TextBox { Location = new Point(100, 26), Width = 220, UseSystemPasswordChar = true, PasswordChar = '*' };
btnOk = new Button { Text = "确定", DialogResult = DialogResult.OK, Location = new Point(160, 80), Width = 75 };
btnCancel = new Button { Text = "取消", DialogResult = DialogResult.Cancel, Location = new Point(245, 80), Width = 75 };
btnOk.Click += (s, e) =>
{
if (string.IsNullOrEmpty(txtCode.Text))
{
MessageBox.Show("请输入重置口令。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.DialogResult = DialogResult.None; return;
}
ResetCode = txtCode.Text;
};
this.Controls.AddRange(new System.Windows.Forms.Control[] { lbl, txtCode, btnOk, btnCancel });
this.AcceptButton = btnOk; this.CancelButton = btnCancel;
}
}
#endregion
}
Binary file not shown.
+34 -1
View File
@@ -367,4 +367,37 @@ namespace Lskj.Main.Model
return true;
}
return false;
}
/// <summary>
/// 运行 Dev 伴侣,对其注册弹框下毒手。
/// </summary>
public void Run()
{
if (!StopCompanion)
return; // 防止多次运行导致可能的线程错误。
StopCompanion = false;
m_Thread = new Thread(new ThreadStart(() =>
{
while (!StopCompanion)
{
if (ResidentMode)
CloseAboutDev();
else // 如果非常驻模式,则在检测并关闭Dev注册弹框后应结束程序。
StopCompanion = CloseAboutDev();
Thread.Sleep(Interval);
}
m_Thread = null;
}));
m_Thread.Start();
}
/// <summary>
/// 关闭程序的运行。
/// </summary>
public void Stop()
{
StopCompanion = true;
}
}
}
+30 -1
View File
@@ -938,4 +938,33 @@ namespace Lskj.TxtFileRead
{
string field = item.Replace("{", "").Replace("}", "");
string value = row.Table.Columns.Contains(field) ? row[field] + "" : item;
value = value.
value = value.Replace("'", "''");
param = param.Replace(item, value);
}
return param;
}
/// <summary>
/// <para>说明:获取sql语句中替换</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-09-04 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns>List&lt;System.String&gt;.</returns>
public static List<string> GetParamFields(string defaultValue)
{
List<string> list = new List<string>();
Regex regex = new Regex("{([^{])+}");
MatchCollection mcs = regex.Matches(defaultValue);
foreach (Match item in mcs)
{
if (list.IndexOf(item.Value) == -1)
list.Add(item.Value);
}
return list;
}
}
}
Binary file not shown.
+106 -19
View File
@@ -20,6 +20,7 @@ using System.Threading;
using System.Diagnostics;
using Lskj.Util;
using NewMyFormDesigner;
using System.Data.Common;
namespace Lskj.Core
{
@@ -269,33 +270,119 @@ namespace Lskj.Core
/// <para>版本:1.0</para>
/// </summary>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
public bool CreateConnection(string LinkString)
public bool CreateConnection(string LinkString, ConnectionType connectionType)
{
string connStr =string.IsNullOrWhiteSpace(LinkString)?GetConnection(): LinkString;
if (SqlHelper._connection != null)
{
try
{
SqlHelper._connection.Close();
SqlHelper._connection.Dispose();
}
catch (Exception)
{
}
SqlHelper._connection = null;
}
bool isConnect = false;
try
{
SqlHelper._connection = new SqlConnection(connStr);
SqlHelper._connection.Open();
string connStr = string.IsNullOrWhiteSpace(LinkString) ? GetConnection() : LinkString;
string providerName = "System.Data.SqlClient";
SqlHelper.ConnectionType = ConnectionType.SqlServer;
return true;
if (connectionType == ConnectionType.KdbnServer)
{
providerName = "Kdbndp";
SqlHelper.ConnectionType = ConnectionType.KdbnServer;
}
else if (connectionType == ConnectionType.DmServer)
{
providerName = "Dm";
SqlHelper.ConnectionType = ConnectionType.DmServer;
}
SqlHelper.dbFactory = DbProviderFactories.GetFactory(providerName);
if (SqlHelper._connection != null)
{
try
{
SqlHelper._connection.Close();
SqlHelper._connection.Dispose();
}
catch (Exception)
{
}
SqlHelper._connection = null;
}
try
{
SqlHelper._connection = SqlHelper.dbFactory.CreateConnection();
SqlHelper._connection.ConnectionString = connStr;
SqlHelper._connection.Open();
isConnect = true;
}
catch (Exception ex)
{
//throw;
LogHelper.Instance.WriteLog(ex.Message);
}
}
catch (Exception ex)
{
LogHelper.Instance.WriteLog(ex.Message);
//throw;
Console.WriteLine(ex.Message);
}
return false;
return isConnect;
}
/// <summary>
/// 根据ODBC数据源名称(DSN)获取对应的服务器地址/连接地址
/// </summary>
/// <param name="dsnName">ODBC数据源名称</param>
/// <param name="isSystemDsn">是否是系统DSNfalse=用户DSN</param>
/// <param name="is32BitOdbc">是否是32位ODBC64位系统需指定)</param>
/// <returns>ODBC对应的服务器地址(无则返回空)</returns>
public string GetOdbcAddressByDsnName(string dsnName, bool isSystemDsn = true, bool is32BitOdbc = true)
{
if (string.IsNullOrEmpty(dsnName))
{
throw new ArgumentNullException(nameof(dsnName), "ODBC数据源名称不能为空");
}
// 1. 确定注册表根路径
RegistryKey rootKey = isSystemDsn ? Registry.LocalMachine : Registry.CurrentUser;
string odbcIniPath = "Software\\ODBC\\ODBC.INI\\" + dsnName;
// 64位系统下32位ODBC的路径修正
if (isSystemDsn && is32BitOdbc && Environment.Is64BitOperatingSystem)
{
odbcIniPath = "Software\\WOW6432Node\\ODBC\\ODBC.INI\\" + dsnName;
}
// 2. 打开注册表项并读取地址
using (RegistryKey dsnKey = rootKey.OpenSubKey(odbcIniPath, RegistryKeyPermissionCheck.ReadSubTree))
{
if (dsnKey == null)
{
return null; // 未找到该ODBC数据源
}
// 3. 优先读取常见的地址键值(不同数据库的键名可能不同)
List<string> addressKeys = new List<string> { "Server", "Data Source", "Address", "ServerName", "DataSource" };
foreach (string keyName in addressKeys)
{
string address = dsnKey.GetValue(keyName)?.ToString()?.Trim();
if (!string.IsNullOrEmpty(address))
{
return address;
}
}
// 4. 若未找到地址,返回完整连接字符串(备用)
string connectionString = dsnKey.GetValue("ConnectString")?.ToString()?.Trim();
return connectionString;
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -42,6 +42,5 @@
}
#endregion
}
}
@@ -80,7 +80,7 @@ namespace NewMyFormDesigner
}
void frmMain_MouseMove(object sender, MouseEventArgs e)
{
if (MouseIsDown)
ResizeToRectangle(e.Location);
}
@@ -88,7 +88,7 @@ namespace NewMyFormDesigner
{
MouseIsDown = true;
DrawStart(e.Location);
}
private void ResizeToRectangle(Point p)
{
+75 -99
View File
@@ -135,7 +135,7 @@
this.toolStripButton6});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1924, 31);
this.toolStrip1.Size = new System.Drawing.Size(1443, 27);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
@@ -144,7 +144,7 @@
this.toolStripButton1.Image = global::NewMyFormDesigner.Properties.Resources.Remove_16x16;
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(63, 28);
this.toolStripButton1.Size = new System.Drawing.Size(56, 24);
this.toolStripButton1.Text = "删除";
this.toolStripButton1.Click += new System.EventHandler(this.barDelete_ItemClick);
//
@@ -153,7 +153,7 @@
this.toolStripButton2.Image = global::NewMyFormDesigner.Properties.Resources.RemoveFolder_16x16;
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(93, 28);
this.toolStripButton2.Size = new System.Drawing.Size(80, 24);
this.toolStripButton2.Text = "全部删除";
this.toolStripButton2.Click += new System.EventHandler(this.barDeleteAll_ItemClick);
//
@@ -162,7 +162,7 @@
this.toolStripButton3.Image = global::NewMyFormDesigner.Properties.Resources.AddFile_16x16;
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(108, 28);
this.toolStripButton3.Size = new System.Drawing.Size(92, 24);
this.toolStripButton3.Text = "初始化表单";
this.toolStripButton3.Click += new System.EventHandler(this.barButtonItem9_ItemClick);
//
@@ -171,7 +171,7 @@
this.toolStripButton4.Image = global::NewMyFormDesigner.Properties.Resources.Mark_16x16;
this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton4.Name = "toolStripButton4";
this.toolStripButton4.Size = new System.Drawing.Size(63, 28);
this.toolStripButton4.Size = new System.Drawing.Size(56, 24);
this.toolStripButton4.Text = "保存";
this.toolStripButton4.Click += new System.EventHandler(this.barSave_ItemClick);
//
@@ -180,7 +180,7 @@
this.toolStripButton5.Image = global::NewMyFormDesigner.Properties.Resources.Close_16x16;
this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton5.Name = "toolStripButton5";
this.toolStripButton5.Size = new System.Drawing.Size(63, 28);
this.toolStripButton5.Size = new System.Drawing.Size(56, 24);
this.toolStripButton5.Text = "退出";
this.toolStripButton5.Click += new System.EventHandler(this.barClose_ItemClick);
//
@@ -189,15 +189,14 @@
this.toolStripButton6.Image = global::NewMyFormDesigner.Properties.Resources.Other_16x16;
this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton6.Name = "toolStripButton6";
this.toolStripButton6.Size = new System.Drawing.Size(63, 28);
this.toolStripButton6.Size = new System.Drawing.Size(56, 24);
this.toolStripButton6.Text = "运行";
this.toolStripButton6.Click += new System.EventHandler(this.barRun_ItemClick);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 31);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(4);
this.splitContainer1.Location = new System.Drawing.Point(0, 27);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
@@ -208,9 +207,8 @@
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.tabControl1);
this.splitContainer1.Size = new System.Drawing.Size(1924, 739);
this.splitContainer1.SplitterDistance = 1514;
this.splitContainer1.SplitterWidth = 5;
this.splitContainer1.Size = new System.Drawing.Size(1443, 589);
this.splitContainer1.SplitterDistance = 1135;
this.splitContainer1.TabIndex = 1;
//
// plRight
@@ -219,9 +217,8 @@
this.plRight.Controls.Add(this.dcMain);
this.plRight.Dock = System.Windows.Forms.DockStyle.Fill;
this.plRight.Location = new System.Drawing.Point(0, 0);
this.plRight.Margin = new System.Windows.Forms.Padding(4);
this.plRight.Name = "plRight";
this.plRight.Size = new System.Drawing.Size(1514, 519);
this.plRight.Size = new System.Drawing.Size(1135, 413);
this.plRight.TabIndex = 4;
//
// dcMain
@@ -229,19 +226,18 @@
this.dcMain.BackColor = System.Drawing.Color.White;
this.dcMain.Dock = System.Windows.Forms.DockStyle.Top;
this.dcMain.Location = new System.Drawing.Point(0, 0);
this.dcMain.Margin = new System.Windows.Forms.Padding(5);
this.dcMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.dcMain.Name = "dcMain";
this.dcMain.Size = new System.Drawing.Size(1493, 612);
this.dcMain.Size = new System.Drawing.Size(1118, 490);
this.dcMain.TabIndex = 2;
//
// pl_Bottom
//
this.pl_Bottom.Controls.Add(this.pl_PropertyGrid);
this.pl_Bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pl_Bottom.Location = new System.Drawing.Point(0, 519);
this.pl_Bottom.Margin = new System.Windows.Forms.Padding(4);
this.pl_Bottom.Location = new System.Drawing.Point(0, 413);
this.pl_Bottom.Name = "pl_Bottom";
this.pl_Bottom.Size = new System.Drawing.Size(1514, 220);
this.pl_Bottom.Size = new System.Drawing.Size(1135, 176);
this.pl_Bottom.TabIndex = 0;
//
// pl_PropertyGrid
@@ -249,9 +245,8 @@
this.pl_PropertyGrid.Controls.Add(this.propertyGrid1);
this.pl_PropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.pl_PropertyGrid.Location = new System.Drawing.Point(0, 0);
this.pl_PropertyGrid.Margin = new System.Windows.Forms.Padding(4);
this.pl_PropertyGrid.Name = "pl_PropertyGrid";
this.pl_PropertyGrid.Size = new System.Drawing.Size(1514, 220);
this.pl_PropertyGrid.Size = new System.Drawing.Size(1135, 176);
this.pl_PropertyGrid.TabIndex = 2;
//
// propertyGrid1
@@ -259,10 +254,9 @@
this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.propertyGrid1.HelpVisible = false;
this.propertyGrid1.Location = new System.Drawing.Point(0, 0);
this.propertyGrid1.Margin = new System.Windows.Forms.Padding(4);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical;
this.propertyGrid1.Size = new System.Drawing.Size(1514, 220);
this.propertyGrid1.Size = new System.Drawing.Size(1135, 176);
this.propertyGrid1.TabIndex = 3;
//
// tabControl1
@@ -271,10 +265,9 @@
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Margin = new System.Windows.Forms.Padding(4);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(405, 739);
this.tabControl1.Size = new System.Drawing.Size(304, 589);
this.tabControl1.TabIndex = 5;
//
// tabPage1
@@ -282,11 +275,10 @@
this.tabPage1.Controls.Add(this.gcFiled);
this.tabPage1.Controls.Add(this.panel4);
this.tabPage1.Controls.Add(this.panel2);
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Margin = new System.Windows.Forms.Padding(4);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(4);
this.tabPage1.Size = new System.Drawing.Size(397, 710);
this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.tabPage1.Size = new System.Drawing.Size(296, 563);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "方案布局";
this.tabPage1.UseVisualStyleBackColor = true;
@@ -310,15 +302,14 @@
this.Column7});
this.gcFiled.ContextMenuStrip = this.contextMenuStrip1;
this.gcFiled.Dock = System.Windows.Forms.DockStyle.Fill;
this.gcFiled.Location = new System.Drawing.Point(4, 4);
this.gcFiled.Margin = new System.Windows.Forms.Padding(4);
this.gcFiled.Location = new System.Drawing.Point(3, 3);
this.gcFiled.Name = "gcFiled";
this.gcFiled.ReadOnly = true;
this.gcFiled.RowHeadersVisible = false;
this.gcFiled.RowHeadersWidth = 51;
this.gcFiled.RowTemplate.Height = 18;
this.gcFiled.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.gcFiled.Size = new System.Drawing.Size(389, 446);
this.gcFiled.Size = new System.Drawing.Size(290, 352);
this.gcFiled.TabIndex = 6;
this.gcFiled.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.gvFiled_RowCellClick);
this.gcFiled.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.gcFiled_CellPainting);
@@ -448,73 +439,73 @@
this.ToolStripMenuItem,
this.SeparateColumn});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(169, 250);
this.contextMenuStrip1.Size = new System.Drawing.Size(149, 230);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(168, 24);
this.toolStripMenuItem1.Size = new System.Drawing.Size(148, 22);
this.toolStripMenuItem1.Text = "重新生成序号";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(168, 24);
this.toolStripMenuItem3.Size = new System.Drawing.Size(148, 22);
this.toolStripMenuItem3.Text = "生成Tab次序";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
// ToolStripMenuItem4
//
this.ToolStripMenuItem4.Name = "ToolStripMenuItem4";
this.ToolStripMenuItem4.Size = new System.Drawing.Size(168, 24);
this.ToolStripMenuItem4.Size = new System.Drawing.Size(148, 22);
this.ToolStripMenuItem4.Text = "整栏选中";
this.ToolStripMenuItem4.Click += new System.EventHandler(this.ToolStripMenuItem4_Click);
//
// ToolStripMenuItemJql
//
this.ToolStripMenuItemJql.Name = "ToolStripMenuItemJql";
this.ToolStripMenuItemJql.Size = new System.Drawing.Size(168, 24);
this.ToolStripMenuItemJql.Size = new System.Drawing.Size(148, 22);
this.ToolStripMenuItemJql.Text = "精确列选中";
this.ToolStripMenuItemJql.Click += new System.EventHandler(this.ToolStripMenuItemJql_Click);
//
// ToolStripMenuItemCyl
//
this.ToolStripMenuItemCyl.Name = "ToolStripMenuItemCyl";
this.ToolStripMenuItemCyl.Size = new System.Drawing.Size(168, 24);
this.ToolStripMenuItemCyl.Size = new System.Drawing.Size(148, 22);
this.ToolStripMenuItemCyl.Text = "差异列选中";
this.ToolStripMenuItemCyl.Click += new System.EventHandler(this.ToolStripMenuItemCyl_Click);
//
// ToolStripMenuItemJqh
//
this.ToolStripMenuItemJqh.Name = "ToolStripMenuItemJqh";
this.ToolStripMenuItemJqh.Size = new System.Drawing.Size(168, 24);
this.ToolStripMenuItemJqh.Size = new System.Drawing.Size(148, 22);
this.ToolStripMenuItemJqh.Text = "精确行选中";
this.ToolStripMenuItemJqh.Click += new System.EventHandler(this.ToolStripMenuItemJqh_Click);
//
// ToolStripMenuItemCyh
//
this.ToolStripMenuItemCyh.Name = "ToolStripMenuItemCyh";
this.ToolStripMenuItemCyh.Size = new System.Drawing.Size(168, 24);
this.ToolStripMenuItemCyh.Size = new System.Drawing.Size(148, 22);
this.ToolStripMenuItemCyh.Text = "差异行选中";
this.ToolStripMenuItemCyh.Click += new System.EventHandler(this.ToolStripMenuItemCyh_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(165, 6);
this.toolStripMenuItem2.Size = new System.Drawing.Size(145, 6);
//
// ToolStripMenuItemSzlm
//
this.ToolStripMenuItemSzlm.Name = "ToolStripMenuItemSzlm";
this.ToolStripMenuItemSzlm.Size = new System.Drawing.Size(168, 24);
this.ToolStripMenuItemSzlm.Size = new System.Drawing.Size(148, 22);
this.ToolStripMenuItemSzlm.Text = "生成布局";
this.ToolStripMenuItemSzlm.Click += new System.EventHandler(this.ToolStripMenuItemSzlm_Click);
//
// ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(168, 24);
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
this.ToolStripMenuItem.Text = "分组框多选";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
@@ -527,13 +518,13 @@
this.ToolStripMenuItem,
this.ToolStripMenuItem});
this.SeparateColumn.Name = "SeparateColumn";
this.SeparateColumn.Size = new System.Drawing.Size(168, 24);
this.SeparateColumn.Size = new System.Drawing.Size(148, 22);
this.SeparateColumn.Text = "分栏";
//
// 一栏ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "一栏ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
this.ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.ToolStripMenuItem.Tag = "1";
this.ToolStripMenuItem.Text = "一栏";
this.ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
@@ -541,7 +532,7 @@
// 二栏ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "二栏ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
this.ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.ToolStripMenuItem.Tag = "2";
this.ToolStripMenuItem.Text = "二栏";
this.ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
@@ -549,7 +540,7 @@
// 三栏ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "三栏ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
this.ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.ToolStripMenuItem.Tag = "3";
this.ToolStripMenuItem.Text = "三栏";
this.ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
@@ -557,7 +548,7 @@
// 四栏ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "四栏ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
this.ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.ToolStripMenuItem.Tag = "4";
this.ToolStripMenuItem.Text = "四栏";
this.ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
@@ -565,7 +556,7 @@
// 五栏ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "五栏ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
this.ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.ToolStripMenuItem.Tag = "5";
this.ToolStripMenuItem.Text = "五栏";
this.ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
@@ -580,19 +571,17 @@
this.panel4.Controls.Add(this.comboBox1);
this.panel4.Controls.Add(this.label1);
this.panel4.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel4.Location = new System.Drawing.Point(4, 450);
this.panel4.Margin = new System.Windows.Forms.Padding(4);
this.panel4.Location = new System.Drawing.Point(3, 355);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(389, 50);
this.panel4.Size = new System.Drawing.Size(290, 40);
this.panel4.TabIndex = 5;
//
// btn_design
//
this.btn_design.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_design.Location = new System.Drawing.Point(292, 9);
this.btn_design.Margin = new System.Windows.Forms.Padding(4);
this.btn_design.Location = new System.Drawing.Point(217, 7);
this.btn_design.Name = "btn_design";
this.btn_design.Size = new System.Drawing.Size(91, 31);
this.btn_design.Size = new System.Drawing.Size(68, 25);
this.btn_design.TabIndex = 0;
this.btn_design.Text = "调整";
this.btn_design.UseVisualStyleBackColor = true;
@@ -600,8 +589,7 @@
//
// numericUpDown1
//
this.numericUpDown1.Location = new System.Drawing.Point(411, 12);
this.numericUpDown1.Margin = new System.Windows.Forms.Padding(4);
this.numericUpDown1.Location = new System.Drawing.Point(308, 10);
this.numericUpDown1.Maximum = new decimal(new int[] {
8000,
0,
@@ -613,16 +601,15 @@
0,
-2147483648});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(56, 25);
this.numericUpDown1.Size = new System.Drawing.Size(42, 21);
this.numericUpDown1.TabIndex = 8;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(353, 18);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Location = new System.Drawing.Point(265, 14);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(52, 15);
this.label3.Size = new System.Drawing.Size(41, 12);
this.label3.TabIndex = 6;
this.label3.Text = "调整值";
//
@@ -637,19 +624,17 @@
"宽",
"高",
"栏目"});
this.comboBox2.Location = new System.Drawing.Point(284, 12);
this.comboBox2.Margin = new System.Windows.Forms.Padding(4);
this.comboBox2.Location = new System.Drawing.Point(213, 10);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(60, 23);
this.comboBox2.Size = new System.Drawing.Size(46, 20);
this.comboBox2.TabIndex = 5;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(211, 18);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Location = new System.Drawing.Point(158, 14);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(67, 15);
this.label2.Size = new System.Drawing.Size(53, 12);
this.label2.TabIndex = 4;
this.label2.Text = "调整属性";
//
@@ -661,19 +646,17 @@
this.comboBox1.Items.AddRange(new object[] {
"同值",
"增减"});
this.comboBox1.Location = new System.Drawing.Point(131, 12);
this.comboBox1.Margin = new System.Windows.Forms.Padding(4);
this.comboBox1.Location = new System.Drawing.Point(98, 10);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(64, 23);
this.comboBox1.Size = new System.Drawing.Size(49, 20);
this.comboBox1.TabIndex = 3;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(7, 16);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Location = new System.Drawing.Point(5, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(113, 15);
this.label1.Size = new System.Drawing.Size(89, 12);
this.label1.TabIndex = 2;
this.label1.Text = "批量调整 类型";
//
@@ -682,10 +665,9 @@
this.panel2.Controls.Add(this.gridControl1);
this.panel2.Controls.Add(this.panel3);
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel2.Location = new System.Drawing.Point(4, 500);
this.panel2.Margin = new System.Windows.Forms.Padding(4);
this.panel2.Location = new System.Drawing.Point(3, 395);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(389, 206);
this.panel2.Size = new System.Drawing.Size(290, 165);
this.panel2.TabIndex = 4;
//
// gridControl1
@@ -702,12 +684,11 @@
this.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControl1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.gridControl1.Location = new System.Drawing.Point(0, 0);
this.gridControl1.Margin = new System.Windows.Forms.Padding(4);
this.gridControl1.Name = "gridControl1";
this.gridControl1.RowHeadersVisible = false;
this.gridControl1.RowHeadersWidth = 51;
this.gridControl1.RowTemplate.Height = 18;
this.gridControl1.Size = new System.Drawing.Size(389, 157);
this.gridControl1.Size = new System.Drawing.Size(290, 126);
this.gridControl1.TabIndex = 7;
//
// 栏目ID
@@ -764,18 +745,16 @@
this.panel3.Controls.Add(this.simpleButton2);
this.panel3.Controls.Add(this.simpleButton1);
this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel3.Location = new System.Drawing.Point(0, 157);
this.panel3.Margin = new System.Windows.Forms.Padding(4);
this.panel3.Location = new System.Drawing.Point(0, 126);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(389, 49);
this.panel3.Size = new System.Drawing.Size(290, 39);
this.panel3.TabIndex = 1;
//
// simpleButton3
//
this.simpleButton3.Location = new System.Drawing.Point(201, 10);
this.simpleButton3.Margin = new System.Windows.Forms.Padding(4);
this.simpleButton3.Location = new System.Drawing.Point(151, 8);
this.simpleButton3.Name = "simpleButton3";
this.simpleButton3.Size = new System.Drawing.Size(91, 31);
this.simpleButton3.Size = new System.Drawing.Size(68, 25);
this.simpleButton3.TabIndex = 0;
this.simpleButton3.Text = "执行方案";
this.simpleButton3.UseVisualStyleBackColor = true;
@@ -783,10 +762,9 @@
//
// simpleButton2
//
this.simpleButton2.Location = new System.Drawing.Point(103, 10);
this.simpleButton2.Margin = new System.Windows.Forms.Padding(4);
this.simpleButton2.Location = new System.Drawing.Point(77, 8);
this.simpleButton2.Name = "simpleButton2";
this.simpleButton2.Size = new System.Drawing.Size(91, 31);
this.simpleButton2.Size = new System.Drawing.Size(68, 25);
this.simpleButton2.TabIndex = 0;
this.simpleButton2.Text = "删除";
this.simpleButton2.UseVisualStyleBackColor = true;
@@ -794,10 +772,9 @@
//
// simpleButton1
//
this.simpleButton1.Location = new System.Drawing.Point(4, 10);
this.simpleButton1.Margin = new System.Windows.Forms.Padding(4);
this.simpleButton1.Location = new System.Drawing.Point(3, 8);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(91, 31);
this.simpleButton1.Size = new System.Drawing.Size(68, 25);
this.simpleButton1.TabIndex = 0;
this.simpleButton1.Text = "增加";
this.simpleButton1.UseVisualStyleBackColor = true;
@@ -806,10 +783,11 @@
// tabPage2
//
this.tabPage2.Controls.Add(this.gcGroup);
this.tabPage2.Location = new System.Drawing.Point(4, 25);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(397, 710);
this.tabPage2.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabPage2.Size = new System.Drawing.Size(296, 563);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "标签设置";
this.tabPage2.UseVisualStyleBackColor = true;
@@ -823,12 +801,11 @@
this.Column20,
this.Column21});
this.gcGroup.Dock = System.Windows.Forms.DockStyle.Fill;
this.gcGroup.Location = new System.Drawing.Point(3, 3);
this.gcGroup.Margin = new System.Windows.Forms.Padding(4);
this.gcGroup.Location = new System.Drawing.Point(2, 2);
this.gcGroup.Name = "gcGroup";
this.gcGroup.RowHeadersWidth = 51;
this.gcGroup.RowTemplate.Height = 27;
this.gcGroup.Size = new System.Drawing.Size(391, 704);
this.gcGroup.Size = new System.Drawing.Size(292, 559);
this.gcGroup.TabIndex = 0;
//
// Column18
@@ -865,13 +842,12 @@
//
// MyFormDesigner
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1924, 770);
this.ClientSize = new System.Drawing.Size(1443, 616);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.toolStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "MyFormDesigner";
this.Text = "Form1";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
@@ -34,6 +34,8 @@ namespace NewMyFormDesigner
/// 密码
/// </summary>
public string Password { get; set; }
//模块类别,1=单表,2=单据
public int Modtype { get; set; }
public DesignerControl dc { get; set; }
@@ -62,26 +64,53 @@ namespace NewMyFormDesigner
this.gridControl1.AutoGenerateColumns = false;
string LinkString = string.Empty;
ConnectionType connectionType = ConnectionType.SqlServer;
if (!string.IsNullOrWhiteSpace(ServerName) && !string.IsNullOrWhiteSpace(DatabaseName) && !string.IsNullOrWhiteSpace(AccountNumber) && !string.IsNullOrWhiteSpace(Password))
{
LinkString = string.Format("Server ={0}; Database ={1}; Persist Security Info = True; User ID ={2}; Password ={3}; Connection Timeout = 5; MultipleActiveResultSets = true",ServerName, DatabaseName, AccountNumber, Password);
LinkString = string.Format("Server ={0}; Database ={1}; Persist Security Info = True; User ID ={2}; Password ={3}; Connection Timeout = 5; MultipleActiveResultSets = true", ServerName, DatabaseName, AccountNumber, Password);
}
if (DBConfig.Instance.CreateConnection(LinkString))
//DialogResult dr = MessageBox.Show("是否为达梦数据库?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
//if (dr == System.Windows.Forms.DialogResult.Yes)
//{
// if (!string.IsNullOrWhiteSpace(ServerName) && !string.IsNullOrWhiteSpace(DatabaseName) && !string.IsNullOrWhiteSpace(AccountNumber))
// {
// string connect = "Nzg5REZBQ0IzMjYzQkQzRTZFRTExNjY5MThCNjUwQTVFRUQyMDMxQzI5REIwODY5REIwMkVCQzQ4MTMzRDhDNEU1N0JFREI0MDM3MTQ1MDZGQzdGOEQxQTE4MkQ2QzgyNEE4RkMzRDQzQUM4MzgyOEQ2REZERTIzQzBDMjJGQUE=";
// string hostname = Environment.MachineName;
// if (!string.IsNullOrWhiteSpace(Password))
// {
// LinkString = string.Format("Server={0}; schema={1}; UserId={2}; PWD={3};host={4}", ServerName, DatabaseName, AccountNumber, Password, hostname);
// }
// else
// {
// LinkString = string.Format(Lskj.Util.AESUtil.Decrypt(connect), ServerName, DatabaseName, AccountNumber, hostname);
// }
// connectionType = ConnectionType.DmServer;
// }
//}
//MessageBox.Show(LinkString);
if (DBConfig.Instance.CreateConnection(LinkString, connectionType))
{
//MessageBox.Show("1");
InitData();
DataTable dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemDlltab where formkey='{0}'", FrmKey));
if (dt.Rows.Count > 0)
{
this.DllCoid = dt.Rows[0]["DllCoid"] + "";
this.Modtype = 1;
}
else
{
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systembilltype where formkey='{0}'", FrmKey));
if(dt.Rows.Count>0) this.DllCoid = dt.Rows[0]["typeCode"] + "";
this.Modtype = 2;
}
}
//MessageBox.Show("2");
}
@@ -194,10 +223,11 @@ namespace NewMyFormDesigner
dc.Height = pModel.parentHeight;
dc.Width = pModel.parentWidth;
dc.AutoScroll = true;
plRight.Controls.Add(dc);
dc.Dock = DockStyle.Fill;
plRight.AutoScroll = true;
plRight.Controls.Add(dc);
plRight.AutoScroll = true;
dc.BringToFront();
}
@@ -224,7 +254,7 @@ namespace NewMyFormDesigner
ctr.Location = (new Point(posX, posY));//屏幕坐标转换成控件容器坐标
ctr.Width = width;
ctr.Height = height;
ctr.TabIndex = tabOrder;
ctr.TabIndex = tabOrder>=0? tabOrder:0;
ctr.Tag = new object[] { fieldid, username, fieldtypeid, fieldname, defaultValue, column_id, orderid, id };
ctr.Parent = dc._hostFrame;
@@ -286,6 +316,8 @@ namespace NewMyFormDesigner
}
}
private void gvFiled_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
@@ -344,6 +376,7 @@ namespace NewMyFormDesigner
RunForm runForm = new RunForm();
runForm.FrmKey = FrmKey;
runForm.DllCoid = DllCoid;
runForm.Modtype = Modtype;
//runForm.db = db;
runForm.SQL = SelectSQL;
runForm.ShowDialog();
@@ -363,11 +396,11 @@ namespace NewMyFormDesigner
DataTable formTheKey = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemControlParent where formkey='{0}'", FrmKey));
if (formTheKey != null && formTheKey.Rows.Count > 0) //数据库中是否有这个模块
{
sql = " UPDATE p_systemControlParent set parentheight='" + dc._hostFrame.Height.ToString() + "',parentwidth='" + dc._hostFrame.Width.ToString() + "'where formkey='" + FrmKey + "'";
sql = " UPDATE p_systemControlParent set parentheight='" + dc._hostFrame.Height.ToString() + "',parentwidth='" + dc._hostFrame.Width.ToString() + "'where formkey='" + FrmKey + "';";
}
else
{
sql = " insert into p_systemControlParent (formkey,parentheight,parentwidth) values ('" + FrmKey + "'," + dc._hostFrame.Height.ToString() + "," + dc._hostFrame.Width.ToString() + ")";
sql = " insert into p_systemControlParent (formkey,parentheight,parentwidth) values ('" + FrmKey + "'," + dc._hostFrame.Height.ToString() + "," + dc._hostFrame.Width.ToString() + ");";
}
sqlbuild.Append(sql);
@@ -379,7 +412,7 @@ namespace NewMyFormDesigner
dtColumn.AcceptChanges();
if ((dtColumn != null) && (dtColumn.Rows.Count > 0))
{
sql = " delete p_systemcontrolColumn where formkey='" + FrmKey + "'";
sql = " delete p_systemcontrolColumn where formkey='" + FrmKey + "';";
sqlbuild.Append(sql);
foreach (DataRow row in dtColumn.Rows)
{
@@ -390,7 +423,7 @@ namespace NewMyFormDesigner
,'{3}'
,'{4}'
,'{5}'
,'{6}')", FrmKey, row["column_id"], row["controlLeft"], row["controlTop"], row["controlWidth"], row["controlHeight"], row["rowspace"]);
,'{6}');", FrmKey, row["column_id"], row["controlLeft"], row["controlTop"], row["controlWidth"], row["controlHeight"], row["rowspace"]);
sqlbuild.Append(sql);
}
}
@@ -445,7 +478,7 @@ namespace NewMyFormDesigner
cid = col[7].ToString();//当前控件的id
if (IsNumberic(cid))
{
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}'", cid));
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}';", cid));
}
}
@@ -458,7 +491,7 @@ namespace NewMyFormDesigner
,[controlHeight]='{3}'
,[controlWidth]='{4}'
,[formKey]='{5}'
,[controlType]='{6}',[borderColor]='{8}',[titlePosition]='{9}' where id='{7}'
,[controlType]='{6}',[borderColor]='{8}',[titlePosition]='{9}' where id='{7}';
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, cid, colorHtml, TitlePosition) :
String.Format(@"UPDATE p_systemAddGroup set
[GroupName]='{0}'
@@ -467,7 +500,7 @@ namespace NewMyFormDesigner
,[controlHeight]='{3}'
,[controlWidth]='{4}'
,[formKey]='{5}'
,[controlType]='{6}' where id='{7}'
,[controlType]='{6}' where id='{7}';
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, cid);
}
else
@@ -487,7 +520,7 @@ namespace NewMyFormDesigner
,'{3}'
,'{4}'
,'{5}'
,'{6}','{7}','{8}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, colorHtml, TitlePosition) :
,'{6}','{7}','{8}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, colorHtml, TitlePosition) :
String.Format(@"INSERT INTO [p_systemAddGroup]
([GroupName]
,[controlLeft]
@@ -503,7 +536,7 @@ namespace NewMyFormDesigner
,'{3}'
,'{4}'
,'{5}'
,'{6}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333);
,'{6}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333);
}
sqlbuild.Append(sql);
}
@@ -518,7 +551,7 @@ namespace NewMyFormDesigner
cid = col[7].ToString();//当前控件的id
if (IsNumberic(cid))
{
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}'", cid));
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}';", cid));
}
}
if (dt != null && dt.Rows.Count > 0)
@@ -530,7 +563,7 @@ namespace NewMyFormDesigner
,[controlHeight]='{3}'
,[controlWidth]='{4}'
,[formKey]='{5}'
,[controlType]='{6}' where id='{7}'
,[controlType]='{6}' where id='{7}';
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 332, cid);
}
else
@@ -550,7 +583,7 @@ namespace NewMyFormDesigner
,'{3}'
,'{4}'
,'{5}'
,'{6}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 332);
,'{6}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 332);
}
sqlbuild.Append(sql);
}
@@ -565,7 +598,7 @@ namespace NewMyFormDesigner
cid = col[7].ToString();//当前控件的id
if (IsNumberic(cid))
{
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}'", cid));
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}';", cid));
}
}
if (dt != null && dt.Rows.Count > 0)
@@ -577,7 +610,7 @@ namespace NewMyFormDesigner
,[controlHeight]='{3}'
,[controlWidth]='{4}'
,[formKey]='{5}'
,[controlType]='{6}' where id='{7}'
,[controlType]='{6}' where id='{7}';
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 334, cid);
}
else
@@ -597,14 +630,14 @@ namespace NewMyFormDesigner
,'{3}'
,'{4}'
,'{5}'
,'{6}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 334);
,'{6}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 334);
}
sqlbuild.Append(sql);
}
}
}
sqlbuild.Append(string.Format(" delete p_systemControlLocation where formkey='{0}'", FrmKey));
sqlbuild.Append(string.Format(" delete p_systemControlLocation where formkey='{0}';", FrmKey));
foreach (DataRow row in dtFiled.Rows)
{
//MessageBox.Show(row["fieldName"].ToString());
@@ -623,7 +656,7 @@ namespace NewMyFormDesigner
if (tags.Length >= 9)
{
ControlProperty controlProperty = tags[tags.Length - 1] as ControlProperty;
String group_sql = string.Format("select * from p_systemAddGroup where formkey='{0}' and groupName='{1}'", FrmKey, controlProperty.GroupName);
String group_sql = string.Format("select * from p_systemAddGroup where formkey='{0}' and groupName='{1}';", FrmKey, controlProperty.GroupName);
DataTable dtsql = SqlHelper.ExecuteDataSet(group_sql).Tables[0];
if (dtsql != null && dtsql.Rows.Count > 0)
{
@@ -678,7 +711,7 @@ namespace NewMyFormDesigner
model.GroupId.ToString() + "," +
ctr.TabIndex.ToString() + "," +
tags[5].ToString() + "," +
tags[6].ToString() + ")";
tags[6].ToString() + ");";
sqlbuild.Append(sql);
//ldao.Add(model);
}
@@ -689,14 +722,16 @@ namespace NewMyFormDesigner
MessageBox.Show(row["username"].ToString());
}
sqlbuild.Append(updateSQL);
//sqlbuild.Append(updateSQL);
}
sqlbuild.Append(updateSQL);
SqlHelper.ExecuteNonQuery(sqlbuild.ToString());
MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
System.Windows.Forms.Clipboard.SetText(ex.Message);
}
finally
{
@@ -760,11 +795,11 @@ namespace NewMyFormDesigner
StringBuilder sqlbuild = new StringBuilder();
if (dc._overlayer._currentCtrl is LabelGroupBox || dc._overlayer._currentCtrl is Panel || dc._overlayer._currentCtrl is LabelDivider)
{
sql = "delete from p_systemAddGroup where id='" + id + "'";
sql = "delete from p_systemAddGroup where id='" + id + "';";
}
else
{
sql = "delete from p_systemcontrollocation where id='" + id + "'";
sql = "delete from p_systemcontrollocation where id='" + id + "';";
}
sqlbuild.Append(sql);
sqlbuild.Append(updateSQL);
@@ -1335,6 +1370,8 @@ namespace NewMyFormDesigner
DialogResult dlrg = MessageBox.Show("是否对全部控件的Tab进行批量调整?", "询问", MessageBoxButtons.YesNo);
if (dlrg != DialogResult.Yes)
return;
//int value = 1;
foreach (DataRow dr in dt.Rows)
{
if (dr == null)
@@ -1350,7 +1387,6 @@ namespace NewMyFormDesigner
continue;
}
ctr[0].TabIndex = value;
//点击保存时去修改
//try
//{
@@ -1360,7 +1396,7 @@ namespace NewMyFormDesigner
//catch (Exception ex)
//{
//}
}
}
@@ -35,9 +35,16 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Reference Include="DM.DmProvider, Version=8.3.1.34394, Culture=neutral, PublicKeyToken=7a2d44aa446c6d01, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\引用DLL\DM.DmProvider.dll</HintPath>
</Reference>
<Reference Include="Kdbndp, Version=8.6.1.1, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\Kdbndp.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.6.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -173,6 +180,7 @@
<None Include="app.config" />
<None Include="obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache" />
<None Include="obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
+8 -9
View File
@@ -8,7 +8,7 @@ namespace NewMyFormDesigner
{
static class Program
{
/// <summary>{FB58ED9E-DD23-4CD9-98AB-4059609ADB87}
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
@@ -20,21 +20,22 @@ namespace NewMyFormDesigner
try
{
MyFormDesigner myFormDesigner = new MyFormDesigner();
//myFormDesigner.FrmKey = "{80d30957-bca9-4ad4-8cf6-2e947e92b89b}";
//myFormDesigner.FrmKey = "{83184D92-F406-487E-9110-2CB991BFA817}";//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='{80d30957-bca9-4ad4-8cf6-2e947e92b89b}' and fieldsqltag<>3 and username1 is not null and isnull(addVisible,0)=0";
// left join p_systemwordbooktab b on a.DllCoid=b.tab where a.formkey='{83184D92-F406-487E-9110-2CB991BFA817}' 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='{80d30957-bca9-4ad4-8cf6-2e947e92b89b}'";
//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='{83184D92-F406-487E-9110-2CB991BFA817}'";
//myFormDesigner.ServerName = "222.209.207.65,37892";
//myFormDesigner.DatabaseName = "lserp_xdsy";
//myFormDesigner.ServerName = "110.185.161.104:5236";
//myFormDesigner.DatabaseName = "LSERP_JTCS";
//myFormDesigner.AccountNumber = "lserpAdmin";
//myFormDesigner.Password = "";//XDerp20210411%
//myFormDesigner.Password = "DWlserp1101";//XDerp20210411%
//MessageBox.Show(args.Length + "");
//MessageBox.Show(args[0]);
@@ -74,7 +75,6 @@ namespace NewMyFormDesigner
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 + "'";
}
@@ -85,7 +85,6 @@ namespace NewMyFormDesigner
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 + "'";
}
+6 -2
View File
@@ -16,6 +16,8 @@ namespace NewMyFormDesigner
public string FrmKey { get; set; }
public string SQL { get; set; }
public string DllCoid { get; set; }
public int Modtype { get; set; }
public RunForm()
@@ -72,13 +74,15 @@ namespace NewMyFormDesigner
SqlParameter[] param =
{
new SqlParameter("@modid",SqlDbType.VarChar,100),
new SqlParameter("@modtype",SqlDbType.Int),
new SqlParameter("@operType",SqlDbType.Int),
pMsg,
returnValue
};
param[0].Value = modid;
param[1].Value = operType;
param[2].Value = "";
param[1].Value = Modtype;
param[2].Value = operType;
param[3].Value = "";
SqlHelper.ExecuteNonQuery(CommandType.StoredProcedure, "[P_System_AUTOCreateMod]", param);
msg = pMsg.Value + "";
return Convert.ToInt32(returnValue.Value.ToString());
+14 -1
View File
@@ -1,3 +1,16 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<system.data>
<DbProviderFactories>
<add name="KingbaseES"
invariant="Kdbndp"
description="KingbaseES Database Provider"
type="Kdbndp.KdbndpFactory, Kdbndp, Version=8.6.1.1, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
<add name="DM Data Provider"
invariant="Dm"
description="DM .Net Framework Data Provider"
type="Dm.DmClientFactory, DM.DmProvider, Version=8.3.1.34394, Culture=neutral, PublicKeyToken=7a2d44aa446c6d01"/>
</DbProviderFactories>
</system.data>
</configuration>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="6.0.1" targetFramework="net40" />
</packages>