提交当前本机整理版本

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
+118
View File
@@ -0,0 +1,118 @@
namespace Lskj.ProductDynamic.Controls
{
partial class ImageButton
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.linePanel = new DevExpress.XtraEditors.PanelControl();
this.line = new DevExpress.XtraEditors.LabelControl();
this.imageLabel = new DevExpress.XtraEditors.LabelControl();
this.simplebButton = new DevExpress.XtraEditors.LabelControl();
((System.ComponentModel.ISupportInitialize)(this.linePanel)).BeginInit();
this.linePanel.SuspendLayout();
this.SuspendLayout();
//
// linePanel
//
this.linePanel.Appearance.BackColor = System.Drawing.Color.Transparent;
this.linePanel.Appearance.BackColor2 = System.Drawing.Color.Transparent;
this.linePanel.Appearance.BorderColor = System.Drawing.Color.Transparent;
this.linePanel.Appearance.Options.UseBackColor = true;
this.linePanel.Appearance.Options.UseBorderColor = true;
this.linePanel.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.linePanel.Controls.Add(this.line);
this.linePanel.Dock = System.Windows.Forms.DockStyle.Left;
this.linePanel.Location = new System.Drawing.Point(52, 0);
this.linePanel.Name = "linePanel";
this.linePanel.Padding = new System.Windows.Forms.Padding(0, 8, 0, 8);
this.linePanel.Size = new System.Drawing.Size(2, 50);
this.linePanel.TabIndex = 5;
//
// line
//
this.line.Appearance.BackColor = System.Drawing.Color.Transparent;
this.line.Appearance.BorderColor = System.Drawing.Color.White;
this.line.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.line.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
this.line.Dock = System.Windows.Forms.DockStyle.Left;
this.line.Location = new System.Drawing.Point(0, 8);
this.line.Name = "line";
this.line.Size = new System.Drawing.Size(2, 34);
this.line.TabIndex = 3;
//
// imageLabel
//
this.imageLabel.Appearance.BackColor = System.Drawing.Color.Transparent;
this.imageLabel.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.imageLabel.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.imageLabel.Dock = System.Windows.Forms.DockStyle.Left;
this.imageLabel.Location = new System.Drawing.Point(0, 0);
this.imageLabel.Name = "imageLabel";
this.imageLabel.Size = new System.Drawing.Size(52, 50);
this.imageLabel.TabIndex = 1;
//
// simplebButton
//
this.simplebButton.Appearance.BackColor = System.Drawing.Color.Transparent;
this.simplebButton.Appearance.Font = new System.Drawing.Font("微软雅黑", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.simplebButton.Appearance.ForeColor = System.Drawing.Color.White;
this.simplebButton.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.simplebButton.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
this.simplebButton.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.simplebButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.simplebButton.Location = new System.Drawing.Point(54, 0);
this.simplebButton.Name = "simplebButton";
this.simplebButton.Size = new System.Drawing.Size(196, 50);
this.simplebButton.TabIndex = 6;
this.simplebButton.Text = "按钮";
//
// ImageButton
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(123)))), ((int)(((byte)(250)))));
this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Controls.Add(this.simplebButton);
this.Controls.Add(this.linePanel);
this.Controls.Add(this.imageLabel);
this.Name = "ImageButton";
this.Size = new System.Drawing.Size(250, 50);
((System.ComponentModel.ISupportInitialize)(this.linePanel)).EndInit();
this.linePanel.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.PanelControl linePanel;
private DevExpress.XtraEditors.LabelControl line;
private DevExpress.XtraEditors.LabelControl imageLabel;
private DevExpress.XtraEditors.LabelControl simplebButton;
}
}
+94
View File
@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Lskj.ProductDynamic.Controls
{
public partial class ImageButton : UserControl
{
/// <summary>
/// this label控件
/// </summary>
private DevExpress.XtraEditors.LabelControl _imageLabel;
public DevExpress.XtraEditors.LabelControl ImageLabel
{
get
{
_imageLabel = this.imageLabel;
return _imageLabel;
}
set { _imageLabel = value; }
}
private DevExpress.XtraEditors.LabelControl _simpleButton;
/// <summary>
/// this simpleButton控件
/// </summary>
public DevExpress.XtraEditors.LabelControl SimpleButton
{
get
{
_simpleButton = this.simplebButton;
return _simpleButton;
}
set { _simpleButton = value; }
}
/// <summary>
/// 按钮模型
/// </summary>
public ProductDynamicBtnModel productDynamicBtnModel;
public ImageButton(DataRow row)
{
InitializeComponent();
productDynamicBtnModel = new ProductDynamicBtnModel(row);
this.Load += new EventHandler(OnImageButton_Load);
this.SimpleButton.MouseMove += new MouseEventHandler(OnSimpleButton_MouseMove);
this.simplebButton.MouseLeave += new EventHandler(OnSimplebButton_MouseLeave);
}
/// <summary>
/// 窗体加载时
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnImageButton_Load(object sender, EventArgs e)
{
this.imageLabel.Width = this.Height;
this.simplebButton.BackColor = this.BackColor;
if (productDynamicBtnModel != null)
{
this.simplebButton.Text = productDynamicBtnModel.ProductName;
try
{
//this.imageLabel.Appearance.Image = productDynamicBtnModel.ProductPic;
}
catch (Exception)
{
}
}
}
/// <summary>
/// 鼠标离开事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnSimplebButton_MouseLeave(object sender, EventArgs e)
{
DevExpress.XtraEditors.LabelControl labelBtn = (DevExpress.XtraEditors.LabelControl)sender;
labelBtn.BackColor = Color.Transparent;
}
/// <summary>
/// 鼠标滑过事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnSimpleButton_MouseMove(object sender, MouseEventArgs e)
{
DevExpress.XtraEditors.LabelControl labelBtn = (DevExpress.XtraEditors.LabelControl)sender;
labelBtn.BackColor = ColorTranslator.FromHtml("#eac205");
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
namespace Lskj.ProductDynamic.Controls
{
/// <summary>
/// 动态按钮模型
/// </summary>
public class ProductDynamicBtnModel
{
private string productName;
private string productPic;
private string productTip;
private string detailId;
private string dynamicSql;
private int productState;
private string errorMessage;
#region
public string ProductName { get { return productName; } set { productName = value; } }
public string ProductPic { get { return productPic; } set { productPic = value; } }
public string ProductTip { get { return productTip; } set { productTip = value; } }
public string DetailId { get { return detailId; } set { detailId = value; } }
public string DynamicSql { get { return dynamicSql; } set { dynamicSql = value; } }
public int ProductState { get { return productState; } set { productState = value; } }
public string ErrorMessage { get { return errorMessage; } set { errorMessage = value; } }
#endregion
public ProductDynamicBtnModel(DataRow row)
{
productName = row.Table.Columns.Contains("ProductName") ? row["ProductName"] + "" : "";
productPic = row.Table.Columns.Contains("ProductPic") ? row["ProductPic"] + "" : "";
productTip = row.Table.Columns.Contains("ProductTip") ? row["ProductTip"] + "" : "";
detailId = row.Table.Columns.Contains("DetailId") ? row["DetailId"] + "" : "";
dynamicSql = row.Table.Columns.Contains("DynamicSql") ? row["DynamicSql"] + "" : "";
productState = row.Table.Columns.Contains("ProductState") && !string.IsNullOrEmpty(row["ProductState"] + "") ? int.TryParse(row["ProductState"] + "", out productState) ? Convert.ToInt32(row["ProductState"] + "") : 0 : 0;
errorMessage = row.Table.Columns.Contains("ErrorMessage") ? row["ErrorMessage"] + "" : "";
}
}
}
Binary file not shown.
@@ -0,0 +1,3 @@
DevExpress.Patch.InMemoryPatch, DevExpress.Patch.Common, Version=6.1.0.0, Culture=neutral, PublicKeyToken=7fc7bfca2443de66
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ProgressBarControl, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+30 -1
View File
@@ -1810,4 +1810,33 @@ namespace Lskj.AutoCreatWord
// 创建新的 DataTable 用于存储分组结果
DataTable groupedTable = selectTable.Clone();
foreach (var group in groupedData)
{
// 将动态键拆分成各个部分,并添加到新行
object[] keyParts = Regex.Split(group.Key.Key, separator);
DataRow newRow = groupedTable.NewRow();
for (int i = 0; i < keyParts.Length; i++)
{
newRow[groupByColumns[i]] = keyParts[i];
}
groupedTable.Rows.Add(newRow);
}
dataTable = groupedTable;
}
}
catch (Exception)
{
}
}
/// <summary>
///word表格数据配置的集合
/// </summary>
protected class GridTarGet
{
public string number;
public Section targetSection;
public Table targetTable;
public int rowIndex;
}
}
}
+27 -1
View File
@@ -121,4 +121,30 @@ namespace Lskj.AutoWordFile
AutoCreatWord.CreateWordUtil.DbOperator = new Lskj.Data.ADO.Template.DbTemplate(string.Format("server={0};database={1};persist security info=true;user id=lserpAdmin;password=lserp110;max pool size = 512;", DBConfig.Instance.ServerName, DBConfig.Instance.DataBase), "system.data.sqlclient");
string[] masterSqls = Model.MasterSql.Trim('^').Split('^');
List<DataSet> dataSets = new List<DataSet>();
for
foreach (string masterSql in masterSqls)
{
if (string.IsNullOrEmpty(masterSql)) continue;
dataSets.Add(SqlHelper.ExecuteDataSet(masterSql));
}
AutoCreatWord.CreateWordUtil.Create(mainTempPath, menuTempPath, Model.MenuTempArray, dataSets, savePdfPath, SystemInfo.Instance.OAUrl, out string msg);
cts.Cancel();
if (this.InvokeRequired)
{
this.Invoke(new Action(() =>
{
progressBar1.Value = 100;
Process.Start(savePdfPath);
Close();
}));
}
});
crateTask.Start();
}
catch (Exception ex)
{
MessageUtil.Show(ex.Message);
Close();
}
}
}
}
+27 -1
View File
@@ -220,4 +220,30 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
thi
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel4.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Splitter splitter2;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.RichTextBox richTextBox;
}
}
+31 -1
View File
@@ -60,4 +60,34 @@ namespace Lskj.AutoUpdate
this.panel4.Visible = false;
this.Height = this.Height - this.panel4.Height;
}
}
/// <summary>
/// <para>说明:窗口加载</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void OnLoad(object sender, EventArgs e)
{
foreach (DownloadFileInfo file in this.downloadFileList)
{
ListViewItem item = new ListViewItem(new string[] { file.FileName, file.LastVersion, file.Size.ToString() });
}
this.Activate();
this.Focus();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
+318 -112
View File
@@ -1,11 +1,11 @@
/******************************
* 说明:下载进度窗口
* 创建人:龚宇超
* 创建日期:2018-02-09
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
/******************************
* 说明:下载进度窗口
* 创建人:龚宇超
* 创建日期:2018-02-09
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
******************************/
using System;
using System.Collections.Generic;
@@ -22,38 +22,45 @@ using System.Net;
namespace Lskj.AutoUpdate
{
/// <summary>
/// 下载进度窗口
/// 下载进度窗口
/// </summary>
public partial class FrmProgress : Form
{
/// <summary>
/// 是否下载完成
/// 是否下载完成
/// </summary>
private bool isFinished = false;
/// <summary>
/// 下载总数
/// 下载总数
/// </summary>
private long total = 0;
/// <summary>
/// 当前下载的总数
/// 当前下载的总数
/// </summary>
private long nDownloadedTotal = 0;
/// <summary>
/// 下载文件列表
/// 下载文件列表
/// </summary>
private List<DownloadFileInfo> downloadFileList = new List<DownloadFileInfo>();
/// <summary>
/// 所有文件列表
/// 所有文件列表
/// </summary>
private List<DownloadFileInfo> allFileList = null;
private ManualResetEvent evtDownload = null;
private ManualResetEvent evtPerDonwload = null;
private WebClient clientDownload = null;
private AutoUpdater autoUpdater = null;
private bool isUserCanceled = false;
private bool isClosingByCode = false;
private delegate void SetProcessBarCallBack(int current, int total);
private delegate void ExitCallBack(bool success);
private delegate void ShowCurrentDownloadFileNameCallBack(string name);
public bool IsUserCanceled
{
get { return isUserCanceled; }
}
public FrmProgress(List<DownloadFileInfo> downloadFileListTemp, AutoUpdater apd)
{
InitializeComponent();
@@ -65,7 +72,7 @@ namespace Lskj.AutoUpdate
//foreach (DownloadFileInfo item in downloadFileListTemp)
//{
// // 本地临时文件夹中不存在此文件则下载.
// // 本地临时文件夹中不存在此文件则下载.
// string tempUrlPath = CommonUnitity.GetFolderUrl(item);
// tempUrlPath = Path.Combine(CommonUnitity.SystemBinUrl + ConstModel.TEMP_FOLDER_NAME + tempUrlPath, item.FileName);
// if (!File.Exists(tempUrlPath))
@@ -73,17 +80,17 @@ namespace Lskj.AutoUpdate
// this.downloadFileList.Add(item);
// }
//}
this.lblAll.Text = string.Format("总进度(0/{0})", this.downloadFileList.Count);
this.lblAll.Text = string.Format("总进度(0/{0})", this.downloadFileList.Count);
}
/// <summary>
/// <para>说明:窗口加载</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:窗口加载</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
@@ -94,40 +101,45 @@ namespace Lskj.AutoUpdate
ThreadPool.QueueUserWorkItem(new WaitCallback(this.ProcDownload));
}
/// <summary>
/// <para>说明:</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="FormClosingEventArgs"/> instance containing the event data.</param>
private void OnFormClosing(object sender, FormClosingEventArgs e)
{
if (!isFinished && DialogResult.Yes == MessageBox.Show(ConstModel.UPDATE_GIVING_UP, ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
if (isClosingByCode)
{
e.Cancel = true;
ReleaseDownloadWait();
return;
}
else
{
if (clientDownload != null)
clientDownload.CancelAsync();
evtDownload.Set();
evtPerDonwload.Set();
if (!isFinished && !isUserCanceled)
{
if (DialogResult.Yes != MessageBox.Show(ConstModel.UPDATE_GIVING_UP, ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
{
e.Cancel = true;
return;
}
CancelUpdate(true);
}
ReleaseDownloadWait();
}
/// <summary>
/// <para>说明:下载文件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:下载文件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="o">The o.</param>
private void ProcDownload(object o)
@@ -148,12 +160,15 @@ namespace Lskj.AutoUpdate
while (!evtDownload.WaitOne(0, false))
{
if (isUserCanceled)
return;
try
{
if (this.downloadFileList.Count == 0)
break;
this.lblAll.Text = string.Format("总进度({0}/{1})", count - this.downloadFileList.Count, count);
this.lblAll.Text = string.Format("总进度({0}/{1})", count - this.downloadFileList.Count, count);
DownloadFileInfo file = this.downloadFileList[0];
@@ -174,7 +189,7 @@ namespace Lskj.AutoUpdate
{
try
{
//this.Text = "接收:" + e.BytesReceived.ToString() + " 字节数:" + progressBarCurrent.Maximum.ToString();
//this.Text = "接收:" + e.BytesReceived.ToString() + " 字节数:" + progressBarCurrent.Maximum.ToString();
progressBarCurrent.Value = (int)e.BytesReceived / progressBarCurrent.Maximum;
progressBarTotal.Value = (int)((nDownloadedTotal + e.BytesReceived) * 100 / total);
this.SetProcessBar(e.ProgressPercentage, (int)((nDownloadedTotal + e.BytesReceived) * 100 / total));
@@ -191,6 +206,15 @@ namespace Lskj.AutoUpdate
{
try
{
if (isUserCanceled || e.Cancelled)
{
evtPerDonwload.Set();
return;
}
if (e.Error != null)
throw e.Error;
DealWithDownloadErrors();
DownloadFileInfo dfile = e.UserState as DownloadFileInfo;
nDownloadedTotal += dfile.Size;
@@ -199,7 +223,13 @@ namespace Lskj.AutoUpdate
}
catch (Exception exp)
{
MessageBox.Show("下载错误202:" + exp.Message);
if (!isUserCanceled)
{
DownloadFileInfo dfile = e.UserState as DownloadFileInfo;
MessageBox.Show(BuildDownloadErrorMessage(dfile, exp), ConstModel.LS_TITLE_NAME, MessageBoxButtons.OK, MessageBoxIcon.Warning);
evtPerDonwload.Set();
ShowErrorAndRestartApplication();
}
//log the error message,you can use the application's log code
}
@@ -223,6 +253,9 @@ namespace Lskj.AutoUpdate
//Wait for the download complete
evtPerDonwload.WaitOne();
if (isUserCanceled)
return;
clientDownload.Dispose();
clientDownload = null;
@@ -231,11 +264,19 @@ namespace Lskj.AutoUpdate
}
catch (Exception e)
{
MessageBox.Show(this.downloadFileList[0].FileName + "\r\n" + e.Message);
ShowErrorAndRestartApplication();
if (!isUserCanceled)
{
DownloadFileInfo file = this.downloadFileList.Count > 0 ? this.downloadFileList[0] : null;
MessageBox.Show(BuildDownloadErrorMessage(file, e), ConstModel.LS_TITLE_NAME, MessageBoxButtons.OK, MessageBoxIcon.Warning);
ShowErrorAndRestartApplication();
}
//throw;
}
}
if (isUserCanceled)
return;
//When the files have not downloaded,return.
if (downloadFileList.Count > 0)
@@ -247,6 +288,7 @@ namespace Lskj.AutoUpdate
DealWithDownloadErrors();
//Debug.WriteLine("All Downloaded");
bool replaceSuccess = true;
foreach (DownloadFileInfo file in this.allFileList)
{
string tempUrlPath = CommonUnitity.GetFolderUrl(file);
@@ -269,7 +311,7 @@ namespace Lskj.AutoUpdate
System.IO.FileInfo f = new FileInfo(newPath);
if (!file.Size.ToString().Equals(f.Length.ToString()) && !file.FileName.ToString().EndsWith(".xml"))
{
MessageBox.Show($"文件大小与服务器不匹配 "+ file.FileName);
MessageBox.Show($"文件大小与服务器不匹配 "+ file.FileName);
ShowErrorAndRestartApplication();
}
@@ -320,7 +362,9 @@ namespace Lskj.AutoUpdate
}
catch (Exception exp)
{
MessageBox.Show("oldPath" + oldPath + "\r\n" + "newPath" + newPath + "\r\n" + exp.Message);
replaceSuccess = false;
MessageBox.Show("oldPath" + oldPath + "\r\n" + "newPath" + newPath + "\r\n" + exp.Message);
break;
//log the error message,you can use the application's log code
}
@@ -329,7 +373,7 @@ namespace Lskj.AutoUpdate
//After dealed with all files, clear the data
this.allFileList.Clear();
if (this.downloadFileList.Count == 0)
if (this.downloadFileList.Count == 0 && replaceSuccess)
Exit(true);
else
Exit(false);
@@ -337,41 +381,58 @@ namespace Lskj.AutoUpdate
evtDownload.Set();
}
/// <summary>
/// <para>说明:移动文件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:移动文件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="oldPath">The old path.</param>
/// <param name="newPath">The new path.</param>
private void MoveFolderToOld(string oldPath, string newPath)
{
Exception lastException = null;
for (int i = 0; i < 10; i++)
{
try
{
if (File.Exists(oldPath + ".old"))
System.IO.File.SetAttributes(oldPath + ".old", System.IO.FileAttributes.Normal);
if (File.Exists(oldPath))
System.IO.File.SetAttributes(oldPath, System.IO.FileAttributes.Normal);
if (File.Exists(oldPath + ".old"))
System.IO.File.SetAttributes(oldPath + ".old", System.IO.FileAttributes.Normal);
if (File.Exists(oldPath))
System.IO.File.SetAttributes(oldPath, System.IO.FileAttributes.Normal);
if (File.Exists(oldPath + ".old"))
File.Delete(oldPath + ".old");
if (File.Exists(oldPath))
File.Move(oldPath, oldPath + ".old");
File.Move(newPath, oldPath);
if (File.Exists(oldPath + ".old"))
File.Delete(oldPath + ".old");
if (File.Exists(oldPath))
File.Move(oldPath, oldPath + ".old");
File.Move(newPath, oldPath);
return;
}
catch (IOException ex)
{
lastException = ex;
Thread.Sleep(500);
}
catch (UnauthorizedAccessException ex)
{
lastException = ex;
Thread.Sleep(500);
}
}
throw new IOException("文件可能仍被其他进程占用,重试后仍无法替换:" + oldPath, lastException);
}
/// <summary>
/// <para>说明:显示当前下载文件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:显示当前下载文件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="name">The name.</param>
private void ShowCurrentDownloadFileName(string name)
@@ -380,21 +441,21 @@ namespace Lskj.AutoUpdate
{
ShowCurrentDownloadFileNameCallBack cb = new ShowCurrentDownloadFileNameCallBack(ShowCurrentDownloadFileName);
this.Invoke(cb, new object[] { name });
this.labelCurrentItem.Text = "正在更新:" + name;
this.labelCurrentItem.Text = "正在更新:" + name;
}
else
{
this.labelCurrentItem.Text = "正在更新:" + name;
this.labelCurrentItem.Text = "正在更新:" + name;
}
}
/// <summary>
/// <para>说明:显示当前进度</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:显示当前进度</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="current">The current.</param>
/// <param name="total">The total.</param>
@@ -412,13 +473,13 @@ namespace Lskj.AutoUpdate
}
}
/// <summary>
/// <para>说明:退出升级程序</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:退出升级程序</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="success">if set to <c>true</c> [success].</param>
private void Exit(bool success)
@@ -430,40 +491,42 @@ namespace Lskj.AutoUpdate
}
else
{
this.isClosingByCode = true;
this.isFinished = success;
this.DialogResult = success ? DialogResult.OK : DialogResult.Cancel;
this.Close();
}
}
/// <summary>
/// <para>说明:取消</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:取消</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void OnCancel(object sender, EventArgs e)
{
if (isUserCanceled)
return;
if (!isFinished && DialogResult.Yes == MessageBox.Show(ConstModel.UPDATE_GIVING_UP, ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
{
evtDownload.Set();
evtPerDonwload.Set();
autoUpdater.RollBack();
CancelUpdate(true);
Exit(false);
}
}
/// <summary>
/// <para>说明:下载失败</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:下载失败</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void DealWithDownloadErrors()
{
@@ -478,4 +541,147 @@ namespace Lskj.AutoUpdate
{
//MessageBox.Show(e.Message);
//log the error message,you can use the application's log code
ShowErrorAndRestartApp
ShowErrorAndRestartApplication();
}
}
/// <summary>
/// 将WebClient下载异常转换为用户可理解的提示。
/// </summary>
/// <param name="file">下载文件信息。</param>
/// <param name="ex">下载异常。</param>
/// <returns>友好的错误提示。</returns>
private string BuildDownloadErrorMessage(DownloadFileInfo file, Exception ex)
{
StringBuilder message = new StringBuilder();
message.AppendLine("更新文件下载失败。");
if (file != null)
{
message.AppendLine("文件:" + file.FileName);
message.AppendLine("地址:" + file.DownloadUrl);
}
message.AppendLine("原因:" + GetFriendlyDownloadExceptionMessage(ex));
message.AppendLine();
message.AppendLine("请检查网络是否正常、更新服务器是否可访问,或关闭防火墙/杀毒软件拦截后重试。");
return message.ToString();
}
/// <summary>
/// 获取下载异常的具体原因。
/// </summary>
/// <param name="ex">异常对象。</param>
/// <returns>异常原因说明。</returns>
private string GetFriendlyDownloadExceptionMessage(Exception ex)
{
WebException webException = ex as WebException;
if (webException == null && ex != null)
{
webException = ex.InnerException as WebException;
}
if (webException != null)
{
HttpWebResponse response = webException.Response as HttpWebResponse;
if (response != null)
{
if (response.StatusCode == HttpStatusCode.ProxyAuthenticationRequired)
{
return "代理服务器需要认证,请检查系统代理账号或网络代理设置。";
}
if (response.StatusCode == HttpStatusCode.NotFound)
{
return "服务器上找不到该更新文件,请确认更新包是否已上传完整。";
}
if (response.StatusCode == HttpStatusCode.Forbidden || response.StatusCode == HttpStatusCode.Unauthorized)
{
return "服务器拒绝访问该更新文件,请检查文件权限或更新地址配置。";
}
return string.Format("服务器返回 {0} {1},请确认更新文件是否存在或服务器权限是否正确。", (int)response.StatusCode, response.StatusDescription);
}
switch (webException.Status)
{
case WebExceptionStatus.NameResolutionFailure:
return "无法解析更新服务器地址,请检查DNS、网络连接或服务器地址配置。";
case WebExceptionStatus.ConnectFailure:
return "无法连接更新服务器,请检查网络、服务器端口或防火墙设置。";
case WebExceptionStatus.Timeout:
return "连接更新服务器超时,可能是网络不稳定或服务器响应过慢。";
case WebExceptionStatus.ProxyNameResolutionFailure:
return "代理服务器地址解析失败,请检查系统代理设置。";
case WebExceptionStatus.TrustFailure:
case WebExceptionStatus.SecureChannelFailure:
return "安全连接失败,请检查服务器证书或客户端系统时间。";
case WebExceptionStatus.ConnectionClosed:
return "下载过程中连接被关闭,可能是网络中断或服务器主动断开。";
case WebExceptionStatus.ProtocolError:
return "服务器返回了错误响应,请确认更新地址和文件权限。";
default:
return webException.Message;
}
}
if (ex is UriFormatException)
{
return "更新文件地址格式不正确。";
}
if (ex is UnauthorizedAccessException)
{
return "没有写入更新文件的权限,请以管理员身份运行或检查目录权限。";
}
if (ex is IOException)
{
return "写入更新文件失败,可能是文件被占用或磁盘空间不足。";
}
return ex != null ? ex.Message : "未知错误。";
}
/// <summary>
/// <para>说明:重新下载</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void ShowErrorAndRestartApplication()
{
DialogResult dlg = MessageBox.Show(ConstModel.UPDATE_CONTINUE, ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dlg == DialogResult.Yes)
CommonUnitity.RestartApplication();
else
{
if (clientDownload != null)
clientDownload.CancelAsync();
ReleaseDownloadWait();
autoUpdater.RollBack();
Exit(false);
}
}
private void CancelUpdate(bool rollback)
{
isUserCanceled = true;
if (clientDownload != null)
clientDownload.CancelAsync();
ReleaseDownloadWait();
if (rollback)
autoUpdater.RollBack(true);
}
private void ReleaseDownloadWait()
{
if (evtDownload != null)
evtDownload.Set();
if (evtPerDonwload != null)
evtPerDonwload.Set();
}
}
}
Binary file not shown.
+32 -1
View File
@@ -59,4 +59,35 @@ namespace Lskj.AutoUpdate
/// <para>版本:1.0</para>
/// </summary>
/// <param name="file">The file.</param>
/// <
/// <returns>Config.</returns>
public Config LoadConfig(string file)
{
if (!File.Exists(file)) SaveConfig(file);
XmlSerializer xs = new XmlSerializer(typeof(Config));
StreamReader sr = new StreamReader(file);
Config config = xs.Deserialize(sr) as Config;
sr.Close();
return config;
}
/// <summary>
/// <para>说明:保存配置</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="file">The file.</param>
public void SaveConfig(string file)
{
XmlSerializer xs = new XmlSerializer(typeof(Config));
StreamWriter sw = new StreamWriter(file);
xs.Serialize(sw, this);
sw.Close();
}
}
}
+104 -54
View File
@@ -1,11 +1,11 @@
/******************************
* 说明:启动进程、关闭进程操作
* 创建人:龚宇超
* 创建日期:2018-02-09
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
/******************************
* 说明:启动进程、关闭进程操作
* 创建人:龚宇超
* 创建日期:2018-02-09
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
******************************/
using System;
using System.Collections.Generic;
@@ -16,18 +16,18 @@ using System.Diagnostics;
namespace Lskj.AutoUpdate
{
/// <summary>
/// 启动进程、关闭进程操作
/// 启动进程、关闭进程操作
/// </summary>
public class ProcessManager
{
/// <summary>
/// <para>说明:初始化更新,关闭现有软件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:初始化更新,关闭现有软件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
public void InitUpdateEnvironment()
{
@@ -42,13 +42,13 @@ namespace Lskj.AutoUpdate
CloseExe(ConstModel.Ls_Notice);
}
/// <summary>
/// <para>说明:启动主程序</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:启动主程序</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
public void StartProcess(bool isMes = false)
{
@@ -70,13 +70,13 @@ namespace Lskj.AutoUpdate
CloseExe(ConstModel.LS_UPDATE_NAME);
}
/// <summary>
/// <para>说明:启动更新程序</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:启动更新程序</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
public void StartUpdateProcess(bool isMes = false)
{
@@ -99,13 +99,13 @@ namespace Lskj.AutoUpdate
CloseExe(ConstModel.Ls_Notice);
}
/// <summary>
/// <para>说明:启动exe绝对路径</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:启动exe绝对路径</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="filePath">The file path.</param>
/// <param name="fileName">Name of the file.</param
@@ -113,8 +113,8 @@ namespace Lskj.AutoUpdate
private void StartExe(string filePath, string fileName, string args = "")
{
Process proc = new Process();
proc.StartInfo.UseShellExecute = true;//是否使用操作系统外壳程序启动进程
proc.StartInfo.WorkingDirectory = filePath;//启动进程的初始目录
proc.StartInfo.UseShellExecute = true;//是否使用操作系统外壳程序启动进程
proc.StartInfo.WorkingDirectory = filePath;//启动进程的初始目录
proc.StartInfo.FileName = fileName;
if (!string.IsNullOrEmpty(args))
{
@@ -123,29 +123,79 @@ namespace Lskj.AutoUpdate
proc.Start();
}
/// <summary>
/// <para>说明:关闭的exe进程名</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:关闭的exe进程名</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="exeName">Name of the executable.</param>
public void CloseExe(string exeName)
{
Process[] arrPro = Process.GetProcessesByName(exeName);
int currentProcessId = Process.GetCurrentProcess().Id;
foreach (Process pro in arrPro)
pro.Kill();
{
try
{
if (pro.Id == currentProcessId)
{
Environment.Exit(0);
}
if (!pro.HasExited)
{
pro.Kill();
pro.WaitForExit(10000);
}
}
catch
{
// 关闭失败时继续处理其他进程,后续文件替换阶段会再次检测文件占用。
}
finally
{
try
{
pro.Dispose();
}
catch
{
}
}
}
//Process[] arrPro = Process.GetProcessesByName(exeName);
//foreach (Process pro in arrPro)
//{
// try
// {
// if (!pro.HasExited)
// pro.Kill();
// }
// catch (Exception ex)
// {
// // Kill 失败不抛异常,记录日志,更新继续
// //LogHelper.Instance.WriteError("关闭进程 " + exeName + " 失败: " + ex.Message);
// }
// finally
// {
// try { pro.Dispose(); }
// catch { }
// }
//}
}
/// <summary>
/// <para>说明:是否存在进程名</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// <para>说明:是否存在进程名</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-09 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="processName">Name of the process.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
@@ -71,4 +71,29 @@ namespace Lskj.BaseAccraditation
return;
}
FrmBaseAccraditation popupForm = new FrmBaseAccraditation();
popupForm.SysModel = DynamicBaseM
popupForm.SysModel = DynamicBaseModel;
popupForm.Opacity = 0;
popupForm.SysModel.DataCaches = new Dictionary<object, Hashtable>();
if (SystemInfo.Instance.OptimizationSpeed) popupForm.GetDataCaches(popupForm.SysModel.DataCaches);
this.SubForm = popupForm;
}
else
{
FrmMain main = new FrmMain();
this.SubForm = main;
main.SysModel = new DynamicBaseAccraditionModel(obj);
main.SysModel.DataCaches = new Dictionary<object, Hashtable>();
if (SystemInfo.Instance.OptimizationSpeed) main.GetDataCaches(main.SysModel.DataCaches);
}
}
catch (Exception ex)
{
LogUtil.WriteError("Lskj.BaseAccraditation.dll--参数错误-->" + obj.ToString(), ex);
}
}
public Form SubForm { get; set; }
}
}
@@ -649,4 +649,21 @@
private DevExpress.XtraBars.PopupMenu pMprint;
private DevExpress.XtraEditors.PanelControl pl_right_bottom;
private DevExpress.XtraEditors.PanelControl pl_right_bottom2;
private DevExpress.XtraEd
private DevExpress.XtraEditors.SimpleButton btnRemindBack;
private DevExpress.XtraEditors.SimpleButton btnRemindAccradit;
private Control.LabelDateEdit labeldate_happendTime;
private DevExpress.XtraEditors.SimpleButton btnAudit;
private DevExpress.XtraEditors.SimpleButton btnClose;
private Control.LabelTextEdit labeltxt_managerAudit;
private Control.LabelComboxEdit combox_Suggestion;
private DevExpress.XtraEditors.SimpleButton btnReturnd;
private DevExpress.XtraEditors.PanelControl pl_right_center;
private System.Windows.Forms.TextBox txt_remark;
private DevExpress.XtraEditors.LabelControl label_auditPerson;
private DevExpress.XtraEditors.SplitContainerControl splitContainer;
private DevExpress.XtraEditors.XtraScrollableControl pl_main;
private DevExpress.XtraEditors.LabelControl label_status;
private Control.TabControlEx tab_basicInfo;
private DevExpress.XtraEditors.DropDownButton btnPrint;
}
}
@@ -2886,4 +2886,34 @@ namespace Lskj.BaseAccraditation
GridDetailModel model = this.tab_basicInfo.GetGridDetailModel(tabPage);
Object moduleObject = tabPage.Controls.Cast<Object>().FirstOrDefault();
if (moduleObject is ModuleGridEx)
if (moduleObject is ModuleGridEx)
{
ModuleGridEx moduleGridEx = moduleObject as ModuleGridEx;
if (moduleGridEx.GridControlObj.IsDataNotSaved() && moduleGridEx.BtnSave.Visible && moduleGridEx.BtnSave.Enabled)
{
moduleGridEx.BtnSave.PerformClick();
}
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
/// <summary>
/// 设置修改过的控件颜色
/// </summary>
public void SetColor()
{
List<string> FieldList = AuditChangeLog.GetChangeLogFields(this.SysModel.PrimaryValue);
foreach (string item in FieldList)
{
this.ControlObj.SetBackgroundColor(item);
}
}
}
}
+22 -1
View File
@@ -509,4 +509,25 @@ namespace Lskj.BaseAccraditation
/// <para>创建日期:2021-11-23 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
public void refreshThePage(string promptInformation, string id)
{
this.auditPanelObj.RefreshTabPage();
if (!string.IsNullOrWhiteSpace(promptInformation)) MessageUtil.Show(promptInformation);
//上一次点开page
XtraTabPage beforePage = ERPInfo.Instance.ModuleForms[id].BeforePage;
//要删除的page
XtraTabPage removePage = new XtraTabPage();
ERPInfo.Instance.ModuleForms.Remove(id);
foreach (XtraTabPage tablepage in ERPInfo.Instance.PageControl.TabPages)
{
if (tablepage.Tag == null) continue;
if (tablepage.Tag.ToString().Equals(id)) removePage = tablepage;
if (tablepage == beforePage) ERPInfo.Instance.PageControl.SelectedTabPage = beforePage;
}
ERPInfo.Instance.PageControl.TabPages.Remove(removePage);
}
}
}
@@ -0,0 +1,2 @@
DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+33 -1
View File
@@ -1089,4 +1089,36 @@ namespace Lskj.BaseInfo
MessageUtil.Show(ResourceKeys.ForcedSuccess);
//暂未推送消息
PushHelper push = new PushHelper(this.SysModel.PrimaryValue, this._stepCode, this.SysModel.ModuleCode, this._beforeUsers, this._beforeMenuName, this._beforeId);
push.Push_Base_Oper_Message();
this.DialogResult = DialogResult.OK;
}
else
{
MessageUtil.Show(ResourceKeys.ForcedFail + "\r\n" + result);
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
#endregion
private void simpleButton1_Click(object sender, EventArgs e)
{
try
{
WebBrowserUtil.StartWebBrowser(this.SysModel.ModuleCode, mRowItem["ToolsName"] + "");
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
}
}
@@ -0,0 +1 @@
DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
@@ -0,0 +1,2 @@
DevExpress.Patch.InMemoryPatch, DevExpress.Patch.Common, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7fc7bfca2443de66
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
@@ -474,4 +474,36 @@ namespace Lskj.BaseWorkflow.Control
int? maxStepCode = BaseflowModelList
.Where(m => m.stepCode < selectedStepCode)
.Select(m => m.stepCode)
.DefaultIfEmpty
.DefaultIfEmpty() // 避免空集合时抛出异常
.Max();
Code = (int)(maxStepCode + (selectedStepCode - maxStepCode) / 2);
}
BaseflowModel model = new BaseflowModel
{
stepCode = Convert.ToInt32(Code),
typeCode = mMenuCode,
stepGroup = stepGroup,
stepName = stepName,
stepApplyText = "审核(&Y)",
stepApplyContent = "同意",
stepBackText = "反退(&N)",
stepBackContent = "不同意",
};
try
{
// 保存
if (WorkFlowBaseImpl.SaveBaseFlow(model))
{
// 重排列表
InitializeStepFlow();
}
}
catch (Exception ex)
{
MessageUtil.Show("保存失败!" + ex.Message);
}
}
}
}
+18 -1
View File
@@ -500,4 +500,21 @@
private DevExpress.XtraEditors.PanelControl panelControl4;
private System.Windows.Forms.GroupBox groupBox3;
private DevExpress.XtraTab.XtraTabControl xtraTabControl2;
private DevExpress.XtraTab.XtraTabPage
private DevExpress.XtraTab.XtraTabPage xtraTabPage3;
public DevExpress.XtraGrid.GridControl gridControl1;
private DevExpress.XtraGrid.Views.Grid.GridView gridView2;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn3;
private DevExpress.XtraGrid.Views.Grid.GridView gridView3;
private DevExpress.XtraTab.XtraTabPage xtraTabPage4;
public DevExpress.XtraGrid.GridControl gridControl;
private DevExpress.XtraGrid.Views.Grid.GridView gridView;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn2;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn1;
private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
private DevExpress.XtraEditors.PanelControl panelControl6;
private Lskj.Control.LabelTextEdit labelTextEdit1;
private Lskj.Control.LabelComboxEdit labelComboxEdit1;
private DevExpress.XtraEditors.XtraScrollableControl xtraScrollableControl1;
private Lskj.Control.LabelCheckEdit labdisable;
}
}
@@ -410,4 +410,35 @@ namespace Lskj.BaseWorkflow.Control
}
else if (e.SourceGridViewObj.Name == "gridView2")
{
f
foreach (DataRow item in e.GridViewSelectRows)
{
userNames += "{&" + item["roleName"] + "&},";
}
//userNames = PowerImpl.getAllPersonnel(userNames);
//if (userNames.Equals(",")) userNames = "";
}
//List<System.String> namesList = new List<System.String>((this.txtEdit.EditValue + "").Split(','));
//foreach (string item in userNames.Split(','))
//{
// if (!namesList.Exists(t => t.Equals(item)))
// {
// this.txtEdit.EditValue += item + ",";
// }
//}
this.txtEdit.EditValue += userNames;
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
MessageUtil.Show(ResourceKeys.OperFault);
}
}
#endregion
}
}
@@ -865,4 +865,30 @@ namespace Lskj.BaseWorkflow.Control
{
try
{
Panel
Panel deletePanel = sender as Panel;
if (deletePanel != null && deletePanel.Tag != null)
{
if (MessageUtil.Show("是否删除当前方案步骤?", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
BaseflowTypeStepModel model = deletePanel.Tag as BaseflowTypeStepModel;
if (WorkFlowBaseImpl.DeleteSchemeSteps(model))
{
MessageUtil.Show("删除成功!");
InitializeStepTypeFlow();
}
else
{
MessageUtil.Show("删除失败");
}
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
}
}
@@ -281,4 +281,39 @@ namespace Lskj.BaseWorkflow.Control
DataTable dataTable = WorkFlowBaseImpl.getFinalBack(mMenuCode);
if (dataTable.Rows.Count > 0) {
this.memoEdit1.Text = dataTable.Rows[0]["OverBackSql"]+"";
this.memo
this.memoEdit2.Text = dataTable.Rows[0]["OverBackOper"] + "";
}
}
/// <summary>
/// 生成终审sql
/// </summary>
public void GenerateFinalSqlStatement()
{
bool result = WorkFlowBaseImpl.CreateSQL();
//DataTable table = WorkFlowBaseImpl.GetBaseFlowData(mMenuCode);
if (result)
{
//单据,单表用的同一个存储过程
string sql = "";
//string stepcode = table.Rows[0]["stepcode"] + "";
int resultNew = WorkFlowBaseImpl.GenerateFinalSqlStatement(mMenuCode,"0", out sql);
if (resultNew == 1)
{
this.memoEdit1.Text = sql;
this.UpdateFinalReturnSettings();
}
}
else
{
MessageUtil.Show("p_systemCreateendFlowSQL存储过程错!");
}
}
}
}
+37 -1
View File
@@ -510,4 +510,40 @@ namespace Lskj.BaseWorkflow
WordDocViewer(filePath);
}
public static void WordDocViewer(string fileName)
{
try
{
System.Diagnostics.Process.Start(fileName);
}
catch
{
}
}
/// <summary>
/// 点击开始生成
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_start_Click(object sender, EventArgs e)
{
this.Initialization(); // 初始化同步平台
// 创建后台线程
try
{
Thread backThread = new Thread(Mulu);
backThread.IsBackground = true;
backThread.Start();
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
private void btn_getout_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
+21 -1
View File
@@ -404,4 +404,24 @@
private System.Windows.Forms.Panel pllzbzsz;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Panel plxllzsz
private System.Windows.Forms.Panel plxllzsz;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Panel plxlsz;
private System.Windows.Forms.Panel panel1;
private DevExpress.XtraEditors.SimpleButton btnSave;
private DevExpress.XtraEditors.SimpleButton btnAdd;
private DevExpress.XtraEditors.SimpleButton btnReset;
private DevExpress.XtraEditors.SimpleButton btnInit;
private DevExpress.XtraEditors.SimpleButton btnSaveAllflow;
private DevExpress.XtraEditors.SimpleButton btnToWord;
private DevExpress.XtraEditors.SimpleButton simpleButton1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel plzsht;
private System.Windows.Forms.Label label4;
private Control.StepPage3 stepPage31;
private Control.StepPage1 stepPage11;
private Control.StepPage2 stepPage21;
private Control.StepPage4 stepPage41;
private DevExpress.XtraEditors.SimpleButton btnInsert;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,2 @@
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+3 -2
View File
@@ -1,4 +1,5 @@
using System;
using Lskj.Control;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
@@ -16,7 +17,7 @@ namespace Lskj.BatchUpload
string arrayAsString = string.Empty;
if (args.Length > 0)
{
arrayAsString = args[0]; // 获取传递的字符串参数
arrayAsString = args[0]; // 获取传递的字符串参数
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
+1 -1
View File
@@ -147,7 +147,7 @@
<Name>Lskj.Data</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Main\Lskj.Main.csproj">
<Project>{BCA1E2B3-C4AB-4D2C-B519-3DCFDB5B83D6}</Project>
<Project>{bca1e2b3-c4ab-4d2c-b519-3dcfdb5b83d6}</Project>
<Name>Lskj.Main</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Model\Lskj.Model.csproj">
@@ -0,0 +1 @@
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+22 -1
View File
@@ -457,4 +457,25 @@ namespace Lskj.Business.Impl
public static DataTable GetCameraFileData()
{
string sqlValue = @" select '1' id , 'stepCode' fieldName, 65 width, '' sysname , '编号' username, '' dataFormat union
select '2' , 'Name' ,
select '2' , 'Name' ,148 , '' , '文件名' , '' union
select '3' , 'Created' ,120 , '' , '时间' , '' union
select '4' , 'key' ,67 , '' , '隐藏字段' , '' ";
return SqlHelper.ExecuteDataTable(sqlValue);
}
/// <summary>
/// <para>说明:获取附件条数</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-08-10 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns>System.Int32.</returns>
public static int GetFileCount(string dirid, string pid)
{
DataTable dt = SqlHelper.ExecuteDataTable(string.Format("select 1 from P_fm_FileTab where parentId='{0}'", GetAttachDirectoryId(dirid, pid)));
return dt == null ? 0 : Convert.ToInt32(dt.Rows.Count);
}
}
}
+20 -1
View File
@@ -1206,4 +1206,23 @@ namespace Lskj.Business.Impl
/// <para>创建人:</para>
/// <para>创建日期:2023-05-12</para>
/// <para>修改人:</para>
/// <para
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="typeCode">模块编号.</param>
/// <returns>DataRow.</returns>
public static DataRow GetAgencyAuthority(string typeCode)
{
DataTable dtTable = new DataTable();
if (SqlHelper.ExecuteDataTable("select object_id('p_systemPrivilegeAgentTab')").Rows.Count > 0 && int.Parse(SqlHelper.ExecuteScalar("select count(*) from sysobjects where id = object_id('p_systemPrivilegeAgentTab')") + "") > 0)
{
string sqlValue = string.Format("select sourceuser from p_systemPrivilegeAgentTab where modid='{0}' and targetuser='{1}' and starttime<=getdate() and endtime>=getdate() and ban=1", typeCode, ERPInfo.Instance.UserName);
dtTable = SqlHelper.ExecuteDataTable(sqlValue);
}
return dtTable.Rows.Count > 0 ? dtTable.Rows[0] : null;
}
}
}
+30 -1
View File
@@ -1222,4 +1222,33 @@ namespace Lskj.Business.Impl
}
/// <summary>
///
/// <para>说明:根据模块id判断是否设置不能同时打开多个相同模块</para>
/// <para>创建人:曹屹峰</para>
/// <para>创建日期:2024-02-21 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns></returns>
public static bool GetOpenRestrictions(string MenuId)
{
if (BaseImpl.HasExistsColumn("p_formmenuconfigtab", "SingleOpenMode"))
{
string sqlValue = string.Format("SELECT SingleOpenMode from p_formmenuconfigtab where MenuId='{0}'", MenuId);
DataTable dtTable = SqlHelper.ExecuteDataTable(sqlValue);
if (dtTable.Rows.Count > 0)
{
return "1".Equals(dtTable.Rows[0]["SingleOpenMode"] + "");
}
}
return false;
}
}
}
File diff suppressed because it is too large Load Diff
+28 -1
View File
@@ -87,4 +87,31 @@ namespace Lskj.Business.Impl
return maxNum;
// 取未使用的编号
sqlValue = string.Format("select cast({1} as bigint) as SpeciesNo from {0} where {1} like '{2}{
sqlValue = string.Format("select cast({1} as bigint) as SpeciesNo from {0} where {1} like '{2}{3}' order by {1}", tableName, parentKey, parentValue,maxdivision);
DataTable table = GetDataTableResult(sqlValue);
Int64 speciesNo = table.Rows.Count > 0 ? Convert.ToInt64(table.Rows[0]["SpeciesNo"] + "") : 0;
if (speciesNo != Int64.Parse(parentValue + PrefixNum+"1"))
return parentValue +PrefixNum+"1";;
foreach (DataRow item in table.Rows)
{
Int64 rowSpeciesNo = Convert.ToInt64(item["SpeciesNo"] + "");
if (speciesNo == rowSpeciesNo) continue;
if (rowSpeciesNo != speciesNo + 1)
{
maxNo = (speciesNo + 1).ToString();
maxNo = maxNo.PadLeft(parentValue.Length + firstNode.Length, '0');
break;
}
speciesNo = rowSpeciesNo;
}
}
return maxNo;
}
}
}
+20 -1
View File
@@ -416,4 +416,23 @@ namespace Lskj.Business.Impl
/// <para>创建人:</para>
/// <para>创建日期:2023-05-12</para>
/// <para>修改人:</para>
/// <para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="typeCode">模块编号.</param>
/// <returns>DataRow.</returns>
public static DataRow GetAgencyAuthority(string typeCode)
{
DataTable dtTable = new DataTable();
if (SqlHelper.ExecuteDataTable("select object_id('p_systemPrivilegeAgentTab')").Rows.Count > 0 && int.Parse(SqlHelper.ExecuteScalar("select count(*) from sysobjects where id = object_id('p_systemPrivilegeAgentTab')") + "") > 0)
{
string sqlValue = string.Format("select sourceuser from p_systemPrivilegeAgentTab where modid='{0}' and targetuser='{1}' and starttime<=getdate() and endtime>=getdate() and ban=1", typeCode, ERPInfo.Instance.UserName);
dtTable = SqlHelper.ExecuteDataTable(sqlValue);
}
return dtTable.Rows.Count > 0 ? dtTable.Rows[0] : null;
}
}
}
+24 -1
View File
@@ -968,4 +968,27 @@ namespace Lskj.Business.Impl
SqlParameter[] param =
{
new SqlParameter("@FormText",SqlDbType.VarChar,50),
new Sq
new SqlParameter("@userId",SqlDbType.Int,20),
new SqlParameter("@UserName",SqlDbType.VarChar,50),
new SqlParameter("@Privilege",SqlDbType.Int,4),
new SqlParameter("@ModuleCode",SqlDbType.VarChar,50),
new SqlParameter("@ModuleId",SqlDbType.VarChar,50),
};
param[0].Value = SysModel.FormText;
param[1].Value = ERPInfo.Instance.UserId;
param[2].Value = ERPInfo.Instance.UserName;
param[3].Value = SysModel.Privilege;
param[4].Value = SysModel.ModuleCode;
param[5].Value = SysModel.ModuleId;
ds = SqlHelper.ExecuteDataSet(CommandType.StoredProcedure, "p_Get_NewDesignPlatform_PubAccraditation2", "cacheSYSConfig", param);
return ds;
}
}
}
Binary file not shown.
+24 -1
View File
@@ -219,4 +219,27 @@ namespace Lskj.Business.Impl
/// <returns>System.String.</returns>
public static string GetConnection()
{
return string.Format
return string.Format(AESUtil.Decrypt(Connection1), serverName, DataBase);
}
/// <summary>
/// <para>说明:遍历获取方法中文注释</para>
/// <para>创建人:唐德馨</para>
/// <para>创建日期:2021-08-13 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns>System.String.</returns>
public static string GetMethodExplain(string methodName, DataTable DataTable)
{
DataTable dataTable = DataTable;
if (dataTable == null || dataTable.Rows.Count == 0) return string.Empty;
IEnumerable<DataRow> resultRow = dataTable.Select().Where(n => n["p_ErrMethod"].Equals(methodName));
if (resultRow.Count() != 0)
return resultRow.First()["p_interpretText"].ToString();
else
return string.Empty;
}
}
}
@@ -152,4 +152,38 @@ namespace Lskj.Business.Impl
foreach (DataRow item in dataTable.Rows)
{
item["MenuCaption"
item["MenuCaption"] = GetTranslatedText(item["MenuCaption"] + "");
item["SubSysName"] = GetTranslatedText(item["SubSysName"] + "");
item["SearchMenuCaption"] = GetTranslatedText(item["MenuCaption"] + "-" + item["SubSysName"]);
}
return dataTable;
}
/// <summary>
/// 传入表格,翻译指定列信息
/// </summary>
/// <param name="dataTable">表格数据</param>
/// <param name="ccolumnName">需要翻译的列</param>
/// <returns></returns>
public static DataTable TranslationTableColumn(DataTable dataTable, string ccolumnName)
{
if (dataTable != null && dataTable.Columns.Contains(ccolumnName))
{
foreach (DataRow item in dataTable.Rows)
{
item[ccolumnName] = GetTranslatedText(item[ccolumnName] + "");
}
}
return dataTable;
}
}
}
+25 -1
View File
@@ -1313,4 +1313,28 @@ namespace Lskj.Business.Impl
string sqlvalue = $@"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns
WHERE TABLE_NAME = '{tableName}' AND COLUMNPROPERTY(OBJECT_ID('{tableName}'),COLUMN_NAME,'IsIdentity')= 1;";
if (SqlHelper.ConnectionType == ConnectionType.DmServer)
{
sqlvalue = $@"select a.NAME from SYS.SYSCOLUMNS a,sysobjects b
where b.id = a.id and b.name = '{tableName}' and a.info2 = 1;";
}
return BaseImpl.GetResult(sqlvalue) + "";
}
/// <summary>
/// 获取表格属性
/// </summary>
/// <returns></returns>
public static DataTable GetDatabaseProperty(string tableName)
{
string sqlvalue = $@"select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns
where table_name = '{tableName}';";
if (SqlHelper.ConnectionType == ConnectionType.DmServer)
{
sqlvalue = $@"SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH AS CHARACTER_MAXIMUM_LENGTH
FROM ALL_TAB_COLUMNS WHERE TABLE_NAME = '{tableName}';";
}
return BaseImpl.GetDataTableResult(sqlvalue);
}
}
}
+22 -1
View File
@@ -737,4 +737,25 @@ namespace Lskj.Business.Impl
//拼接添加权限分类sql
//List<string> moduleNumbers = new List<string>();
//string Sql = string.Format("delete p_sy
//string Sql = string.Format("delete p_systemPrivilege where roleid='{0}';", roleid);
//foreach (DataRow item in Module.Rows)
//{
// string PurviewId = item["PurviewId"] + "";
// if (!string.IsNullOrWhiteSpace(PurviewId) && !moduleNumbers.Contains(PurviewId))
// {
// moduleNumbers.Add(PurviewId);
// DataRow dr= GetDataRowResult(string.Format("select top 1 privTypeId from p_systemPrivilege where modId='{0}' order by privTypeId desc ", PurviewId));
// int privTypeId =1;
// if (dr != null) privTypeId = int.Parse(dr["privTypeId"] + "") + 1;
// Sql += string.Format(" insert into p_systemPrivilege(privTypeId,privTypeName,modId,userList,remark,roleid) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}'); ",
// privTypeId+"", roleName, PurviewId, text,"", roleid);
// }
//}
//ExecSqlValue(Sql);
}
}
}
+23 -1
View File
@@ -243,4 +243,26 @@ namespace Lskj.Business.Impl
new SqlParameter("@modid",SqlDbType.Int),
new SqlParameter("@storehouseid",SqlDbType.Int),
new SqlParameter("@uniqueCode",SqlDbType.VarChar,40),
new SqlParameter("@mxid",SqlDbType.Int),
new SqlParameter("@billtype",SqlDbType.VarChar,20),
new SqlParameter("@productid",SqlDbType.VarChar,20),
new SqlParameter("@operatorid",SqlDbType.Int),
new SqlParameter("@operatorname",SqlDbType.VarChar,50),
msg,
returnValue
};
param[0].Value = primaryKey;
param[1].Value = modid;
param[2].Value = storehouseid;
param[3].Value = uniqueCode;
param[4].Value = mxid;
param[5].Value = billtype;
param[6].Value = productid;
param[7].Value = ERPInfo.Instance.UserId;
param[8].Value = ERPInfo.Instance.UserName;
SqlHelper.ExecuteDataSet(CommandType.StoredProcedure, "BillTM_ADDPR", "temp", param);
msgs = msg.Value + "";
return Convert.ToInt32(returnValue.Value);
}
}
}
+22 -1
View File
@@ -205,4 +205,25 @@ namespace Lskj.Business.Impl
new SqlParameter("@moduleCode",SqlDbType.VarChar,50),
new SqlParameter("@Privilege",SqlDbType.Int,4),
new SqlParameter("@StepCode",SqlDbType.VarChar,50),
new SqlParameter("@PrimaryValue",SqlDbType.VarChar,50),
new SqlParameter("@settingTableName",SqlDbType.VarChar,50),
new SqlParameter("@ConfirmId",SqlDbType.VarChar,50),
};
param[0].Value = ERPInfo.Instance.UserId;
param[1].Value = ERPInfo.Instance.UserName;
param[2].Value = SysModel.ModuleId;
param[3].Value = SysModel.ModuleCode;
param[4].Value = SysModel.Privilege;
param[5].Value = SysModel.StepCode;
param[6].Value = SysModel.PrimaryValue;
param[7].Value = SettingTableName;
param[8].Value = SysModel.ConfirmId; ;
ds = SqlHelper.ExecuteDataSet(CommandType.StoredProcedure, "p_Get_NewDesignPlatform_BasicFileAudit", "cacheSYSConfig", param);
return ds;
}
}
}
@@ -518,4 +518,40 @@ SELECT 'return' = @returnValue, 'msg' = @msg;";
{
try
{
string script
string script = "--保存明细到临时表\r\n" + detailSql + "\r\n" + $@"DECLARE @msg NVARCHAR(4000), @return INT;
-- 执行单据保存存储过程
"+Dmsql+ $@"
-- 清理临时表
DELETE {EscapeSqlString(detailTable)}_temp WHERE sysstr = N'{EscapeSqlString(detailGuid)}';";
if (ERPInfo.Instance.UserName.Equals("管理员")) Clipboard.SetText(script);
LogHelper.Instance.WriteLog(script);
}
catch (Exception ex)
{
}
}
//达梦数据库通用提示
public static void GenerateBillSaveScript_DM(string Dmsql)
{
try
{
if (!string.IsNullOrWhiteSpace(Dmsql))
{
if (ERPInfo.Instance.UserName.Equals("管理员")) Clipboard.SetText(Dmsql);
LogHelper.Instance.WriteLog(Dmsql);
}
}
catch (Exception ex)
{
}
}
}
}
+27 -1
View File
@@ -1120,4 +1120,30 @@ namespace Lskj.Business
/// 正常提示死锁(否则遇到死锁会提示网络问题)
/// </summary>
public bool PromptDeadlock;
/// <summary>
/// 审核改动记录(记录后会改变颜色)
/// </summary>
public bool AuditChangeRecord;
/// <summary>
/// 导出时相同文件名插入工作表(插入页签,不覆盖)
/// </summary>
public bool IsInsertWorksheet;
/// <summary>
///frx打印,设置模板权限人员名称
/// </summary>
public string PrintTemplate;
/// <summary>
/// 信息框特殊处理(弹窗中正常执行后,清除消息框中对应信息)
/// </summary>
public bool EnableSpecialInfoProcess;
/// <summary>
/// 单据来源拖拽到主表中,移动当前行过滤后的来源明细数据(默认移动全部明细到主表明细中)
/// </summary>
public bool SourceFilteringMobile;
/// <summary>
///登录界面,用户名显示字段
/// </summary>
public string LoginUsername;
}
}
@@ -761,4 +761,33 @@ namespace Lskj.Business.Impl
new SqlParameter("@stepcode",SqlDbType.Int),
new SqlParameter("@operatorid",SqlDbType.Int),
pMsg,
returnValue
};
//param[0].Value = model.typeCode;
//param[1].Value = model.stepCode;
//param[2].Value = ERPInfo.Instance.UserId;
param[0].Value = mMenuCode;
param[1].Value = 0;
param[2].Value = ERPInfo.Instance.UserId;
DataSet ds = SqlHelper.ExecuteDataSet(CommandType.StoredProcedure, "p_systemCreateendFlowSQL", "FlowSQL", param);
retuenMsg = pMsg.Value.ToString();
int result = Convert.ToInt32(returnValue.Value + "");
return result;
}
/// <summary>
/// 删除方案步骤
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public static bool DeleteSchemeSteps(BaseflowTypeStepModel model)
{
string sqlValue = string.Format(@"delete p_systemdlltabflowtypestep where id='{0}'", model.id);
return ExecSqlValue(sqlValue) > 0;
}
}
}
@@ -568,4 +568,29 @@ namespace Lskj.Business
/// <para>说明:保存终审条件信息</para>
/// <para>创建人:曹屹峰</para>
/// <para>创建日期:2022-06-7 </para>
/// <para>修改人:</para
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns>System.String.</returns>
public static bool deleteFinalConditions(string id, string key)
{
string sqlValue = string.Empty;
sqlValue = string.Format("delete from p_systemControlLocation where formkey='{0}' and fieldid='{1}'", key, id);
sqlValue += string.Format("delete from p_systembillsourcecond where id='{0}'", id);
return ExecSqlValue(sqlValue) > 0;
}
/// <summary>
/// 删除方案步骤
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public static bool DeleteSchemeSteps(BillflowTypeStepModel model)
{
string sqlValue = string.Format(@"delete p_systembillflowtypestep where id='{0}'", model.id);
return ExecSqlValue(sqlValue) > 0;
}
}
}
+29 -1
View File
@@ -49,4 +49,32 @@ namespace Lskj.Business.Impl
{
return base.CreateResXLocalizer();
}
}
public class XtraGridLocalizer : GridLocalizer
{
private GridResLocalizer ResLocalizer;
public XtraGridLocalizer()
{
ResLocalizer = (GridResLocalizer)CreateResXLocalizer();
}
public override string GetLocalizedString(GridStringId id)
{
if (Business.Impl.LanguageTranslation.Translatable)
{
switch (id)
{
case GridStringId.FindControlFindButton:
return Business.Impl.LanguageTranslation.GetTranslatedText("查找");
case GridStringId.FindControlClearButton:
return Business.Impl.LanguageTranslation.GetTranslatedText("清除");
default:
return ResLocalizer.GetLocalizedString(id);
}
}
else
{
return ResLocalizer.GetLocalizedString(id);
}
}
}
}
+27 -1
View File
@@ -567,4 +567,30 @@ namespace Lskj.CallWebLibrary
long timestamp = (dateTime.Ticks - epoch.Ticks) / TimeSpan.TicksPerSecond;
pms.Add("exp", timestamp);
}
return $"{urlParams[0]}?pms={HttpUtili
return $"{urlParams[0]}?pms={HttpUtility.UrlEncode(hasEn ? Lskj.Web.Core.Util.safety.AESUtil.Encrypt(JSON.Encode(pms), enVal) : Lskj.Web.Core.Util.safety.AESUtil.MobileEncrypt(JSON.Encode(pms)))}&{qpLS.SJoin("&")}";
}
return url;
}
/// <summary>
/// <para>说明:特殊dll模块处理</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-20 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="dllName">Name of the DLL.</param>
/// <returns>System.String.</returns>
private static string ReplaceDllFileName(string dllName)
{
switch (dllName.ToLower().Trim())
{
case "pubspec.dll":
dllName = "Lskj.PubSpec.dll";
break;
}
return dllName;
}
}
}
@@ -6,4 +6,31 @@ using System.Runtime.InteropServices;
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Lskj.CallWebLibrary")]
[assembly: AssemblyDesc
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lskj.CallWebLibrary")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("865e8766-011c-404e-8c30-bb820f7a49dc")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -37,4 +37,34 @@ namespace Lskj.CallWebLibrary.Properties
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManage
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Lskj.CallWebLibrary.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;
}
}
}
}
+29 -1
View File
@@ -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 Lskj.CallWebLibrary.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;
}
}
}
}
Binary file not shown.
+19 -1
View File
@@ -691,4 +691,22 @@
private GridControlEx gridFinish;
private DevExpress.XtraEditors.PanelControl pl_top;
private DevExpress.XtraEditors.PanelControl pl_top_searchCond;
private LabelCheckDa
private LabelCheckDateEdit labeldate_start;
private LabelCheckAutoTextEdit labelcheck_finalAuditor;
private LabelTextEdit labeltxt_dataFlag;
private DevExpress.XtraEditors.SimpleButton btnSearch;
private LabelCheckDateEdit labeldate_end;
private DevExpress.XtraEditors.PanelControl pl_top_right;
private DevExpress.XtraEditors.SimpleButton simpleButton1;
private DevExpress.XtraEditors.SimpleButton btnBackTop;
public DevExpress.XtraEditors.SimpleButton simpleButton2;
private DevExpress.XtraEditors.DropDownButton dbpFP;
private DevExpress.XtraBars.BarDockControl barDockControl3;
private DevExpress.XtraBars.BarDockControl barDockControl5;
private DevExpress.XtraBars.BarDockControl barDockControl2;
private DevExpress.XtraBars.BarDockControl barDockControl1;
private DevExpress.XtraBars.PopupMenu pmFP;
private DevExpress.XtraBars.BarManager barManager2;
public GridControlEx gcDetail;
}
}
+32 -1
View File
@@ -3578,4 +3578,35 @@ namespace Lskj.Control
}
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
LogUtil.WriteError("计算列计算公式--错误-->" + rowItem[gridModel.FieldName], ex);
}
}
}
}
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
// MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// 设置修改过的控件颜色
/// </summary>
public void SetColor()
{
this.ControlObj.SetClearBackgroundColor();
List<string> FieldList = AuditChangeLog.GetChangeLogFields(this.SysModel.BillDocumentId);
foreach (string item in FieldList)
{
this.ControlObj.SetBackgroundColor(item);
}
}
}
}
+9 -3
View File
@@ -118,12 +118,18 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="pMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>349, 15</value>
<value>233, 17</value>
</metadata>
<metadata name="barManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>458, 15</value>
<value>327, 17</value>
</metadata>
<metadata name="pmFP.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="barManager2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>102, 17</value>
</metadata>
<metadata name="pMprint.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>614, 15</value>
<value>458, 17</value>
</metadata>
</root>
@@ -1656,4 +1656,33 @@ namespace Lskj.Control
if (this.InvokeRequired)
{
this.Invoke(new EventHandler(delegate
{
int second = Convert.ToInt32((endTime - beginTime).TotalSeconds);
string tipMsg = "数据筛选完成.";
this.Popup.LabelObj.Text = second > 0 ? string.Format(tipMsg + "(耗时{0}秒)", second) : tipMsg;
this.Popup.GridControlObj.DataSource = table;
//this.DataSourceTable = table.Copy();
this._working = false;
this.CalcFormAndGrid(true);
}));
}
}
}
catch (Exception ex)
{
}
}
/// <summary>
/// 注销时
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnDisposed(object sender, EventArgs e)
{
this._popup?.Dispose();
this._popup = null;
}
}
}
@@ -1386,4 +1386,41 @@ namespace Lskj.Control
{
int second = Convert.ToInt32((endTime - beginTime).TotalSeconds);
string tipMsg = "数据筛选完成.";
this.Popup.LabelObj.Text =
this.Popup.LabelObj.Text = second > 0 ? string.Format(tipMsg + "(耗时{0}秒)", second) : tipMsg;
this.Popup.GridControlObj.DataSource = table;
this._working = false;
//this.CalcFormAndGrid();
}));
}
}
}
catch (Exception ex)
{
}
}
/// <summary>
/// 搜索回调
/// </summary>
public void SearchCallBack()
{
this.HidePopup();
if (this.OnSearchCallBack != null)
{
OnSearchCallBack(this, null);
}
}
/// <summary>
/// 注销时
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnDisposed(object sender, EventArgs e)
{
this._popup?.Dispose();
this._popup = null;
}
}
}
@@ -827,4 +827,34 @@ namespace Lskj.Control
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="KeyEvnentArgs"/> instance containing the event data.</param>
prot
protected void OnAutoGridLookUpKeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this._popup.Focus();
}
else
{
this.RefreshPopupDataSource(this.Text.Contains(",") ? string.Empty : this.Text);
if (string.IsNullOrWhiteSpace(this.Text))
{
this.EditText = this.Text;
}
}
this.ShowPopup();
}
/// <summary>
/// <para>说明:释放时清理数据源</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-03-16 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
private void OnDisposed(object sender, EventArgs e)
{
this._popup?.Dispose();
this._popup = null;
}
}
}
+21 -1
View File
@@ -3396,4 +3396,24 @@ namespace Lskj.Control
}
/// <summary>
/// 设置数值的编辑格式
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void GridView_ShowingEditor(object sender, CancelEventArgs e)
{
GridColumn gridColumn = bandedGridView.FocusedColumn;
if (gridColumn != null && gridColumn.Tag != null)
{
GridColumnModel model = (GridColumnModel)gridColumn.Tag;
if (model.FormatEditBox && (model.FieldType == ControlType.LabTextInt || model.FieldType == ControlType.LabCalcText || model.FieldType == ControlType.LabAccount) && gridColumn.RealColumnEdit != null && !gridColumn.RealColumnEdit.EditFormat.FormatString.Equals(model.DataFormat))
{
gridColumn.RealColumnEdit.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
gridColumn.RealColumnEdit.EditFormat.FormatString = model.DataFormat;
}
}
}
}
}
+32 -1
View File
@@ -143,4 +143,35 @@ namespace Lskj.Control
/// <param name="panel"></param>
protected void GetCharWidthMultilingual(Label label, string text, Panel panel)
{
//之前只对非中文模式生效,后发现GetCharWidth()方法计算不准确,就改成通用设置
//Business.Impl.LanguageTranslation.Translatable &&
if (text.Length > 0)
{
using (Graphics graphics = label.CreateGraphics())
{
// 使用TextRenderer而不是Graphics.MeasureString,以匹配Label的文本渲染方式
Size textSize = TextRenderer.MeasureText(graphics, text, label.Font);
panel.Width= textSize.Width;
}
}
}
public BaseUserControl()
{
InitializeComponent();
}
public void ModifyDefaultColors(Color color)
{
DefaultLabelForceColor = color;
}
public void ModifyAuditDefaultColors(Color color)
{
DefaultLabelForceColor = color;
ReadOnlyLabelForceColor = color;
}
}
}
+44 -1
View File
@@ -1098,4 +1098,47 @@ namespace Lskj.MiniBlink
return InvokeJSW("return document.documentElement.outerHTML").ToString();
}
else
{
return string.Empty;
}
}
set
{
if (handle != IntPtr.Zero)
{
BlinkBrowserPInvoke.wkeLoadHTMLW(this.handle, value);
}
}
}
public string Url
{
get { return url; }
set
{
url = value;
if (handle != IntPtr.Zero)
{
BlinkBrowserPInvoke.wkeLoadURLW(handle, url);
}
}
}
public string Cookies
{
get
{
if (handle != IntPtr.Zero)
{
return BlinkBrowserPInvoke.Utf8IntptrToString(BlinkBrowserPInvoke.wkeGetCookie(handle));
}
else
{
return string.Empty;
}
}
}
}
}
@@ -124,4 +124,38 @@ namespace Lskj.Control.BrowserSetting
{
baseForm.Invoke(new Action(() =>
{
BsOpenModuleHandler.AddReturn
BsOpenModuleHandler.AddReturnRow(arg0);
if (isclose)
{
baseForm.DialogResult = DialogResult.OK;
baseForm.Close();
}
}));
}
else
{
BsOpenModuleHandler.AddReturnRow(arg0);
if (isclose)
{
baseForm.DialogResult = DialogResult.OK;
baseForm.Close();
}
}
}
}
return base.OnProcessMessageReceived(browser, frame, sourceProcess, message);
}
public void Created(CefBrowser cefBrowser)
{
if (OnCreated != null)
{
OnCreated(cefBrowser, EventArgs.Empty);
}
}
}
}
@@ -188,4 +188,32 @@ namespace Lskj.Control.BrowserSetting
//}
}
/// <summary>
/// 通过 CefBrowser 获取所在
/// 通过 CefBrowser 获取所在的 WinForms 窗口
/// </summary>
public static Form GetParentForm(CefBrowser browser,out string ModuleCode)
{
ModuleCode = "";
try
{
if (browser == null) return null;
IntPtr browserHandle = browser.GetHost().GetWindowHandle();
if (browserHandle == IntPtr.Zero) return null;
IntPtr parentHandle = GetParent(browserHandle);
if (parentHandle == IntPtr.Zero) return null;
System.Windows.Forms.Control control = System.Windows.Forms.Control.FromHandle(parentHandle);
if (control != null && control.Parent != null && control.Parent.Parent != null)
{
ModuleCode = (control.Parent.Parent).Tag + "";
}
return control as Form;
}
catch (Exception ex)
{
}
return null;
}
}
}
@@ -73,4 +73,27 @@ namespace Lskj.Control.BrowserSetting
}
break;
case 38://↑
if (keyEvent.EventT
if (keyEvent.EventType.Equals(CefKeyEventType.RawKeyDown))
{
bool ctrlDown = (keyEvent.Modifiers & CefEventFlags.ControlDown) != 0;
if (ctrlDown && browser.GetHost().GetZoomLevel() < 3)
{
browser.GetHost().SetZoomLevel(browser.GetHost().GetZoomLevel() + 0.1);
}
}
break;
case 40://↓
if (keyEvent.EventType.Equals(CefKeyEventType.RawKeyDown))
{
bool ctrlDown = (keyEvent.Modifiers & CefEventFlags.ControlDown) != 0;
if (ctrlDown && browser.GetHost().GetZoomLevel() > -3)
{
browser.GetHost().SetZoomLevel(browser.GetHost().GetZoomLevel() - 0.1);
}
}
break;
}
return false;
}
}
}
@@ -17,4 +17,33 @@ namespace Lskj.Control.BrowserSetting
}
protected override void OnAfterCreated(Xilium.CefGlue.CefBrowser browser)
{
base.OnAfterCreated(browser
base.OnAfterCreated(browser);
BsClient.Created(browser);
}
protected override void OnBeforeClose(CefBrowser browser)
{
base.OnBeforeClose(browser);
}
protected override bool OnBeforePopup(
CefBrowser browser,
CefFrame frame,
string targetUrl,
string targetFrameName,
CefWindowOpenDisposition targetDisposition,
bool userGesture,
CefPopupFeatures popupFeatures,
CefWindowInfo windowInfo,
ref CefClient client,
CefBrowserSettings settings,
ref CefDictionaryValue extraInfo,
ref bool noJavascriptAccess)
{
if (BsExternalProtocolHandler.TryHandle(targetUrl))
return true;
return base.OnBeforePopup(browser, frame, targetUrl, targetFrameName, targetDisposition,
userGesture, popupFeatures, windowInfo, ref client, settings, ref extraInfo, ref noJavascriptAccess);
}
}
}
@@ -323,4 +323,35 @@ namespace Lskj.Control.BrowserSetting
{
if (!string.IsNullOrWhiteSpace(rowdata) && StaticControl.RightMenuGridView != null)
{
JObject
JObject rowObject = JsonConvert.DeserializeObject<JObject>(rowdata);
JArray jArray = new JArray();
jArray.Add(rowObject);
DataTable dataTable = JsonConvert.DeserializeObject<DataTable>(JsonConvert.SerializeObject(jArray));
DataTable gridTable = (StaticControl.RightMenuGridView.GridControl.DataSource as DataTable).TrimDeleteRows();
if (gridTable == null) return;
GridColumnCollection gridColumns = StaticControl.RightMenuGridView.Columns;
if (!string.IsNullOrWhiteSpace(StaticControl.Comprefix) && dataTable.Columns.Contains("ProductId"))
{
dataTable.Columns["ProductId"].ColumnName = StaticControl.Comprefix+"ProductId"; // 将ProductId加上前缀
}
DataRow rowItem = dataTable.Rows[0];
StaticControl.ReturnRowLisy.Add(rowItem);
}
}
}
}
@@ -23,4 +23,30 @@ namespace Lskj.Control.BrowserSetting
native function OpenModule();
return OpenModule(menuId, menuName, dllName, modelFlag, urlParams);
};
boundObject.OpenOnRightClick = function(arrayItem, rightId,MenuN
boundObject.OpenOnRightClick = function(arrayItem, rightId,MenuName,mMenuCode)
{
native function OpenOnRightClick();
return OpenOnRightClick(arrayItem, rightId,MenuName,mMenuCode);
};
boundObject.CloseWin = function()
{
native function CloseWin();
return CloseWin();
};
boundObject.SelectPro = function(rowdata,isclose)
{
native function SelectPro();
return SelectPro(rowdata,isclose);
};
})();
";
CefRuntime.RegisterExtension("boundObject", extensionCode, bsOpenModuleHandler);
base.OnWebKitInitialized();
}
protected override void OnContextCreated(CefBrowser browser, CefFrame frame, CefV8Context context)
{
bsOpenModuleHandler.V8Context = context;
base.OnContextCreated(browser, frame, context);
}
}
}
@@ -73,4 +73,34 @@ namespace Lskj.Control.BrowserSetting
System.Diagnostics.Process.Start(processStartInfo);
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(
"打开打印程序失败:" + ex.Message,
"提示",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Warning);
}
return true;
}
}
internal sealed class BsExternalProtocolResourceRequestHandler : CefResourceRequestHandler
{
protected override CefCookieAccessFilter GetCookieAccessFilter(CefBrowser browser, CefFrame frame, CefRequest request)
{
return null;
}
protected override void OnProtocolExecution(CefBrowser browser, CefFrame frame, CefRequest request, ref bool allowOsExecution)
{
if (BsExternalProtocolHandler.IsPrintProtocol(request.Url))
{
allowOsExecution = true;
return;
}
base.OnProtocolExecution(browser, frame, request, ref allowOsExecution);
}
}
}
@@ -340,4 +340,28 @@ namespace Lskj.Control.BrowserSetting
byteRequest = Encoding.UTF8.GetBytes(builder.ToString());
break;
}
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();
cookie = httpWebRequest.CookieContainer;
cookieCollection = cookie.GetCookies(new Uri(url));
return httpWebResponse;
}
catch (Exception ex)
{
cookieCollection = null;
result = ex.Message;
return httpWebResponse;
}
}
}
}
@@ -89,4 +89,34 @@ namespace Lskj.Control.BrowserSetting2
}
else
{
BrowserSetting.BsOpenModuleHandler.OpenRightModule(arg0, ar
BrowserSetting.BsOpenModuleHandler.OpenRightModule(arg0, arg1, arg2, arg3);
}
}
else if (message.Name.Equals("CloseWin"))
{
if (frmWebBrowser != null && frmWebBrowser.Parent != null && frmWebBrowser.Parent.Parent != null && frmWebBrowser.Parent.Parent is BaseForm baseForm)
{
if (baseForm.InvokeRequired)
{
baseForm.Invoke(new Action(() =>
{
baseForm.Close();
}));
}
else
{
baseForm.Close();
}
}
}
return base.OnProcessMessageReceived(browser, frame, sourceProcess, message);
}
public void Created(CefBrowser cefBrowser)
{
if (OnCreated != null)
{
OnCreated(cefBrowser, EventArgs.Empty);
}
}
}
}
@@ -77,4 +77,27 @@ namespace Lskj.Control.BrowserSetting2
}
break;
case 38://↑
if (keyEvent.EventT
if (keyEvent.EventType.Equals(CefKeyEventType.RawKeyDown))
{
bool ctrlDown = (keyEvent.Modifiers & CefEventFlags.ControlDown) != 0;
if (ctrlDown && browser.GetHost().GetZoomLevel() < 3)
{
browser.GetHost().SetZoomLevel(browser.GetHost().GetZoomLevel() + 0.1);
}
}
break;
case 40://↓
if (keyEvent.EventType.Equals(CefKeyEventType.RawKeyDown))
{
bool ctrlDown = (keyEvent.Modifiers & CefEventFlags.ControlDown) != 0;
if (ctrlDown && browser.GetHost().GetZoomLevel() > -3)
{
browser.GetHost().SetZoomLevel(browser.GetHost().GetZoomLevel() - 0.1);
}
}
break;
}
return false;
}
}
}
+21 -1
View File
@@ -131,4 +131,24 @@
this.pl_buttom.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pl_main)).EndInit();
this.pl_main.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitMain)).EndInit();
this.splitMain.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).EndInit();
((System.ComponentModel.ISupportInitialize)(pieSeriesView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(series1)).EndInit();
((System.ComponentModel.ISupportInitialize)(pointSeriesLabel1)).EndInit();
((System.ComponentModel.ISupportInitialize)(lineSeriesView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cmMain)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.PanelControl pl_buttom;
private DevExpress.XtraEditors.PanelControl pl_main;
private GridControlEx gridControlEx1;
private DevExpress.XtraEditors.SplitContainerControl splitMain;
public DevExpress.XtraCharts.ChartControl cmMain;
}
}
+42 -1
View File
@@ -601,4 +601,45 @@ namespace Lskj.Control
/// <summary>
/// The y axis shared
/// </summary>
public int YAxisShar
public int YAxisShared;
/// <summary>
/// The y axis title
/// </summary>
public string YAxisTitle;
/// <summary>
/// The x label field
/// </summary>
public string XLabelField;
/// <summary>
/// The y value field
/// </summary>
public string YValueField;
/// <summary>
/// The chart color
/// </summary>
public string ChartColor;
/// <summary>
/// The chart type
/// </summary>
public ChartType ChartType;
/// <summary>
/// 是否为百分比
/// </summary>
public string IsAbsolutely;
/// <summary>
/// Y轴最大刻度
/// </summary>
public double YScale;
/// <summary>
/// 禁显数字
/// </summary>
public bool ValueVisible;
/// <summary>
/// 图表标题
/// </summary>
public string ChartTitle;
}
}
+36 -1
View File
@@ -1 +1,36 @@
namespace Lskj.Cont
namespace Lskj.Control
{
partial class CircleButton
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}
+36 -1
View File
@@ -131,4 +131,39 @@ namespace Lskj.Control
private void SyncSize()
{
Width = Height = _radius * 2;
UpdateRegion();
Invalidate();
}
private void UpdateRegion()
{
try
{
GraphicsPath gp = new GraphicsPath();
gp.AddEllipse(0, 0, Width, Height);
Region?.Dispose();
Region = new Region(gp);
}
catch (Exception ex) { Debug.WriteLine(ex); }
}
/* 隐藏 Size(设计器防误改) */
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Size Size
{
get => base.Size;
set => base.Size = value;
}
public void SetMenuNum(int num)
{
if (SystemInfo.Instance.DisableShowNotify || num < 1)
{
this.Visible = false;
return;
}
this.Number = num;
this.Visible = true;
}
}
}
+26 -1
View File
@@ -36,4 +36,29 @@ namespace Lskj.Control
// txtEdit
//
this.txtEdit.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtEdit.Loca
this.txtEdit.Location = new System.Drawing.Point(0, 0);
this.txtEdit.Name = "txtEdit";
this.txtEdit.Size = new System.Drawing.Size(800, 450);
this.txtEdit.TabIndex = 1;
//
// FrmAnnouncement
//
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
this.Appearance.Options.UseBackColor = true;
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(800, 450);
this.Controls.Add(this.txtEdit);
this.Name = "FrmAnnouncement";
this.Text = "公告";
((System.ComponentModel.ISupportInitialize)(this.txtEdit.Properties)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.MemoEdit txtEdit;
}
}
+29 -1
View File
@@ -124,4 +124,32 @@ namespace Lskj.Control
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show("选择å
MessageUtil.Show("选择反退步骤确定操作出错!" + Message);
}
}
/// <summary>
/// <para>说明:取消操作/para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-01-23</para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void btnCancel_Click(object sender, EventArgs e)
{
try {
if (BtnCancelCallBack != null) BtnCancelCallBack(sender, e);
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
}
}
+20 -1
View File
@@ -283,4 +283,23 @@
#endregion
private System.Windows.Forms.Label lab
private System.Windows.Forms.Label lable1;
private DevExpress.XtraEditors.PanelControl panelControl5;
private System.Windows.Forms.Label lblFP;
private System.Windows.Forms.Label label2;
private DevExpress.XtraEditors.PanelControl panelControl3;
private GridControlEx gcMain;
private System.Windows.Forms.Label lblTotal;
private DevExpress.XtraEditors.PanelControl panelControl2;
private DevExpress.XtraEditors.PanelControl panelControl6;
private System.Windows.Forms.Label lblSY;
private System.Windows.Forms.Label label4;
private DevExpress.XtraEditors.PanelControl panelControl4;
private DevExpress.XtraEditors.SimpleButton btnCancel;
private DevExpress.XtraEditors.SimpleButton btnFP;
private DevExpress.XtraEditors.PanelControl PlSearch;
private DevExpress.XtraEditors.SimpleButton btnJ;
private DevExpress.XtraEditors.SimpleButton btnDel;
private DevExpress.XtraEditors.SimpleButton btnUpdate;
}
}
+27 -1
View File
@@ -567,4 +567,30 @@ namespace Lskj.Control
/// <para>说明:行颜色</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期: </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs"/> instance containing the event data.</param>
void GridView_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
{
try
{
DataRow rowItem = this.gcMain.GridView.GetDataRow(e.RowHandle);
double total = Convert.ToDouble(rowItem[KcAmountField]);
double fpAmount = Convert.ToDouble(rowItem[AmountField]);
if (fpAmount > 0)
{
e.Appearance.BackColor = total - fpAmount <= 0 ? Color.Green : Color.Red;
}
}
catch (Exception)
{
}
}
}
}
+26 -1
View File
@@ -38,4 +38,29 @@ namespace Lskj.Control
this.gridcolor.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridcolor.Location = new System.Drawing.Point(0, 0);
this.gridcolor.Margin = new System.Windows.Forms.Padding(4);
this.gridcolor.Name = "gridcolor";
this.gridcolor.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
this.gridcolor.Size = new System.Drawing.Size(800, 450);
this.gridcolor.SysModel = null;
this.gridcolor.TabIndex = 8;
//
// FrmColorDescription
//
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
this.Appearance.Options.UseBackColor = true;
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(800, 450);
this.Controls.Add(this.gridcolor);
this.Name = "FrmColorDescription";
this.Text = "颜色说明";
this.ResumeLayout(false);
}
#endregion
private GridControlEx gridcolor;
}
}
+29 -1
View File
@@ -88,4 +88,32 @@ namespace Lskj.Control
//ifStrickOutColumn.Visible = true;
//ifStrickOutColumn.VisibleIndex = 10;
//GridColumn ii
//GridColumn iifUnderLineColumn = new GridColumn();
//iifUnderLineColumn.Caption = "下划线";
//iifUnderLineColumn.FieldName = "ifUnderLine";
//iifUnderLineColumn.ColumnEdit = checkEdit;
//iifUnderLineColumn.Visible = true;
//iifUnderLineColumn.VisibleIndex = 11;
//GridColumn useflagColumn = new GridColumn();
//useflagColumn.Caption = "禁用";
//useflagColumn.FieldName = "useflag";
//useflagColumn.ColumnEdit = checkEdit;
//useflagColumn.Visible = true;
//useflagColumn.VisibleIndex = 12;
this.gridcolor.GridView.Columns.AddRange(new GridColumn[] {
conditionColumn,
forcecolorColumn,
backcolorColumn,
//ifBoldColumn,
//ifItalicColumn,
//ifStrickOutColumn,
//iifUnderLineColumn,
//useflagColumn
});
}
}
}
+38 -1
View File
@@ -205,4 +205,41 @@ namespace Lskj.Control
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Messag
MessageUtil.Show(Message,ex.Message);
}
}
private void simpleButton24_Click(object sender, EventArgs e)
{
try {
if (this.mPage < this.mMaxPage)
{
this.mPage += 1;
this.InitControl();
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
private void simpleButton25_Click(object sender, EventArgs e)
{
try {
if (this.mPage == this.mMaxPage) return;
this.mPage = this.mMaxPage;
this.InitControl();
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
}
}
+38 -1
View File
@@ -213,4 +213,41 @@ namespace Lskj.Control
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Messa
MessageUtil.Show(Message,ex.Message);
}
}
private void simpleButton24_Click(object sender, EventArgs e)
{
try {
if (this.mPage < this.mMaxPage)
{
this.mPage += 1;
this.InitControl();
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
private void simpleButton25_Click(object sender, EventArgs e)
{
try {
if (this.mPage == this.mMaxPage) return;
this.mPage = this.mMaxPage;
this.InitControl();
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
}
}
+26 -1
View File
@@ -112,4 +112,29 @@
this.Appearance.Options.UseBackColor = true;
this.Appearance.Options.UseFont = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(751, 542);
this.Controls.Add(this.gcMain);
this.Controls.Add(this.pl_bottom);
this.Controls.Add(this.pl_top);
this.Name = "FrmCover";
this.Text = "导入Excel";
((System.ComponentModel.ISupportInitialize)(this.pl_top)).EndInit();
this.pl_top.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pl_bottom)).EndInit();
this.pl_bottom.ResumeLayout(false);
this.pl_bottom.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.PanelControl pl_top;
private DevExpress.XtraEditors.SimpleButton btnCover;
private DevExpress.XtraEditors.SimpleButton btnRead;
private DevExpress.XtraEditors.PanelControl pl_bottom;
private System.Windows.Forms.Label label1;
private Control.GridControlEx gcMain;
}
}
+31
View File
@@ -1066,3 +1066,34 @@ namespace Lskj.Control
string[] fields = model.UnionFields.Trim(',').Split(',');
DataRow rowResult = BaseImpl.GetDataRowResult(unionValues);
if (rowResult != null)
{
for (int i = 0; i < fields.Length; i++)
{
string field = fields[i];
string value = rowResult.Table.Columns.Contains(field) ? rowResult[field] + "" : null;
rowItem[field] = value;
}
}
else
{
// 设置为空
for (int i = 0; i < fields.Length; i++)
{
string field = fields[i];
rowItem[field] = DBNull.Value;
}
}
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
LogUtil.WriteError("计算列关联字段--错误-->" + unionValues, ex);
}
}
}
}
}
+27 -1
View File
@@ -346,4 +346,30 @@ namespace Lskj.Control
/// <para>说明:取消</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-02-23 </para>
/// <par
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void OnCancel(object sender, EventArgs e)
{
try
{
if (!isFinished && DialogResult.Yes == MessageBox.Show("附件正在下载确定取消下载吗?", ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
{
evtDownload.Set();
evtPerDonwload.Set();
Exit(false);
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show("附件下载取消出错!" + Message);
}
}
}
}
+33 -1
View File
@@ -1035,4 +1035,36 @@ namespace Lskj.Control
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版æ
/// <para>版本:1.0.0.3</para>
/// </summary>
/// <param name="control">The control.</param>
/// <returns>DataTable.</returns>
public string GetValueByImportText(GridColumnModel model, string text, bool isBillImport = false)
{
string value = text;
Dictionary<string, string> translationDict = null;
if (ValueGridColumnTable.TryGetValue(model, out translationDict))
{
if (translationDict != null && translationDict.Count > 0)
{
if (translationDict.TryGetValue(text, out string translatedValue))
{
value = translatedValue;
}
else
{
value = text;
}
}
else
{
value = "";
}
}
return value;
}
}
}
+35 -1
View File
@@ -288,4 +288,38 @@ namespace Lskj.Control
{
try
{
if (this.mPage == this.mMaxPage) return;
if (this.mPage == this.mMaxPage) return;
this.mPage = this.mMaxPage;
this.InitControl();
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
private void simpleButton5_Click(object sender, EventArgs e)
{
try
{
this.DialogResult = System.Windows.Forms.DialogResult.OK;
this.ShowText = this.ShowText.TrimStart(',');
this.ShowValue = this.ShowValue.TrimStart(',');
this.Close();
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
private void simpleButton6_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
+26 -1
View File
@@ -173,4 +173,29 @@
this.Text = "导入Excel";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnImportFormClosing);
((System.ComponentModel.ISupportInitialize)(this.pl_top)).EndInit();
this.pl_top.ResumeLayout(false
this.pl_top.ResumeLayout(false);
this.pl_top.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pl_bottom)).EndInit();
this.pl_bottom.ResumeLayout(false);
this.pl_bottom.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pl_main)).EndInit();
this.pl_main.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.PanelControl pl_top;
private DevExpress.XtraEditors.PanelControl pl_bottom;
private DevExpress.XtraEditors.PanelControl pl_main;
private DevExpress.XtraEditors.SimpleButton btnExport;
private DevExpress.XtraEditors.SimpleButton btnImport;
private DevExpress.XtraEditors.SimpleButton btnRead;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private GridControlEx gcMain;
private DevExpress.XtraEditors.SimpleButton btnCover;
}
}
+31
View File
@@ -1281,3 +1281,34 @@ namespace Lskj.Control
string[] fields = model.UnionFields.Trim(',').Split(',');
DataRow rowResult = BaseImpl.GetDataRowResult(unionValues);
if (rowResult != null)
{
for (int i = 0; i < fields.Length; i++)
{
string field = fields[i];
string value = rowResult.Table.Columns.Contains(field) ? rowResult[field] + "" : null;
rowItem[field] = value;
}
}
else
{
// 设置为空
for (int i = 0; i < fields.Length; i++)
{
string field = fields[i];
rowItem[field] = DBNull.Value;
}
}
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
LogUtil.WriteError("计算列关联字段--错误-->" + unionValues, ex);
}
}
}
}
}
+24 -1
View File
@@ -67,4 +67,27 @@ namespace Lskj.Control
//
// FrmPicture
//
this.Appearance.Back
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
this.Appearance.Options.UseBackColor = true;
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(787, 571);
this.Controls.Add(this.lbRight);
this.Controls.Add(this.lbLeft);
this.Controls.Add(this.pictureEdit);
this.Name = "FrmPicture";
this.Text = "FrmPicture";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
((System.ComponentModel.ISupportInitialize)(this.pictureEdit.Properties)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.PictureEdit pictureEdit;
private System.Windows.Forms.Label lbLeft;
private System.Windows.Forms.Label lbRight;
}
}
+22 -1
View File
@@ -71,4 +71,25 @@ namespace Lskj.Control
if (index >= 0 && index - 1 >= 0)
{
FocusedColumn = PicUrlColumns[index - 1];
if (FocusedColumn.Tag != null && FocusedColumn.Tag is GridColumnModel columnModel)
{
string imageUrl = FocusedRow.Table.Columns.Contains(columnModel.FieldName) ? FocusedRow[columnModel.FieldName] + "" : "";
if (string.IsNullOrEmpty(imageUrl))
{
return;
}
if (!imageUrl.StartsWith("http"))
{
string oaUrl = SystemInfo.Instance.OAUrl.EndsWith("/") ? SystemInfo.Instance.OAUrl : $"{SystemInfo.Instance.OAUrl}/";
imageUrl = $"{oaUrl}{imageUrl}";
}
if (columnModel.LabPicUrlImages.ContainsKey(imageUrl))
{
Image image = ((KeyValuePair<Image, Image>)columnModel.LabPicUrlImages[imageUrl]).Key;
Picture = image;
}
}
}
}
}
}
+25 -1
View File
@@ -79,4 +79,28 @@ namespace Lskj.Control
this.gridView.OptionsView.ColumnHeaderAutoHeight = DevExpress.Utils.DefaultBoolean.True;
this.gridView.OptionsView.RowAutoHeight = true;
this.gridView.OptionsView.ShowGroupPanel = false;
this.gridView.PaintStyleNam
this.gridView.PaintStyleName = "Skin";
//
// FrmPositioningColumn
//
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
this.Appearance.Options.UseBackColor = true;
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(535, 309);
this.Controls.Add(this.gridControl);
this.Name = "FrmPositioningColumn";
this.Text = "双击定位到选中列";
((System.ComponentModel.ISupportInitialize)(this.gridControl)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridView)).EndInit();
this.ResumeLayout(false);
}
#endregion
public DevExpress.XtraGrid.GridControl gridControl;
private DevExpress.XtraGrid.Views.Grid.GridView gridView;
}
}
+32 -1
View File
@@ -62,4 +62,35 @@ namespace Lskj.Control
Caption,
});
// åˆå§‹åŒ
// 初始化DataTable
if (this.ColumnInformation.Count > 0)
{
DataTable dataTable = new DataTable();
dataTable.Columns.Add("Caption", typeof(string));
dataTable.Columns.Add("FieldName", typeof(string));
foreach (string item in ColumnInformation.Keys)
{
string value = ColumnInformation[item];
dataTable.Rows.Add(value, item);
}
this.gridControl.DataSource = dataTable;
}
}
private void GridView_DoubleClick(object sender, EventArgs e)
{
this.FindName = string.Empty;
DataRow rowItem = this.gridView.GetFocusedDataRow();
if (rowItem != null)
{
this.FindName = rowItem["FieldName"] + "";
this.Close();
this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More