基线 SVN r240

SVN-Revision: r240
This commit is contained in:
cyf
2025-02-06 06:46:06 +00:00
commit ab56a9bcf7
5317 changed files with 902274 additions and 0 deletions
@@ -0,0 +1,47 @@
/***********************
* 说明:单据条码录入模块入口
* 创建人:龚宇超
* 创建日期:2018-04-28
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
***********************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Lskj.Util;
using Lskj.Business;
using Lskj.Model;
namespace Lskj.PubBillDetail
{
public class DllBaseClass : IForm
{
public DllBaseClass()
{
}
public DllBaseClass(string[] obj)
{
FrmInputBarCode frmMain = new FrmInputBarCode();
try
{
DynamicBillInputBarModel SysModel= new DynamicBillInputBarModel(obj);
FrmInputBarCode main = new FrmInputBarCode(SysModel.FormText);
this.SubForm = main;
main.SysModel = SysModel;
}
catch (Exception ex)
{
LogUtil.WriteError("Lskj.PubBillDetail.dll--参数错误-->" + obj.ToString(), ex);
}
}
public Form SubForm { get; set; }
}
}
+176
View File
@@ -0,0 +1,176 @@
namespace Lskj.PubBillDetail
{
partial class FrmImportBarCode
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
this.btnExport = new DevExpress.XtraEditors.SimpleButton();
this.btnInverseSelect = new DevExpress.XtraEditors.SimpleButton();
this.btnAllSelect = new DevExpress.XtraEditors.SimpleButton();
this.btnClose = new DevExpress.XtraEditors.SimpleButton();
this.btnConfirmImport = new DevExpress.XtraEditors.SimpleButton();
this.btnReadExl = new DevExpress.XtraEditors.SimpleButton();
this.panelControl2 = new DevExpress.XtraEditors.PanelControl();
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.gridImport = new Lskj.Control.GridControlEx();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
this.panelControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.panelControl2)).BeginInit();
this.panelControl2.SuspendLayout();
this.SuspendLayout();
//
// panelControl1
//
this.panelControl1.Controls.Add(this.btnExport);
this.panelControl1.Controls.Add(this.btnInverseSelect);
this.panelControl1.Controls.Add(this.btnAllSelect);
this.panelControl1.Controls.Add(this.btnClose);
this.panelControl1.Controls.Add(this.btnConfirmImport);
this.panelControl1.Controls.Add(this.btnReadExl);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.panelControl1.Location = new System.Drawing.Point(0, 0);
this.panelControl1.Name = "panelControl1";
this.panelControl1.Size = new System.Drawing.Size(699, 34);
this.panelControl1.TabIndex = 0;
//
// btnExport
//
this.btnExport.Location = new System.Drawing.Point(624, 4);
this.btnExport.Name = "btnExport";
this.btnExport.Size = new System.Drawing.Size(65, 25);
this.btnExport.TabIndex = 5;
this.btnExport.Text = "导出模板";
this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
//
// btnInverseSelect
//
this.btnInverseSelect.Location = new System.Drawing.Point(288, 4);
this.btnInverseSelect.Name = "btnInverseSelect";
this.btnInverseSelect.Size = new System.Drawing.Size(65, 25);
this.btnInverseSelect.TabIndex = 4;
this.btnInverseSelect.Text = "反选";
this.btnInverseSelect.Click += new System.EventHandler(this.btnInverseSelect_Click);
//
// btnAllSelect
//
this.btnAllSelect.Location = new System.Drawing.Point(218, 4);
this.btnAllSelect.Name = "btnAllSelect";
this.btnAllSelect.Size = new System.Drawing.Size(65, 25);
this.btnAllSelect.TabIndex = 3;
this.btnAllSelect.Text = "全选";
this.btnAllSelect.Click += new System.EventHandler(this.btnAllSelect_Click);
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(147, 4);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(65, 25);
this.btnClose.TabIndex = 2;
this.btnClose.Text = "关闭";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnConfirmImport
//
this.btnConfirmImport.Location = new System.Drawing.Point(76, 4);
this.btnConfirmImport.Name = "btnConfirmImport";
this.btnConfirmImport.Size = new System.Drawing.Size(65, 25);
this.btnConfirmImport.TabIndex = 1;
this.btnConfirmImport.Text = "确认导入";
this.btnConfirmImport.Click += new System.EventHandler(this.btnConfirmImport_Click);
//
// btnReadExl
//
this.btnReadExl.Location = new System.Drawing.Point(5, 4);
this.btnReadExl.Name = "btnReadExl";
this.btnReadExl.Size = new System.Drawing.Size(65, 25);
this.btnReadExl.TabIndex = 0;
this.btnReadExl.Text = "读取Excel";
this.btnReadExl.Click += new System.EventHandler(this.btnReadExl_Click);
//
// panelControl2
//
this.panelControl2.Controls.Add(this.labelControl1);
this.panelControl2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelControl2.Location = new System.Drawing.Point(0, 440);
this.panelControl2.Name = "panelControl2";
this.panelControl2.Size = new System.Drawing.Size(699, 29);
this.panelControl2.TabIndex = 1;
//
// labelControl1
//
this.labelControl1.Location = new System.Drawing.Point(11, 8);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(472, 14);
this.labelControl1.TabIndex = 0;
this.labelControl1.Text = "操作提示:请先读取需要导入条码的Excel文件,然后过滤数据核对后,点击【确认导入】";
//
// gridImport
//
this.gridImport.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridImport.Location = new System.Drawing.Point(0, 34);
this.gridImport.Name = "gridImport";
this.gridImport.Size = new System.Drawing.Size(699, 406);
this.gridImport.TabIndex = 2;
//
// FormImportBarCode
//
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
this.Appearance.Font = new System.Drawing.Font("宋体", 9F);
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(699, 469);
this.Controls.Add(this.gridImport);
this.Controls.Add(this.panelControl2);
this.Controls.Add(this.panelControl1);
this.Name = "FormImportBarCode";
this.Text = "条码录入";
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit();
this.panelControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.panelControl2)).EndInit();
this.panelControl2.ResumeLayout(false);
this.panelControl2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.PanelControl panelControl1;
private DevExpress.XtraEditors.PanelControl panelControl2;
private Control.GridControlEx gridImport;
private DevExpress.XtraEditors.LabelControl labelControl1;
private DevExpress.XtraEditors.SimpleButton btnReadExl;
private DevExpress.XtraEditors.SimpleButton btnConfirmImport;
private DevExpress.XtraEditors.SimpleButton btnClose;
private DevExpress.XtraEditors.SimpleButton btnAllSelect;
private DevExpress.XtraEditors.SimpleButton btnInverseSelect;
private DevExpress.XtraEditors.SimpleButton btnExport;
}
}
@@ -0,0 +1,251 @@
/***********************
* 说明:条码导入模块
* 创建人:龚宇超
* 创建日期:2018-05-02
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
***********************/
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;
using Lskj.Control;
using Lskj.Control.Model;
using Lskj.Util;
using Lskj.Business.Impl;
using Lskj.Data;
using DevExpress.XtraGrid.Columns;
using Lskj.Business;
namespace Lskj.PubBillDetail
{
public partial class FrmImportBarCode : BaseForm
{
public FrmImportBarCode()
{
InitializeComponent();
}
/// <summary>
/// 注册事件
/// </summary>
/// <param name="uCode"></param>
/// <param name="uAmount"></param>
/// <param name="uGroup"></param>
/// <param name="uJydh"></param>
public delegate bool AddBarCodeEventHandler(string uCode, string uAmount, string uGroup, string uJydh);
public AddBarCodeEventHandler AddBaeCodeEvent;
/// <summary>
/// 导入数据源
/// </summary>
private DataTable _dtImport = new DataTable();
/// <summary>
/// <para>说明:窗体加载时</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-05-02 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
protected override void OnLoad(EventArgs e)
{
try
{
this.gridImport.SetEditColumns(BillImpl.SetBarCodeImportantColumns());
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:读取Excel</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-05-02 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnReadExl_Click(object sender, EventArgs e)
{
try
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Title = "导入文件选择";
ofd.Filter = "Excel文件(*.xls)|*.xls";
if (ofd.ShowDialog() == DialogResult.OK)
{
_dtImport = this.gridImport.GridView.ToExcelDataTable(ofd.FileName, "");
DataColumn check = new DataColumn();
check.ColumnName = "xd";
check.DataType = System.Type.GetType("System.Boolean");
check.DefaultValue = false;
_dtImport.Columns.Add(check);
this.gridImport.SetGridViewDataSource(_dtImport);
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:确认导入</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-05-02 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnConfirmImport_Click(object sender, EventArgs e)
{
try
{
if (MessageUtil.Show(ResourceKeys.IsImportantSelectBarCode, MessageBoxButtons.YesNo) == DialogResult.Yes)
{
for (int i = 0; i < gridImport.GridView.DataRowCount; i++)
{
DataRow row = this.gridImport.GridView.GetDataRow(i);
if (Convert.ToBoolean(row["xd"]))
{
if (!AddBaeCodeEvent(row["条码"] + "", row["数量"] + "", row["分组"] + "", row["检验单号"] + "")) return;
}
}
MessageUtil.Show(ResourceKeys.BarCodeImportFinish);
for (int row = gridImport.GridView.DataRowCount - 1; row >= 0; row--)
{
DataRow dataRow = this.gridImport.GridView.GetDataRow(row);
if (Convert.ToBoolean(dataRow["xd"]))
{
dataRow.Delete();
}
}
}
}
catch (Exception ex)
{
LogUtil.WriteError("确认导入事件出错!", ex);
//MessageUtil.Show("确认导入事件出错!" + ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:关闭</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-05-02 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnClose_Click(object sender, EventArgs e)
{
try
{
this.DialogResult = DialogResult.Cancel;
}
catch (Exception ex)
{
//MessageUtil.Show(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:全选</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-05-02 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnAllSelect_Click(object sender, EventArgs e)
{
try
{
foreach (DataRow datarow in _dtImport.Rows)
{
if (Convert.ToBoolean(datarow["xd"]) == false)
{
datarow["xd"] = true;
}
}
}
catch (Exception ex)
{
//MessageUtil.Show(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:反选</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-05-02 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnInverseSelect_Click(object sender, EventArgs e)
{
try
{
foreach (DataRow row in _dtImport.Rows)
{
row["xd"] = !Convert.ToBoolean(row["xd"]);
}
this.gridImport.SetGridViewDataSource(_dtImport);
}
catch (Exception ex)
{
//MessageUtil.Show(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:导出</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-05-02 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnExport_Click(object sender, EventArgs e)
{
try
{
GridColumn Column = gridImport.GridView.Columns.ColumnByFieldName("xd");
Column.Visible = false;
this.gridImport.gridControl.ToExcel("条码导出");
Column.Visible = true;
}
catch (Exception ex)
{
//MessageUtil.Show(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
}
}
@@ -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>
+377
View File
@@ -0,0 +1,377 @@
namespace Lskj.PubBillDetail
{
partial class FrmInputBarCode
{
/// <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 Windows
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.pl_top = new DevExpress.XtraEditors.PanelControl();
this.lbProductColor = new DevExpress.XtraEditors.LabelControl();
this.lbProductBrand = new DevExpress.XtraEditors.LabelControl();
this.lbProductSpec = new DevExpress.XtraEditors.LabelControl();
this.lbProductName = new DevExpress.XtraEditors.LabelControl();
this.lbProductType = new DevExpress.XtraEditors.LabelControl();
this.lbProductModel = new DevExpress.XtraEditors.LabelControl();
this.lbProductId = new DevExpress.XtraEditors.LabelControl();
this.label7 = new DevExpress.XtraEditors.LabelControl();
this.label6 = new DevExpress.XtraEditors.LabelControl();
this.label5 = new DevExpress.XtraEditors.LabelControl();
this.label4 = new DevExpress.XtraEditors.LabelControl();
this.label3 = new DevExpress.XtraEditors.LabelControl();
this.label2 = new DevExpress.XtraEditors.LabelControl();
this.label1 = new DevExpress.XtraEditors.LabelControl();
this.gridBarCode = new Lskj.Control.GridControlEx();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
this.btnDelete = new DevExpress.XtraEditors.SimpleButton();
this.btnExport = new DevExpress.XtraEditors.SimpleButton();
this.btnImport = new DevExpress.XtraEditors.SimpleButton();
this.btnAdd = new DevExpress.XtraEditors.SimpleButton();
this.btnView = new DevExpress.XtraEditors.SimpleButton();
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
this.txt_Count = new Lskj.Control.LabelTextEdit();
this.txt_input = new Lskj.Control.LabelTextEdit();
this.lbTip = new DevExpress.XtraEditors.LabelControl();
((System.ComponentModel.ISupportInitialize)(this.pl_top)).BeginInit();
this.pl_top.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
this.panelControl1.SuspendLayout();
this.SuspendLayout();
//
// pl_top
//
this.pl_top.Controls.Add(this.lbProductColor);
this.pl_top.Controls.Add(this.lbProductBrand);
this.pl_top.Controls.Add(this.lbProductSpec);
this.pl_top.Controls.Add(this.lbProductName);
this.pl_top.Controls.Add(this.lbProductType);
this.pl_top.Controls.Add(this.lbProductModel);
this.pl_top.Controls.Add(this.lbProductId);
this.pl_top.Controls.Add(this.label7);
this.pl_top.Controls.Add(this.label6);
this.pl_top.Controls.Add(this.label5);
this.pl_top.Controls.Add(this.label4);
this.pl_top.Controls.Add(this.label3);
this.pl_top.Controls.Add(this.label2);
this.pl_top.Controls.Add(this.label1);
this.pl_top.Dock = System.Windows.Forms.DockStyle.Top;
this.pl_top.Location = new System.Drawing.Point(0, 0);
this.pl_top.Name = "pl_top";
this.pl_top.Size = new System.Drawing.Size(707, 71);
this.pl_top.TabIndex = 0;
//
// lbProductColor
//
this.lbProductColor.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.lbProductColor.Location = new System.Drawing.Point(364, 30);
this.lbProductColor.Name = "lbProductColor";
this.lbProductColor.Size = new System.Drawing.Size(0, 12);
this.lbProductColor.TabIndex = 13;
//
// lbProductBrand
//
this.lbProductBrand.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.lbProductBrand.Location = new System.Drawing.Point(237, 49);
this.lbProductBrand.Name = "lbProductBrand";
this.lbProductBrand.Size = new System.Drawing.Size(0, 12);
this.lbProductBrand.TabIndex = 12;
//
// lbProductSpec
//
this.lbProductSpec.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.lbProductSpec.Location = new System.Drawing.Point(237, 30);
this.lbProductSpec.Name = "lbProductSpec";
this.lbProductSpec.Size = new System.Drawing.Size(0, 12);
this.lbProductSpec.TabIndex = 11;
//
// lbProductName
//
this.lbProductName.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.lbProductName.Location = new System.Drawing.Point(237, 9);
this.lbProductName.Name = "lbProductName";
this.lbProductName.Size = new System.Drawing.Size(0, 12);
this.lbProductName.TabIndex = 10;
//
// lbProductType
//
this.lbProductType.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.lbProductType.Location = new System.Drawing.Point(78, 49);
this.lbProductType.Name = "lbProductType";
this.lbProductType.Size = new System.Drawing.Size(0, 12);
this.lbProductType.TabIndex = 9;
//
// lbProductModel
//
this.lbProductModel.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.lbProductModel.Location = new System.Drawing.Point(78, 30);
this.lbProductModel.Name = "lbProductModel";
this.lbProductModel.Size = new System.Drawing.Size(0, 12);
this.lbProductModel.TabIndex = 8;
//
// lbProductId
//
this.lbProductId.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.lbProductId.Location = new System.Drawing.Point(78, 9);
this.lbProductId.Name = "lbProductId";
this.lbProductId.Size = new System.Drawing.Size(0, 12);
this.lbProductId.TabIndex = 7;
//
// label7
//
this.label7.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.label7.Location = new System.Drawing.Point(331, 30);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(36, 12);
this.label7.TabIndex = 6;
this.label7.Text = "花色:";
//
// label6
//
this.label6.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.label6.Location = new System.Drawing.Point(171, 49);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(60, 12);
this.label6.TabIndex = 5;
this.label6.Text = "商品品牌:";
//
// label5
//
this.label5.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.label5.Location = new System.Drawing.Point(171, 29);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(60, 12);
this.label5.TabIndex = 4;
this.label5.Text = "商品规格:";
//
// label4
//
this.label4.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.label4.Location = new System.Drawing.Point(171, 9);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(60, 12);
this.label4.TabIndex = 3;
this.label4.Text = "商品名称:";
//
// label3
//
this.label3.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.label3.Location = new System.Drawing.Point(12, 49);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(60, 12);
this.label3.TabIndex = 2;
this.label3.Text = "商品品类:";
//
// label2
//
this.label2.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.label2.Location = new System.Drawing.Point(12, 29);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(60, 12);
this.label2.TabIndex = 1;
this.label2.Text = "商品型号:";
//
// label1
//
this.label1.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 12);
this.label1.TabIndex = 0;
this.label1.Text = "商品编码:";
//
// gridBarCode
//
this.gridBarCode.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridBarCode.Location = new System.Drawing.Point(0, 71);
this.gridBarCode.Name = "gridBarCode";
this.gridBarCode.Size = new System.Drawing.Size(707, 360);
this.gridBarCode.TabIndex = 1;
this.gridBarCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.gridBarCode_KeyDown);
//
// panelControl1
//
this.panelControl1.Controls.Add(this.btnDelete);
this.panelControl1.Controls.Add(this.btnExport);
this.panelControl1.Controls.Add(this.btnImport);
this.panelControl1.Controls.Add(this.btnAdd);
this.panelControl1.Controls.Add(this.btnView);
this.panelControl1.Controls.Add(this.btnSave);
this.panelControl1.Controls.Add(this.txt_Count);
this.panelControl1.Controls.Add(this.txt_input);
this.panelControl1.Controls.Add(this.lbTip);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelControl1.Location = new System.Drawing.Point(0, 431);
this.panelControl1.Name = "panelControl1";
this.panelControl1.Size = new System.Drawing.Size(707, 71);
this.panelControl1.TabIndex = 2;
//
// btnDelete
//
this.btnDelete.Location = new System.Drawing.Point(540, 38);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(75, 23);
this.btnDelete.TabIndex = 8;
this.btnDelete.Text = "删除";
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnExport
//
this.btnExport.Location = new System.Drawing.Point(621, 9);
this.btnExport.Name = "btnExport";
this.btnExport.Size = new System.Drawing.Size(75, 23);
this.btnExport.TabIndex = 7;
this.btnExport.Text = "导出";
this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
//
// btnImport
//
this.btnImport.Location = new System.Drawing.Point(621, 38);
this.btnImport.Name = "btnImport";
this.btnImport.Size = new System.Drawing.Size(75, 23);
this.btnImport.TabIndex = 6;
this.btnImport.Text = "导入";
this.btnImport.Click += new System.EventHandler(this.btnInput_Click);
//
// btnAdd
//
this.btnAdd.Location = new System.Drawing.Point(459, 38);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(75, 23);
this.btnAdd.TabIndex = 5;
this.btnAdd.Text = "添加";
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnView
//
this.btnView.Location = new System.Drawing.Point(540, 9);
this.btnView.Name = "btnView";
this.btnView.Size = new System.Drawing.Size(75, 23);
this.btnView.TabIndex = 4;
this.btnView.Text = "预览";
this.btnView.Click += new System.EventHandler(this.btnView_Click);
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(459, 9);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
this.btnSave.TabIndex = 3;
this.btnSave.Text = "保存";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// txt_Count
//
this.txt_Count.BackColor = System.Drawing.Color.Transparent;
this.txt_Count.EditText = "1";
this.txt_Count.LabelText = "数量";
this.txt_Count.Location = new System.Drawing.Point(240, 38);
this.txt_Count.Model = null;
this.txt_Count.Name = "txt_Count";
this.txt_Count.NullText = "";
this.txt_Count.ReadOnly = false;
this.txt_Count.Required = false;
this.txt_Count.Size = new System.Drawing.Size(103, 21);
this.txt_Count.TabIndex = 2;
//
// txt_input
//
this.txt_input.BackColor = System.Drawing.Color.Transparent;
this.txt_input.EditText = "";
this.txt_input.LabelText = "条码";
this.txt_input.Location = new System.Drawing.Point(5, 38);
this.txt_input.Model = null;
this.txt_input.Name = "txt_input";
this.txt_input.NullText = "";
this.txt_input.ReadOnly = false;
this.txt_input.Required = false;
this.txt_input.Size = new System.Drawing.Size(218, 21);
this.txt_input.TabIndex = 1;
this.txt_input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txt_input_KeyDown);
//
// lbTip
//
this.lbTip.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.lbTip.Location = new System.Drawing.Point(12, 9);
this.lbTip.Name = "lbTip";
this.lbTip.Size = new System.Drawing.Size(84, 12);
this.lbTip.TabIndex = 0;
this.lbTip.Text = "应录入条码数:";
//
// FrmInputBarCode
//
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
this.Appearance.Font = new System.Drawing.Font("宋体", 9F);
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(707, 502);
this.Controls.Add(this.gridBarCode);
this.Controls.Add(this.pl_top);
this.Controls.Add(this.panelControl1);
this.KeyPreview = true;
this.Name = "FrmInputBarCode";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.pl_top)).EndInit();
this.pl_top.ResumeLayout(false);
this.pl_top.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit();
this.panelControl1.ResumeLayout(false);
this.panelControl1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.PanelControl pl_top;
private DevExpress.XtraEditors.LabelControl label1;
private DevExpress.XtraEditors.LabelControl label7;
private DevExpress.XtraEditors.LabelControl label6;
private DevExpress.XtraEditors.LabelControl label5;
private DevExpress.XtraEditors.LabelControl label4;
private DevExpress.XtraEditors.LabelControl label3;
private DevExpress.XtraEditors.LabelControl label2;
private Control.GridControlEx gridBarCode;
private DevExpress.XtraEditors.PanelControl panelControl1;
private DevExpress.XtraEditors.LabelControl lbTip;
private Control.LabelTextEdit txt_input;
private Control.LabelTextEdit txt_Count;
private DevExpress.XtraEditors.SimpleButton btnDelete;
private DevExpress.XtraEditors.SimpleButton btnExport;
private DevExpress.XtraEditors.SimpleButton btnImport;
private DevExpress.XtraEditors.SimpleButton btnAdd;
private DevExpress.XtraEditors.SimpleButton btnView;
private DevExpress.XtraEditors.SimpleButton btnSave;
private DevExpress.XtraEditors.LabelControl lbProductId;
private DevExpress.XtraEditors.LabelControl lbProductBrand;
private DevExpress.XtraEditors.LabelControl lbProductSpec;
private DevExpress.XtraEditors.LabelControl lbProductName;
private DevExpress.XtraEditors.LabelControl lbProductType;
private DevExpress.XtraEditors.LabelControl lbProductModel;
private DevExpress.XtraEditors.LabelControl lbProductColor;
}
}
@@ -0,0 +1,545 @@
/***********************
* 说明:单据条码输入
* 创建人:龚宇超
* 创建日期:
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
***********************/
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;
using Lskj.Control;
using Lskj.Model;
using Lskj.Control.Model;
using Lskj.Util;
using Lskj.Data;
using Lskj.Business.Impl;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Columns;
using Lskj.Business;
namespace Lskj.PubBillDetail
{
/// <summary>
/// Class FrmInputBarCode.
/// </summary>
public partial class FrmInputBarCode : BaseForm
{
#region
/// <summary>
/// 模块对象
/// </summary>
public DynamicBillInputBarModel SysModel;
/// <summary>
/// 单据明细模型
/// </summary>
public BillDetailModel BillDetailModel;
/// <summary>
/// 单据条码录入
/// </summary>
public BillBarCodeModel BillBarCodeModel;
/// <summary>
/// 模块名称
/// </summary>
public string _fromText;
#endregion
#region
/// <summary>
/// 列前缀
/// </summary>
private string _columnPrefix;
/// <summary>
/// 打印sql2
/// </summary>
private string _printSql2 = "";
#endregion
public FrmInputBarCode()
: this("")
{
}
public FrmInputBarCode(string Fromtext)
{
InitializeComponent();
this._fromText = Fromtext;
}
#region
/// <summary>
/// <para>说明:初始化设置</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void InitializeSetting()
{
this.Text = this.SysModel.FormText + "单据号" + this.SysModel.BilldocumentId;
DataTable dt = BillImpl.GetBillDetail(this.SysModel.ParentDLLCoid);
if (dt.Rows.Count == 0)
{
MessageUtil.Show(string.Format(ResourceKeys.ParameterError, this.SysModel.ParentDLLCoid));
return;
}
this.BillDetailModel = new BillDetailModel(dt.Rows[0]);
//获取列前缀
this._columnPrefix = BaseImpl.GetColumnPrefix(this.BillDetailModel.DetailTable);
DataTable dtTmp = BillImpl.GetBillDeatilInfo(this.BillDetailModel.DetailTable, this._columnPrefix, this.SysModel.BilldocumentId, this.SysModel.DetailId);
if (dtTmp.Rows.Count < 1)
{
MessageUtil.Show(ResourceKeys.NotFindBarCodeInfo);
return;
}
dtTmp = BillImpl.GetProductInfo(this.SysModel.ProductId);
//获取商品信息
this.BillBarCodeModel = new BillBarCodeModel(dtTmp.Rows[0]);
this.lbProductBrand.Text = this.BillBarCodeModel.ProductBrand;
this.lbProductColor.Text = this.BillBarCodeModel.Color;
this.lbProductId.Text = this.SysModel.ProductId;
this.lbProductModel.Text = this.BillBarCodeModel.ProductModel;
this.lbProductName.Text = this.BillBarCodeModel.ProductName;
this.lbProductSpec.Text = this.BillBarCodeModel.ProductSpec;
this.lbProductType.Text = this.BillBarCodeModel.ProductClassify;
this.gridBarCode.SetReadOnlyColumns(BillImpl.SetProductBarCodeColumns());
//绑定条码表格数据
this.gridBarCode.SetGridViewDataSource(BillImpl.GetProductBarCodeData(this.SysModel.ParentDLLCoid, this.SysModel.BilldocumentId, this.SysModel.DetailId));
this.lbTip.Text = string.Format(ResourceKeys.BarCodeHintMsg, this.SysModel.CodeCount, this.gridBarCode.DataRowCount());
this.gridBarCode.GridView.KeyDown += new KeyEventHandler(gridBarCode_KeyDown);
this.txt_input.TextEdit.KeyDown += new KeyEventHandler(txt_input_KeyDown);
}
/// <summary>
/// <para>说明:窗体加载时</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
protected override void OnLoad(EventArgs e)
{
WaitForm.ShowForm();
try
{
SysModel.Privilege = SysModel.ModuleId > 0 ? BaseImpl.GetUserPurviewsByMenuId(SysModel.ModuleId + "") + "" : BaseImpl.GetUserPurviewsByMenuCode(SysModel.ModuleCode) + "";
if (!this.SysModel.HasPrivilege())
{
MessageUtil.Show(ResourceKeys.UnPurview);
this.Close();
}
this.InitializeSetting();
this.InitializeControl();
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
//MessageUtil.Show(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
finally
{
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
WaitForm.HideForm();
}
}
#endregion
#region
/// <summary>
/// <para>说明:初始化控件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void InitializeControl()
{
if (!this.SysModel.IsView)
{
this.btnAdd.Enabled = false;
this.btnDelete.Enabled = false;
this.btnImport.Enabled = false;
this.txt_input.Visible = false;
this.txt_Count.Visible = false;
}
if (!this.SysModel.IsView || this.SysModel.IsEdit)
{
this.btnSave.Enabled = false;
}
}
#endregion
#region
/// <summary>
/// <para>说明:录入条码</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private bool AddUniqueCode(string uCode, string uAmount, string uGroup, string uJyBillNo)
{
if (string.IsNullOrEmpty(uCode)) return false;
if (this.SysModel.CodeCount <= this.gridBarCode.GridView.DataRowCount)
{
MessageUtil.Show(ResourceKeys.InputCountGTR);
return false;
}
int uniqueCode = this.gridBarCode.GridView.LocateByValue("uniqueCode", uCode, null);
if (uniqueCode < 0)
{
string runNumber = BillImpl.GetBillNo("'FIXED'");
if (string.IsNullOrWhiteSpace(runNumber))
{
MessageUtil.Show(ResourceKeys.CreateSerialNumberFail);
return false;
}
//验证
int result = BillImpl.InsertProductBarCodeData(this.SysModel.ModuleCode, this.SysModel.ParentDLLCoid, this.SysModel.BilldocumentId, this.SysModel.DetailId, uCode, this.SysModel.ProductId, runNumber, uAmount, uGroup, uJyBillNo);
if (result < 1)
{
MessageUtil.Show(ResourceKeys.SaveFault);
return false;
}
this.lbTip.Text = string.Format(ResourceKeys.BarCodeHintMsg, this.SysModel.CodeCount, this.gridBarCode.GridView.DataRowCount);
this.gridBarCode.SetGridViewDataSource(BillImpl.GetProductBarCodeData(this.SysModel.ParentDLLCoid, this.SysModel.BilldocumentId, this.SysModel.DetailId));
}
this.gridBarCode.GridView.ClearSelection();
this.gridBarCode.GridView.SelectRow(uniqueCode);
return true;
}
#endregion
#region
/// <summary>
/// <para>说明:导入</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnInput_Click(object sender, EventArgs e)
{
try
{
//导入窗口
FrmImportBarCode form = new FrmImportBarCode();
form.AddBaeCodeEvent += new FrmImportBarCode.AddBarCodeEventHandler(AddUniqueCode);
form.ShowDialog();
}
catch (Exception ex)
{
LogUtil.WriteError("导入事件出错!", ex);
//MessageUtil.Show("导入事件出错!" + ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:导出</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnExport_Click(object sender, EventArgs e)
{
try
{
this.gridBarCode.GridControl.ToExcel(this._fromText);
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:浏览</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnView_Click(object sender, EventArgs e)
{
try
{
string printPath = PubUtil.PrintFileAbsolutelyPath;
string billModuleFile = "barcodePreview1.rmf";
string tmpSql = string.Format("select '{0}' as Billdocument_Id,'{1}' as model,'{2}' as ProductId,'{3}' as pl,'{4}' as pp,'{5}' as gg,'{6}' as ys", this.SysModel.BilldocumentId, this.lbProductModel.Text, this.SysModel.ProductId, this.lbProductType.Text, this.lbProductBrand.Text, this.lbProductSpec.Text, this.lbProductColor.Text);
string tmpSql1 = string.Format("select * from wms_productBarcode where modid='{0}' and primaryKey='{1}' and mxid='{2}'", this.SysModel.ParentDLLCoid, this.SysModel.BilldocumentId, this.SysModel.DetailId);
DelphiHelper.LoadDelphiDll(printPath, printPath, billModuleFile, tmpSql, tmpSql1, 1, "");
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:条码输入框按键事件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void txt_input_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (!this.SysModel.IsView) return;
if (e.KeyCode == Keys.Return)
{
string code = this.txt_input.EditText.Trim();
string[] codeSplit = code.Split('&');
if (codeSplit.Length > 1)
{
this.txt_Count.Text = codeSplit[1];
}
AddUniqueCode(codeSplit[0], this.txt_Count.EditText.Trim(), "", "");
this.txt_input.EditText = "";
txt_Count.Text = "1";
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:条码表格按键事件</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void gridBarCode_KeyDown(object sender, KeyEventArgs e)
{
try
{
//ctrl+c复制
if (e.Control & e.KeyCode == Keys.C)
{
object obj = this.gridBarCode.GridView.GetFocusedRowCellValue(this.gridBarCode.GridView.FocusedColumn);
if (obj != null)
{
Clipboard.SetDataObject(obj);
e.Handled = true;
}
}
if (e.KeyCode == Keys.F6 || e.KeyCode == Keys.F7)
{
GridColumn gc = this.gridBarCode.GridView.FocusedColumn;
if (gc != null && this.gridBarCode.GridView.RowCount > 0 && gc.OptionsColumn.AllowEdit == true && this.gridBarCode.GridView.OptionsBehavior.Editable == true)
{
GridCell[] selecells = this.gridBarCode.GridView.GetSelectedCells();
if (selecells.Length == 1)
{
if (gridBarCode.GridView.FocusedRowHandle < gridBarCode.GridView.RowCount)
{
if (MessageUtil.Show(ResourceKeys.IsChangeCurrentCellData, MessageBoxButtons.YesNo) == DialogResult.Yes)
{
object obj = this.gridBarCode.GridView.GetFocusedRowCellValue(gc);
if (obj != null)
{
int focusedRowHandle = this.gridBarCode.GridView.FocusedRowHandle;
for (int i = focusedRowHandle; i < this.gridBarCode.GridView.RowCount; i++)
{
this.gridBarCode.GridView.FocusedRowHandle = i;
object obj1 = this.gridBarCode.GridView.GetRowCellValue(i, gc);
if (e.KeyCode == Keys.F6)
{
if ((obj1 == null) || (obj1.ToString() == "0") || (obj1.ToString() == ""))
this.gridBarCode.GridView.SetRowCellValue(i, gc, obj);
}
else
this.gridBarCode.GridView.SetRowCellValue(i, gc, obj);
this.gridBarCode.GridView.PostEditor();
}
e.Handled = true;
}
}
}
}
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
/// <summary>
/// <para>说明:保存</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnSave_Click(object sender, EventArgs e)
{
try
{
this.gridBarCode.GridView.CloseEditor();
this.gridBarCode.GridView.UpdateCurrentRow();
//更新数据
DataTable table = this.gridBarCode.GridControl.DataSourceTable();
if (table.Rows.Count > 0 && table.Rows.Cast<DataRow>().FirstOrDefault(x => x.RowState == DataRowState.Modified) != null)
{
if (MessageUtil.Show(ResourceKeys.IsSaveApplyData, MessageBoxButtons.YesNo) == DialogResult.Yes)
{
WaitForm.ShowForm(ResourceKeys.Handing);
BillImpl.UpdateProductBarCodeData(table);
//调用存储过程进行保存验证
BaseSaveModel saveModel = new BaseSaveModel
{
BaseSaveType = SaveType.Update,
BaseSql = "select 1",
KeyField = "",
FieldValue = this.SysModel.DetailId,
MenuCode = this.SysModel.ParentDLLCoid,
TableName = ""
};
int result = BaseModuleImpl.SaveBasePanelData(saveModel);
if (result == 1)
{
this.gridBarCode.SetGridViewDataSource(BillImpl.GetProductBarCodeData(this.SysModel.ParentDLLCoid, this.SysModel.BilldocumentId, this.SysModel.DetailId));
}
else
{
MessageUtil.Show(saveModel.FaultMsg);
}
}
}
else
{
MessageUtil.Show(ResourceKeys.UnUpdateData);
}
}
catch (Exception ex)
{
//MessageUtil.Show(ex.Message.Contains("ix") ? ResourceKeys.InputRepeatData : ex.Message);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
finally
{
WaitForm.HideForm();
}
}
/// <summary>
/// <para>说明:删除</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnDelete_Click(object sender, EventArgs e)
{
try
{
int[] selectRows = this.gridBarCode.GridView.GetSelectedRows();
if (selectRows.Length > 0)
{
if (MessageUtil.Show(string.Format(ResourceKeys.DeleteRows, selectRows.Length), MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
{
WaitForm.ShowForm(ResourceKeys.Handing);
foreach (int row in selectRows)
{
DataRow dr = this.gridBarCode.GridView.GetDataRow(row);
int result = BillImpl.DeleteProductBarCodeData(this.SysModel.ModuleCode, this.SysModel.BilldocumentId, this.SysModel.DetailId, dr);
if (result < 1)
{
MessageUtil.Show(ResourceKeys.SaveFault);
return;
}
}
this.gridBarCode.GridView.DeleteSelectedRows();
this.lbTip.Text = string.Format(ResourceKeys.BarCodeHintMsg, this.SysModel.CodeCount, this.gridBarCode.GridView.DataRowCount);
}
}
else
{
MessageUtil.Show(ResourceKeys.SelectRowIsNull);
}
}
catch (Exception ex)
{
//MessageUtil.Show(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
finally
{
WaitForm.HideForm();
}
}
/// <summary>
/// <para>说明:添加</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-04-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
private void btnAdd_Click(object sender, EventArgs e)
{
try
{
WaitForm.ShowForm(ResourceKeys.DataSaving);
this.AddUniqueCode(this.txt_input.EditText, this.txt_Count.EditText, "", "");
this.txt_input.EditText = "";
}
catch (Exception ex)
{
//MessageUtil.Show(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
finally
{
WaitForm.HideForm();
}
}
#endregion
}
}
@@ -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,141 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1FCA653B-D21D-47D2-8798-57401AD82785}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lskj.PubBillDetail</RootNamespace>
<AssemblyName>Lskj.PubBillDetail</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Debug\Lib\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\Debug\AllMethodXml\Lskj.PubBillDetail.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Release\Lib\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Printing.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Sparkline.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Utils.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Charts.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraCharts.v15.2.Wizard, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraCharts.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraCharts.v15.2.UI, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraPrinting.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraScheduler.v15.2.Reporting.Extensions, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraScheduler.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraScheduler.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraTreeList.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="NPOI">
<HintPath>..\..\引用DLL\NPOI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DllBaseClass.cs" />
<Compile Include="FrmImportBarCode.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmImportBarCode.Designer.cs">
<DependentUpon>FrmImportBarCode.cs</DependentUpon>
</Compile>
<Compile Include="FrmInputBarCode.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmInputBarCode.Designer.cs">
<DependentUpon>FrmInputBarCode.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="FrmImportBarCode.resx">
<DependentUpon>FrmImportBarCode.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmInputBarCode.resx">
<DependentUpon>FrmInputBarCode.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lskj.Business\Lskj.Business.csproj">
<Project>{7EAFCCC2-A18F-49E9-85C6-A984966CFD01}</Project>
<Name>Lskj.Business</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Control\Lskj.Control.csproj">
<Project>{447CDC40-659F-4CCA-9ED6-8E818B4CF8BF}</Project>
<Name>Lskj.Control</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Core\Lskj.Core.csproj">
<Project>{2A1BE6AC-1077-491B-A754-C5822FE8121E}</Project>
<Name>Lskj.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Data\Lskj.Data.csproj">
<Project>{308B9B18-9BE2-495C-9C64-EED81D567813}</Project>
<Name>Lskj.Data</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Model\Lskj.Model.csproj">
<Project>{52BC40E0-C0C6-4F78-996B-CAE028D209CA}</Project>
<Name>Lskj.Model</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Util\Lskj.Util.csproj">
<Project>{A51BF642-6543-4DE3-8948-83F558B72BD4}</Project>
<Name>Lskj.Util</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Lskj.PubBillDetail")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lskj.PubBillDetail")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("86dbc276-5fff-48cb-bf33-66837bd10a47")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订号
//
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+35
View File
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NPOI" publicKeyToken="0df73ec7942b34e1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.3.1" newVersion="2.1.3.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Spire.XLS" publicKeyToken="663f351905198cb3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.3.8.0" newVersion="10.3.8.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Spire.Presentation" publicKeyToken="663f351905198cb3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.3.6.0" newVersion="5.3.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Spire.Doc" publicKeyToken="663f351905198cb3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.3.15.0" newVersion="8.3.15.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>