init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lskj.PhotoView", "Lskj.PhotoView\Lskj.PhotoView.csproj", "{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Debug|x86.Build.0 = Debug|x86
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Release|x86.ActiveCfg = Release|x86
|
||||
{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using CommonLib;
|
||||
using CommonLib.utils;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PhotoView
|
||||
{
|
||||
/// <summary>
|
||||
/// c#库被调用统一接口类
|
||||
/// </summary>
|
||||
public sealed class DllBaseClass : IForm
|
||||
{
|
||||
public DllBaseClass()
|
||||
{
|
||||
|
||||
}
|
||||
//以数组传入参数,容易扩展
|
||||
public DllBaseClass(string[] obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
FrmMain frm = new FrmMain();
|
||||
SubForm = frm;
|
||||
frm.FormText = obj[0];
|
||||
frm.OperatorId = obj[1];
|
||||
frm.OperatorName = obj[2];
|
||||
frm.Privilege = obj[3];
|
||||
frm.DllCoid = obj[4];
|
||||
//扩展参数
|
||||
frm.ObjectId = obj[5];
|
||||
frm.IsView = obj[6];
|
||||
frm.DirId = obj[7];
|
||||
frm.ModuleId = obj[8];
|
||||
if (obj.Length > 9)
|
||||
{
|
||||
// 是否显示关联按钮
|
||||
frm.IsUnionImage = obj[9];
|
||||
}
|
||||
if (obj.Length > 10)
|
||||
{
|
||||
// 需要关联的列
|
||||
frm.ColumnName = obj[10];
|
||||
}
|
||||
if (obj.Length > 11)
|
||||
{
|
||||
// 需要关联的列
|
||||
frm.BmpSpec = obj[11];
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
PubUtil.WriteLog("参数错误!",".Lskj.PhotoView.dll",".图片模块");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗口
|
||||
/// </summary>
|
||||
public Form SubForm { get; set; }
|
||||
}
|
||||
}
|
||||
+363
@@ -0,0 +1,363 @@
|
||||
namespace Lskj.PhotoView
|
||||
{
|
||||
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.tvClass = new System.Windows.Forms.TreeView();
|
||||
this.picEdit = new DevExpress.XtraEditors.PictureEdit();
|
||||
this.btnUpload = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.btnReflash = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.gridMain = new Lskj.MyControl.GridControlEx();
|
||||
this.panel5 = new System.Windows.Forms.Panel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.txtKey = new System.Windows.Forms.TextBox();
|
||||
this.cbField = new System.Windows.Forms.ComboBox();
|
||||
this.btnSearch = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.btnOpenPhoto = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel4 = new System.Windows.Forms.Panel();
|
||||
this.panel7 = new System.Windows.Forms.Panel();
|
||||
this.panel8 = new System.Windows.Forms.Panel();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.panel6 = new System.Windows.Forms.Panel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.panel9 = new System.Windows.Forms.Panel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picEdit.Properties)).BeginInit();
|
||||
this.panel2.SuspendLayout();
|
||||
this.panel5.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel4.SuspendLayout();
|
||||
this.panel7.SuspendLayout();
|
||||
this.panel8.SuspendLayout();
|
||||
this.panel6.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tvClass
|
||||
//
|
||||
this.tvClass.CheckBoxes = true;
|
||||
this.tvClass.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tvClass.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.tvClass.Location = new System.Drawing.Point(0, 26);
|
||||
this.tvClass.Name = "tvClass";
|
||||
this.tvClass.Size = new System.Drawing.Size(260, 339);
|
||||
this.tvClass.TabIndex = 2;
|
||||
//
|
||||
// picEdit
|
||||
//
|
||||
this.picEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.picEdit.Location = new System.Drawing.Point(0, 26);
|
||||
this.picEdit.Name = "picEdit";
|
||||
this.picEdit.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Zoom;
|
||||
this.picEdit.Properties.Click += new System.EventHandler(this.picEdit_Properties_Click);
|
||||
this.picEdit.Size = new System.Drawing.Size(260, 155);
|
||||
this.picEdit.TabIndex = 0;
|
||||
//
|
||||
// btnUpload
|
||||
//
|
||||
this.btnUpload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnUpload.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnUpload.Appearance.Options.UseFont = true;
|
||||
this.btnUpload.Location = new System.Drawing.Point(463, 8);
|
||||
this.btnUpload.Name = "btnUpload";
|
||||
this.btnUpload.Size = new System.Drawing.Size(69, 24);
|
||||
this.btnUpload.TabIndex = 1;
|
||||
this.btnUpload.Text = "上传附件";
|
||||
this.btnUpload.Click += new System.EventHandler(this.btnUpload_Click);
|
||||
//
|
||||
// btnReflash
|
||||
//
|
||||
this.btnReflash.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnReflash.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnReflash.Appearance.Options.UseFont = true;
|
||||
this.btnReflash.Location = new System.Drawing.Point(538, 8);
|
||||
this.btnReflash.Name = "btnReflash";
|
||||
this.btnReflash.Size = new System.Drawing.Size(69, 24);
|
||||
this.btnReflash.TabIndex = 2;
|
||||
this.btnReflash.Text = "刷新";
|
||||
this.btnReflash.Click += new System.EventHandler(this.btnReflash_Click);
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.gridMain);
|
||||
this.panel2.Controls.Add(this.panel5);
|
||||
this.panel2.Controls.Add(this.panel3);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(264, 0);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(616, 546);
|
||||
this.panel2.TabIndex = 2;
|
||||
//
|
||||
// gridMain
|
||||
//
|
||||
this.gridMain.bomCaption = null;
|
||||
this.gridMain.bomSql = null;
|
||||
this.gridMain.ConstSql = null;
|
||||
this.gridMain.detailEnableCond = null;
|
||||
this.gridMain.detailEnableMsg = null;
|
||||
this.gridMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gridMain.loadBom = null;
|
||||
this.gridMain.Location = new System.Drawing.Point(0, 38);
|
||||
this.gridMain.Name = "gridMain";
|
||||
this.gridMain.pnlMain = null;
|
||||
this.gridMain.RowColorCondtion = null;
|
||||
this.gridMain.Size = new System.Drawing.Size(616, 467);
|
||||
this.gridMain.SourceType = 0;
|
||||
this.gridMain.Sql = null;
|
||||
this.gridMain.sqlC = null;
|
||||
this.gridMain.SumFieldsTable = null;
|
||||
this.gridMain.TabIndex = 6;
|
||||
this.gridMain.UnAllowEditChangeColor = false;
|
||||
//
|
||||
// panel5
|
||||
//
|
||||
this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel5.Controls.Add(this.label1);
|
||||
this.panel5.Controls.Add(this.txtKey);
|
||||
this.panel5.Controls.Add(this.cbField);
|
||||
this.panel5.Controls.Add(this.btnSearch);
|
||||
this.panel5.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel5.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel5.Name = "panel5";
|
||||
this.panel5.Size = new System.Drawing.Size(616, 38);
|
||||
this.panel5.TabIndex = 3;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(8, 13);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(29, 12);
|
||||
this.label1.TabIndex = 4;
|
||||
this.label1.Text = "查询";
|
||||
//
|
||||
// txtKey
|
||||
//
|
||||
this.txtKey.Location = new System.Drawing.Point(139, 8);
|
||||
this.txtKey.Name = "txtKey";
|
||||
this.txtKey.Size = new System.Drawing.Size(166, 21);
|
||||
this.txtKey.TabIndex = 3;
|
||||
//
|
||||
// cbField
|
||||
//
|
||||
this.cbField.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbField.FormattingEnabled = true;
|
||||
this.cbField.Location = new System.Drawing.Point(38, 8);
|
||||
this.cbField.Name = "cbField";
|
||||
this.cbField.Size = new System.Drawing.Size(97, 20);
|
||||
this.cbField.TabIndex = 2;
|
||||
//
|
||||
// btnSearch
|
||||
//
|
||||
this.btnSearch.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnSearch.Appearance.Options.UseFont = true;
|
||||
this.btnSearch.Location = new System.Drawing.Point(308, 6);
|
||||
this.btnSearch.Name = "btnSearch";
|
||||
this.btnSearch.Size = new System.Drawing.Size(66, 24);
|
||||
this.btnSearch.TabIndex = 1;
|
||||
this.btnSearch.Text = "搜索";
|
||||
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.btnOpenPhoto);
|
||||
this.panel3.Controls.Add(this.btnReflash);
|
||||
this.panel3.Controls.Add(this.btnUpload);
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel3.Location = new System.Drawing.Point(0, 505);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(616, 41);
|
||||
this.panel3.TabIndex = 4;
|
||||
//
|
||||
// btnOpenPhoto
|
||||
//
|
||||
this.btnOpenPhoto.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnOpenPhoto.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnOpenPhoto.Appearance.Options.UseFont = true;
|
||||
this.btnOpenPhoto.Location = new System.Drawing.Point(21, 8);
|
||||
this.btnOpenPhoto.Name = "btnOpenPhoto";
|
||||
this.btnOpenPhoto.Size = new System.Drawing.Size(70, 24);
|
||||
this.btnOpenPhoto.TabIndex = 5;
|
||||
this.btnOpenPhoto.Text = "启动拍照";
|
||||
this.btnOpenPhoto.Visible = false;
|
||||
this.btnOpenPhoto.Click += new System.EventHandler(this.btnOpenPhoto_Click);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.panel4);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(260, 546);
|
||||
this.panel1.TabIndex = 6;
|
||||
//
|
||||
// panel4
|
||||
//
|
||||
this.panel4.Controls.Add(this.tvClass);
|
||||
this.panel4.Controls.Add(this.panel7);
|
||||
this.panel4.Controls.Add(this.panel6);
|
||||
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel4.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel4.Name = "panel4";
|
||||
this.panel4.Size = new System.Drawing.Size(260, 546);
|
||||
this.panel4.TabIndex = 3;
|
||||
//
|
||||
// panel7
|
||||
//
|
||||
this.panel7.Controls.Add(this.picEdit);
|
||||
this.panel7.Controls.Add(this.panel8);
|
||||
this.panel7.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel7.Location = new System.Drawing.Point(0, 365);
|
||||
this.panel7.Name = "panel7";
|
||||
this.panel7.Size = new System.Drawing.Size(260, 181);
|
||||
this.panel7.TabIndex = 6;
|
||||
this.panel7.Visible = false;
|
||||
//
|
||||
// panel8
|
||||
//
|
||||
this.panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel8.Controls.Add(this.label4);
|
||||
this.panel8.Controls.Add(this.label3);
|
||||
this.panel8.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel8.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel8.Name = "panel8";
|
||||
this.panel8.Size = new System.Drawing.Size(260, 26);
|
||||
this.panel8.TabIndex = 4;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.ForeColor = System.Drawing.Color.Red;
|
||||
this.label4.Location = new System.Drawing.Point(65, 7);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(113, 12);
|
||||
this.label4.TabIndex = 1;
|
||||
this.label4.Text = "点击预览区打开文件";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(6, 7);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(53, 12);
|
||||
this.label3.TabIndex = 0;
|
||||
this.label3.Text = "图片预览";
|
||||
//
|
||||
// panel6
|
||||
//
|
||||
this.panel6.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel6.Controls.Add(this.label2);
|
||||
this.panel6.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel6.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel6.Name = "panel6";
|
||||
this.panel6.Size = new System.Drawing.Size(260, 26);
|
||||
this.panel6.TabIndex = 3;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(6, 7);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(77, 12);
|
||||
this.label2.TabIndex = 0;
|
||||
this.label2.Text = "选择附件分类";
|
||||
//
|
||||
// panel9
|
||||
//
|
||||
this.panel9.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.panel9.Location = new System.Drawing.Point(260, 0);
|
||||
this.panel9.Name = "panel9";
|
||||
this.panel9.Size = new System.Drawing.Size(4, 546);
|
||||
this.panel9.TabIndex = 7;
|
||||
//
|
||||
// FrmMain
|
||||
//
|
||||
this.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
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(880, 546);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel9);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.LookAndFeel.SkinName = "Office 2010 Blue";
|
||||
this.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;
|
||||
this.Name = "FrmMain";
|
||||
this.Text = "附件查看工具";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
|
||||
this.Load += new System.EventHandler(this.FrmMain_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.picEdit.Properties)).EndInit();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel5.ResumeLayout(false);
|
||||
this.panel5.PerformLayout();
|
||||
this.panel3.ResumeLayout(false);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel4.ResumeLayout(false);
|
||||
this.panel7.ResumeLayout(false);
|
||||
this.panel8.ResumeLayout(false);
|
||||
this.panel8.PerformLayout();
|
||||
this.panel6.ResumeLayout(false);
|
||||
this.panel6.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private DevExpress.XtraEditors.SimpleButton btnUpload;
|
||||
private DevExpress.XtraEditors.SimpleButton btnReflash;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.Panel panel5;
|
||||
private DevExpress.XtraEditors.SimpleButton btnSearch;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox txtKey;
|
||||
private System.Windows.Forms.ComboBox cbField;
|
||||
private System.Windows.Forms.TreeView tvClass;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private DevExpress.XtraEditors.PictureEdit picEdit;
|
||||
private System.Windows.Forms.Panel panel4;
|
||||
private System.Windows.Forms.Panel panel6;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Panel panel7;
|
||||
private System.Windows.Forms.Panel panel8;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Panel panel9;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private DevExpress.XtraEditors.SimpleButton btnOpenPhoto;
|
||||
private MyControl.GridControlEx gridMain;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,976 @@
|
||||
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 DevExpress.XtraGrid.Views.Base;
|
||||
using CommonLib;
|
||||
using System.IO;
|
||||
using DevExpress.XtraBars.Ribbon;
|
||||
using System.Diagnostics;
|
||||
using DevExpress.XtraGrid.Columns;
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.PubModule;
|
||||
using System.Xml;
|
||||
using CommonLib.data;
|
||||
using Lskj.CmCapture;
|
||||
using System.Data.SqlClient;
|
||||
using Lskj.Common;
|
||||
|
||||
namespace Lskj.PhotoView
|
||||
{
|
||||
public partial class FrmMain : FormBase
|
||||
{
|
||||
#region 属性
|
||||
private IntPtr m_ClientTestHandle = IntPtr.Zero;
|
||||
public string DllCoid { get; set; }
|
||||
/// <summary>
|
||||
/// 对应模块Id
|
||||
/// </summary>
|
||||
public string ObjectId { get; set; }
|
||||
/// <summary>
|
||||
/// 释放浏览
|
||||
/// </summary>
|
||||
public string IsView { get; set; }
|
||||
/// <summary>
|
||||
/// 是否关联附件
|
||||
/// </summary>
|
||||
public string IsUnionImage { get; set; }
|
||||
/// <summary>
|
||||
/// 需要关联的列
|
||||
/// </summary>
|
||||
public string ColumnName { get; set; }
|
||||
/// <summary>
|
||||
/// 父目录Id
|
||||
/// </summary>
|
||||
public string DirId { get; set; }
|
||||
|
||||
public string BmpSpec { get; set; }
|
||||
private string FileDLLCoid = "2005_1";
|
||||
|
||||
private string[] _imageExt = { ".bmp", ".dib", ".rle", ".emf", ".gif", ".jpg", ".jpeg", ".jpe", ".jif", ".pcx", ".dcx", ".pic", ".png", ".tga", ".tif", ".tiffxif", ".wmf", ".jfif " };
|
||||
|
||||
|
||||
private bool chkFileNum = true;
|
||||
private string filePath = PubUtil.AbsolutelyPath + "tempfiles/";
|
||||
private string currtneFilePath = string.Empty;
|
||||
private string treeTags;
|
||||
private string file;
|
||||
private string fileName;
|
||||
private string serverPath = string.Empty;
|
||||
private int DiectoryId;
|
||||
private string tableName = string.Empty;
|
||||
#endregion
|
||||
|
||||
#region 构造函数
|
||||
public FrmMain()
|
||||
{
|
||||
//处理控件编码
|
||||
//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();
|
||||
tvClass.AfterCheck += new TreeViewEventHandler(tvLeft_AfterCheck);
|
||||
tvClass.AfterSelect += new TreeViewEventHandler(tvLeft_AfterSelect);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 树checkbox点击事件
|
||||
/// <summary>
|
||||
/// 树checkbox点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void tvLeft_AfterCheck(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
if (e.Action == TreeViewAction.ByMouse)
|
||||
{
|
||||
//取消节点选中状态之后,取消所有父节点的选中状态
|
||||
if (e.Node.Checked)
|
||||
{
|
||||
setChildNodeCheckedState(e.Node, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//取消节点选中状态之后,取消所有父节点的选中状态
|
||||
setChildNodeCheckedState(e.Node, false);
|
||||
//如果节点存在父节点,取消父节点的选中状态
|
||||
if (e.Node.Parent != null)
|
||||
{
|
||||
setParentNodeCheckedState(e.Node, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 取消节点选中状态之后,取消所有父节点的选中状态
|
||||
/// </summary>
|
||||
/// <param name="currNode"></param>
|
||||
/// <param name="state"></param>
|
||||
private void setParentNodeCheckedState(TreeNode currNode, bool state)
|
||||
{
|
||||
TreeNode parentNode = currNode.Parent;
|
||||
parentNode.Checked = state;
|
||||
if (currNode.Parent.Parent != null)
|
||||
{
|
||||
setParentNodeCheckedState(currNode.Parent, state);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 选中节点之后,选中节点的所有子节点
|
||||
/// </summary>
|
||||
/// <param name="currNode"></param>
|
||||
/// <param name="state"></param>
|
||||
private void setChildNodeCheckedState(TreeNode currNode, bool state)
|
||||
{
|
||||
TreeNodeCollection nodes = currNode.Nodes;
|
||||
if (nodes.Count > 0)
|
||||
{
|
||||
foreach (TreeNode tn in nodes)
|
||||
{
|
||||
tn.Checked = state;
|
||||
setChildNodeCheckedState(tn, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 选择树
|
||||
protected void tvLeft_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
if (e.Action == TreeViewAction.ByMouse)
|
||||
{
|
||||
InitData();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 初始化数据
|
||||
private void FrmMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
int ModulePriv = 0;
|
||||
DllCoid = !string.IsNullOrEmpty(ModuleId) ? ModuleId : DllCoid;
|
||||
//MessageBox.Show(DllCoid);
|
||||
ModulePriv = PubClass.GetPrivModule(DllCoid, "", OperatorId, OperatorName);
|
||||
if (ModulePriv == 0)
|
||||
IsView = "1";
|
||||
object obj = SqlHelper.ExecuteScalar(CommandType.Text, "select dirid from P_fm_DirectoryTab where ParentId=" + DirId + " and PID='" + ObjectId + "'");
|
||||
DiectoryId = obj == null ? 0 : Convert.ToInt32(obj);
|
||||
if (DiectoryId == 0)
|
||||
{
|
||||
string sqls = "insert into P_fm_DirectoryTab (sName,ParentId,creator,SpeciesNo,relationCode,PID) values('" + ObjectId + "'," + DirId + ",1,'0201',0,'" + ObjectId + "');select @@identity";
|
||||
DiectoryId = Convert.ToInt32(SqlHelper.ExecuteScalar(CommandType.Text, sqls));
|
||||
}
|
||||
DataTable dtSystemTable = SqlHelper.ExecuteDataTable("select * from p_systemtab");
|
||||
if (dtSystemTable.Columns.Contains("serverattachpath"))
|
||||
{
|
||||
serverPath = dtSystemTable.Rows[0]["serverattachpath"] + "";
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlDocument xmlDoc = new XmlDocument();
|
||||
xmlDoc.Load(PubUtil.AbsolutelyPath + "/LSClientConfig.xml");
|
||||
XmlNodeList list = xmlDoc.DocumentElement.SelectNodes("/Root/ClientSettings/rootPath");
|
||||
foreach (XmlNode rootPath in list)
|
||||
serverPath = rootPath.InnerText;
|
||||
}
|
||||
|
||||
this.Text = "附件管理";
|
||||
DataTable dtTable = SqlHelper.ExecuteDataTable("select bmpSpec,tableName,dirid from dbo.v_systemdlltab where DllCoid='" + DllCoid + "'");
|
||||
|
||||
if (dtTable.Rows.Count == 0)
|
||||
{
|
||||
XtraMessageBox.Show("检测到" + DllCoid + "模块不存在.");
|
||||
this.Close();
|
||||
}
|
||||
|
||||
string bmpSpec = dtTable.Rows[0]["bmpSpec"] + "";
|
||||
tableName = dtTable.Rows[0]["tableName"] + "";
|
||||
|
||||
string sql = "select * from bmp_ProductSpeciesTab where SpeciesNo like '" + (string.IsNullOrEmpty(BmpSpec) ? bmpSpec : BmpSpec) + "%'";
|
||||
PubClass.BindTree(sql, tvClass);
|
||||
InitData();
|
||||
InitColumns(FileDLLCoid, 0);
|
||||
|
||||
ContextMenuStrip menu = new ContextMenuStrip();
|
||||
ToolStripMenuItem tsmDownLoad = new ToolStripMenuItem("下载附件", null, tsmDownLoad_Click);
|
||||
ToolStripMenuItem tsmUpload = new ToolStripMenuItem("上传附件", null, tsmUpload_Click);
|
||||
ToolStripMenuItem tsmLock = new ToolStripMenuItem("锁定附件", null, tsmLock_Click);
|
||||
ToolStripMenuItem tmsUnlock = new ToolStripMenuItem("附件解锁", null, tmsUnlock_Click);
|
||||
ToolStripMenuItem tsmDelete = new ToolStripMenuItem("删除附件", null, 删除附件ToolStripMenuItem_Click);
|
||||
ToolStripMenuItem tsmi_union_image = new ToolStripMenuItem("关联附件", null, tsmi_union_image_Click);
|
||||
menu.Items.AddRange(new ToolStripMenuItem[] { tsmi_union_image, tsmDelete, tmsUnlock, tsmLock, tsmUpload, tsmDownLoad });
|
||||
|
||||
GridMenu gm = new GridMenu(FormText, OperatorId, OperatorName, Privilege, FileDLLCoid, "", gridMain.gridControl);
|
||||
gm.DirId = dtTable.Rows[0]["dirid"] + "";
|
||||
gm.filedKey = PubClass.GetPrimaryKey(FileDLLCoid);
|
||||
gm.BindGridMenuWQ(FileDLLCoid, menu);
|
||||
gm.OnGridMenuClickRefreshData += new EventHandler(gm_OnGridMenuClickRefreshData);
|
||||
|
||||
|
||||
//DeleteFile();
|
||||
Lskj.PubModule.GridDragTree gdtree = new Lskj.PubModule.GridDragTree(this, gridMain.gridControl, tvClass, Drag_EventHandler);
|
||||
//浏览附件
|
||||
//if (IsView != "1")
|
||||
//{
|
||||
// btnUpload.Enabled = false;
|
||||
// btnOpenPhoto.Enabled = false;
|
||||
// tsmUpload.Enabled = false;
|
||||
// tsmLock.Enabled = false;
|
||||
// tmsUnlock.Enabled = false;
|
||||
// tsmDelete.Enabled = false;
|
||||
// tsmDownLoad.Enabled = false;
|
||||
// tsmi_union_image.Enabled = false;
|
||||
//}
|
||||
|
||||
tsmi_union_image.Visible = IsUnionImage == "1";
|
||||
|
||||
gridMain.gridControl.DoubleClick += new EventHandler(gridView_DoubleClick);
|
||||
}
|
||||
|
||||
void gm_OnGridMenuClickRefreshData(object sender, EventArgs e)
|
||||
{
|
||||
InitData();
|
||||
}
|
||||
public void Drag_EventHandler(object sender, DragEventArgs e)
|
||||
{
|
||||
MessageBox.Show("物料类别修改成功!");
|
||||
}
|
||||
|
||||
public void InitData()
|
||||
{
|
||||
TreeNode tn = tvClass.SelectedNode;
|
||||
string strWhere = "parentId=" + DiectoryId;
|
||||
if (tn != null)
|
||||
strWhere += " and speciesno like '" + tn.Name + "%'";
|
||||
//DataTable dt = SqlHelper.ExecuteDataSet("select * from P_fm_FileTab where " + strWhere + " order by fileId desc").Tables[0];
|
||||
//gridMain.DataSource = dt;
|
||||
|
||||
gridMain.SetDataSource("select * from P_fm_FileTab where " + strWhere + " order by fileId desc");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除文件
|
||||
/// <summary>
|
||||
/// 删除文件
|
||||
/// </summary>
|
||||
public void DeleteFile()
|
||||
{
|
||||
DirectoryInfo dir = new DirectoryInfo(filePath);
|
||||
FileInfo[] f = dir.GetFiles();
|
||||
foreach (var item in f)
|
||||
{
|
||||
try
|
||||
{
|
||||
item.Delete();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载表格列
|
||||
/// <summary>
|
||||
/// 加载表格列头
|
||||
/// </summary>
|
||||
/// <param name="tab"></param>
|
||||
public void InitColumns(string tab, int n)
|
||||
{
|
||||
DataTable dtColums = SqlHelper.ExecuteDataSet("select * from P_systemwordbooktab where " + "tab='" + tab + "' and isnull(vislble,0)=0 order by orderid").Tables[0];
|
||||
gridMain.SetColumns2(dtColums);
|
||||
DataTable dtColor = SqlHelper.ExecuteDataSet("select * from p_systemwordbookcolor where tab='" + tab + "'").Tables[0];
|
||||
gridMain.RowColorCondtion = dtColor;
|
||||
|
||||
DataView dtView = dtColums.DefaultView;
|
||||
dtView.RowFilter = " ifSearch =0 ";
|
||||
//加载筛选框
|
||||
cbField.DataSource = dtView;
|
||||
cbField.DisplayMember = "username1";
|
||||
cbField.ValueMember = "fieldname";
|
||||
|
||||
//gridView.Columns.Clear();
|
||||
//for (int i = 0; i < dtColums.Rows.Count; i++)
|
||||
//{
|
||||
// DataRow row = dtColums.Rows[i];
|
||||
// GridColumn gridColumn = new GridColumn();
|
||||
// gridColumn.FieldName = row["fieldname"] + "";
|
||||
// gridColumn.Name = row["fieldname"] + "";
|
||||
// gridColumn.VisibleIndex = i;
|
||||
// gridColumn.Caption = row["username1"] + "";
|
||||
// gridColumn.Width = Convert.ToInt32(row["width"]);
|
||||
// gridColumn.Visible = true;
|
||||
// if (i == 0)
|
||||
// {
|
||||
// gridColumn.OptionsColumn.AllowShowHide = false;
|
||||
// }
|
||||
// gridColumn.OptionsColumn.ReadOnly = false;
|
||||
// if (Convert.ToInt32(row["edit"]) == 1)
|
||||
// gridColumn.OptionsColumn.AllowEdit = false;
|
||||
// gridView.Columns.Add(gridColumn);
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 上传文件
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnUpload_Click(object sender, EventArgs e)
|
||||
{
|
||||
TreeNode tn = tvClass.SelectedNode;
|
||||
if (tn == null)
|
||||
{
|
||||
MessageBox.Show("请选择附件分类", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
if (tn.Nodes.Count > 0)
|
||||
{
|
||||
MessageBox.Show("请选择末级分类", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
string nodeName = tn.Name;
|
||||
|
||||
string tmpsql = @"select 1 as zt from bmp_ProductSpeciesTab
|
||||
where speciesno='" + nodeName + "' and (charindex('," + OperatorName + ",',','+str1+',')>0 or charindex('|" + OperatorName + "|','|'+str1+'|')>0 or isnull(str1,'''')='''')";
|
||||
DataTable dtFileIds = SqlHelper.ExecuteDataSet(tmpsql).Tables[0];
|
||||
|
||||
//if ((dtFileIds.Rows.Count == 0) || (dtFileIds.Rows[0].ToString()=="0"))
|
||||
//{
|
||||
// MessageBox.Show("抱歉,您没有权限上传该分类下的附件");
|
||||
// return;
|
||||
//}
|
||||
|
||||
fmUpdateDownloadType type = (fmUpdateDownloadType)0;
|
||||
TParamsData pd = new TParamsData(type, this.Handle);
|
||||
pd.setLocation(100, 100);
|
||||
pd.setSize(800, 500);
|
||||
pd.setParent(DiectoryId);
|
||||
string[] strFileIds = { };
|
||||
foreach (string sId in strFileIds)
|
||||
pd.addFileId(int.Parse(sId));
|
||||
if (chkFileNum)
|
||||
{
|
||||
//文件编码
|
||||
pd.SetfileNumber("001");
|
||||
//类别编码
|
||||
pd.SetspecieNo(nodeName);
|
||||
}
|
||||
if (chkFileNum)
|
||||
pd.CallUpdateUIEx();
|
||||
else
|
||||
pd.CallUpdateUI();
|
||||
}
|
||||
|
||||
private void tsmUpload_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnUpload_Click(sender, e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 下载文件
|
||||
private void tsmDownLoad_Click(object sender, EventArgs e)
|
||||
{
|
||||
int[] rows = gridMain.gridView.GetSelectedRows();
|
||||
if (rows.Length == 0)
|
||||
{
|
||||
MessageBox.Show("请选择要下载附件", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
string ids = string.Empty;
|
||||
for (int i = 0; i < rows.Length; i++)
|
||||
{
|
||||
DataRow row = gridMain.gridView.GetDataRow(rows[i]);
|
||||
ids += row["fileId"] + ",";
|
||||
}
|
||||
string tmpsql = @"select a.fileId from P_fm_FileTab a
|
||||
inner join bmp_ProductSpeciesTab b on a.speciesno=b.SpeciesNo
|
||||
where charindex(','+cast(fileid as varchar)+',','," + ids + ",')>0 ";//and (charindex(',"+OperatorName+",',','+b.str2+',')>0 or charindex('|"+OperatorName+"|','|'+b.str2+'|')>0 or a.creator='"+OperatorId+"')";
|
||||
DataTable dtFileIds = SqlHelper.ExecuteDataSet(tmpsql).Tables[0];
|
||||
ids = "";
|
||||
foreach (DataRow dr in dtFileIds.Rows)
|
||||
{
|
||||
ids += dr["fileId"] + ",";
|
||||
}
|
||||
ids = ids.Trim(',');
|
||||
if (ids == "")
|
||||
{
|
||||
MessageBox.Show("抱歉,系统没有找到符合条件的附件");
|
||||
return;
|
||||
}
|
||||
fmUpdateDownloadType type = (fmUpdateDownloadType)2;
|
||||
TParamsData pd = new TParamsData(type, this.Handle);
|
||||
pd.setLocation(100, 100);
|
||||
pd.setSize(800, 500);
|
||||
pd.setParent(DiectoryId);
|
||||
string[] strFileIds = ids.Split(',');
|
||||
foreach (string sId in strFileIds)
|
||||
{
|
||||
int stmpId = 0;
|
||||
bool isucc = int.TryParse(sId, out stmpId);
|
||||
//pd.addFileId(int.Parse(sId));
|
||||
pd.addFileId(stmpId);
|
||||
}
|
||||
pd.CallUpdateUI();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息处理
|
||||
protected override void DefWndProc(ref Message m)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch (m.Msg)
|
||||
{
|
||||
//接收到客户端发来的窗体句柄
|
||||
case LSCustomWinMsg.REV_CLIENT_WINDOW_HANDLE:
|
||||
{
|
||||
m_ClientTestHandle = m.WParam;
|
||||
break;
|
||||
}
|
||||
//接收到客户端处理错误消息
|
||||
case LSCustomWinMsg.REV_CLIENT_DEAL_ERROR:
|
||||
{
|
||||
MessageBox.Show("通讯客户端处理出错了");
|
||||
break;
|
||||
}
|
||||
//接收到客户端处理ok消息
|
||||
case LSCustomWinMsg.REV_CLIENT_DEAL_OK:
|
||||
{
|
||||
SetImg(file, fileName);
|
||||
break;
|
||||
}
|
||||
case LSCustomWinMsg.DOWNLOADCOMPLETED:
|
||||
SetImg(file, fileName);
|
||||
if (fileName.Contains(".pdf"))
|
||||
Lskj.Common.PubClass.CreateNewPdf(fileName, file);
|
||||
break;
|
||||
//批量上传关闭窗体之前的通知消息
|
||||
case LSCustomWinMsg.BATCH_UPLOAD_COMPLETED:
|
||||
{
|
||||
//MessageBox.Show("删除完毕");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
base.DefWndProc(ref m);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PubUtil.WriteLog(ex.Message);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 刷新文件
|
||||
private void btnReflash_Click(object sender, EventArgs e)
|
||||
{
|
||||
InitData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查看大图
|
||||
private void galleryControlMain_Gallery_ItemClick(object sender, GalleryItemClickEventArgs e)
|
||||
{
|
||||
GalleryItem gitem = e.Item;
|
||||
Process.Start(gitem.Tag.ToString());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 文件和图片锁定和解锁功能
|
||||
private void tsmLock_Click(object sender, EventArgs e)
|
||||
{
|
||||
int[] rows = gridMain.gridView.GetSelectedRows();
|
||||
if (rows.Length == 0)
|
||||
{
|
||||
MessageBox.Show("请选择要锁定的附件", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
string ids = string.Empty;
|
||||
for (int i = 0; i < rows.Length; i++)
|
||||
{
|
||||
DataRow row = gridMain.gridView.GetDataRow(rows[i]);
|
||||
ids += row["fileId"] + ",";
|
||||
}
|
||||
if (this.AttachOperation(4, ERPInfo.Instance.EmployeeId, ERPInfo.Instance.EmployeeName, "", Convert.ToInt32(gridMain.gridView.GetDataRow(rows[0])["fileId"]), "", 0))
|
||||
{
|
||||
string tmpsql = @"select a.fileId from P_fm_FileTab a
|
||||
inner join bmp_ProductSpeciesTab b on a.speciesno=b.SpeciesNo
|
||||
where charindex(','+cast(fileid as varchar)+',','," + ids + ",')>0 and (charindex('," + OperatorName + ",',','+b.str4+',')>0 or charindex('|" + OperatorName + "|','|'+b.str4+'|')>0 or a.creator='" + OperatorId + "')";
|
||||
object obj = SqlHelper.ExecuteScalar(CommandType.Text, "select 1 as zt from sys.columns where object_id=object_id('bmp_ProductSpeciesTab') and name='str4'");
|
||||
if ((obj == null) || (obj.ToString() != "1"))
|
||||
tmpsql = @"select a.fileId from P_fm_FileTab a
|
||||
inner join bmp_ProductSpeciesTab b on a.speciesno=b.SpeciesNo
|
||||
where charindex(','+cast(fileid as varchar)+',','," + ids + ",')>0 and ( a.creator='" + OperatorId + "')";
|
||||
DataTable dtFileIds = SqlHelper.ExecuteDataSet(tmpsql).Tables[0];
|
||||
if (dtFileIds.Rows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("抱歉,没有找到符合条件的附件");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (DataRow row in dtFileIds.Rows)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery("update P_fm_FileTab set A1=1 where fileId=" + row["fileId"]);
|
||||
}
|
||||
}
|
||||
|
||||
//for (int i = 0; i < rows.Length; i++)
|
||||
//{
|
||||
// DataRow row = gridMain.gridView.GetDataRow(rows[0]);
|
||||
// SqlHelper.ExecuteNonQuery("update P_fm_FileTab set A1=1 where fileId=" + row["fileId"]);
|
||||
//}
|
||||
InitData();
|
||||
}
|
||||
private void tmsUnlock_Click(object sender, EventArgs e)
|
||||
{
|
||||
int[] rows = gridMain.gridView.GetSelectedRows();
|
||||
if (rows.Length == 0)
|
||||
{
|
||||
MessageBox.Show("请选择要解除锁定的附件", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
string ids = string.Empty;
|
||||
for (int i = 0; i < rows.Length; i++)
|
||||
{
|
||||
DataRow row = gridMain.gridView.GetDataRow(rows[i]);
|
||||
ids += row["fileId"] + ",";
|
||||
}
|
||||
if (this.AttachOperation(5, ERPInfo.Instance.EmployeeId, ERPInfo.Instance.EmployeeName, "", Convert.ToInt32(gridMain.gridView.GetDataRow(rows[0])["fileId"]), "", 0))
|
||||
{
|
||||
string tmpsql = @"select a.fileId from P_fm_FileTab a
|
||||
inner join bmp_ProductSpeciesTab b on a.speciesno=b.SpeciesNo
|
||||
where charindex(','+cast(fileid as varchar)+',','," + ids + ",')>0 and (charindex('," + OperatorName + ",',','+b.str4+',')>0 or charindex('|" + OperatorName + "|','|'+b.str4+'|')>0 or a.creator='" + OperatorId + "')";
|
||||
object obj = SqlHelper.ExecuteScalar(CommandType.Text, "select 1 as zt from sys.columns where object_id=object_id('bmp_ProductSpeciesTab') and name='str4'");
|
||||
if ((obj == null) || (obj.ToString() != "1"))
|
||||
tmpsql = @"select a.fileId from P_fm_FileTab a
|
||||
inner join bmp_ProductSpeciesTab b on a.speciesno=b.SpeciesNo
|
||||
where charindex(','+cast(fileid as varchar)+',','," + ids + ",')>0 and ( a.creator='" + OperatorId + "')";
|
||||
DataTable dtFileIds = SqlHelper.ExecuteDataSet(tmpsql).Tables[0];
|
||||
if (dtFileIds.Rows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("抱歉,没有找到符合条件的附件");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (DataRow row in dtFileIds.Rows)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery("update P_fm_FileTab set A1=0 where fileId=" + row["fileId"]);
|
||||
}
|
||||
}
|
||||
//for (int i = 0; i < rows.Length; i++)
|
||||
//{
|
||||
// DataRow row = gridMain.gridView.GetDataRow(rows[0]);
|
||||
// SqlHelper.ExecuteNonQuery("update P_fm_FileTab set A1=0 where fileId=" + row["fileId"]);
|
||||
//}
|
||||
InitData();
|
||||
}
|
||||
private void tmsFilelock_Click(object sender, EventArgs e)
|
||||
{
|
||||
InitData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 双击打开附件
|
||||
//private void gvFile_DoubleClick(object sender, EventArgs e)
|
||||
//{
|
||||
// //int[] rows = gridView.GetSelectedRows();
|
||||
// //isDoubleClick = true;
|
||||
// //if (rows.Length > 0)
|
||||
// //{
|
||||
// // TParamsData pd = new TParamsData(this.Handle);
|
||||
// // DataRow row = gridView.GetDataRow(rows[0]);
|
||||
// // file = filePath + row["sName"];
|
||||
// // if (!File.Exists(file))
|
||||
// // {
|
||||
// // string sql = "select dbo.fun_fm_getAbsolutePath(" + row["fileId"] + ");";
|
||||
// // string path = SqlHelper.ExecuteScalar(CommandType.Text, sql) + "";
|
||||
// // pd.CallDownload(serverPath + path);
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // Process.Start(file);
|
||||
// // }
|
||||
// //}
|
||||
//}
|
||||
#endregion
|
||||
|
||||
private void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
string strWhere = "parentId=" + DiectoryId;
|
||||
treeTags = string.Empty;
|
||||
string field = cbField.SelectedValue.ToString();
|
||||
strWhere += " and " + field + " like '%" + txtKey.Text + "%'";
|
||||
foreach (TreeNode tn in tvClass.Nodes)
|
||||
GetCheckedState(tn);
|
||||
if (!string.IsNullOrEmpty(treeTags))
|
||||
strWhere += " and speciesno in (" + treeTags.Trim(',') + ")";
|
||||
DataTable dt = SqlHelper.ExecuteDataSet("select * from P_fm_FileTab where " + strWhere + " order by fileId desc").Tables[0];
|
||||
gridMain.gridControl.DataSource = dt;
|
||||
}
|
||||
|
||||
private void GetCheckedState(TreeNode currNode)
|
||||
{
|
||||
TreeNodeCollection nodes = currNode.Nodes;
|
||||
if (nodes.Count > 0)
|
||||
{
|
||||
foreach (TreeNode tn in nodes)
|
||||
{
|
||||
if (tn.Checked)
|
||||
treeTags += "'" + tn.Name + "',";
|
||||
GetCheckedState(tn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void gridView_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
|
||||
{
|
||||
//int[] rows = gridView.GetSelectedRows();
|
||||
//for (int i = 0; i < rows.Length; i++)
|
||||
//{
|
||||
// DataRow row = gridView.GetDataRow(e.RowHandle);
|
||||
// file = filePath + row["sName"].ToString();
|
||||
// fileName = Convert.ToString(row["sName"]);
|
||||
// if (!File.Exists(file))
|
||||
// {
|
||||
// TParamsData pd = new TParamsData(this.Handle);
|
||||
// string sql = "select dbo.fun_fm_getAbsolutePath(" + row["fileId"] + ");";
|
||||
// string path = SqlHelper.ExecuteScalar(CommandType.Text, sql) + "";
|
||||
// pd.CallDownload(serverPath + path);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// SetImg(file, row["sName"].ToString());
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
public void SetImg(string _file, string fileName)
|
||||
{
|
||||
FileInfo f = new FileInfo(file);
|
||||
string ext = f.Extension.ToLower();
|
||||
if (_imageExt.Contains(ext.ToLower()))
|
||||
{
|
||||
//currtneFilePath = filePath + Guid.NewGuid() + ext;
|
||||
//if (File.Exists(currtneFilePath))
|
||||
// File.Delete(currtneFilePath);
|
||||
|
||||
//File.Copy(file, currtneFilePath, true);
|
||||
|
||||
Image image = Image.FromFile(file);
|
||||
picEdit.Tag = file;
|
||||
picEdit.Image = image;
|
||||
}
|
||||
else
|
||||
if (ext == ".xls" || ext == ".xlsx")
|
||||
{
|
||||
Image image = Image.FromFile(PubUtil.AbsolutelyPath + "Images/fileicon/excel.png");
|
||||
picEdit.Tag = file;
|
||||
picEdit.Image = image;
|
||||
}
|
||||
else if (ext == ".doc" || ext == ".docx")
|
||||
{
|
||||
Image image = Image.FromFile(PubUtil.AbsolutelyPath + "Images/fileicon/word.png");
|
||||
picEdit.Tag = file;
|
||||
picEdit.Image = image;
|
||||
}
|
||||
else if (ext == ".pdf")
|
||||
{
|
||||
Image image = Image.FromFile(PubUtil.AbsolutelyPath + "Images/fileicon/pdf.png");
|
||||
picEdit.Tag = file;
|
||||
picEdit.Image = image;
|
||||
}
|
||||
else
|
||||
{
|
||||
string defaultImage = PubUtil.AbsolutelyPath + "Images/fileicon/cx.png";
|
||||
if (File.Exists(defaultImage))
|
||||
{
|
||||
Image image = Image.FromFile(defaultImage);
|
||||
picEdit.Tag = file;
|
||||
picEdit.Image = image;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开附件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void picEdit_Properties_Click(object sender, EventArgs e)
|
||||
{
|
||||
PictureEdit pic = (PictureEdit)sender;
|
||||
if (pic != null)
|
||||
{
|
||||
string filePath = pic.Tag + "";
|
||||
if (!string.IsNullOrEmpty(filePath))
|
||||
Process.Start(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOpenPhoto_Click(object sender, EventArgs e)
|
||||
{
|
||||
TreeNode tn = tvClass.SelectedNode;
|
||||
if (tn == null)
|
||||
{
|
||||
MessageBox.Show("请选择附件分类", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
if (tn.Nodes.Count > 0)
|
||||
{
|
||||
MessageBox.Show("请选择末级分类", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
//MessageBox.Show(tn.Name);
|
||||
try
|
||||
{
|
||||
FrmCmCapture frm = new FrmCmCapture();
|
||||
frm.DirId = DiectoryId.ToString();
|
||||
frm.speciesno = tn.Name;
|
||||
frm.OperatorId = OperatorId;
|
||||
frm.ShowDialog();
|
||||
InitData();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
XtraMessageBox.Show("启动拍照出错!");
|
||||
}
|
||||
}
|
||||
|
||||
private void gridView_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
//MessageBox.Show("OK");
|
||||
if (string.IsNullOrEmpty(serverPath))
|
||||
{
|
||||
XtraMessageBox.Show("下载附件路径未配置.");
|
||||
return;
|
||||
}
|
||||
|
||||
int[] rows = gridMain.gridView.GetSelectedRows();
|
||||
for (int i = 0; i < rows.Length; i++)
|
||||
{
|
||||
DataRow row = gridMain.gridView.GetFocusedDataRow();
|
||||
if (row == null)
|
||||
return;
|
||||
string ids = row["fileid"].ToString();
|
||||
// string tmpsql = @"select a.fileId from P_fm_FileTab a
|
||||
// inner join bmp_ProductSpeciesTab b on a.speciesno=b.SpeciesNo
|
||||
// where charindex(','+cast(fileid as varchar)+',','," + ids + ",')>0 and (charindex('," + OperatorName + ",',','+b.str2+',')>0 or charindex('|" + OperatorName + "|','|'+b.str2+'|')>0 or a.creator='" + OperatorId + "')";
|
||||
// DataTable dtFileIds = SqlHelper.ExecuteDataSet(tmpsql).Tables[0];
|
||||
// ids = "";
|
||||
// foreach (DataRow dr in dtFileIds.Rows)
|
||||
// {
|
||||
// ids += dr["fileId"] + ",";
|
||||
// }
|
||||
// ids = ids.Trim(',');
|
||||
if (ids == "")
|
||||
{
|
||||
MessageBox.Show("抱歉,没有权限查看附件");
|
||||
return;
|
||||
}
|
||||
|
||||
file = filePath + row["sName"].ToString();
|
||||
fileName = Convert.ToString(row["sName"]);
|
||||
//MessageBox.Show(fileName);
|
||||
|
||||
if (this.AttachOperation(2, Convert.ToInt32(OperatorId), "", "", Convert.ToInt32(ids), "", 0))
|
||||
{
|
||||
if (picEdit.Image != null)
|
||||
picEdit.Image.Dispose();
|
||||
string picFilePath = picEdit.Tag + "";
|
||||
if (!string.IsNullOrEmpty(picFilePath) && File.Exists(picFilePath))
|
||||
File.Delete(picFilePath);
|
||||
if (File.Exists(filePath + row["sName"] + ""))
|
||||
File.Delete(filePath + row["sName"] + "");
|
||||
|
||||
TParamsData pd = new TParamsData(this.Handle);
|
||||
string sql = "select dbo.fun_fm_getAbsolutePath(" + row["fileId"] + ");";
|
||||
string path = SqlHelper.ExecuteScalar(CommandType.Text, sql) + "";
|
||||
pd.CallDownload(serverPath + path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void 删除附件ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
int[] rows = gridMain.gridView.GetSelectedRows();
|
||||
if (rows.Length == 0)
|
||||
{
|
||||
MessageBox.Show("请选择要删除的附件", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
DialogResult drt = MessageBox.Show("附件删除后不可恢复,是否真要删除选中的附件?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
if (drt != DialogResult.Yes)
|
||||
return;
|
||||
string ids = string.Empty;
|
||||
for (int i = 0; i < rows.Length; i++)
|
||||
{
|
||||
DataRow row = gridMain.gridView.GetDataRow(rows[i]);
|
||||
ids += row["fileId"] + ",";
|
||||
}
|
||||
if (this.AttachOperation(3, ERPInfo.Instance.EmployeeId, ERPInfo.Instance.EmployeeName, "", Convert.ToInt32(gridMain.gridView.GetDataRow(rows[0])["fileId"]), "", 0))
|
||||
{
|
||||
string tmpsql = @"select a.fileId from P_fm_FileTab a
|
||||
inner join bmp_ProductSpeciesTab b on a.speciesno=b.SpeciesNo
|
||||
where charindex(','+cast(fileid as varchar)+',','," + ids + ",')>0"; // and (charindex('," + OperatorName + ",',','+b.str3+',')>0 or charindex('|" + OperatorName + "|','|'+b.str3+'|')>0 or a.creator='" + OperatorId + "')";
|
||||
DataTable dtFileIds = SqlHelper.ExecuteDataSet(tmpsql).Tables[0];
|
||||
//if (dtFileIds.Rows.Count < 1)
|
||||
//{
|
||||
// MessageBox.Show("抱歉,没有找到符合条件的附件");
|
||||
// return;
|
||||
//}
|
||||
ids = "";
|
||||
foreach (DataRow dr in dtFileIds.Rows)
|
||||
{
|
||||
ids += dr["fileId"] + ",";
|
||||
}
|
||||
|
||||
ids = ids.Trim(',');
|
||||
fmUpdateDownloadType type = (fmUpdateDownloadType)2;
|
||||
TParamsData pd = new TParamsData(type, this.Handle);
|
||||
pd.setLocation(100, 100);
|
||||
pd.setSize(800, 500);
|
||||
pd.setParent(DiectoryId);
|
||||
string[] strFileIds = ids.Split(',');
|
||||
foreach (string sId in strFileIds)
|
||||
{
|
||||
int tmpsId = 0;
|
||||
bool isucc = int.TryParse(sId, out tmpsId);
|
||||
//pd.addFileId(int.Parse(sId));
|
||||
pd.addFileId(tmpsId);
|
||||
}
|
||||
pd.CallDeleteFile();
|
||||
this.btnReflash.PerformClick();
|
||||
}
|
||||
}
|
||||
|
||||
private void tsmi_union_image_Click(object sender, EventArgs e)
|
||||
{
|
||||
int[] rows = gridMain.gridView.GetSelectedRows();
|
||||
if (rows.Length == 0)
|
||||
{
|
||||
XtraMessageBox.Show("请选择要关联的附件.");
|
||||
return;
|
||||
}
|
||||
|
||||
DataRow row = gridMain.gridView.GetDataRow(rows[0]);
|
||||
string fileId = row["fileId"] + "";
|
||||
string fileName = row["sName"] + "";
|
||||
if (string.IsNullOrWhiteSpace(fileId))
|
||||
{
|
||||
XtraMessageBox.Show("附件名标识不能为空.");
|
||||
}
|
||||
string extName = Path.GetExtension(fileName);
|
||||
if (_imageExt.Contains(extName.ToLower()))
|
||||
{
|
||||
string parmayKey = PubClass.GetPrimaryKey(DllCoid);
|
||||
|
||||
string sqlValue = string.Format("update {0} set {1}='{2}' where {3}='{4}'",
|
||||
tableName, ColumnName, fileId, parmayKey, ObjectId);
|
||||
int result = SqlHelper.ExecuteNonQuery(sqlValue);
|
||||
if (result > 0)
|
||||
{
|
||||
XtraMessageBox.Show("关联附件成功.");
|
||||
}
|
||||
else
|
||||
{
|
||||
XtraMessageBox.Show("关联附件失败.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
XtraMessageBox.Show("关联只支持图片格式.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:附件操作之前调用</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-09-28 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="operType">1=上传,2=下载,3=删除,4=锁定,5=解除锁定 必填</param>
|
||||
/// <param name="userId">The user identifier.</param>
|
||||
/// <param name="userName">Name of the user.</param>
|
||||
/// <param name="fileSpecisNo">The file specis no.</param>
|
||||
/// <param name="filename">The filename.</param>
|
||||
/// <param name="filesize">The filesize.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
private bool AttachOperation(int operType, int userId, string userName, string fileSpecisNo, int fileid, string filename, int filesize)
|
||||
{
|
||||
try
|
||||
{
|
||||
SqlParameter pMsg = new SqlParameter("@msg", SqlDbType.VarChar, 2000);
|
||||
pMsg.Direction = ParameterDirection.Output;
|
||||
SqlParameter returnValue = new SqlParameter("@return", SqlDbType.Int, 4);
|
||||
returnValue.Direction = ParameterDirection.ReturnValue;
|
||||
SqlParameter[] param =
|
||||
{
|
||||
new SqlParameter("@opertype",SqlDbType.Int),
|
||||
new SqlParameter("@operatorid",SqlDbType.Int),
|
||||
new SqlParameter("@operatorname",SqlDbType.VarChar,50),
|
||||
new SqlParameter("@fileSpecisNo",SqlDbType.VarChar,50),
|
||||
new SqlParameter("@fileid",SqlDbType.Int),
|
||||
new SqlParameter("@filename",SqlDbType.VarChar,200),
|
||||
new SqlParameter("@filesize",SqlDbType.Int),
|
||||
pMsg,
|
||||
returnValue
|
||||
};
|
||||
|
||||
|
||||
param[0].Value = operType;
|
||||
param[1].Value = userId;
|
||||
param[2].Value = userName;
|
||||
param[3].Value = fileSpecisNo;
|
||||
param[4].Value = fileid;
|
||||
param[5].Value = filename;
|
||||
param[6].Value = filesize;
|
||||
DataSet ds = SqlHelper.ExecuteDataSet(CommandType.StoredProcedure, "p_SystemAttachOperation", "attach", param);
|
||||
string msg = pMsg.Value.ToString();
|
||||
int rVaule = Convert.ToInt32(returnValue.Value + "");
|
||||
|
||||
if (rVaule != 1)
|
||||
{
|
||||
XtraMessageBox.Show(msg);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
XtraMessageBox.Show(ex.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (picEdit.Image != null)
|
||||
picEdit.Image.Dispose();
|
||||
string picFilePath = picEdit.Tag + "";
|
||||
if (!string.IsNullOrEmpty(picFilePath) && File.Exists(picFilePath))
|
||||
File.Delete(picFilePath);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraGrid;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
||||
using CommonLib;
|
||||
|
||||
namespace Lskj.PubModule
|
||||
{
|
||||
public class GridDragTree
|
||||
{
|
||||
|
||||
public GridDragTree(Form thisForm, GridControl grid, TreeView target, DragEventHandler Complete)
|
||||
{
|
||||
opForm = thisForm;
|
||||
currentGridView = (GridView)grid.FocusedView;
|
||||
dragComplete = Complete;
|
||||
grid.FocusedView.MouseDown += new MouseEventHandler(gridMouseDown);
|
||||
grid.FocusedView.MouseMove += new MouseEventHandler(gridMouseMove);
|
||||
target.HideSelection = false;
|
||||
target.DragOver += new DragEventHandler(objDragOver);
|
||||
target.DragDrop += new DragEventHandler(objDragDrop);
|
||||
target.AllowDrop = true;
|
||||
}
|
||||
|
||||
private GridHitInfo downHitInfo = null;
|
||||
private GridView currentGridView = null;
|
||||
Form opForm = null;
|
||||
DragEventHandler dragComplete = null;
|
||||
|
||||
private void gridMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
GridView view = sender as GridView;
|
||||
downHitInfo = null;
|
||||
GridHitInfo hitInfo = view.CalcHitInfo(new Point(e.X, e.Y));
|
||||
if (Control.ModifierKeys != Keys.None) return;
|
||||
if (e.Button == MouseButtons.Left && hitInfo.RowHandle >= 0)
|
||||
downHitInfo = hitInfo;
|
||||
}
|
||||
|
||||
private void gridMouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
GridView view = sender as GridView;
|
||||
if (e.Button == MouseButtons.Left && downHitInfo != null)
|
||||
{
|
||||
Size dragSize = SystemInformation.DragSize;
|
||||
Rectangle dragRect = new Rectangle(new Point(downHitInfo.HitPoint.X - dragSize.Width / 2,
|
||||
downHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize);
|
||||
|
||||
if (!dragRect.Contains(new Point(e.X, e.Y)))
|
||||
{
|
||||
object row = view.GetRow(downHitInfo.RowHandle);
|
||||
view.GridControl.DoDragDrop(row, DragDropEffects.Move);
|
||||
downHitInfo = null;
|
||||
DevExpress.Utils.DXMouseEventArgs.GetMouseArgs(e).Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void objDragOver(object sender, DragEventArgs e)
|
||||
{
|
||||
(sender as TreeView).Select();
|
||||
e.Effect = DragDropEffects.Move;
|
||||
TreeNode tn = null;
|
||||
Point pt = new Point();
|
||||
pt.X = e.X;
|
||||
pt.Y = e.Y;
|
||||
tn = (sender as TreeView).GetNodeAt((sender as TreeView).PointToClient(pt));
|
||||
if (tn == null)
|
||||
return;
|
||||
(sender as TreeView).SelectedNode = tn;
|
||||
if (tn.GetNodeCount(true) > 0)
|
||||
tn.Expand();
|
||||
}
|
||||
|
||||
private void objDragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
//这里处理拖放后的操作,比如更改选中数据属性
|
||||
TreeNode tn = null;
|
||||
Point pt = new Point();
|
||||
pt.X = e.X;
|
||||
pt.Y = e.Y;
|
||||
tn = (sender as TreeView).GetNodeAt((sender as TreeView).PointToClient(pt));
|
||||
if (tn == null)
|
||||
return;
|
||||
if (tn.GetNodeCount(true) > 0)
|
||||
{
|
||||
MessageBox.Show("【" + tn.Text + "】不是最后一级不能拖拽");
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("确定将所选档案信息转移到[" + tn.Text + "]", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//选中行操作,修改或者删除
|
||||
int[] rowid = currentGridView.GetSelectedRows();
|
||||
foreach (int rid in rowid)
|
||||
{
|
||||
DataRow dr = currentGridView.GetDataRow(rid);
|
||||
SqlHelper.ExecuteNonQuery(CommandType.Text, "' where fileId='" + dr["fileId"] + "'");
|
||||
}
|
||||
dragComplete(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{C107C4A7-6C8F-4608-B53C-B56AD5E207AB}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Lskj.PhotoView</RootNamespace>
|
||||
<AssemblyName>Lskj.PhotoView</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\publish\lib\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DevExpress.Data.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Printing.v13.1.Core, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Utils.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraBars.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraCharts.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraCharts.v13.1.UI, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraEditors.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraGrid.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraLayout.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraPrinting.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraTreeList.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Dxper.LocalizationCHS.Win.v13.1.5">
|
||||
<HintPath>..\..\..\引用DLL\Dxper.LocalizationCHS.Win.v13.1.5.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.CmCapture, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\publish\Lskj.CmCapture.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<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="GridDrag.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PubClass.cs" />
|
||||
<EmbeddedResource Include="FrmMain.resx">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</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>
|
||||
<Content Include="a.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\CommonLib\CommonLib.csproj">
|
||||
<Project>{3E8E6529-5D8A-4F17-8C41-27CD7380178D}</Project>
|
||||
<Name>CommonLib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\ControlLib\ControlLib.csproj">
|
||||
<Project>{73C024E7-D9DC-44C3-BABC-2AA1544ECCF9}</Project>
|
||||
<Name>ControlLib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Lskj.Common\Lskj.Common.csproj">
|
||||
<Project>{DE7EFD7F-2DFE-4D50-A578-452A2DBFD088}</Project>
|
||||
<Name>Lskj.Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Lskj.MyControl\Lskj.MyControl.csproj">
|
||||
<Project>{F6502012-9A7C-44AE-AAC6-DE2AD02F5C11}</Project>
|
||||
<Name>Lskj.MyControl</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Lskj.PubUtils\Lskj.PubUtils.csproj">
|
||||
<Project>{752386CB-FD63-4565-980F-E8F72A520F77}</Project>
|
||||
<Name>Lskj.PubUtils</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,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过以下
|
||||
// 特性集控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("Lskj.PhotoView")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("Lskj.PhotoView")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("04dc789f-23e0-4db1-8839-abccf03e06fc")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.6")]
|
||||
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.18408
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Lskj.PhotoView.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.PhotoView.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.1
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Lskj.PhotoView.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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>
|
||||
@@ -0,0 +1,3 @@
|
||||
DevExpress.Patch.InMemoryPatch, DevExpress.Patch.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7fc7bfca2443de66
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraTreeList.TreeList, DevExpress.XtraTreeList.v13.1, Version=13.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
@@ -0,0 +1,242 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraPrinting;
|
||||
using DevExpress.XtraEditors;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Drawing;
|
||||
using System.Data.SqlClient;
|
||||
using System.Diagnostics;
|
||||
using CommonLib;
|
||||
|
||||
namespace Lskj.PhotoView
|
||||
{
|
||||
public class PubClass
|
||||
{
|
||||
#region 绑定树
|
||||
/// <summary>
|
||||
/// 绑定树结构
|
||||
/// </summary>
|
||||
/// <param name="TabName"></param>
|
||||
/// <param name="treeView"></param>
|
||||
public static void BindTree(string treeSql, TreeView treeView)
|
||||
{
|
||||
DataTable dt = SqlHelper.ExecuteDataSet(treeSql).Tables[0];
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
DataRow dr = dt.Rows[i];
|
||||
String tnKey = dr["SpeciesNo"].ToString();
|
||||
String tnStr = dr["SpeciesName"].ToString();
|
||||
String CodeNo = dr[2].ToString();
|
||||
TreeNode[] tn = null;
|
||||
if (tnKey.Length >= 4)
|
||||
{
|
||||
String pKey = tnKey.Substring(0, tnKey.Length - 2);
|
||||
tn = treeView.Nodes.Find(pKey, true);
|
||||
if (tn.Count() > 0)
|
||||
{
|
||||
TreeNode tNode = tn[0].Nodes.Add(tnKey, tnStr);
|
||||
tNode.Tag = CodeNo;
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode tNode = treeView.Nodes.Add(tnKey, tnStr);
|
||||
tNode.Tag = CodeNo;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode tNode = treeView.Nodes.Add(tnKey, tnStr);
|
||||
tNode.Tag = CodeNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出Excel
|
||||
/// <summary>
|
||||
/// 导出Excel
|
||||
/// </summary>
|
||||
/// <param name="GridControlPub"></param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
}
|
||||
XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 打印GridControl
|
||||
/// <summary>
|
||||
/// 打印GridControl
|
||||
/// </summary>
|
||||
/// <param name="GridControlPub"></param>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 图片转换
|
||||
/// <summary>
|
||||
/// 将byte[]转换为Image
|
||||
/// </summary>
|
||||
/// <param name="bytes">字节数组</param>
|
||||
/// <returns>Image</returns>
|
||||
public static Image ReadImage(byte[] bytes)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(bytes, 0, bytes.Length);
|
||||
BinaryFormatter bf = new BinaryFormatter();
|
||||
object obj = bf.Deserialize(ms);
|
||||
ms.Close();
|
||||
return (Image)obj;
|
||||
}
|
||||
/// <summary>
|
||||
/// 将Image转换为byte[]
|
||||
/// </summary>
|
||||
/// <param name="image">Image</param>
|
||||
/// <returns>byte[]</returns>
|
||||
public static byte[] ConvertImage(Image image)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream();
|
||||
BinaryFormatter bf = new BinaryFormatter();
|
||||
bf.Serialize(ms, (object)image);
|
||||
ms.Close();
|
||||
return ms.ToArray();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取编号
|
||||
/// <summary>
|
||||
/// 获取编号
|
||||
/// </summary>
|
||||
/// <param name="Ostr1"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetBillNo(string Ostr1, string tab)
|
||||
{
|
||||
SqlParameter param = new SqlParameter("@return_id", SqlDbType.VarChar);
|
||||
param.Direction = ParameterDirection.InputOutput;
|
||||
SqlParameter[] parameters ={
|
||||
new SqlParameter("@billSeq",SqlDbType.VarChar),
|
||||
param
|
||||
};
|
||||
parameters[0].Value = tab;
|
||||
param.Value = Ostr1 + "";
|
||||
DataTable dt = SqlHelper.ExecuteDataSet(CommandType.StoredProcedure, "P_create_billdocumentPr", "bill", parameters).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
return dt.Rows[0][0] + "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
//获取单个模块权限
|
||||
public static int GetPrivModule(string dllCoid, string moduleFile, string operatorid, string operatorname)
|
||||
{
|
||||
if (operatorname == "管理员")
|
||||
return 1;
|
||||
string qxCols = "";
|
||||
string sql = "";
|
||||
if (string.IsNullOrEmpty(dllCoid))
|
||||
return -1;
|
||||
//if (string.IsNullOrEmpty( moduleFile))
|
||||
// return -1;
|
||||
sql = "select top 1 MenuId from P_FormMenuConfigTab where lower(UrlParams)='" + dllCoid.ToLower() + "' and lower(DllFileName) not like '%accraditation%' and subsysid in (select SubSysId from P_SubSystemTab where UseEd=1 )";
|
||||
object exec_obj = null;
|
||||
object menu_id = null;
|
||||
menu_id = SqlHelper.ExecuteScalar(CommandType.Text, sql);
|
||||
if (menu_id == null)
|
||||
return -1;
|
||||
if (menu_id + "" == "")
|
||||
return -1;
|
||||
sql = "select name from sys.columns where object_id=object_id('p_SubsysPurviewTab') and name like '%purview'";
|
||||
DataTable dt = SqlHelper.ExecuteDataSet(sql).Tables[0];
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
if (qxCols == "")
|
||||
qxCols = "','+isnull(" + dr["name"].ToString() + ",'')+','";
|
||||
else
|
||||
qxCols = qxCols + "+','+isnull(" + dr["name"].ToString() + ",'')+','";
|
||||
}
|
||||
sql = "select 1 from p_SubsysPurviewTab where charindex('," + menu_id.ToString() + ",'," + qxCols + ")>0 and employeeid=" + operatorid.ToString();
|
||||
//MessageBox.Show("1============="+sql);
|
||||
exec_obj = null;
|
||||
exec_obj = SqlHelper.ExecuteScalar(CommandType.Text, sql);
|
||||
if (exec_obj + "" == "1")
|
||||
return 1;
|
||||
else
|
||||
{
|
||||
sql = "select 1 from p_SubsysPurviewTab where charindex('," + menu_id.ToString() + "|,'," + qxCols + ")>0 and employeeid=" + operatorid.ToString();
|
||||
//MessageBox.Show("2=============" + sql);
|
||||
exec_obj = null;
|
||||
exec_obj = SqlHelper.ExecuteScalar(CommandType.Text, sql);
|
||||
if (exec_obj + "" == "1")
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取基础档案主键
|
||||
/// </summary>
|
||||
/// <param name="menuId"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetPrimaryKey(string menuId)
|
||||
{
|
||||
string key = string.Empty;
|
||||
DataTable dtTable = SqlHelper.ExecuteDataTable(string.Format("select top 1 fieldname from P_systemwordbooktab where tab='{0}' order by orderid", menuId));
|
||||
|
||||
return (dtTable.Rows.Count > 0) ? dtTable.Rows[0]["fieldname"] + "" : string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Reference in New Issue
Block a user