init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using CommonLib;
|
||||
using Ls;
|
||||
|
||||
namespace EmployeeManager
|
||||
{
|
||||
/// <summary>
|
||||
/// c#库被调用统一接口类
|
||||
/// </summary>
|
||||
public sealed class DllBaseClass
|
||||
{
|
||||
public DllBaseClass()
|
||||
{
|
||||
}
|
||||
|
||||
//以数组传入参数,容易扩展
|
||||
public DllBaseClass(string[] args)
|
||||
{
|
||||
|
||||
FrmMain _FrmMain = new FrmMain();
|
||||
//------------------自定义的参数解析过程----------------
|
||||
try
|
||||
{
|
||||
if (args.Length == 0)
|
||||
_FrmMain.Text = "没有参数";
|
||||
else
|
||||
{
|
||||
Ls.sysstr.str1 = (string)args[0];
|
||||
Ls.sysstr.str2 = (string)args[1];
|
||||
Ls.sysstr.str3 = (string)args[2];
|
||||
Ls.sysstr.str4 = (string)args[3];
|
||||
Ls.sysstr.str5 = (string)args[4];
|
||||
Ls.sysstr.str6 = (string)args[5];
|
||||
Ls.sysstr.str7 = (string)args[6];
|
||||
Ls.sysstr.str8 = (string)args[7];
|
||||
_FrmMain.Text = Ls.sysstr.str1;
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PubUtil.WriteLog("ModuleInit错误:" + ex.Message);
|
||||
}
|
||||
//------------------解析完毕,准备调用有关窗体----------------
|
||||
|
||||
_FrmMain.ShowDialog();
|
||||
_FrmMain.Close();
|
||||
_FrmMain.Dispose();
|
||||
_FrmMain = null;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+418
@@ -0,0 +1,418 @@
|
||||
namespace EmployeeManager
|
||||
{
|
||||
partial class FrmMain
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.gridControl2 = new DevExpress.XtraGrid.GridControl();
|
||||
this.gridView2 = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.tagname = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.softmodule = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.tagid = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.gridControl1 = new DevExpress.XtraGrid.GridControl();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.orderid = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.Mix_apellation = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.Mix_Bak = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.tmp1 = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.bases1 = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.Ban = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.Tag = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.Id = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.BtnAdd = new System.Windows.Forms.Button();
|
||||
this.BtnPrint = new System.Windows.Forms.Button();
|
||||
this.BtnOut = new System.Windows.Forms.Button();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.BtnDel = new System.Windows.Forms.Button();
|
||||
this.btnSave = new System.Windows.Forms.Button();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.panel3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridControl2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
|
||||
this.panel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.gridControl2);
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.panel3.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(221, 572);
|
||||
this.panel3.TabIndex = 13;
|
||||
//
|
||||
// gridControl2
|
||||
//
|
||||
this.gridControl2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gridControl2.Location = new System.Drawing.Point(0, 0);
|
||||
this.gridControl2.MainView = this.gridView2;
|
||||
this.gridControl2.Name = "gridControl2";
|
||||
this.gridControl2.Size = new System.Drawing.Size(221, 572);
|
||||
this.gridControl2.TabIndex = 0;
|
||||
this.gridControl2.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
|
||||
this.gridView2});
|
||||
//
|
||||
// gridView2
|
||||
//
|
||||
this.gridView2.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
|
||||
this.tagname,
|
||||
this.softmodule,
|
||||
this.tagid});
|
||||
this.gridView2.GridControl = this.gridControl2;
|
||||
this.gridView2.Name = "gridView2";
|
||||
this.gridView2.OptionsSelection.MultiSelect = true;
|
||||
this.gridView2.OptionsSelection.UseIndicatorForSelection = false;
|
||||
this.gridView2.OptionsView.ShowFooter = true;
|
||||
this.gridView2.OptionsView.ShowGroupPanel = false;
|
||||
this.gridView2.OptionsView.ShowIndicator = false;
|
||||
this.gridView2.Click += new System.EventHandler(this.gridView2_Click);
|
||||
//
|
||||
// tagname
|
||||
//
|
||||
this.tagname.Caption = "所属类别";
|
||||
this.tagname.FieldName = "tagname";
|
||||
this.tagname.Name = "tagname";
|
||||
this.tagname.OptionsColumn.AllowEdit = false;
|
||||
this.tagname.Visible = true;
|
||||
this.tagname.VisibleIndex = 1;
|
||||
this.tagname.Width = 96;
|
||||
//
|
||||
// softmodule
|
||||
//
|
||||
this.softmodule.Caption = "类别名称";
|
||||
this.softmodule.FieldName = "softmodule";
|
||||
this.softmodule.Name = "softmodule";
|
||||
this.softmodule.OptionsColumn.AllowEdit = false;
|
||||
this.softmodule.Visible = true;
|
||||
this.softmodule.VisibleIndex = 0;
|
||||
this.softmodule.Width = 73;
|
||||
//
|
||||
// tagid
|
||||
//
|
||||
this.tagid.Caption = "tagid";
|
||||
this.tagid.FieldName = "tagid";
|
||||
this.tagid.Name = "tagid";
|
||||
//
|
||||
// gridControl1
|
||||
//
|
||||
this.gridControl1.ContextMenuStrip = this.contextMenuStrip1;
|
||||
this.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gridControl1.Location = new System.Drawing.Point(221, 0);
|
||||
this.gridControl1.MainView = this.gridView1;
|
||||
this.gridControl1.Name = "gridControl1";
|
||||
this.gridControl1.Size = new System.Drawing.Size(752, 542);
|
||||
this.gridControl1.TabIndex = 14;
|
||||
this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
|
||||
this.gridView1});
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripMenuItem1,
|
||||
this.toolStripMenuItem2,
|
||||
this.toolStripMenuItem3,
|
||||
this.toolStripMenuItem4});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(193, 92);
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(192, 22);
|
||||
this.toolStripMenuItem1.Text = "复制数据";
|
||||
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
|
||||
//
|
||||
// toolStripMenuItem2
|
||||
//
|
||||
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(192, 22);
|
||||
this.toolStripMenuItem2.Text = "toolStripMenuItem2";
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(192, 22);
|
||||
this.toolStripMenuItem3.Text = "toolStripMenuItem3";
|
||||
//
|
||||
// toolStripMenuItem4
|
||||
//
|
||||
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
|
||||
this.toolStripMenuItem4.Size = new System.Drawing.Size(192, 22);
|
||||
this.toolStripMenuItem4.Text = "toolStripMenuItem4";
|
||||
//
|
||||
// gridView1
|
||||
//
|
||||
this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
|
||||
this.orderid,
|
||||
this.Mix_apellation,
|
||||
this.Mix_Bak,
|
||||
this.tmp1,
|
||||
this.bases1,
|
||||
this.Ban,
|
||||
this.Tag,
|
||||
this.Id});
|
||||
this.gridView1.GridControl = this.gridControl1;
|
||||
this.gridView1.Name = "gridView1";
|
||||
this.gridView1.OptionsSelection.MultiSelect = true;
|
||||
this.gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
|
||||
this.gridView1.OptionsView.ShowFooter = true;
|
||||
this.gridView1.OptionsView.ShowGroupPanel = false;
|
||||
//
|
||||
// orderid
|
||||
//
|
||||
this.orderid.Caption = "序号";
|
||||
this.orderid.FieldName = "orderid";
|
||||
this.orderid.Name = "orderid";
|
||||
this.orderid.Summary.AddRange(new DevExpress.XtraGrid.GridSummaryItem[] {
|
||||
new DevExpress.XtraGrid.GridColumnSummaryItem(DevExpress.Data.SummaryItemType.Count, "productid", "{0,0}")});
|
||||
this.orderid.Visible = true;
|
||||
this.orderid.VisibleIndex = 0;
|
||||
this.orderid.Width = 68;
|
||||
//
|
||||
// Mix_apellation
|
||||
//
|
||||
this.Mix_apellation.Caption = "类别名称";
|
||||
this.Mix_apellation.FieldName = "Mix_apellation";
|
||||
this.Mix_apellation.Name = "Mix_apellation";
|
||||
this.Mix_apellation.Visible = true;
|
||||
this.Mix_apellation.VisibleIndex = 1;
|
||||
this.Mix_apellation.Width = 156;
|
||||
//
|
||||
// Mix_Bak
|
||||
//
|
||||
this.Mix_Bak.Caption = "备注";
|
||||
this.Mix_Bak.FieldName = "Mix_Bak";
|
||||
this.Mix_Bak.Name = "Mix_Bak";
|
||||
this.Mix_Bak.Visible = true;
|
||||
this.Mix_Bak.VisibleIndex = 2;
|
||||
this.Mix_Bak.Width = 187;
|
||||
//
|
||||
// tmp1
|
||||
//
|
||||
this.tmp1.Caption = "其它1";
|
||||
this.tmp1.FieldName = "tmp1";
|
||||
this.tmp1.Name = "tmp1";
|
||||
this.tmp1.Visible = true;
|
||||
this.tmp1.VisibleIndex = 3;
|
||||
this.tmp1.Width = 103;
|
||||
//
|
||||
// bases1
|
||||
//
|
||||
this.bases1.Caption = "自定义1";
|
||||
this.bases1.FieldName = "bases1";
|
||||
this.bases1.Name = "bases1";
|
||||
this.bases1.Visible = true;
|
||||
this.bases1.VisibleIndex = 4;
|
||||
this.bases1.Width = 97;
|
||||
//
|
||||
// Ban
|
||||
//
|
||||
this.Ban.Caption = "禁用";
|
||||
this.Ban.FieldName = "Ban";
|
||||
this.Ban.Name = "Ban";
|
||||
this.Ban.UnboundType = DevExpress.Data.UnboundColumnType.Boolean;
|
||||
this.Ban.Visible = true;
|
||||
this.Ban.VisibleIndex = 5;
|
||||
this.Ban.Width = 37;
|
||||
//
|
||||
// Tag
|
||||
//
|
||||
this.Tag.AppearanceCell.BackColor = System.Drawing.Color.WhiteSmoke;
|
||||
this.Tag.AppearanceCell.BorderColor = System.Drawing.Color.Gray;
|
||||
this.Tag.AppearanceCell.Options.UseBackColor = true;
|
||||
this.Tag.AppearanceCell.Options.UseBorderColor = true;
|
||||
this.Tag.AppearanceHeader.BackColor = System.Drawing.Color.Gray;
|
||||
this.Tag.AppearanceHeader.BackColor2 = System.Drawing.Color.OliveDrab;
|
||||
this.Tag.AppearanceHeader.BorderColor = System.Drawing.Color.OliveDrab;
|
||||
this.Tag.AppearanceHeader.Font = new System.Drawing.Font("Times New Roman", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(1)), true);
|
||||
this.Tag.AppearanceHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.Tag.AppearanceHeader.Options.UseBackColor = true;
|
||||
this.Tag.AppearanceHeader.Options.UseBorderColor = true;
|
||||
this.Tag.AppearanceHeader.Options.UseFont = true;
|
||||
this.Tag.AppearanceHeader.Options.UseForeColor = true;
|
||||
this.Tag.Caption = "主ID";
|
||||
this.Tag.FieldName = "Tag";
|
||||
this.Tag.Name = "Tag";
|
||||
this.Tag.OptionsColumn.AllowEdit = false;
|
||||
this.Tag.Visible = true;
|
||||
this.Tag.VisibleIndex = 6;
|
||||
this.Tag.Width = 48;
|
||||
//
|
||||
// Id
|
||||
//
|
||||
this.Id.Caption = "Id";
|
||||
this.Id.FieldName = "Id";
|
||||
this.Id.Name = "Id";
|
||||
this.Id.OptionsColumn.AllowEdit = false;
|
||||
this.Id.Visible = true;
|
||||
this.Id.VisibleIndex = 7;
|
||||
this.Id.Width = 38;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.BtnAdd);
|
||||
this.panel2.Controls.Add(this.BtnPrint);
|
||||
this.panel2.Controls.Add(this.BtnOut);
|
||||
this.panel2.Controls.Add(this.btnClose);
|
||||
this.panel2.Controls.Add(this.BtnDel);
|
||||
this.panel2.Controls.Add(this.btnSave);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel2.Location = new System.Drawing.Point(221, 542);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(752, 30);
|
||||
this.panel2.TabIndex = 16;
|
||||
//
|
||||
// BtnAdd
|
||||
//
|
||||
this.BtnAdd.Location = new System.Drawing.Point(382, 5);
|
||||
this.BtnAdd.Name = "BtnAdd";
|
||||
this.BtnAdd.Size = new System.Drawing.Size(75, 23);
|
||||
this.BtnAdd.TabIndex = 16;
|
||||
this.BtnAdd.Text = "增加(&A)";
|
||||
this.BtnAdd.UseVisualStyleBackColor = true;
|
||||
this.BtnAdd.Click += new System.EventHandler(this.button7_Click);
|
||||
//
|
||||
// BtnPrint
|
||||
//
|
||||
this.BtnPrint.Location = new System.Drawing.Point(94, 6);
|
||||
this.BtnPrint.Name = "BtnPrint";
|
||||
this.BtnPrint.Size = new System.Drawing.Size(75, 23);
|
||||
this.BtnPrint.TabIndex = 15;
|
||||
this.BtnPrint.Text = "打印(&P)";
|
||||
this.BtnPrint.UseVisualStyleBackColor = true;
|
||||
this.BtnPrint.Click += new System.EventHandler(this.BtnPrint_Click);
|
||||
//
|
||||
// BtnOut
|
||||
//
|
||||
this.BtnOut.Location = new System.Drawing.Point(12, 6);
|
||||
this.BtnOut.Name = "BtnOut";
|
||||
this.BtnOut.Size = new System.Drawing.Size(75, 23);
|
||||
this.BtnOut.TabIndex = 14;
|
||||
this.BtnOut.Text = "导出(&O)";
|
||||
this.BtnOut.UseVisualStyleBackColor = true;
|
||||
this.BtnOut.Click += new System.EventHandler(this.BtnOut_Click);
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Location = new System.Drawing.Point(631, 3);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnClose.TabIndex = 12;
|
||||
this.btnClose.Text = "关闭(&C)";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click_1);
|
||||
//
|
||||
// BtnDel
|
||||
//
|
||||
this.BtnDel.Location = new System.Drawing.Point(550, 4);
|
||||
this.BtnDel.Name = "BtnDel";
|
||||
this.BtnDel.Size = new System.Drawing.Size(75, 23);
|
||||
this.BtnDel.TabIndex = 11;
|
||||
this.BtnDel.Text = "删除(&D)";
|
||||
this.BtnDel.UseVisualStyleBackColor = true;
|
||||
this.BtnDel.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// btnSave
|
||||
//
|
||||
this.btnSave.Location = new System.Drawing.Point(463, 5);
|
||||
this.btnSave.Name = "btnSave";
|
||||
this.btnSave.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnSave.TabIndex = 3;
|
||||
this.btnSave.Text = "修改保存(&S)";
|
||||
this.btnSave.UseVisualStyleBackColor = true;
|
||||
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||
//
|
||||
// FrmMain
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(973, 572);
|
||||
this.Controls.Add(this.gridControl1);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel3);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "FrmMain";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "FrmMain";
|
||||
this.Load += new System.EventHandler(this.FrmMain_Load);
|
||||
this.panel3.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridControl2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit();
|
||||
this.contextMenuStrip1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private DevExpress.XtraGrid.GridControl gridControl1;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn orderid;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn Mix_apellation;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn Mix_Bak;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn tmp1;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn Tag;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Button BtnPrint;
|
||||
private System.Windows.Forms.Button BtnOut;
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private System.Windows.Forms.Button BtnDel;
|
||||
private System.Windows.Forms.Button btnSave;
|
||||
private DevExpress.XtraGrid.GridControl gridControl2;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView2;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn tagname;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn softmodule;
|
||||
private System.Windows.Forms.Button BtnAdd;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn tagid;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn bases1;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn Ban;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn Id;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
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 System.Data.SqlClient;
|
||||
using CommonLib;
|
||||
using DevExpress.XtraPrinting;
|
||||
using DevExpress.XtraPrinting.Preview;
|
||||
using System.IO;
|
||||
|
||||
|
||||
//DllBaseClass
|
||||
namespace EmployeeManager
|
||||
{
|
||||
public partial class FrmMain : Form
|
||||
{
|
||||
public FrmMain()
|
||||
{
|
||||
// this.textBox1=PubUtil.
|
||||
//DevExpress.XtraGrid.Localization.GridResLocalizer.Active = new Dxper.LocalizationCHS.Win.XtraGridCHS();
|
||||
//DevExpress.XtraEditors.Controls.Localizer.Active = new Dxper.LocalizationCHS.Win.XtraEditorsCHS();
|
||||
//DevExpress.XtraLayout.Localization.LayoutLocalizer.Active = new Dxper.LocalizationCHS.Win.XtraLayoutCHS();
|
||||
//DevExpress.XtraPrinting.Localization.PreviewLocalizer.Active = new Dxper.LocalizationCHS.Win.XtraPrintingCHS();
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
private SqlDataAdapter da;
|
||||
private DataSet ds = new DataSet();
|
||||
|
||||
|
||||
private void FrmMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
Ls.dx.SelectRow(gridView2);
|
||||
|
||||
if (Ls.sysstr.str3 == "2")
|
||||
{
|
||||
Ls.dx.SelectRow(gridView1);
|
||||
BtnDel.Enabled = false;
|
||||
BtnAdd.Enabled = false;
|
||||
btnSave.Enabled = false;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
string subidstr = "|" + ERPInfo.Instance.SubSysId + "|";
|
||||
string sql = "select id,tagid,softmodule,tagname from P_BaseMixInfoTypeTab where charindex('" + subidstr + "',useed)>0 order by orderid ";
|
||||
da = SqlHelper.ExecuteAdapter(CommandType.Text,sql);
|
||||
ds.Tables.Clear();
|
||||
da.Fill(ds);
|
||||
gridControl2.DataSource = ds.Tables[0];
|
||||
|
||||
// gridControl2.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PubUtil.WriteLog("基础数据模块错误:" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void btnSave_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
SqlCommandBuilder cb = new SqlCommandBuilder(da);
|
||||
da.Update(ds);
|
||||
MessageBox.Show("修改成功");
|
||||
//MessageBox("修改成功", "朗速科技");
|
||||
}
|
||||
|
||||
private void button2_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Qbtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void button1_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
FrmTest f = new FrmTest();
|
||||
f.ShowDialog();
|
||||
f.Dispose();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void button5_Click(object sender, EventArgs e)
|
||||
{
|
||||
gridView1.OptionsFind.AlwaysVisible = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void btnClose_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
|
||||
}
|
||||
|
||||
private void BtnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
Ls.dx.Preview(gridControl1);
|
||||
|
||||
}
|
||||
|
||||
private void BtnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
Ls.dx.SaveXls(gridControl1);
|
||||
|
||||
}
|
||||
|
||||
private void gridView2_Click(object sender, EventArgs e)
|
||||
{
|
||||
string ID = gridView2.GetFocusedRowCellValue("tagid").ToString();
|
||||
string sql = "select Id,Mix_apellation,Mix_Bak,Tag,Ban,tmp1,tmp2,orderid,bases1,bases2 from dbo.P_BaseMixInfoTab " +
|
||||
" where tag="+ID+" and ban=0 order by orderid ";
|
||||
da = SqlHelper.ExecuteAdapter(CommandType.Text, sql);
|
||||
LoadData();
|
||||
}
|
||||
private void LoadData()
|
||||
{
|
||||
try
|
||||
{
|
||||
ds.Tables.Clear();
|
||||
da.Fill(ds);
|
||||
gridControl1.DataSource = ds.Tables[0];
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PubUtil.WriteLog("基础数据模块错误:" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void button7_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
string Lid = gridView2.GetFocusedRowCellValue("tagid").ToString();
|
||||
int val = SqlHelper.ExecuteNonQuery(SqlHelper.conn, CommandType.Text, "insert P_BaseMixInfoTab(orderid,mix_no,Mix_apellation,Mix_Bak,Tag) " +
|
||||
" select " + (gridView1.RowCount+1)+ ",'输入编号','输入类别','输入备注'," + Lid + " ", null);
|
||||
LoadData();
|
||||
gridView1.MoveLast();
|
||||
//gridView1.IsLastRow=true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
SqlCommandBuilder cb = new SqlCommandBuilder(da);
|
||||
da.Update(ds);
|
||||
MessageBox.Show("修改成功");
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBoxButtons messButton = MessageBoxButtons.OKCancel;
|
||||
DialogResult dr = MessageBox.Show("确定删除数据吗?", "朗速科技", messButton);
|
||||
if (dr == DialogResult.OK)//如果点击“确定”按钮
|
||||
{
|
||||
string Lid = gridView1.GetFocusedRowCellValue("Id").ToString();
|
||||
int val = SqlHelper.ExecuteNonQuery(SqlHelper.conn, CommandType.Text, "delete P_BaseMixInfoTab where Id=" + Lid + "", null);
|
||||
gridView1.DeleteSelectedRows();
|
||||
LoadData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void toolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
//Clipboard.SetText(this.gridView1.GetCli
|
||||
// Clipboard.SetText(gridView1.GetSelectedRows);
|
||||
//.GetClipboardContent().GetData(DataFormats.Text).ToString());
|
||||
// gridControl1.
|
||||
// gridView1.GetSelectedRows
|
||||
Ls.dx.CopyTitle(gridView1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
SqlConnection connection = new SqlConnection(connectionString);
|
||||
SqlCommand cmd = new SqlCommand();
|
||||
SqlDataAdapter da = new SqlDataAdapter(cmd);
|
||||
da.DeleteCommand = new SqlCommand("", connection);
|
||||
da.InsertCommand = new SqlCommand("", connection);
|
||||
da.UpdateCommand = new SqlCommand("", connection);
|
||||
|
||||
|
||||
SqlCommandBuilder myCommandBuilder = new SqlCommandBuilder(da);
|
||||
da.DeleteCommand = myCommandBuilder.GetDeleteCommand();
|
||||
da.InsertCommand = myCommandBuilder.GetInsertCommand();
|
||||
da.UpdateCommand = myCommandBuilder.GetUpdateCommand();
|
||||
|
||||
DataTable tb=(DataTable)datagridview1.DataSource;
|
||||
da.Update(tb);
|
||||
|
||||
*/
|
||||
File diff suppressed because it is too large
Load Diff
Generated
+116
@@ -0,0 +1,116 @@
|
||||
namespace EmployeeManager
|
||||
{
|
||||
partial class FrmTest
|
||||
{
|
||||
/// <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.listBox1 = new System.Windows.Forms.ListBox();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// listBox1
|
||||
//
|
||||
this.listBox1.FormattingEnabled = true;
|
||||
this.listBox1.ItemHeight = 12;
|
||||
this.listBox1.Location = new System.Drawing.Point(160, 217);
|
||||
this.listBox1.Name = "listBox1";
|
||||
this.listBox1.Size = new System.Drawing.Size(94, 52);
|
||||
this.listBox1.TabIndex = 11;
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Items.AddRange(new object[] {
|
||||
"测试1",
|
||||
"测试2",
|
||||
"测试3"});
|
||||
this.comboBox1.Location = new System.Drawing.Point(147, 171);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(121, 20);
|
||||
this.comboBox1.TabIndex = 10;
|
||||
//
|
||||
// checkedListBox1
|
||||
//
|
||||
this.checkedListBox1.FormattingEnabled = true;
|
||||
this.checkedListBox1.Items.AddRange(new object[] {
|
||||
"测试1",
|
||||
"测试2",
|
||||
"测试3"});
|
||||
this.checkedListBox1.Location = new System.Drawing.Point(147, 66);
|
||||
this.checkedListBox1.Name = "checkedListBox1";
|
||||
this.checkedListBox1.Size = new System.Drawing.Size(120, 84);
|
||||
this.checkedListBox1.TabIndex = 9;
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.AutoSize = true;
|
||||
this.checkBox1.Location = new System.Drawing.Point(177, 17);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.Size = new System.Drawing.Size(78, 16);
|
||||
this.checkBox1.TabIndex = 8;
|
||||
this.checkBox1.Text = "checkBox1";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(314, 202);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 12;
|
||||
this.button1.Text = "关闭";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// FrmTest
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(415, 286);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.listBox1);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.checkedListBox1);
|
||||
this.Controls.Add(this.checkBox1);
|
||||
this.Name = "FrmTest";
|
||||
this.Text = "FrmTest";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ListBox listBox1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.CheckedListBox checkedListBox1;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace EmployeeManager
|
||||
{
|
||||
public partial class FrmTest : Form
|
||||
{
|
||||
public FrmTest()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("测试窗口");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,170 @@
|
||||
<?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)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{73E41A23-CE3D-4724-A794-80FA9AE071A3}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>P_baseDate</RootNamespace>
|
||||
<AssemblyName>P_baseDate</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\publish\lib\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\..\..\pub\lib\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup />
|
||||
<ItemGroup>
|
||||
<Reference Include="DevExpress.Charts.v13.1.Core, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.Charts.v13.1.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.Data.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Printing.v13.1.Core, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.Printing.v13.1.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Tutorials.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.Tutorials.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Utils.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.Utils.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpo.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.Xpo.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraBars.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraBars.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraCharts.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraCharts.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraCharts.v13.1.Extensions, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraCharts.v13.1.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraCharts.v13.1.UI, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraCharts.v13.1.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraCharts.v13.1.Web, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraCharts.v13.1.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraCharts.v13.1.Wizard, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraCharts.v13.1.Wizard.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraEditors.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraEditors.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraGrid.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraGrid.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraLayout.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraLayout.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraPrinting.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraPrinting.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraTreeList.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\DevExpress.XtraTreeList.v13.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dxper.LocalizationCHS.Win.v13.1.5, Version=13.1.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\Dxper.LocalizationCHS.Win.v13.1.5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<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="FrmTest.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmTest.Designer.cs">
|
||||
<DependentUpon>FrmTest.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ls.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="FrmMain.resx">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FrmTest.resx">
|
||||
<DependentUpon>FrmTest.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="a.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CommonLib\CommonLib.csproj">
|
||||
<Project>{3E8E6529-5D8A-4F17-8C41-27CD7380178D}</Project>
|
||||
<Name>CommonLib</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,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P_baseDate", "P_baseDate.csproj", "{73E41A23-CE3D-4724-A794-80FA9AE071A3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{73E41A23-CE3D-4724-A794-80FA9AE071A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{73E41A23-CE3D-4724-A794-80FA9AE071A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{73E41A23-CE3D-4724-A794-80FA9AE071A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{73E41A23-CE3D-4724-A794-80FA9AE071A3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using EmployeeManager;
|
||||
|
||||
namespace EmployeeManager
|
||||
{
|
||||
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("EmployeeManager")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("EmployeeManager")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("b5756d80-308a-4094-8002-58d974ad7cf6")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
@@ -0,0 +1,316 @@
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.Win32;
|
||||
using System.Management;
|
||||
using System.Net;
|
||||
using System.Globalization;
|
||||
using System.Data.SqlClient;
|
||||
using CommonLib;
|
||||
using DevExpress.XtraPrinting;
|
||||
using DevExpress.XtraPrinting.Preview;
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.XtraGrid;
|
||||
using DevExpress.XtraGrid.Columns;
|
||||
using DevExpress.XtraGrid.Views.Base;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
||||
|
||||
|
||||
|
||||
namespace Ls
|
||||
{
|
||||
public class sysstr
|
||||
{
|
||||
public static string str1;
|
||||
public static string str2;
|
||||
public static string showid;
|
||||
public static string str3;
|
||||
public static string str4;
|
||||
public static string str5;
|
||||
public static string str6;
|
||||
public static string str7;
|
||||
public static string str8;
|
||||
}
|
||||
public class dx
|
||||
{
|
||||
|
||||
public static int SaveXls(DevExpress.XtraGrid.GridControl GridControlPub)
|
||||
{
|
||||
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||
saveFileDialog.Title = "导出Excel";
|
||||
saveFileDialog.Filter = "Excel文件(*.xls)|*.xls|Excel2007|*.xlsx|PDF文件|*.PDF|RTF文件|*.RTF|HTML文件|*.html";
|
||||
DialogResult dialogResult = saveFileDialog.ShowDialog();
|
||||
if (dialogResult == DialogResult.OK)
|
||||
{
|
||||
DevExpress.XtraPrinting.XlsExportOptions options = new DevExpress.XtraPrinting.XlsExportOptions();
|
||||
if (saveFileDialog.FilterIndex == 1)
|
||||
{
|
||||
GridControlPub.ExportToXls(saveFileDialog.FileName);
|
||||
}
|
||||
if (saveFileDialog.FilterIndex == 2)
|
||||
{
|
||||
GridControlPub.ExportToXlsx(saveFileDialog.FileName);
|
||||
}
|
||||
if (saveFileDialog.FilterIndex == 3)
|
||||
{
|
||||
GridControlPub.ExportToPdf(saveFileDialog.FileName);
|
||||
}
|
||||
if (saveFileDialog.FilterIndex == 4)
|
||||
{
|
||||
GridControlPub.ExportToRtf(saveFileDialog.FileName);
|
||||
}
|
||||
if (saveFileDialog.FilterIndex == 5)
|
||||
{
|
||||
GridControlPub.ExportToHtml(saveFileDialog.FileName);
|
||||
}
|
||||
DevExpress.XtraEditors.XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
public static int Preview(DevExpress.XtraGrid.GridControl GridControlPub)
|
||||
{
|
||||
PrintingSystem ps = null;
|
||||
DevExpress.XtraPrinting.PrintableComponentLink link = null;
|
||||
ps = new DevExpress.XtraPrinting.PrintingSystem();
|
||||
link = new DevExpress.XtraPrinting.PrintableComponentLink(ps);
|
||||
ps.Links.Add(link);
|
||||
link.Component = GridControlPub;//这里可以是可打印的部件
|
||||
string _PrintHeader = "我的物料档案打印数据信息";
|
||||
PageHeaderFooter phf = link.PageHeaderFooter as PageHeaderFooter;
|
||||
phf.Header.Content.Clear();
|
||||
phf.Header.Content.AddRange(new string[] { "", _PrintHeader, "" });
|
||||
phf.Header.Font = new System.Drawing.Font("宋体", 14, System.Drawing.FontStyle.Bold); phf.Header.LineAlignment = BrickAlignment.Center;
|
||||
link.CreateDocument(); //建立文档
|
||||
ps.PreviewFormEx.Show();
|
||||
return 1;
|
||||
}
|
||||
public static int CopyTitle(DevExpress.XtraGrid.Views.Grid.GridView gridView1)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
StringBuilder stringBuilder2 = new StringBuilder();
|
||||
foreach (GridColumn gridColumn in gridView1.Columns)
|
||||
{
|
||||
if (gridColumn.Visible)
|
||||
{
|
||||
stringBuilder.AppendFormat("{0} ", gridColumn.Caption);
|
||||
}
|
||||
}
|
||||
int[] selectedRows = gridView1.GetSelectedRows();
|
||||
int[] array = selectedRows;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
int rowHandle = array[i];
|
||||
foreach (GridColumn gridColumn in gridView1.Columns)
|
||||
{
|
||||
if (gridColumn.Visible)
|
||||
{
|
||||
stringBuilder2.AppendFormat("{0} ", gridView1.GetRowCellDisplayText(rowHandle, gridColumn.FieldName));
|
||||
}
|
||||
}
|
||||
stringBuilder2.AppendLine();
|
||||
}
|
||||
Clipboard.SetText(stringBuilder.ToString() + "\r\n" + stringBuilder2.ToString());
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static string SetRowNb(object sender, RowIndicatorCustomDrawEventArgs e)
|
||||
{
|
||||
e.Appearance.TextOptions.HAlignment = HorzAlignment.Far;
|
||||
if (e.Info.IsRowIndicator)
|
||||
{
|
||||
if (e.RowHandle >= 0)
|
||||
{
|
||||
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static string SelectRow(DevExpress.XtraGrid.Views.Grid.GridView GridViewpub)
|
||||
{
|
||||
GridViewpub.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
|
||||
GridViewpub.OptionsBehavior.Editable = false;
|
||||
GridViewpub.OptionsSelection.EnableAppearanceFocusedCell = false;
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string Group(DevExpress.XtraGrid.Views.Grid.GridView GridViewpub)
|
||||
{
|
||||
if (GridViewpub.OptionsView.ShowGroupPanel == true)
|
||||
{
|
||||
GridViewpub.OptionsView.ShowGroupPanel = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
GridViewpub.OptionsView.ShowGroupPanel = true;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
public static string find(DevExpress.XtraGrid.Views.Grid.GridView GridViewpub)
|
||||
{
|
||||
if (GridViewpub.OptionsFind.AlwaysVisible == true)
|
||||
{
|
||||
GridViewpub.OptionsFind.AlwaysVisible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
GridViewpub.OptionsFind.AlwaysVisible = true;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
public class Ado
|
||||
{
|
||||
public static string message()
|
||||
{
|
||||
return Ls.Net.GetLocalHost();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class contentsAdo
|
||||
{
|
||||
public static string message()
|
||||
{
|
||||
return Ls.Reg.GetRegistData("ServerName");
|
||||
}
|
||||
}
|
||||
//注册表访问
|
||||
public class Reg
|
||||
{
|
||||
public static string GetRegistData(string name)
|
||||
{
|
||||
string registData;
|
||||
RegistryKey hkml = Registry.CurrentUser;
|
||||
RegistryKey software = hkml.OpenSubKey("AA_LS_Erp V2.0", true);
|
||||
if (software == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
RegistryKey aimdir = software.OpenSubKey("File", true);
|
||||
if (aimdir == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
registData = aimdir.GetValue(name).ToString();
|
||||
if (registData == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return registData;
|
||||
}
|
||||
|
||||
public static void WTRegedit(string name, string tovalue)
|
||||
{
|
||||
RegistryKey hkml = Registry.CurrentUser;
|
||||
RegistryKey software = hkml.CreateSubKey("AA_LS_Erp V2.0");
|
||||
RegistryKey aimdir = software.CreateSubKey("File");
|
||||
aimdir.SetValue(name, tovalue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void SetValue(string keyName, string valueName, object value)
|
||||
{
|
||||
Registry.SetValue(keyName, valueName, value, RegistryValueKind.String);
|
||||
}
|
||||
|
||||
public static object GetValue(string keyName, string valueName, object defaultValue)
|
||||
{
|
||||
object obj1 = Registry.GetValue(keyName, valueName, defaultValue);
|
||||
if (obj1 == null)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
return obj1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class Net
|
||||
{
|
||||
|
||||
public static string GetLocalHost()
|
||||
{
|
||||
return Dns.GetHostName();
|
||||
}
|
||||
//获取本地IP地址
|
||||
public static IPAddress[] GetLocalIP()
|
||||
{
|
||||
string name = Dns.GetHostName();
|
||||
IPHostEntry me = Dns.GetHostEntry(name);
|
||||
return me.AddressList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class IO
|
||||
{
|
||||
|
||||
//建目录
|
||||
public static bool CreatePath(string strPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (strPath.Length == 0)
|
||||
{ return false; }
|
||||
|
||||
if (Directory.Exists(strPath))
|
||||
{ return true; }
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(strPath));
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//写文本日志 try catch (Exception ex)
|
||||
|
||||
public static void WriteLog(string strFile, string strLog)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(strFile))
|
||||
{
|
||||
using (StreamWriter sw1 = File.AppendText(strFile))
|
||||
{
|
||||
//", DateTime.Now.ToString("yyMMdd-HHmmss")
|
||||
sw1.WriteLine("[" + System.DateTime.Now.ToString("yyMMdd-HHmmss") + "]" + strLog);
|
||||
sw1.Close();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IO.CreatePath(strFile))
|
||||
{
|
||||
using (StreamWriter sw2 = File.CreateText(strFile))
|
||||
{
|
||||
sw2.WriteLine("[" + System.DateTime.Now.ToString("yyMMdd-HHmmss") + "]" + strLog);
|
||||
sw2.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user