基线 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
+42
View File
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Spire.Pdf" publicKeyToken="663f351905198cb3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.9.130.14040" newVersion="3.9.130.14040" />
</dependentAssembly>
<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="Spire.Doc" publicKeyToken="663f351905198cb3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.3.15.0" newVersion="8.3.15.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="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="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>
</assemblyBinding>
</runtime>
</configuration>
@@ -0,0 +1,39 @@
using Lskj.Business;
using Lskj.Model;
using Lskj.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Lskj.AutoWordFiles
{
public sealed class DllBaseClass : IForm
{
public DllBaseClass()
{
}
public DllBaseClass(string[] obj)
{
try
{
DynamicAutoWordFile moduleModel = new DynamicAutoWordFile(obj);
FrmMain main = new FrmMain();
this.SubForm = main;
//main.Model = moduleModel;
}
catch (Exception ex)
{
LogUtil.WriteError("Lskj.AutoWordFile.dll--参数错误-->" + obj.ToString(), ex);
}
}
/// <summary>
/// 窗口
/// </summary>
public Form SubForm { get; set; }
}
}
+139
View File
@@ -0,0 +1,139 @@
namespace Lskj.AutoWordFiles
{
partial class FrmMain
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.txtLog = new System.Windows.Forms.TextBox();
this.lbl_progress = new System.Windows.Forms.ProgressBar();
this.panel1 = new System.Windows.Forms.Panel();
this.btn_getout = new DevExpress.XtraEditors.SimpleButton();
this.btn_pdf = new DevExpress.XtraEditors.SimpleButton();
this.btn_start = new DevExpress.XtraEditors.SimpleButton();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// txtLog
//
this.txtLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtLog.Location = new System.Drawing.Point(0, 0);
this.txtLog.Multiline = true;
this.txtLog.Name = "txtLog";
this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtLog.Size = new System.Drawing.Size(717, 494);
this.txtLog.TabIndex = 7;
//
// lbl_progress
//
this.lbl_progress.Dock = System.Windows.Forms.DockStyle.Bottom;
this.lbl_progress.Location = new System.Drawing.Point(0, 473);
this.lbl_progress.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.lbl_progress.Name = "lbl_progress";
this.lbl_progress.Size = new System.Drawing.Size(717, 21);
this.lbl_progress.TabIndex = 8;
//
// panel1
//
this.panel1.Controls.Add(this.btn_getout);
this.panel1.Controls.Add(this.btn_pdf);
this.panel1.Controls.Add(this.btn_start);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(0, 434);
this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(717, 39);
this.panel1.TabIndex = 9;
//
// btn_getout
//
this.btn_getout.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_getout.Location = new System.Drawing.Point(630, 2);
this.btn_getout.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_getout.Name = "btn_getout";
this.btn_getout.Size = new System.Drawing.Size(76, 32);
this.btn_getout.TabIndex = 0;
this.btn_getout.Text = "退出";
this.btn_getout.Click += new System.EventHandler(this.btn_getout_Click);
//
// btn_pdf
//
this.btn_pdf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_pdf.Location = new System.Drawing.Point(406, 0);
this.btn_pdf.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_pdf.Name = "btn_pdf";
this.btn_pdf.Size = new System.Drawing.Size(76, 32);
this.btn_pdf.TabIndex = 0;
this.btn_pdf.Text = "生成pdf";
this.btn_pdf.Click += new System.EventHandler(this.button2_Click);
//
// btn_start
//
this.btn_start.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_start.Location = new System.Drawing.Point(528, 2);
this.btn_start.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btn_start.Name = "btn_start";
this.btn_start.Size = new System.Drawing.Size(76, 32);
this.btn_start.TabIndex = 0;
this.btn_start.Text = "开始生成";
this.btn_start.Click += new System.EventHandler(this.btn_start_Click);
//
// FrmMain
//
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(717, 494);
this.Controls.Add(this.panel1);
this.Controls.Add(this.lbl_progress);
this.Controls.Add(this.txtLog);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmMain";
this.Text = "朗速-开发设计文档(WORD)智能生成工具";
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.ComponentModel.BackgroundWorker backgroundWorker1;
private System.Windows.Forms.TextBox txtLog;
private System.Windows.Forms.ProgressBar lbl_progress;
private System.Windows.Forms.Panel panel1;
private DevExpress.XtraEditors.SimpleButton btn_getout;
private DevExpress.XtraEditors.SimpleButton btn_start;
private DevExpress.XtraEditors.SimpleButton btn_pdf;
}
}
+596
View File
@@ -0,0 +1,596 @@
using Lskj.Core;
using Spire.Doc;
using Spire.Doc.Documents;
using Spire.Doc.Fields;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Lskj.Control.Model;
using Lskj.Control;
using Lskj.Model;
using Lskj.Business;
namespace Lskj.AutoWordFiles
{
public partial class FrmMain : BaseForm
{
public DynamicAutoWordFile Model;
private bool NewInitSuccess = false;
private int fileCount;
public FrmMain()
{
InitializeComponent();
}
DataTable masterdt = new DataTable();
/// <summary>
/// 转成ptf格式
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender, EventArgs e)
{
try
{
SaveFileDialog dialog = new SaveFileDialog();
dialog.Title = "选择需要转换的ptf文件";
dialog.Filter = "Word文件(*.doc)|*.Docx";
DialogResult result = dialog.ShowDialog();
if (result == DialogResult.OK)
{
WaitForm.ShowForm("word转换中,请稍后...");
//Create word document
Document document = new Document();
document.LoadFromFile(dialog.FileName);
//Save the document to a PDF file.
document.SaveToFile("Sample.pdf", FileFormat.PDF);
//Launching the pdf reader to open.
FileViewer("Sample.pdf");
}
}
catch (Exception)
{
throw;
}
finally
{
WaitForm.HideForm();
}
}
/// <summary>
/// 初始化同步平台
/// </summary>
private void Initialization()
{
try
{
RefreshLog(DateTime.Now + "正在初始化平台.\r\n");
if (DBConfig.Instance.CreateConnection())
{
masterdt = SqlHelper.ExecuteDataTable(string.Format("select modid,mid,Name from P_ConveWordTmpTab where OperatorName='{0}' order by verid", "管理员"));//初始化需要导入word的表
// select name from syscolumns where id=object_id('P_EmployeeTab') and name='SyncFlag'
bool flag = masterdt.Rows.Count > 0;
if (flag)
{
SqlHelper.ExecuteNonQuery(string.Format("UPDATE P_SYSTEMTAB SET WORDtAGID=0"));
NewInitSuccess = true;
RefreshLog(DateTime.Now + "初始化平台成功.\r\n");
//获取指定目录下所有文件数量(实际过程忽略)
fileCount = masterdt.Rows.Count;
//设置进度条基础属性
this.lbl_progress.Value = 0;
this.lbl_progress.Style = ProgressBarStyle.Blocks;
this.lbl_progress.Maximum = fileCount;
this.lbl_progress.Minimum = 0;
this.lbl_progress.MarqueeAnimationSpeed = 100;
this.lbl_progress.Step = 1;
this.lbl_progress.Text = "0%";
this.lbl_progress.Refresh();
}
else
{
MessageBox.Show("此数据库内无'P_ConveWordTmpTab'表!请配置好注册表后重新打开!");
this.Close();
return;
}
}
else
{
RefreshLog(DateTime.Now + " 初始化平台失败.\r\n");
}
}
catch (Exception ex)
{
RefreshLog(DateTime.Now + string.Format("初始化失败.原因:{0}.\r\n", ex.Message));
}
}
/// <summary>
/// 主线程刷新数据
/// </summary>
/// <param name="msg"></param>
public void RefreshLog(string msg)
{
txtLog.Text += msg;
txtLog.Select(txtLog.TextLength, 0);
txtLog.ScrollToCaret();
}
/// <summary>
/// 后台线程刷新数据
/// </summary>
/// <param name="msg"></param>
public void RefreshLogUIThread(string msg)
{
Invoke((EventHandler)delegate
{
txtLog.Text += msg;
txtLog.Select(txtLog.TextLength, 0);
txtLog.ScrollToCaret();
});
}
private void FileViewer(string fileName)
{
try
{
System.Diagnostics.Process.Start(fileName);
}
catch { }
}
private DataSet Worddata(string modid, int tagid, int mid)
{
SqlParameter[] param =
{
new SqlParameter("@modid",SqlDbType.VarChar,15),
new SqlParameter("@tagid",SqlDbType.Int),
new SqlParameter("@Mid",SqlDbType.Int)
};
param[0].Value = modid;
param[1].Value = tagid;
param[2].Value = mid;
DataSet ds = SqlHelper.ExecuteDataSet(CommandType.StoredProcedure, "pr_system_File01", "#ba_firstpage", param);
return ds;
}
public void Mulu()
{
DBConfig.Instance.CreateConnection();
DataTable headerdt = SqlHelper.ExecuteDataTable("select Erp_ItemInfo from p_systemtab");//初始化选择的套用模块
DataTable firstdt = SqlHelper.ExecuteDataTable("select ERP_WORDTitle from p_systemtab");//初始化选择的首页模块
DataTable seconddt = SqlHelper.ExecuteDataTable("select top 1 SubSysName+'-ERP流程' as name from P_SubSystemTab where SubSysId in(select SubSysId from P_FormMenuConfigTab where PurviewId in( select modid from P_ConveWordTmpTab))");//初始化选择的首页模块
RefreshLogUIThread(string.Format("开始生成设计文件:(共需要转换设计模块:{0})\r\n", masterdt.Rows.Count));
RefreshLogUIThread(string.Format("开始智能生成:.\r\n"));
//初始化文档
Document document = new Document();
Section sec0 = document.AddSection();
Section sec1 = document.AddSection();
Section sec = document.AddSection();
//将默认首页样式添加到文档并修改
Style BodyTextStyle = document.AddStyle(BuiltinStyle.Subtitle);
BodyTextStyle.CharacterFormat.Font = new System.Drawing.Font("FangSong", 24);
BodyTextStyle.CharacterFormat.TextColor = Color.Black;
BodyTextStyle.CharacterFormat.Bold = true;
//将默认首页样式2添加到文档并修改
Style BodyTextStyle2 = document.AddStyle(BuiltinStyle.BodyText);
BodyTextStyle2.CharacterFormat.Font = new System.Drawing.Font("FangSong", 16);
BodyTextStyle2.CharacterFormat.TextColor = Color.Black;
//将默认标题样式添加到文档并修改
Style titleStyle = document.AddStyle(BuiltinStyle.Title);
titleStyle.CharacterFormat.Font = new System.Drawing.Font("Microsoft Yahei", 10);
titleStyle.CharacterFormat.TextColor = Color.FromArgb(42, 123, 136);
//判断是否为段落样式,然后设置段落格式
if (titleStyle is ParagraphStyle)
{
ParagraphStyle ps = titleStyle as ParagraphStyle;
ps.ParagraphFormat.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.Single;
ps.ParagraphFormat.Borders.Bottom.Color = Color.FromArgb(42, 123, 136);
ps.ParagraphFormat.Borders.Bottom.LineWidth = 1.5f;
ps.ParagraphFormat.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Left;
}
//应用风格
HeaderFooter header = sec.HeadersFooters.Header;
Paragraph paragraph = header.AddParagraph();
sec0.PageSetup.HeaderDistance = 7;
sec1.PageSetup.HeaderDistance = 7;
sec0.PageSetup.FooterDistance = 7;
sec1.PageSetup.FooterDistance = 7;
paragraph.AppendText(headerdt.Rows[0]["Erp_ItemInfo"] + "");
paragraph.ApplyStyle(BuiltinStyle.Title);
HeaderFooter footer = sec.HeadersFooters.Footer;
Paragraph footerPara = footer.AddParagraph();
TextRange TR2 = footerPara.AppendText("地址:中国(四川)自由贸易试验区成都高新区吉泰五路88号 电话:18123296181/028-85379300 ");
footerPara.AppendField("页码", Spire.Doc.FieldType.FieldPage);
footerPara.AppendText(" of ");
footerPara.AppendField("总页数", Spire.Doc.FieldType.FieldNumPages);
footerPara.Format.Borders.Top.BorderType = Spire.Doc.Documents.BorderStyle.Single;
footerPara.Format.Borders.Top.Color = Color.FromArgb(42, 123, 136);
footerPara.Format.Borders.Top.LineWidth = 1.5f;
for (int e = 0; e < masterdt.Rows.Count; e++)
{
sec.PageSetup.FooterDistance = 7;
sec.PageSetup.HeaderDistance = 7;
string ProductId = masterdt.Rows[e]["modId"] + "";//初始化需要导入word的表
DataTable middt = SqlHelper.ExecuteDataTable(string.Format("select * from P_WordFileSetTab where Mid='{0}'", masterdt.Rows[e]["Mid"]));//初始化选择的套用模块
DataRow midrt = middt.Rows[0];
//添加默认标题1样式
Style heading1Style = document.AddStyle(BuiltinStyle.Heading1);
heading1Style.CharacterFormat.Font = new System.Drawing.Font(midrt["TitleFont1"] + "", int.Parse(midrt["TitleFontSize1"] + ""));
heading1Style.CharacterFormat.Bold = bool.Parse(midrt["TitleFontBoid1"] + "");
heading1Style.CharacterFormat.TextColor = Color.FromName(midrt["TitleFontColor1"] + "");
//添加默认标题2样式paragraph
Style heading2Style = document.AddStyle(BuiltinStyle.Heading2);
heading2Style.CharacterFormat.Font = new System.Drawing.Font(midrt["TitleFont2"] + "", int.Parse(midrt["TitleFontSize2"] + ""));
heading2Style.CharacterFormat.TextColor = Color.FromName(midrt["TitleFontColor2"] + "");
heading2Style.CharacterFormat.Bold = bool.Parse(midrt["TitleFontBoid2"] + "");
//添加默认标题2样式
Style heading3Style = document.AddStyle(BuiltinStyle.Heading3);
heading3Style.CharacterFormat.Font = new System.Drawing.Font(midrt["TitleFont3"] + "", int.Parse(midrt["TitleFontSize3"] + ""));
heading3Style.CharacterFormat.TextColor = Color.FromName(midrt["TitleFontColor3"] + "");
heading3Style.CharacterFormat.Bold = bool.Parse(midrt["TitleFontBoid3"] + "");
//添加默认表格标题样式
Style GridHeadStyle = document.AddStyle(BuiltinStyle.Normal);
GridHeadStyle.CharacterFormat.Font = new System.Drawing.Font(midrt["GridHeadFont"] + "", int.Parse(midrt["GridHeadFontSize"] + ""));
GridHeadStyle.CharacterFormat.Bold = bool.Parse(midrt["GridHeadFontBoid"] + "");
//添加默认文本输出样式
Style textStyle = document.AddStyle(BuiltinStyle.Toc1);
textStyle.CharacterFormat.Font = new System.Drawing.Font(midrt["TexFontItalic"] + "", int.Parse(midrt["TextFontSize"] + ""));
textStyle.CharacterFormat.Bold = bool.Parse(midrt["Textfontboid"] + "");
textStyle.CharacterFormat.TextColor = Color.FromName(midrt["TextfontColor"] + "");
//列表样式
ListStyle bulletList = new ListStyle(document, ListType.Bulleted);
bulletList.Name = "bulletList";
document.ListStyles.Add(bulletList);
for (int i = 1; i < 50; i++)
{
DataSet ds = Worddata(ProductId, i, 0);
for (int a = 0; a < ds.Tables.Count; a++)
{
DataTable dt = ds.Tables[a];
if (dt == null || dt.Rows.Count == 0)
{
continue;
}
//去除配置列
DataTable copydt = dt.Copy();
foreach (DataColumn dc in copydt.Columns)
{
if (dc.ColumnName.Equals("TABLETYPE") || dc.ColumnName.Equals("TITLENAME") || dc.ColumnName.Equals("TITLECONTENT") ||
dc.ColumnName.Equals("ROWHEIGHT") || dc.ColumnName.Equals("TITLEIMG") || dc.ColumnName.Equals("fontmodid") || dc.ColumnName.Equals("Cellmerge"))
dt.Columns.Remove(dc.ColumnName);
}
//添加段落和表格
paragraph = sec.AddParagraph();
//判断为文字或图片格式不生成表格
if (copydt.Rows[0]["TABLETYPE"] + "" == "2" || (copydt.Rows[0]["TABLETYPE"] + "" == "3" && copydt.Rows.Count == 1))
{
switch (copydt.Rows[0]["TABLETYPE"] + "")
{
case "2":
paragraph.AppendText(copydt.Rows[0]["TITLENAME"] + "");
switch (copydt.Rows[0]["fontmodid"] + "")
{
case "1":
paragraph.ApplyStyle(BuiltinStyle.Heading1);
break;
case "2":
paragraph.ApplyStyle(BuiltinStyle.Heading2);
break;
case "3":
paragraph.ApplyStyle(BuiltinStyle.Heading3);
break;
case "4":
paragraph.ApplyStyle(BuiltinStyle.Toc1);
break;
}
paragraph = sec.AddParagraph();
TextRange tr = paragraph.AppendText(copydt.Rows[0]["TITLECONTENT"] + "");
paragraph.ApplyStyle(BuiltinStyle.Toc1);
break;
case "3":
paragraph.AppendText(copydt.Rows[0]["TITLENAME"] + "");
paragraph.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Left;
switch (copydt.Rows[0]["fontmodid"] + "")
{
case "1":
paragraph.ApplyStyle(BuiltinStyle.Heading1);
break;
case "2":
paragraph.ApplyStyle(BuiltinStyle.Heading2);
break;
case "3":
paragraph.ApplyStyle(BuiltinStyle.Heading3);
break;
case "4":
paragraph.ApplyStyle(BuiltinStyle.Toc1);
break;
}
paragraph = sec.AddParagraph();
Image _image = Image.FromStream(WebRequest.Create(copydt.Rows[0]["TITLEIMG"] + "").GetResponse().GetResponseStream());
DocPicture picture = paragraph.AppendPicture(_image);
break;
}
continue;
}
Spire.Doc.Table table = sec.AddTable(true);
paragraph.AppendText(copydt.Rows[0]["TITLENAME"] + "");
switch (copydt.Rows[0]["fontmodid"] + "")
{
case "1":
paragraph.ApplyStyle(BuiltinStyle.Heading1);
break;
case "2":
paragraph.ApplyStyle(BuiltinStyle.Heading2);
break;
case "3":
paragraph.ApplyStyle(BuiltinStyle.Heading3);
break;
case "4":
paragraph.ApplyStyle(BuiltinStyle.Toc1);
break;
}
table.TableFormat.LeftIndent = 34;
bool TableFlag = false;
List<string> ColumnList = new List<string>();
foreach (var name in dt.Columns)
{
ColumnList.Add(name + "");
}
//循环遍历data数组给表格赋值
if (copydt.Rows[0]["TABLETYPE"] + "" == "1")
{
table.ResetCells(dt.Rows.Count + 1, dt.Columns.Count);
// ***************** First Row *************************
TableRow row = table.Rows[0];
row.IsHeader = true;
row.Height = 20; //unit: point, 1point = 0.3528 mm
row.HeightType = TableRowHeightType.Exactly;
row.RowFormat.BackColor = Color.FromName(midrt["GridHeadFontColor"] + "");//设置标题的背景颜色
for (int k = 0; k < ColumnList.Count; k++)
{
string sh = ColumnList[k].Substring((ColumnList[k].Length > 3 ? ColumnList[k].Length : 3) - 3);
bool isShuZi = Regex.IsMatch(sh, @"^\d+$");
row.Cells[k].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
Paragraph p = row.Cells[k].AddParagraph();
p.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
if (isShuZi)
{
ColumnList[k] = ColumnList[k].Substring(0, ColumnList[k].Length - 3);
table[0, k].Width = int.Parse(sh);
}
table[0, k].Paragraphs[0].ApplyStyle(BuiltinStyle.Normal);
TextRange txtRange = p.AppendText(ColumnList[k]);
txtRange.CharacterFormat.Bold = true;
}
TableFlag = true;
}
else
{
table.ResetCells(dt.Rows.Count, dt.Columns.Count);
}
for (int r = 0; r < dt.Rows.Count; r++)
{
TableRow dataRow = TableFlag ? table.Rows[r + 1] : table.Rows[r];
dataRow.Height = 20;
dataRow.HeightType = TableRowHeightType.Exactly;
dataRow.RowFormat.BackColor = Color.Empty;
table.Rows[r].Height = int.Parse(copydt.Rows[r]["ROWHEIGHT"] + "");
for (int c = 0; c < dt.Columns.Count; c++)
{
string sh = ColumnList[c].Substring((ColumnList[c].Length > 3 ? ColumnList[c].Length : 3) - 3);
bool isShuZi = Regex.IsMatch(sh, @"^\d+$");
dataRow.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
dataRow.Cells[c].AddParagraph().AppendText(dt.Rows[r][c] + "");
if (copydt.Rows[r]["TABLETYPE"] + "" == "3" && dt.Rows[r][c].ToString() == "图片")
{
try
{
//查找一个特定字符串 ”Spire.Doc”
TextSelection selection = document.FindString("图片", false, true);
if (selection != null) {
TextRange range = selection.GetAsOneRange();
//替换字符串
range.Text = "";
}
string url = copydt.Rows[r]["TITLEIMG"] + "";
table.Rows[r].Cells[c].Paragraphs[0].Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
Image _image = Image.FromStream( WebRequest.Create(url.StartsWith("http")? url: SystemInfo.Instance.OAUrl + url).GetResponse().GetResponseStream());
DocPicture picture = table.Rows[r].Cells[c].Paragraphs[0].AppendPicture(_image);
float proportion = (float)(_image.Width) / (float)(_image.Height);
picture.Height = int.Parse(copydt.Rows[r]["ROWHEIGHT"] + "") - (float.Parse(copydt.Rows[r]["ROWHEIGHT"] + "") / 7);
picture.Width = (float)(int.Parse(copydt.Rows[r]["ROWHEIGHT"] + "") * proportion);
}
catch (Exception ex)
{
MessageUtil.Show("生成图片出错" + ex);
}
}
if (isShuZi)
{
table[r, c].Width = int.Parse(sh);
}
table[TableFlag ? r + 1 : r, c].Paragraphs[0].ApplyStyle(BuiltinStyle.Toc1);
}
}
//判断是否有合并规则
if (copydt.Columns.Contains("Cellmerge"))
{
//判断合并规则是否为空
if (string.IsNullOrWhiteSpace(copydt.Rows[0]["Cellmerge"] + "")) continue;
try
{
int Mergedindex = copydt.Rows[0]["Cellmerge"].ToString().IndexOf(":");
string MergedText = copydt.Rows[0]["Cellmerge"].ToString().Substring(0, Mergedindex);
string Cellmuster = copydt.Rows[0]["Cellmerge"].ToString().Substring(Mergedindex + 1);
string[] CellmusterN = Cellmuster.Trim().TrimEnd(':').Split(':');
string[] Cellmerge = MergedText.Trim().TrimEnd('|').Split('|');
for (int cellNum = 0; cellNum < Cellmerge.Count(); cellNum++)
{
int start = 0;
string[] Ranks = Cellmerge[cellNum].Trim().Split(',');
int indexs = Ranks[0].IndexOf("-");
int columnindexs = Ranks[1].IndexOf("-");
int startindex = start = int.Parse(Ranks[0].Substring(0, indexs));
int overindex = int.Parse(Ranks[0].Substring(indexs + 1));
if (TableFlag)
{
start = startindex += 1; overindex += 1;
}
int startcolumn = int.Parse(Ranks[1].Substring(0, columnindexs));
int overcolumn = int.Parse(Ranks[1].Substring(columnindexs + 1));
table[start, startcolumn].Paragraphs.Clear();
table[start, startcolumn].AddParagraph().AppendText(CellmusterN[cellNum]);
table[start, startcolumn].Paragraphs[0].Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
if (overindex - startindex > 0)
{
while (overindex - startindex > 0)
{
table.ApplyHorizontalMerge(startindex, startcolumn, overcolumn);
startindex += 1;
}
table.ApplyVerticalMerge(startcolumn, start, overindex);
}
else if (overindex - startindex == 0)
{
table.ApplyHorizontalMerge(startindex, startcolumn, overcolumn);
}
}
}
catch (Exception ex)
{
MessageUtil.Show("设置合并规则出错请检查:" + ex);
}
}
}
}
this.Invoke(new EventHandler(delegate
{
//更新进度条进度状态,当进度条为跑马灯模式时(ProgressBarStyle.Marquee)不可能调用该方法
this.lbl_progress.PerformStep();
//设置进度百分比
double dCount = fileCount, dProg = this.lbl_progress.Value;
this.lbl_progress.Text = ((dProg / dCount) * 100).ToString() + "%";
this.lbl_progress.Refresh();
}));
RefreshLogUIThread(string.Format("{0}=========》生成成功.\r\n", masterdt.Rows[e]["Name"]));
if (e < masterdt.Rows.Count - 1)
{
sec = document.AddSection();
}
}
//Save to docx file.
try
{
//Paragraph paraInserted = new Paragraph(document);
//TextRange textRange = paraInserted.AppendText("目 录");
//textRange.CharacterFormat.Bold = true;
//textRange.CharacterFormat.TextColor = Color.CadetBlue;
//document.Sections[1].Paragraphs.Insert(0, paraInserted);
//paraInserted.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
//document.Sections[1].Paragraphs[0].AppendTOC(1, 9);
//document.Sections[1].Paragraphs[0].ApplyStyle(BuiltinStyle.Heading1);
//document.UpdateTableOfContents();
//document.Sections.RemoveAt(1);
}
catch (Exception ex)
{
MessageBox.Show("目录生成失败:" + ex);
}
try
{
//添加首页的字段
Paragraph fristparagraph = sec0.AddParagraph();
fristparagraph = sec0.AddParagraph();
fristparagraph = sec0.AddParagraph();
fristparagraph = sec0.AddParagraph();
fristparagraph = sec0.AddParagraph();
fristparagraph = sec0.AddParagraph();
fristparagraph = sec0.AddParagraph();
fristparagraph.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
fristparagraph.AppendText(firstdt.Rows[0]["ERP_WORDTitle"] + "\n");
fristparagraph.AppendText(seconddt.Rows[0]["name"] + "");
fristparagraph.ApplyStyle(BuiltinStyle.Subtitle);
fristparagraph = sec0.AddParagraph();
fristparagraph = sec0.AddParagraph();
fristparagraph.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
fristparagraph.AppendText("ERP-" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + ")\n\n\n\n\n\n\n\n\n\n\n\n");
fristparagraph.ApplyStyle(BuiltinStyle.BodyText);
fristparagraph = sec0.AddParagraph();
fristparagraph.AppendText("初稿");
fristparagraph.ApplyStyle(BuiltinStyle.Subtitle);
string filePath = "word文档" + DateTime.Now.ToString("yyyyMMddHHmmss") + "Sample.docx";
document.SaveToFile(filePath, FileFormat.Docx);
Document doc = new Document();
doc.LoadFromFile(filePath);
Paragraph paraInserted = new Paragraph(doc);
TextRange textRange = paraInserted.AppendText("目 录");
textRange.CharacterFormat.Bold = true;
textRange.CharacterFormat.TextColor = Color.CadetBlue;
doc.Sections[1].Paragraphs.Insert(0, paraInserted);
paraInserted.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
doc.Sections[1].Paragraphs[0].AppendTOC(1, 9);
doc.UpdateTableOfContents();
doc.SaveToFile(filePath, FileFormat.Docx);
//Launching the MS Word file.
WordDocViewer(filePath);
}
catch (Exception ex)
{
MessageBox.Show("首页生成失败:" + ex);
}
}
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(); // 初始化同步平台
// 创建后台线程
Thread backThread = new Thread(Mulu);
backThread.IsBackground = true;
backThread.Start();
}
private void btn_getout_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
using Lskj.Business.Impl;
using Lskj.Core;
using Lskj.Model;
using Spire.Doc;
using Spire.Doc.Documents;
using Spire.Doc.Fields;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
namespace Lskj.WordHelp
{
public partial class Help
{
public BillModel BillModel;
}
}
@@ -0,0 +1,155 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BB67D9AD-3490-4CBF-A680-24D2702AFCC2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lskj.AutoWordFiles</RootNamespace>
<AssemblyName>Lskj.AutoWordFiles</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Debug\Lib\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>logo.ico</ApplicationIcon>
</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.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Spire.Common">
<HintPath>..\..\引用DLL\Spire.Common.dll</HintPath>
</Reference>
<Reference Include="Spire.Doc">
<HintPath>..\..\引用DLL\Spire.Doc.dll</HintPath>
</Reference>
<Reference Include="Spire.License">
<HintPath>..\..\引用DLL\Spire.License.dll</HintPath>
</Reference>
<Reference Include="Spire.Pdf">
<HintPath>..\..\引用DLL\Spire.Pdf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Net" />
<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="FrmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmMain.Designer.cs">
<DependentUpon>FrmMain.cs</DependentUpon>
</Compile>
<Compile Include="Help.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="logo.ico" />
</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.Push\Lskj.Push.csproj">
<Project>{d77c7b9e-3694-400d-bee7-afc99e63e55b}</Project>
<Name>Lskj.Push</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Util\Lskj.Util.csproj">
<Project>{a51bf642-6543-4de3-8948-83f558b72bd4}</Project>
<Name>Lskj.Util</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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,213 @@
/******************************
* 说明:数据库连接参数配置类
* 创建人:龚宇超
* 创建日期:2017-07-24
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
******************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
using System.Data.SqlClient;
using System.Data;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Diagnostics;
namespace Lskj.Core
{
/// <summary>
/// 数据库连接参数配置类
/// </summary>
public sealed class DBConfig
{
private static string _regKey = "AA_LS_Erp V2.0";
private static DBConfig _instance = null;
/// <summary>
/// DBConfig静态单例对象
/// </summary>
/// <value>The instance.</value>
public static DBConfig Instance
{
get
{
if (_instance == null)
{
_instance = new DBConfig();
_instance.ReadConfig();
_instance.WriteConfig();
}
return _instance;
}
}
/// <summary>
/// 数据库名
/// </summary>
public string DataBase;
/// <summary>
/// 帐套
/// </summary>
public string DataBook;
/// <summary>
/// 服务器名
/// </summary>
public string ServerName;
/// <summary>
/// 登录名
/// </summary>
public string LoginName;
/// <summary>
/// 文件升级标志
/// </summary>
public bool UpdateSet;
///<summary>
///智能客户端启动
///</summary>
public bool SmallClient;
/// <summary>
/// 内外外网标志
/// </summary>
public bool Internet;
/// <summary>
/// <para>说明:读取注册表配置</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-07 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
public void ReadConfig()
{
RegistryKey regKey = Registry.CurrentUser;
RegistryKey subKey = regKey.OpenSubKey(_regKey);
subKey = subKey.OpenSubKey("File");
DataBase = subKey.GetValue("datastr", "") + "";
ServerName = subKey.GetValue("ServerName", "") + "";
LoginName = subKey.GetValue("LoginName", "") + "";
UpdateSet = subKey.GetValue("UpdateSet", "0") + "" == "1" || subKey.GetValue("UpdateSet", "0") + "" == "True" ? true : false;
SmallClient = subKey.GetValue("SmallClient", "0") + "" == "1" || subKey.GetValue("SmallClient", "0") + "" == "True" ? true : false;
Internet = subKey.GetValue("Internet", "1") + "" == "0" ? true : false;
try
{
DataBook = subKey.GetValue("DataBook", "") + "";
}
catch (Exception)
{
}
}
/// <summary>
/// <para>说明:写配置</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-07 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
public void WriteConfig()
{
RegistryKey regKey = Registry.CurrentUser;
RegistryKey subKey = regKey.OpenSubKey(_regKey);
subKey = subKey.OpenSubKey("File", true);
subKey.SetValue("datastr", DataBase);
subKey.SetValue("ServerName", ServerName);
subKey.SetValue("LoginName", LoginName);
subKey.SetValue("UpdateSet", UpdateSet);
subKey.SetValue("SmallClient", SmallClient);
subKey.SetValue("DataBook", DataBook);
subKey.Close();
}
/// <summary>
/// <para>说明:获取C#连接字符串</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-07 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns>System.String.</returns>
public string GetConnection()
{
return string.Format("Server={0};Database={1};Persist Security Info=True;User ID=lserpAdmin;Password=lserp110;Connection Timeout=5", ServerName, DataBase);
}
/// <summary>
/// <para>说明:获取delphi连接字符串</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-07 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns>System.String.</returns>
public string GetDelphiConnection()
{
return string.Format("Provider=SQLOLEDB.1;Server={0};Database={1};Persist Security Info=True;User ID=lserpAdmin;Password=lserp110;Connection Timeout=5", ServerName, DataBase);
}
/// <summary>
/// <para>说明:获取</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-03-28 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns>System.String.</returns>
public string GetLsCrmConnection()
{
return Internet ? "Server=192.168.0.10,14330;Database=lscrm;Persist Security Info=True;User ID=Lserp_crm;Password=lserp_ERP_@#$_123;Connection Timeout=5"
: "Server=lsucrm.ticp.net,14330;Database=lscrm;Persist Security Info=True;User ID=Lserp_crm;Password=lserp_ERP_@#$_123;Connection Timeout=5";
}
/// <summary>
/// <para>说明:创建数据库连接</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-07 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
public bool CreateConnection()
{
string connStr = GetConnection();
if (SqlHelper._connection != null)
{
try
{
SqlHelper._connection.Close();
SqlHelper._connection.Dispose();
}
catch (Exception)
{
}
SqlHelper._connection = null;
}
try
{
SqlHelper._connection = new SqlConnection(connStr);
SqlHelper._connection.Open();
return true;
}
catch (Exception ex)
{
}
return false;
}
}
}
@@ -0,0 +1,651 @@
/******************************
* 说明:数据库操作类
* 创建人:龚宇超
* 创建日期:2017-07-24
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
******************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace Lskj.Core
{
/// <summary>
/// 数据库操作类
/// </summary>
public static class SqlHelper
{
/// <summary>
/// 数据连接
/// </summary>
public static SqlConnection _connection;
#region ExecuteAdapter
/// <summary>
/// <para>说明:获取适配器</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>SqlDataAdapter.</returns>
public static SqlDataAdapter ExecuteAdapter(CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
{
SqlDataAdapter adapter;
SqlCommand cmd = new SqlCommand();
try
{
PrepareCommand(cmd, _connection, null, cmdType, cmdText, commandParameters);
adapter = new SqlDataAdapter(cmd);
}
catch
{
throw;
}
return adapter;
}
/// <summary>
/// <para>说明:获取适配器</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <returns>SqlDataAdapter.</returns>
public static SqlDataAdapter ExecuteAdapter(CommandType cmdType, string cmdText)
{
SqlDataAdapter adapter;
SqlCommand cmd = new SqlCommand();
try
{
PrepareCommand(cmd, _connection, null, cmdType, cmdText, null);
adapter = new SqlDataAdapter(cmd);
}
catch
{
throw;
}
return adapter;
}
#endregion
#region ExecuteDataTable
/// <summary>
/// <para>说明:执行sql返回DataTable</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdText">The command text.</param>
/// <returns>DataTable.</returns>
public static DataTable ExecuteDataTable(string cmdText)
{
return ExecuteDataSet(cmdText).Tables[0];
}
/// <summary>
/// <para>说明:执行sql返回DataTable</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdText">The command text.</param>
/// <returns>DataTable.</returns>
public static DataTable ExecuteDataTable(string cmdText, params SqlParameter[] commandParameters)
{
return ExecuteDataSet(CommandType.Text, cmdText, "temp", commandParameters).Tables[0];
}
/// <summary>
/// <para>说明:执行sql返回指定字段值</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-15 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="fieldName">Name of the field.</param>
/// <param name="cmdText">The command text.</param>
/// <returns>System.Object.</returns>
public static object ExecuteObject(string fieldName, string cmdText)
{
object result = null;
try
{
result = ExecuteDataSet(cmdText).Tables[0].Rows[0][fieldName];
}
catch (Exception)
{
}
return result;
}
/// <summary>
/// <para>说明:执行sql返回指定字段值</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-11-27 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="fieldName">Name of the field.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>System.Object.</returns>
public static object ExecuteObject(string fieldName, string cmdText, params SqlParameter[] commandParameters)
{
object result = null;
try
{
result = ExecuteDataSet(CommandType.Text, cmdText, "temp", commandParameters).Tables[0].Rows[0][fieldName];
}
catch (Exception)
{
}
return result;
}
/// <summary>
/// <para>说明:执行sql返回指定字段值</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-15 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="fieldName">Name of the field.</param>
/// <param name="cmdText">The command text.</param>
/// <returns>System.Object.</returns>
public static string ExecuteString(string fieldName, string cmdText)
{
object obj = ExecuteObject(fieldName, cmdText);
return obj == null ? "" : obj.ToString();
}
/// <summary>
/// <para>说明:执行sql返回指定字段值</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-11-27 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="fieldName">Name of the field.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>System.String.</returns>
public static string ExecuteString(string fieldName, string cmdText, params SqlParameter[] commandParameters)
{
object obj = ExecuteObject(fieldName, cmdText, commandParameters);
return obj == null ? "" : obj.ToString();
}
#endregion
#region ExecuteDataSet
/// <summary>
/// <para>说明:查询结果集</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="tabName">Name of the tab.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>DataSet.</returns>
public static DataSet ExecuteDataSet(int cmdType, string cmdText, string tabName, params SqlParameter[] commandParameters)
{
CommandType _cmdType = CommandType.Text;
switch (cmdType)
{
case 4:
_cmdType = CommandType.StoredProcedure;
break;
case 512:
_cmdType = CommandType.TableDirect;
break;
}
return ExecuteDataSet(_cmdType, cmdText, tabName, commandParameters);
}
/// <summary>
/// <para>说明:查询结果集</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">语句类型存储过程或者sql语句</param>
/// <param name="cmdText">执行内容</param>
/// <param name="tabName">表名</param>
/// <param name="commandParameters">参数</param>
/// <returns>DataSet.</returns>
public static DataSet ExecuteDataSet(CommandType cmdType, string cmdText, string tabName, params SqlParameter[] commandParameters)
{
DataSet set2;
SqlCommand cmd = new SqlCommand();
try
{
PrepareCommand(cmd, _connection, null, cmdType, cmdText, commandParameters);
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, tabName);
//adapter.FillSchema(dataSet, SchemaType.Mapped, tabName);
set2 = dataSet;
}
catch
{
throw;
}
finally
{
cmd.Dispose();
}
return set2;
}
/// <summary>
/// <para>说明:查询结果集</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">语句类型存储过程或者sql语句</param>
/// <param name="cmdText">执行内容</param>
/// <param name="tabName">表名</param>
/// <returns>DataSet.</returns>
public static DataSet ExecuteDataSet(CommandType cmdType, string cmdText, string tabName)
{
DataSet set2;
SqlCommand cmd = new SqlCommand();
try
{
PrepareCommand(cmd, _connection, null, cmdType, cmdText, null);
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, tabName);
set2 = dataSet;
}
catch
{
throw;
}
return set2;
}
/// <summary>
/// <para>说明:查询结果集</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdText">执行内容</param>
/// <returns>DataSet.</returns>
public static DataSet ExecuteDataSet(string cmdText)
{
DataSet set2;
SqlCommand cmd = new SqlCommand();
try
{
PrepareCommand(cmd, _connection, null, CommandType.Text, cmdText, null);
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, "temp");
set2 = dataSet;
}
catch
{
throw;
}
return set2;
}
/// <summary>
/// <para>说明:查询结果集</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="procedureName">Name of the procedure.</param>
/// <param name="tabName">表名</param>
/// <param name="parameterNames">The parameter names.</param>
/// <param name="parameterValues">The parameter values.</param>
/// <returns>DataSet.</returns>
public static DataSet ExecuteDataSet(string procedureName, string tabName, string[] parameterNames, object[] parameterValues)
{
DataSet set2;
try
{
SqlCommand cmd = new SqlCommand(procedureName, _connection);
cmd.CommandType = CommandType.StoredProcedure;
if (parameterNames != null && parameterValues != null)
{
for (int i = 0; i < parameterNames.Length && i < parameterValues.Length; i++)
{
cmd.Parameters.AddWithValue(parameterNames[i], parameterValues[i]);
}
}
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, tabName);
set2 = dataSet;
}
catch
{
throw;
}
return set2;
}
#endregion
#region ExecuteNonQuery
/// <summary>
/// <para>说明:执行sql语句或者存储过程</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="Connectionection">The connectionection.</param>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>System.Int32.</returns>
public static int ExecuteNonQuery(SqlConnection Connectionection, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
{
SqlCommand cmd = new SqlCommand();
PrepareCommand(cmd, Connectionection, null, cmdType, cmdText, commandParameters);
int num = cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
return num;
}
/// <summary>
/// <para>说明:执行sql语句或者存储过程</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="trans">The trans.</param>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>System.Int32.</returns>
public static int ExecuteNonQuery(SqlTransaction trans, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
{
SqlCommand cmd = new SqlCommand();
PrepareCommand(cmd, trans.Connection, trans, cmdType, cmdText, commandParameters);
int num = cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
return num;
}
/// <summary>
/// <para>说明:执行sql语句或者存储过程</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>System.Int32.</returns>
public static int ExecuteNonQuery(CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
{
SqlCommand cmd = new SqlCommand();
PrepareCommand(cmd, _connection, null, cmdType, cmdText, commandParameters);
int num = cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
return num;
}
/// <summary>
/// <para>说明:执行sql语句或者存储过程</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <returns>System.Int32.</returns>
public static int ExecuteNonQuery(CommandType cmdType, string cmdText)
{
SqlCommand cmd = new SqlCommand();
PrepareCommand(cmd, _connection, null, cmdType, cmdText, null);
int num = cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
return num;
}
/// <summary>
/// <para>说明:执行sql语句或者存储过程</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdText">The command text.</param>
/// <returns>System.Int32.</returns>
public static int ExecuteNonQuery(string cmdText)
{
SqlCommand cmd = new SqlCommand();
PrepareCommand(cmd, _connection, null, CommandType.Text, cmdText, null);
int num = cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
return num;
}
#endregion
#region ExecuteReader
/// <summary>
/// <para>说明:执行sql语句或者存储过程并返回结果集(只读、只进)</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>SqlDataReader.</returns>
public static SqlDataReader ExecuteReader(CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
{
SqlDataReader reader2;
SqlCommand cmd = new SqlCommand();
try
{
PrepareCommand(cmd, _connection, null, cmdType, cmdText, commandParameters);
SqlDataReader reader = cmd.ExecuteReader();
cmd.Parameters.Clear();
reader2 = reader;
}
catch
{
throw;
}
return reader2;
}
#endregion
#region ExecuteScalar
/// <summary>
/// <para>说明:执行sql语句或者存储过程并返回结果集第一行第一列</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="Connectionection">The connectionection.</param>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>System.Object.</returns>
public static object ExecuteScalar(SqlConnection Connectionection, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
{
SqlCommand cmd = new SqlCommand();
PrepareCommand(cmd, Connectionection, null, cmdType, cmdText, commandParameters);
object obj2 = cmd.ExecuteScalar();
cmd.Parameters.Clear();
return obj2;
}
/// <summary>
/// <para>说明:执行sql语句或者存储过程并返回结果集第一行第一列</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="commandParameters">The command parameters.</param>
/// <returns>System.Object.</returns>
public static object ExecuteScalar(CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
{
SqlCommand cmd = new SqlCommand();
{
PrepareCommand(cmd, _connection, null, cmdType, cmdText, commandParameters);
object obj2 = cmd.ExecuteScalar();
cmd.Parameters.Clear();
return obj2;
}
}
/// <summary>
/// <para>说明:执行sql语句或者存储过程并返回结果集第一行第一列</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <returns>System.Object.</returns>
public static object ExecuteScalar(CommandType cmdType, string cmdText)
{
SqlCommand cmd = new SqlCommand();
{
PrepareCommand(cmd, _connection, null, cmdType, cmdText, null);
object obj2 = cmd.ExecuteScalar();
cmd.Parameters.Clear();
return obj2;
}
}
/// <summary>
/// <para>说明:执行sql语句或者存储过程并返回结果集第一行第一列</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-21 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmdText">The command text.</param>
/// <returns>System.Object.</returns>
public static object ExecuteScalar(string cmdText)
{
SqlCommand cmd = new SqlCommand();
{
PrepareCommand(cmd, _connection, null, CommandType.Text, cmdText, null);
object obj2 = cmd.ExecuteScalar();
cmd.Parameters.Clear();
return obj2;
}
}
#endregion
#region PrepareCommand
/// <summary>
/// <para>说明: sql参数处理</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-07-24 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="cmd">The command.</param>
/// <param name="Connection">The connection.</param>
/// <param name="trans">The trans.</param>
/// <param name="cmdType">Type of the command.</param>
/// <param name="cmdText">The command text.</param>
/// <param name="cmdParms">The command parms.</param>
private static void PrepareCommand(SqlCommand cmd, SqlConnection Connection, SqlTransaction trans, CommandType cmdType, string cmdText, SqlParameter[] cmdParms)
{
if (Connection.State != ConnectionState.Open)
{
Connection.Open();
}
cmd.Connection = Connection;
//cmd.CommandTimeout = CommandTimeout;
cmd.CommandText = cmdText;
if (trans != null)
{
cmd.Transaction = trans;
}
cmd.CommandType = cmdType;
if (cmdParms != null)
{
foreach (SqlParameter parameter in cmdParms)
{
cmd.Parameters.Add(parameter);
}
}
}
#endregion
}
}
+22
View File
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Lserp_WordHelp
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmMain());
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Lskj.WordHelp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lskj.WordHelp")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("99914c91-26c4-4b7c-806e-9962eeda3400")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Lskj.AutoWordFiles.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Lskj.AutoWordFiles.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;
}
}
}
}
@@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Lskj.AutoWordFiles.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.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;
}
}
}
}
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB