基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
|
||||
namespace Lskj.PubArtworkDynamic.Control
|
||||
{
|
||||
partial class ModuleGrid
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.pl_Bottom = new DevExpress.XtraEditors.PanelControl();
|
||||
this.btnAdd = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.btnDel = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.gc_Main = new Lskj.Control.GridControlEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_Bottom)).BeginInit();
|
||||
this.pl_Bottom.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pl_Bottom
|
||||
//
|
||||
this.pl_Bottom.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pl_Bottom.Appearance.Options.UseBackColor = true;
|
||||
this.pl_Bottom.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.pl_Bottom.Controls.Add(this.btnAdd);
|
||||
this.pl_Bottom.Controls.Add(this.btnDel);
|
||||
this.pl_Bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.pl_Bottom.Location = new System.Drawing.Point(0, 360);
|
||||
this.pl_Bottom.LookAndFeel.UseDefaultLookAndFeel = false;
|
||||
this.pl_Bottom.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pl_Bottom.Name = "pl_Bottom";
|
||||
this.pl_Bottom.Size = new System.Drawing.Size(354, 45);
|
||||
this.pl_Bottom.TabIndex = 19;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnAdd.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnAdd.Appearance.Options.UseFont = true;
|
||||
this.btnAdd.Location = new System.Drawing.Point(150, 6);
|
||||
this.btnAdd.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(96, 32);
|
||||
this.btnAdd.TabIndex = 43;
|
||||
this.btnAdd.Text = "上传(&A)";
|
||||
//
|
||||
// btnDel
|
||||
//
|
||||
this.btnDel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnDel.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnDel.Appearance.Options.UseFont = true;
|
||||
this.btnDel.Location = new System.Drawing.Point(254, 6);
|
||||
this.btnDel.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnDel.Name = "btnDel";
|
||||
this.btnDel.Size = new System.Drawing.Size(96, 32);
|
||||
this.btnDel.TabIndex = 42;
|
||||
this.btnDel.Text = "删除(&D)";
|
||||
//
|
||||
// gc_Main
|
||||
//
|
||||
this.gc_Main.AdapterObj = null;
|
||||
this.gc_Main.AllowDrop = true;
|
||||
this.gc_Main.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gc_Main.Location = new System.Drawing.Point(0, 0);
|
||||
this.gc_Main.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
|
||||
this.gc_Main.Name = "gc_Main";
|
||||
this.gc_Main.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gc_Main.Size = new System.Drawing.Size(354, 360);
|
||||
this.gc_Main.TabIndex = 20;
|
||||
//
|
||||
// ModuleGrid
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.gc_Main);
|
||||
this.Controls.Add(this.pl_Bottom);
|
||||
this.Name = "ModuleGrid";
|
||||
this.Size = new System.Drawing.Size(354, 405);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_Bottom)).EndInit();
|
||||
this.pl_Bottom.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PanelControl pl_Bottom;
|
||||
private DevExpress.XtraEditors.SimpleButton btnAdd;
|
||||
private DevExpress.XtraEditors.SimpleButton btnDel;
|
||||
private Lskj.Control.GridControlEx gc_Main;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,479 @@
|
||||
using Lskj.Business;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Control.BrowserSetting;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Core;
|
||||
using Lskj.Model;
|
||||
using Lskj.Util;
|
||||
using Microsoft.WindowsAPICodePack.Shell;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubArtworkDynamic.Control
|
||||
{
|
||||
public partial class ModuleGrid : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 模块类
|
||||
/// </summary>
|
||||
public ViewModel MainViewModel;
|
||||
/// <summary>
|
||||
/// 表格控件
|
||||
/// </summary>
|
||||
public GridControlEx MainGridEx { get { return gc_Main; } }
|
||||
/// <summary>
|
||||
/// 明细Model
|
||||
/// </summary>
|
||||
public GridDetailModel DetailModel;
|
||||
/// <summary>
|
||||
/// 条件控件
|
||||
/// </summary>
|
||||
public MyControl SearchMainObj;
|
||||
/// <summary>
|
||||
/// 左侧节点上方主键
|
||||
/// </summary>
|
||||
private string leftTopGridIdValue
|
||||
{
|
||||
get
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = (ModuleGridDetail)MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0];
|
||||
string rtnString = "";
|
||||
DataRow dataRow = moduleGridDetail.TopGridEx.GridView.GetFocusedDataRow();
|
||||
if (dataRow != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(MainViewModel.MoudleMainObj.UploadIdValueField) && dataRow.Table.Columns.Contains(MainViewModel.MoudleMainObj.UploadIdValueField))
|
||||
{
|
||||
rtnString = dataRow[MainViewModel.MoudleMainObj.UploadIdValueField] + "";
|
||||
}
|
||||
}
|
||||
return rtnString;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 左侧节点上方主键
|
||||
/// </summary>
|
||||
private string leftBottomGridIdValue
|
||||
{
|
||||
get
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = (ModuleGridDetail)MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0];
|
||||
string rtnString = "";
|
||||
DataRow dataRow = moduleGridDetail.BottomGridEx.GridView.GetFocusedDataRow();
|
||||
if (dataRow != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(MainViewModel.MoudleMainObj.UploadIdValueField) && dataRow.Table.Columns.Contains(MainViewModel.MoudleMainObj.UploadIdValueField))
|
||||
{
|
||||
rtnString = dataRow[MainViewModel.MoudleMainObj.UploadIdValueField] + "";
|
||||
}
|
||||
}
|
||||
return rtnString;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 文件大小
|
||||
/// </summary>
|
||||
private static readonly string[] suffixes = new string[] { " B", " KB", " MB", " GB", " TB", " PB" };
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public ModuleGrid(GridDetailModel model)
|
||||
{
|
||||
DetailModel = model;
|
||||
InitializeComponent();
|
||||
Load += OnModuleGridDetailLoad;
|
||||
btnAdd.Click += OnBtnAddClick;
|
||||
btnDel.Click += OnBtnDelClick;
|
||||
}
|
||||
/// <summary>
|
||||
/// 加载完成后
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnModuleGridDetailLoad(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
gc_Main.GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect;
|
||||
gc_Main.Tag = DetailModel;
|
||||
if (DetailModel.IsReadOnly)
|
||||
{
|
||||
this.SearchMainObj = new MyControl(DetailModel.DetailSql, gc_Main);//构建主表mycontrol
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SearchMainObj = new MyControl(DetailModel.SystemModel.MenuSql, gc_Main);//构建主表mycontrol
|
||||
}
|
||||
DataTable gridColumns = new DataTable();
|
||||
if (!string.IsNullOrEmpty(DetailModel.UnionModule))
|
||||
{
|
||||
gridColumns = BaseModuleImpl.GetBaseGridColumns(DetailModel.UnionModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
gridColumns = ReportImpl.GetReportDetailColumns(MainViewModel.SysModel.ModuleCode, DetailModel.Id + "");
|
||||
}
|
||||
gc_Main.GridView.OptionsBehavior.Editable = false;
|
||||
gc_Main.SetReadOnlyColumns(gridColumns, GridCustomColumnStruct.BaseMainGridView + DetailModel.FormKey);//明细
|
||||
DynamicModel dyncModel = new DynamicModuleModel(new string[] { DetailModel.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, MainViewModel.SysModel.Privilege, DetailModel.UnionModule, "0" });
|
||||
if (!string.IsNullOrEmpty(DetailModel.SystemModel.ModeCode))
|
||||
{
|
||||
gc_Main.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DetailModel.SystemModel.ModeCode), dyncModel, OnRightMenuCallBack, this.SearchMainObj);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(DetailModel.FormKey))
|
||||
{
|
||||
gc_Main.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DetailModel.FormKey), dyncModel, OnRightMenuCallBack, this.SearchMainObj);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 上传按钮点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnAddClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string resultStr = string.Empty;
|
||||
OpenFileDialog dialog = new OpenFileDialog();
|
||||
dialog.Multiselect = true;//该值确定是否可以选择多个文件
|
||||
dialog.Title = "请选择文件";
|
||||
string filter = SqlHelper.ExecuteScalar(@"select 合并字段=stuff((select '|'+Mix_apellation+'(*'+bases1 +')'+'|*'+bases1 from P_BaseMixInfoTab b where Tag=a.Tag for xml path('')),1,1,'')
|
||||
from P_BaseMixInfoTab a
|
||||
where Tag='70700201'
|
||||
group by Tag
|
||||
") + "";
|
||||
dialog.Filter = string.IsNullOrWhiteSpace(filter) ? "所有文件(*.*)|*.*" : filter;
|
||||
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
WaitForm.ShowForm("文件上传中...");
|
||||
foreach (string fileName in dialog.FileNames)
|
||||
{
|
||||
string outMsg = "";
|
||||
bool isUpload = false;
|
||||
if (filter.ToLower().Contains(Path.GetExtension(fileName).ToLower()))
|
||||
{
|
||||
isUpload = UploadFile(fileName, out outMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
outMsg = "该文件类型不允许上传";
|
||||
}
|
||||
if (!isUpload)
|
||||
{
|
||||
resultStr += string.Format("文件{0}上传失败,原因:{1}\r\n", Path.GetFileName(fileName), outMsg);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(resultStr))
|
||||
{
|
||||
MessageUtil.Show(resultStr);
|
||||
}
|
||||
WaitForm.HideForm();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
RefushWaitDetail();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除操作页签附件数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnDelClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataTable dataTable = gc_Main.gridControl.DataSource as DataTable;
|
||||
int[] rowNumbers = gc_Main.GridView.GetSelectedRows();
|
||||
string resultStr = string.Empty;
|
||||
foreach (int rowIndex in rowNumbers)
|
||||
{
|
||||
DataRow rowItem = gc_Main.GridView.GetDataRow(rowIndex);
|
||||
bool isDelete = false;
|
||||
isDelete = DeleteFile(rowIndex);
|
||||
if (!isDelete)
|
||||
{
|
||||
gc_Main.GridView.UnselectRow(rowIndex);
|
||||
resultStr += string.Format("文件{0}删除失败\r\n", rowItem["name"]);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(resultStr))
|
||||
{
|
||||
MessageUtil.Show(resultStr);
|
||||
}
|
||||
gc_Main.GridView.DeleteSelectedRows();
|
||||
gc_Main.GridView.SelectRow(dataTable.Rows.Count - 1);
|
||||
gc_Main.GridView.FocusedRowHandle = dataTable.Rows.Count - 1;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
RefushWaitDetail();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 刷新等待区
|
||||
/// </summary>
|
||||
public void RefushWaitDetail()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage != null && MainViewModel.RightTabControl.TabControlObj.SelectedTabPage != null)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
DataRow rowItem = moduleGridDetail.TopGridEx.GetViewFocusedDataRow();
|
||||
if (rowItem != null && this.MainGridEx.Tag != null && this.MainGridEx.Tag is GridDetailModel)
|
||||
{
|
||||
GridDetailModel gridDetailModel = this.MainGridEx.Tag as GridDetailModel;
|
||||
string sqlValue = this.GetSearchSql(gridDetailModel, rowItem);
|
||||
DataTable dataTable = MainImpl.GetDataTableResult(sqlValue);
|
||||
this.MainGridEx.SetGridViewDataSource(dataTable);
|
||||
this.MainGridEx.LastSearchSql = sqlValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取查询条件
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <param name="rowItem"></param>
|
||||
/// <returns></returns>
|
||||
private string GetSearchSql(GridDetailModel model, DataRow rowItem)
|
||||
{
|
||||
string fieldName = !string.IsNullOrEmpty(model.UnionParentField) && rowItem.Table.Columns.Contains(model.UnionParentField) ? model.UnionParentField : MainViewModel.MoudleMainObj.ParmaryKey;
|
||||
string sqlValue = model.IsReadOnly || model.IsChart ? model.DetailSql : model.SystemModel.MenuSql;
|
||||
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
|
||||
|
||||
if (ReplaceHelper.IsSelect(sqlValue) && !string.IsNullOrEmpty(model.UnionValue))
|
||||
{
|
||||
sqlValue = ReplaceHelper.ReplaceWhereCond(sqlValue) + string.Format(" and {0}='{1}'", model.UnionValue, rowItem[fieldName] + "");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.UnionCond))
|
||||
{
|
||||
string UnionCond = ReplaceHelper.ReplaceRowParam(rowItem, model.UnionCond);
|
||||
sqlValue += UnionCond;
|
||||
}
|
||||
return sqlValue;
|
||||
}
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
private bool UploadFile(string filePath, out string msg)
|
||||
{
|
||||
bool isUpload = false;
|
||||
string File = filePath;
|
||||
string returnMsg = "";
|
||||
string postUrl = "";
|
||||
try
|
||||
{
|
||||
//获取文件信息
|
||||
System.IO.FileInfo fileInfo = new FileInfo(File);
|
||||
string suffix = Path.GetExtension(File);
|
||||
//获取Excel等文件信息
|
||||
string fileAuthor = "";
|
||||
string fileType = "";
|
||||
try
|
||||
{
|
||||
var file = ShellFile.FromFilePath(File);
|
||||
string[] oldAuthors = file.Properties.System.Author.Value;//作者
|
||||
if (oldAuthors != null && oldAuthors.Length > 0)
|
||||
{
|
||||
fileAuthor = string.Join(",", oldAuthors);
|
||||
}
|
||||
else
|
||||
{
|
||||
fileAuthor = "";
|
||||
}
|
||||
fileType = file.Properties.System.ItemTypeText.Value + "";
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
fileType = Path.GetExtension(File).TrimStart(',');
|
||||
}
|
||||
string name = fileInfo.Name;
|
||||
DateTime creationTime = fileInfo.CreationTime;
|
||||
string fileSize = BytesToReadableValue(fileInfo.Length);
|
||||
byte[] fileBytes = ConvertFileToBytes(File);
|
||||
string fileStream = Convert.ToBase64String(fileBytes);
|
||||
string userId = ERPInfo.Instance.UserId;
|
||||
DateTime uploadTime = DateTime.Now;
|
||||
//上传文件到服务器目录
|
||||
postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&idValue={2}&folder={3}&totsize={4}&position={5}&filename={6}&method={7}";
|
||||
if (!string.IsNullOrEmpty(leftTopGridIdValue))
|
||||
{
|
||||
postUrl = string.Format(postUrl, SystemInfo.Instance.OAUrl, this.MainViewModel.SysModel.ModuleCode, leftTopGridIdValue, "UploadFilesTemp", fileBytes.Length, 0, name, "DoWebUpload");
|
||||
HttpTools.setting("application/x-www-form-urlencoded", null, null);
|
||||
string result = "";
|
||||
CookieCollection cookieCollection = null;
|
||||
HttpWebResponse webResponse = HttpTools.Post(postUrl, fileStream, null, HttpTools.Method.POST, out cookieCollection, out result);
|
||||
if (webResponse != null && !string.IsNullOrEmpty(result))
|
||||
{
|
||||
JObject jsonObject = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(result);
|
||||
string isSuccess = jsonObject["success"] + "";
|
||||
if (isSuccess.Equals("True", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
string fileId = jsonObject["other"] + "";
|
||||
string webpath = jsonObject["data"]["WebRelPath"] + "";
|
||||
string searchSql = @"update P_fm_FileTab set author='{2}',CreationTime='{3}' ,Uploader='{4}',UploaderId='{5}' ,UploadTime='{6}' ,Pid='{1}'
|
||||
where dllcoid = '{0}' and fileId='{7}' ";
|
||||
searchSql = string.Format(searchSql, this.MainViewModel.SysModel.ModuleCode, this.leftTopGridIdValue, fileAuthor, fileInfo.CreationTime, ERPInfo.Instance.UserName, ERPInfo.Instance.UserId, uploadTime, fileId);
|
||||
SqlHelper.ExecuteNonQuery(searchSql);
|
||||
isUpload = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (jsonObject.ContainsKey("msg"))
|
||||
{
|
||||
returnMsg = jsonObject["msg"] + "";
|
||||
}
|
||||
isUpload = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
returnMsg = "上传请求失败";
|
||||
isUpload = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
returnMsg = "上传节点值不能为空";
|
||||
isUpload = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
returnMsg = ex.Message;
|
||||
isUpload = false;
|
||||
}
|
||||
msg = returnMsg;
|
||||
return isUpload;
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除文件
|
||||
/// </summary>
|
||||
/// <param name="rowIndex"></param>
|
||||
/// <returns></returns>
|
||||
private bool DeleteFile(int rowIndex)
|
||||
{
|
||||
DataRow rowItem = gc_Main.GridView.GetDataRow(rowIndex);
|
||||
bool isDelete = false;
|
||||
try
|
||||
{
|
||||
//删除文件
|
||||
//string postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&idValue={2}&folder={3}&filename={4}&method={5}";
|
||||
string postUrl = "{0}Api/FileUploadApi.ashx?fileId={1}&filename={2}&method={3}";
|
||||
//postUrl = string.Format(postUrl, SystemInfo.Instance.OAUrl, this.Model.ModuleCode, "", "UploadFilesTemp", rowItem["name"], "DoDelete");
|
||||
postUrl = string.Format(postUrl, SystemInfo.Instance.OAUrl, rowItem["fileId"], rowItem["webpath"], "DoDelete");
|
||||
HttpTools.setting("application/x-www-form-urlencoded", null, null);
|
||||
string result = "";
|
||||
CookieCollection cookieCollection = null;
|
||||
HttpWebResponse webResponse = HttpTools.Post(postUrl, "", null, HttpTools.Method.POST, out cookieCollection, out result);
|
||||
if (webResponse != null && !string.IsNullOrEmpty(result))
|
||||
{
|
||||
JObject jsonObject = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(result);
|
||||
string isSuccess = jsonObject["success"] + "";
|
||||
if (isSuccess.Equals("True", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
isDelete = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
return isDelete;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取文件大小的显示字符串
|
||||
/// </summary>
|
||||
/// <param name="number"></param>
|
||||
/// <returns></returns>
|
||||
public static string BytesToReadableValue(double number)
|
||||
{
|
||||
double last = 1;
|
||||
for (int i = 0; i < suffixes.Length; i++)
|
||||
{
|
||||
var current = Math.Pow(1024, i + 1);
|
||||
var temp = number / current;
|
||||
if (temp < 1)
|
||||
{
|
||||
return (number / last).ToString("n2") + suffixes[i];
|
||||
}
|
||||
last = current;
|
||||
}
|
||||
return number.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 附件转换byte[]
|
||||
/// </summary>
|
||||
/// <param name="filePath">附件路径</param>
|
||||
/// <returns>二进制</returns>
|
||||
private byte[] ConvertFileToBytes(string filePath)
|
||||
{
|
||||
byte[] bytContent = null;
|
||||
System.IO.FileStream fs = null;
|
||||
System.IO.BinaryReader br = null;
|
||||
try
|
||||
{
|
||||
fs = new FileStream(filePath, System.IO.FileMode.Open);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (fs != null)
|
||||
br = new BinaryReader((Stream)fs);
|
||||
if (br != null)
|
||||
bytContent = br.ReadBytes((Int32)fs.Length);
|
||||
if (fs != null)
|
||||
fs.Dispose();
|
||||
}
|
||||
return bytContent;
|
||||
}
|
||||
/// <summary>
|
||||
/// 右键菜单回调
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnRightMenuCallBack(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,165 @@
|
||||
|
||||
namespace Lskj.PubArtworkDynamic.Control
|
||||
{
|
||||
partial class ModuleGridDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitMainControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.pl_top_cond = new DevExpress.XtraEditors.PanelControl();
|
||||
this.plm_top_btnFixSearch = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.labelControl3 = new DevExpress.XtraEditors.LabelControl();
|
||||
this.plm_top_cbField = new System.Windows.Forms.ComboBox();
|
||||
this.plm_top_txtFixKey = new System.Windows.Forms.TextBox();
|
||||
this.gc_Top = new Lskj.Control.GridControlEx();
|
||||
this.gc_Bottom = new Lskj.Control.GridControlEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).BeginInit();
|
||||
this.splitMainControl.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_top_cond)).BeginInit();
|
||||
this.pl_top_cond.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitMainControl
|
||||
//
|
||||
this.splitMainControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitMainControl.Horizontal = false;
|
||||
this.splitMainControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitMainControl.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.splitMainControl.Name = "splitMainControl";
|
||||
this.splitMainControl.Panel1.Controls.Add(this.gc_Top);
|
||||
this.splitMainControl.Panel1.Controls.Add(this.pl_top_cond);
|
||||
this.splitMainControl.Panel1.Text = "Panel1";
|
||||
this.splitMainControl.Panel2.Controls.Add(this.gc_Bottom);
|
||||
this.splitMainControl.Panel2.Text = "Panel2";
|
||||
this.splitMainControl.Size = new System.Drawing.Size(457, 562);
|
||||
this.splitMainControl.SplitterPosition = 355;
|
||||
this.splitMainControl.TabIndex = 5;
|
||||
this.splitMainControl.Text = "splitContainerControl3";
|
||||
//
|
||||
// pl_top_cond
|
||||
//
|
||||
this.pl_top_cond.Controls.Add(this.plm_top_btnFixSearch);
|
||||
this.pl_top_cond.Controls.Add(this.labelControl3);
|
||||
this.pl_top_cond.Controls.Add(this.plm_top_cbField);
|
||||
this.pl_top_cond.Controls.Add(this.plm_top_txtFixKey);
|
||||
this.pl_top_cond.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.pl_top_cond.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_top_cond.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pl_top_cond.Name = "pl_top_cond";
|
||||
this.pl_top_cond.Size = new System.Drawing.Size(457, 40);
|
||||
this.pl_top_cond.TabIndex = 18;
|
||||
//
|
||||
// plm_top_btnFixSearch
|
||||
//
|
||||
this.plm_top_btnFixSearch.Appearance.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.plm_top_btnFixSearch.Appearance.Options.UseFont = true;
|
||||
this.plm_top_btnFixSearch.Location = new System.Drawing.Point(356, 6);
|
||||
this.plm_top_btnFixSearch.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.plm_top_btnFixSearch.Name = "plm_top_btnFixSearch";
|
||||
this.plm_top_btnFixSearch.Size = new System.Drawing.Size(72, 26);
|
||||
this.plm_top_btnFixSearch.TabIndex = 40;
|
||||
this.plm_top_btnFixSearch.Text = "查询(&Q)";
|
||||
//
|
||||
// labelControl3
|
||||
//
|
||||
this.labelControl3.Appearance.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.labelControl3.Location = new System.Drawing.Point(3, 11);
|
||||
this.labelControl3.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.labelControl3.Name = "labelControl3";
|
||||
this.labelControl3.Size = new System.Drawing.Size(30, 15);
|
||||
this.labelControl3.TabIndex = 39;
|
||||
this.labelControl3.Text = "查询";
|
||||
//
|
||||
// plm_top_cbField
|
||||
//
|
||||
this.plm_top_cbField.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.plm_top_cbField.FormattingEnabled = true;
|
||||
this.plm_top_cbField.Location = new System.Drawing.Point(40, 5);
|
||||
this.plm_top_cbField.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.plm_top_cbField.Name = "plm_top_cbField";
|
||||
this.plm_top_cbField.Size = new System.Drawing.Size(121, 26);
|
||||
this.plm_top_cbField.TabIndex = 37;
|
||||
this.plm_top_cbField.Tag = "";
|
||||
//
|
||||
// plm_top_txtFixKey
|
||||
//
|
||||
this.plm_top_txtFixKey.Location = new System.Drawing.Point(171, 5);
|
||||
this.plm_top_txtFixKey.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.plm_top_txtFixKey.Name = "plm_top_txtFixKey";
|
||||
this.plm_top_txtFixKey.Size = new System.Drawing.Size(176, 26);
|
||||
this.plm_top_txtFixKey.TabIndex = 38;
|
||||
//
|
||||
// gc_Top
|
||||
//
|
||||
this.gc_Top.AdapterObj = null;
|
||||
this.gc_Top.AllowDrop = true;
|
||||
this.gc_Top.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gc_Top.Location = new System.Drawing.Point(0, 40);
|
||||
this.gc_Top.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
|
||||
this.gc_Top.Name = "gc_Top";
|
||||
this.gc_Top.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gc_Top.Size = new System.Drawing.Size(457, 315);
|
||||
this.gc_Top.TabIndex = 20;
|
||||
//
|
||||
// gc_Bottom
|
||||
//
|
||||
this.gc_Bottom.AdapterObj = null;
|
||||
this.gc_Bottom.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gc_Bottom.Location = new System.Drawing.Point(0, 0);
|
||||
this.gc_Bottom.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
|
||||
this.gc_Bottom.Name = "gc_Bottom";
|
||||
this.gc_Bottom.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gc_Bottom.Size = new System.Drawing.Size(457, 201);
|
||||
this.gc_Bottom.TabIndex = 17;
|
||||
//
|
||||
// GridDetailControl
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.Controls.Add(this.splitMainControl);
|
||||
this.Name = "GridDetailControl";
|
||||
this.Size = new System.Drawing.Size(457, 562);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).EndInit();
|
||||
this.splitMainControl.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_top_cond)).EndInit();
|
||||
this.pl_top_cond.ResumeLayout(false);
|
||||
this.pl_top_cond.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitMainControl;
|
||||
private Lskj.Control.GridControlEx gc_Top;
|
||||
private DevExpress.XtraEditors.PanelControl pl_top_cond;
|
||||
private DevExpress.XtraEditors.SimpleButton plm_top_btnFixSearch;
|
||||
private DevExpress.XtraEditors.LabelControl labelControl3;
|
||||
private System.Windows.Forms.ComboBox plm_top_cbField;
|
||||
private System.Windows.Forms.TextBox plm_top_txtFixKey;
|
||||
private Lskj.Control.GridControlEx gc_Bottom;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,463 @@
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.XtraGrid.Views.Base;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Model;
|
||||
using Lskj.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubArtworkDynamic.Control
|
||||
{
|
||||
public partial class ModuleGridDetail : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 模块类
|
||||
/// </summary>
|
||||
public ViewModel MainViewModel;
|
||||
/// <summary>
|
||||
/// 搜索按钮
|
||||
/// </summary>
|
||||
public SimpleButton SearchButton
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.SearchMainObj.ButtonObj != null)
|
||||
{
|
||||
return this.SearchMainObj.ButtonObj;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.plm_top_btnFixSearch;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 主模块的表格
|
||||
/// </summary>
|
||||
public GridControlEx MainGridEx
|
||||
{
|
||||
get
|
||||
{
|
||||
if (gc_Top.ContainsFocus)
|
||||
{
|
||||
return gc_Top;
|
||||
}
|
||||
else
|
||||
{
|
||||
return gc_Bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 上方表格控件
|
||||
/// </summary>
|
||||
public GridControlEx TopGridEx { get { return gc_Top; } }
|
||||
/// <summary>
|
||||
/// 下方表格控件
|
||||
/// </summary>
|
||||
public GridControlEx BottomGridEx { get { return gc_Bottom; } }
|
||||
/// <summary>
|
||||
/// 明细Model
|
||||
/// </summary>
|
||||
public GridDetailModel DetailModel;
|
||||
/// <summary>
|
||||
/// 主条件控件
|
||||
/// </summary>
|
||||
public MyControl SearchMainObj;
|
||||
/// <summary>
|
||||
/// 明细条件控件
|
||||
/// </summary>
|
||||
public MyControl SearchDetailObj;
|
||||
|
||||
/// <summary>
|
||||
/// 条件参数
|
||||
/// </summary>
|
||||
public string[] OtherParams;
|
||||
/// <summary>
|
||||
/// 拖拽方向(1只能拖拽到主表,2只能拖拽到明细。默认0都可以拖)
|
||||
/// </summary>
|
||||
public int DragDirection;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public ModuleGridDetail(GridDetailModel model)
|
||||
{
|
||||
DetailModel = model;
|
||||
InitializeComponent();
|
||||
Load += OnModuleGridDetailLoad;
|
||||
}
|
||||
|
||||
public ModuleGridDetail(GridDetailModel model, string[] otherParams)
|
||||
{
|
||||
DetailModel = model;
|
||||
this.OtherParams = otherParams;
|
||||
InitializeComponent();
|
||||
Load += OnModuleGridDetailLoad;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加载完成后
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnModuleGridDetailLoad(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
gc_Top.GridView.OptionsSelection.MultiSelect = false;
|
||||
gc_Top.GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect;
|
||||
gc_Bottom.GridView.OptionsSelection.MultiSelect = false;
|
||||
gc_Bottom.GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect;
|
||||
gc_Top.GridView.RowClick += OnGridViewRowClick;
|
||||
gc_Bottom.GridView.RowClick += OnGridViewRowClick;
|
||||
//gc_Bottom.GridView.FocusedRowObjectChanged += OnGridViewFocusedRowObjectChanged;
|
||||
if (DetailModel != null)
|
||||
{
|
||||
this.DragDirection = DetailModel.SystemModel.DragDirection;
|
||||
if (DetailModel.IsReadOnly)
|
||||
{
|
||||
this.SearchMainObj = new MyControl(DetailModel.DetailSql, gc_Top);//构建主表mycontrol
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SearchMainObj = new MyControl(DetailModel.SystemModel.MenuSql, gc_Top);//构建主表mycontrol
|
||||
}
|
||||
this.SearchMainObj.OtherParams = this.OtherParams;
|
||||
this.SearchMainObj.OnSearchAfterCallBack += OnSearchAfterCallBack;//搜索完成后
|
||||
DataTable gridColumns = new DataTable();
|
||||
if (!string.IsNullOrEmpty(DetailModel.UnionModule))
|
||||
{
|
||||
gridColumns = BaseModuleImpl.GetBaseGridColumns(DetailModel.UnionModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
gridColumns = ReportImpl.GetReportDetailColumns(MainViewModel.SysModel.ModuleCode, DetailModel.Id + "");
|
||||
}
|
||||
gc_Top.GridView.OptionsBehavior.Editable = false;
|
||||
gc_Top.SetReadOnlyColumns(gridColumns, GridCustomColumnStruct.BaseMainGridView + DetailModel.FormKey);//明细
|
||||
DynamicModel dyncModel = new DynamicModuleModel(new string[] { DetailModel.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, MainViewModel.SysModel.Privilege, DetailModel.UnionModule, "0" });
|
||||
if (!string.IsNullOrEmpty(DetailModel.SystemModel.ModeCode))
|
||||
{
|
||||
gc_Top.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DetailModel.SystemModel.ModeCode), dyncModel, OnRightMenuCallBack, this.SearchMainObj);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(DetailModel.FormKey))
|
||||
{
|
||||
gc_Top.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DetailModel.FormKey), dyncModel, OnRightMenuCallBack, this.SearchMainObj);
|
||||
}
|
||||
DataTable queryTable = BaseModuleImpl.GetCustomQueryFields(DetailModel.SystemModel.CondKey);//获取主模块构建的条件
|
||||
if (queryTable != null && queryTable.Rows.Count > 0)
|
||||
{
|
||||
// 加载自定义查询条件
|
||||
this.pl_top_cond.Controls.Clear();
|
||||
this.SearchMainObj.InitSearchControl(queryTable, this.pl_top_cond, null, null, DetailModel.SystemModel.ConditionRefresh);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 加载固定查询条件
|
||||
DataTable table = BaseModuleImpl.GetFixedQueryFields(DetailModel.SystemModel.ModeCode);//加载固定查询条件
|
||||
this.plm_top_cbField.DisplayMember = "fieldText";
|
||||
this.plm_top_cbField.ValueMember = "fieldName";
|
||||
this.plm_top_cbField.DataSource = table;
|
||||
this.SearchMainObj.InitDefaultSearchControl(table, this.pl_top_cond, this.plm_top_cbField.Name, this.plm_top_txtFixKey.Name, this.plm_top_btnFixSearch.Name);
|
||||
}
|
||||
//加载明细表格
|
||||
DataTable moduleDetailTable = BaseModuleImpl.GetBaseDetailPages(DetailModel.UnionModule);//获取关联模块配置明细
|
||||
DataRow detailRow = moduleDetailTable.Rows.Cast<DataRow>().Where(n => (n["orderId"] + "").Equals("99")).FirstOrDefault();
|
||||
if (detailRow != null)
|
||||
{
|
||||
GridDetailModel bottomDetailModel = new GridDetailModel(detailRow);
|
||||
bottomDetailModel.SystemModel = new ModuleModel(MainImpl.GetSystemdllTab(bottomDetailModel.UnionModule));//获取主模块构建类
|
||||
gc_Bottom.Tag = bottomDetailModel;
|
||||
if (bottomDetailModel.IsReadOnly)
|
||||
{
|
||||
this.SearchDetailObj = new MyControl(bottomDetailModel.DetailSql, gc_Bottom);//构建明细表mycontrol
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SearchDetailObj = new MyControl(bottomDetailModel.SystemModel.MenuSql, gc_Bottom);//构建明细表mycontrol
|
||||
}
|
||||
DataTable bottomDetailColumns = new DataTable();
|
||||
if (!string.IsNullOrEmpty(bottomDetailModel.UnionModule))
|
||||
{
|
||||
bottomDetailColumns = BaseModuleImpl.GetBaseGridColumns(bottomDetailModel.UnionModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
bottomDetailColumns = ReportImpl.GetReportDetailColumns(MainViewModel.SysModel.ModuleCode, bottomDetailModel.Id + "");
|
||||
}
|
||||
gc_Bottom.GridView.OptionsBehavior.Editable = false;
|
||||
gc_Bottom.SetReadOnlyColumns(bottomDetailColumns, GridCustomColumnStruct.BaseMainGridView + bottomDetailModel.FormKey);//明细
|
||||
DynamicModel dyncBottomDetailModel = new DynamicModuleModel(new string[] { bottomDetailModel.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, MainViewModel.SysModel.Privilege, bottomDetailModel.UnionModule, "0" });
|
||||
if (!string.IsNullOrEmpty(bottomDetailModel.SystemModel.ModeCode))
|
||||
{
|
||||
gc_Bottom.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(bottomDetailModel.SystemModel.ModeCode), dyncBottomDetailModel, OnRightMenuCallBack, SearchDetailObj);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(bottomDetailModel.FormKey))
|
||||
{
|
||||
gc_Bottom.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(bottomDetailModel.FormKey), dyncBottomDetailModel, OnRightMenuCallBack, SearchDetailObj);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
splitMainControl.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ModuleModel MainModuleModel = new ModuleModel(MainImpl.GetSystemdllTab(MainViewModel.SysModel.ModuleCode));//获取主模块构建类
|
||||
this.DragDirection = MainModuleModel.DragDirection;
|
||||
this.SearchMainObj = new MyControl(MainModuleModel.MenuSql, gc_Top);//构建主表mycontrol
|
||||
this.SearchMainObj.OtherParams = this.OtherParams;
|
||||
this.SearchMainObj.OnSearchAfterCallBack += OnSearchAfterCallBack;//搜索完成后
|
||||
DataTable gridColumns = BaseModuleImpl.GetBaseGridColumns(MainModuleModel.ModeCode);
|
||||
gc_Top.GridView.OptionsBehavior.Editable = false;
|
||||
gc_Top.SetReadOnlyColumns(gridColumns, GridCustomColumnStruct.BaseMainGridView + MainModuleModel.FormKey);//明细
|
||||
DynamicModel dyncModel = new DynamicModuleModel(new string[] { MainModuleModel.MenuName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, MainViewModel.SysModel.Privilege, MainModuleModel.ModeCode, "0" });
|
||||
if (!string.IsNullOrEmpty(MainModuleModel.ModeCode))
|
||||
{
|
||||
gc_Top.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(MainModuleModel.ModeCode), dyncModel, OnRightMenuCallBack, this.SearchMainObj);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(MainModuleModel.FormKey))
|
||||
{
|
||||
gc_Top.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(MainModuleModel.FormKey), dyncModel, OnRightMenuCallBack, this.SearchMainObj);
|
||||
}
|
||||
DataTable queryTable = BaseModuleImpl.GetCustomQueryFields(MainModuleModel.CondKey);//获取主模块构建的条件
|
||||
if (queryTable != null && queryTable.Rows.Count > 0)
|
||||
{
|
||||
// 加载自定义查询条件
|
||||
this.pl_top_cond.Controls.Clear();
|
||||
this.SearchMainObj.InitSearchControl(queryTable, this.pl_top_cond, null, null, MainModuleModel.ConditionRefresh);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 加载固定查询条件
|
||||
DataTable table = BaseModuleImpl.GetFixedQueryFields(DetailModel.SystemModel.ModeCode);//加载固定查询条件
|
||||
this.plm_top_cbField.DisplayMember = "fieldText";
|
||||
this.plm_top_cbField.ValueMember = "fieldName";
|
||||
this.plm_top_cbField.DataSource = table;
|
||||
this.SearchMainObj.InitDefaultSearchControl(table, this.pl_top_cond, this.plm_top_cbField.Name, this.plm_top_txtFixKey.Name, this.plm_top_btnFixSearch.Name);
|
||||
}
|
||||
//加载明细表格
|
||||
DataTable moduleDetailTable = BaseModuleImpl.GetBaseDetailPages(MainModuleModel.ModeCode);//获取关联模块配置明细
|
||||
DataRow detailRow = moduleDetailTable.Rows.Cast<DataRow>().Where(n => (n["orderId"] + "").Equals("99")).FirstOrDefault();
|
||||
if (detailRow != null)
|
||||
{
|
||||
GridDetailModel bottomDetailModel = new GridDetailModel(detailRow);
|
||||
bottomDetailModel.SystemModel = new ModuleModel(MainImpl.GetSystemdllTab(bottomDetailModel.UnionModule));//获取主模块构建类
|
||||
gc_Bottom.Tag = bottomDetailModel;
|
||||
if (bottomDetailModel.IsReadOnly)
|
||||
{
|
||||
this.SearchDetailObj = new MyControl(bottomDetailModel.DetailSql, gc_Bottom);//构建明细表mycontrol
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SearchDetailObj = new MyControl(bottomDetailModel.SystemModel.MenuSql, gc_Bottom);//构建明细表mycontrol
|
||||
}
|
||||
DataTable bottomDetailColumns = new DataTable();
|
||||
if (!string.IsNullOrEmpty(bottomDetailModel.UnionModule))
|
||||
{
|
||||
bottomDetailColumns = BaseModuleImpl.GetBaseGridColumns(bottomDetailModel.UnionModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
bottomDetailColumns = ReportImpl.GetReportDetailColumns(MainViewModel.SysModel.ModuleCode, bottomDetailModel.Id + "");
|
||||
}
|
||||
gc_Bottom.GridView.OptionsBehavior.Editable = false;
|
||||
gc_Bottom.SetReadOnlyColumns(bottomDetailColumns, GridCustomColumnStruct.BaseMainGridView + bottomDetailModel.FormKey);//明细
|
||||
DynamicModel dyncBottomDetailModel = new DynamicModuleModel(new string[] { bottomDetailModel.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, MainViewModel.SysModel.Privilege, bottomDetailModel.UnionModule, "0" });
|
||||
if (!string.IsNullOrEmpty(bottomDetailModel.SystemModel.ModeCode))
|
||||
{
|
||||
gc_Bottom.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(bottomDetailModel.SystemModel.ModeCode), dyncBottomDetailModel, OnRightMenuCallBack, SearchDetailObj);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(bottomDetailModel.FormKey))
|
||||
{
|
||||
gc_Bottom.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(bottomDetailModel.FormKey), dyncBottomDetailModel, OnRightMenuCallBack, SearchDetailObj);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
splitMainControl.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 右键菜单回调
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnRightMenuCallBack(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
SearchMainObj.SearchGrid();
|
||||
RefushLeftDetail();
|
||||
RefushBottomLeftDetail();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 搜索完成后
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnSearchAfterCallBack(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
RefushWaitDetail();
|
||||
RefushLeftDetail();
|
||||
RefushBottomLeftDetail();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 行选中改变时刷新明细
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void OnGridViewRowClick(object sender, RowClickEventArgs e)
|
||||
{
|
||||
GridView gridView = (GridView)sender;
|
||||
if (gridView == gc_Top.GridView)
|
||||
{
|
||||
RefushLeftDetail();
|
||||
}
|
||||
RefushWaitDetail();
|
||||
RefushBottomLeftDetail();
|
||||
}
|
||||
/// <summary>
|
||||
/// 刷新左边选中的明细信息
|
||||
/// </summary>
|
||||
public void RefushLeftDetail()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage != null)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
DataRow rowItem = moduleGridDetail.TopGridEx.GetViewFocusedDataRow();
|
||||
if (rowItem != null && moduleGridDetail.BottomGridEx.Tag != null && moduleGridDetail.BottomGridEx.Tag is GridDetailModel)
|
||||
{
|
||||
GridDetailModel leftDetailModel = moduleGridDetail.BottomGridEx.Tag as GridDetailModel;
|
||||
string sqlValue = this.GetSearchSql(leftDetailModel, rowItem);
|
||||
DataTable dataTable = MainImpl.GetDataTableResult(sqlValue);
|
||||
moduleGridDetail.BottomGridEx.SetGridViewDataSource(dataTable);
|
||||
moduleGridDetail.BottomGridEx.LastSearchSql = sqlValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 刷新左边选中的底部明细信息
|
||||
/// </summary>
|
||||
public void RefushBottomLeftDetail()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage != null)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
DataRow rowItem = null;
|
||||
if (moduleGridDetail.BottomGridEx.Visible == true)
|
||||
{
|
||||
rowItem = moduleGridDetail.BottomGridEx.GetViewFocusedDataRow();
|
||||
}
|
||||
if (rowItem == null || moduleGridDetail.BottomGridEx.Visible == false)
|
||||
{
|
||||
rowItem = moduleGridDetail.TopGridEx.GetViewFocusedDataRow();
|
||||
}
|
||||
if (rowItem != null && MainViewModel.BottomLeftGridEx.Tag != null && MainViewModel.BottomLeftGridEx.Tag is GridDetailModel)
|
||||
{
|
||||
GridDetailModel bottomLeftDetailModel = MainViewModel.BottomLeftGridEx.Tag as GridDetailModel;
|
||||
string sqlValue = this.GetSearchSql(bottomLeftDetailModel, rowItem);
|
||||
DataTable dataTable = MainImpl.GetDataTableResult(sqlValue);
|
||||
MainViewModel.BottomLeftGridEx.SetGridViewDataSource(dataTable);
|
||||
MainViewModel.BottomLeftGridEx.LastSearchSql = sqlValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 刷新等待区
|
||||
/// </summary>
|
||||
public void RefushWaitDetail()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage != null && MainViewModel.RightTabControl.TabControlObj.SelectedTabPage != null)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
ModuleGrid moduleGrid = MainViewModel.RightTabControl.TabControlObj.SelectedTabPage.Controls[0] as ModuleGrid;
|
||||
DataRow rowItem = moduleGridDetail.TopGridEx.GetViewFocusedDataRow();
|
||||
if (rowItem != null && moduleGrid.MainGridEx.Tag != null && moduleGrid.MainGridEx.Tag is GridDetailModel)
|
||||
{
|
||||
GridDetailModel gridDetailModel = moduleGrid.MainGridEx.Tag as GridDetailModel;
|
||||
string sqlValue = this.GetSearchSql(gridDetailModel, rowItem);
|
||||
DataTable dataTable = MainImpl.GetDataTableResult(sqlValue);
|
||||
moduleGrid.MainGridEx.SetGridViewDataSource(dataTable);
|
||||
moduleGrid.MainGridEx.LastSearchSql = sqlValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取查询条件
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <param name="rowItem"></param>
|
||||
/// <returns></returns>
|
||||
private string GetSearchSql(GridDetailModel model, DataRow rowItem)
|
||||
{
|
||||
string fieldName = !string.IsNullOrEmpty(model.UnionParentField) && rowItem.Table.Columns.Contains(model.UnionParentField) ? model.UnionParentField : MainViewModel.MoudleMainObj.ParmaryKey;
|
||||
string sqlValue = model.IsReadOnly || model.IsChart ? model.DetailSql : model.SystemModel.MenuSql;
|
||||
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
|
||||
|
||||
if (ReplaceHelper.IsSelect(sqlValue) && !string.IsNullOrEmpty(model.UnionValue))
|
||||
{
|
||||
sqlValue = ReplaceHelper.ReplaceWhereCond(sqlValue) + string.Format(" and {0}='{1}'", model.UnionValue, rowItem[fieldName] + "");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.UnionCond))
|
||||
{
|
||||
string UnionCond = ReplaceHelper.ReplaceRowParam(rowItem, model.UnionCond);
|
||||
sqlValue += UnionCond;
|
||||
}
|
||||
return sqlValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Lskj.Util;
|
||||
using System.Windows.Forms;
|
||||
using Lskj.Model;
|
||||
using Lskj.Business;
|
||||
using Lskj.Business.Impl;
|
||||
|
||||
namespace Lskj.PubArtworkDynamic
|
||||
{
|
||||
/// <summary>
|
||||
/// 单据模版入口
|
||||
/// </summary>
|
||||
public class DllBaseClass : IForm
|
||||
{
|
||||
public DllBaseClass()
|
||||
{
|
||||
|
||||
}
|
||||
public DllBaseClass(string[] obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
FrmMain main = new FrmMain();
|
||||
DynamicDllModel sysModel = new DynamicDllModel(obj);
|
||||
SubForm = main;
|
||||
main.SysModel = sysModel;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogUtil.WriteError("Lskj.PubMrpAnalyze.dll--参数错误-->" + obj.ToString(), ex);
|
||||
}
|
||||
}
|
||||
public Form SubForm { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
///图档功能链接模块
|
||||
/// </summary>
|
||||
public class DynamicDllModel : DynamicModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 其他参数
|
||||
/// </summary>
|
||||
/// <value>The parameters.</value>
|
||||
private readonly new string[] Params;
|
||||
/// <summary>
|
||||
/// <para>说明:传入特殊参数处理</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-04-03 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>System.String[].</returns>
|
||||
public override string[] OtherParams()
|
||||
{
|
||||
return this.Params;
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化基础档案动态链接库参数
|
||||
/// </summary>
|
||||
/// <param name="args">The arguments.</param>
|
||||
public DynamicDllModel(string[] args)
|
||||
: base(args)
|
||||
{
|
||||
// 右键菜单打开的模块没有moduleId,部分特殊模块没有moduleId比如添加界面.
|
||||
if (!string.IsNullOrEmpty(args[5]))
|
||||
{
|
||||
base.ModuleId = Convert.ToInt32(args[5]);
|
||||
}
|
||||
if (args.Length > 6 && !string.IsNullOrWhiteSpace(args[6]))
|
||||
{
|
||||
base.ModuleCode = args[6];
|
||||
}
|
||||
if (args.Length > 7)
|
||||
{
|
||||
this.Params = new string[args.Length];
|
||||
for (int i = 7; i < args.Length; i++)
|
||||
{
|
||||
Params[i - 7] = args[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
|
||||
namespace Lskj.PubArtworkDynamic
|
||||
{
|
||||
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()
|
||||
{
|
||||
this.pl_Main = new DevExpress.XtraEditors.PanelControl();
|
||||
this.splitMainControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.splitRightControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.splitBottomControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.tabControlRight = new Lskj.Control.TabControlEx();
|
||||
this.gmLeft_Control = new Lskj.Control.GridControlEx();
|
||||
this.gmRight_Control = new Lskj.Control.GridControlEx();
|
||||
this.tabControlLeft = new Lskj.Control.TabControlEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_Main)).BeginInit();
|
||||
this.pl_Main.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).BeginInit();
|
||||
this.splitMainControl.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitRightControl)).BeginInit();
|
||||
this.splitRightControl.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitBottomControl)).BeginInit();
|
||||
this.splitBottomControl.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pl_Main
|
||||
//
|
||||
this.pl_Main.Controls.Add(this.splitMainControl);
|
||||
this.pl_Main.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_Main.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_Main.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pl_Main.Name = "pl_Main";
|
||||
this.pl_Main.Size = new System.Drawing.Size(1177, 599);
|
||||
this.pl_Main.TabIndex = 14;
|
||||
//
|
||||
// splitMainControl
|
||||
//
|
||||
this.splitMainControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitMainControl.Location = new System.Drawing.Point(2, 2);
|
||||
this.splitMainControl.Name = "splitMainControl";
|
||||
this.splitMainControl.Panel1.Controls.Add(this.tabControlLeft);
|
||||
this.splitMainControl.Panel1.Text = "Panel1";
|
||||
this.splitMainControl.Panel2.Controls.Add(this.splitRightControl);
|
||||
this.splitMainControl.Panel2.Text = "Panel2";
|
||||
this.splitMainControl.Size = new System.Drawing.Size(1173, 595);
|
||||
this.splitMainControl.SplitterPosition = 297;
|
||||
this.splitMainControl.TabIndex = 4;
|
||||
this.splitMainControl.Text = "splitContainerControl3";
|
||||
//
|
||||
// splitRightControl
|
||||
//
|
||||
this.splitRightControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitRightControl.Horizontal = false;
|
||||
this.splitRightControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitRightControl.Name = "splitRightControl";
|
||||
this.splitRightControl.Panel1.Controls.Add(this.tabControlRight);
|
||||
this.splitRightControl.Panel1.Text = "Panel1";
|
||||
this.splitRightControl.Panel2.Controls.Add(this.splitBottomControl);
|
||||
this.splitRightControl.Panel2.Text = "Panel2";
|
||||
this.splitRightControl.Size = new System.Drawing.Size(870, 595);
|
||||
this.splitRightControl.SplitterPosition = 335;
|
||||
this.splitRightControl.TabIndex = 4;
|
||||
this.splitRightControl.Text = "splitContainerControl3";
|
||||
//
|
||||
// splitBottomControl
|
||||
//
|
||||
this.splitBottomControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitBottomControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitBottomControl.Name = "splitBottomControl";
|
||||
this.splitBottomControl.Panel1.Controls.Add(this.gmLeft_Control);
|
||||
this.splitBottomControl.Panel1.Text = "Panel1";
|
||||
this.splitBottomControl.Panel2.Controls.Add(this.gmRight_Control);
|
||||
this.splitBottomControl.Panel2.Text = "Panel2";
|
||||
this.splitBottomControl.Size = new System.Drawing.Size(870, 254);
|
||||
this.splitBottomControl.SplitterPosition = 442;
|
||||
this.splitBottomControl.TabIndex = 16;
|
||||
this.splitBottomControl.Text = "splitContainerControl1";
|
||||
//
|
||||
// tabControlRight
|
||||
//
|
||||
this.tabControlRight.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabControlRight.Location = new System.Drawing.Point(0, 0);
|
||||
this.tabControlRight.Name = "tabControlRight";
|
||||
this.tabControlRight.Size = new System.Drawing.Size(870, 335);
|
||||
this.tabControlRight.TabIndex = 0;
|
||||
//
|
||||
// gmLeft_Control
|
||||
//
|
||||
this.gmLeft_Control.AdapterObj = null;
|
||||
this.gmLeft_Control.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gmLeft_Control.Location = new System.Drawing.Point(0, 0);
|
||||
this.gmLeft_Control.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.gmLeft_Control.Name = "gmLeft_Control";
|
||||
this.gmLeft_Control.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gmLeft_Control.Size = new System.Drawing.Size(442, 254);
|
||||
this.gmLeft_Control.TabIndex = 0;
|
||||
//
|
||||
// gmRight_Control
|
||||
//
|
||||
this.gmRight_Control.AdapterObj = null;
|
||||
this.gmRight_Control.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gmRight_Control.Location = new System.Drawing.Point(0, 0);
|
||||
this.gmRight_Control.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.gmRight_Control.Name = "gmRight_Control";
|
||||
this.gmRight_Control.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gmRight_Control.Size = new System.Drawing.Size(422, 254);
|
||||
this.gmRight_Control.TabIndex = 1;
|
||||
//
|
||||
// tabControlLeft
|
||||
//
|
||||
this.tabControlLeft.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabControlLeft.Location = new System.Drawing.Point(0, 0);
|
||||
this.tabControlLeft.Name = "tabControlLeft";
|
||||
this.tabControlLeft.Size = new System.Drawing.Size(297, 595);
|
||||
this.tabControlLeft.TabIndex = 6;
|
||||
//
|
||||
// FrmMain
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(1177, 599);
|
||||
this.Controls.Add(this.pl_Main);
|
||||
this.Name = "FrmMain";
|
||||
this.Text = "附件管理";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_Main)).EndInit();
|
||||
this.pl_Main.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).EndInit();
|
||||
this.splitMainControl.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitRightControl)).EndInit();
|
||||
this.splitRightControl.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitBottomControl)).EndInit();
|
||||
this.splitBottomControl.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PanelControl pl_Main;
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitMainControl;
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitRightControl;
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitBottomControl;
|
||||
private Lskj.Control.GridControlEx gmLeft_Control;
|
||||
private Lskj.Control.GridControlEx gmRight_Control;
|
||||
private Lskj.Control.TabControlEx tabControlRight;
|
||||
private Lskj.Control.TabControlEx tabControlLeft;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,702 @@
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using DevExpress.XtraTab;
|
||||
using Lskj.Business;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Control.BrowserSetting;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Core;
|
||||
using Lskj.Model;
|
||||
using Lskj.PubArtworkDynamic.Control;
|
||||
using Lskj.Util;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubArtworkDynamic
|
||||
{
|
||||
public partial class FrmMain : BaseForm
|
||||
{
|
||||
/// <summary>
|
||||
/// 模块类
|
||||
/// </summary>
|
||||
public ViewModel MainViewModel;
|
||||
/// <summary>
|
||||
/// 左侧节点上方主键
|
||||
/// </summary>
|
||||
private string leftTopGridIdValue
|
||||
{
|
||||
get
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = (ModuleGridDetail)MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0];
|
||||
string rtnString = "";
|
||||
DataRow dataRow = moduleGridDetail.TopGridEx.GridView.GetFocusedDataRow();
|
||||
if (dataRow != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(MainViewModel.MoudleMainObj.UploadIdValueField) && dataRow.Table.Columns.Contains(MainViewModel.MoudleMainObj.UploadIdValueField))
|
||||
{
|
||||
rtnString = dataRow[MainViewModel.MoudleMainObj.UploadIdValueField] + "";
|
||||
}
|
||||
}
|
||||
return rtnString;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 左侧节点上方主键
|
||||
/// </summary>
|
||||
private string leftBottomGridIdValue
|
||||
{
|
||||
get
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = (ModuleGridDetail)MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0];
|
||||
string rtnString = "";
|
||||
DataRow dataRow = moduleGridDetail.BottomGridEx.GridView.GetFocusedDataRow();
|
||||
if (dataRow != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(MainViewModel.MoudleMainObj.UploadIdValueField) && dataRow.Table.Columns.Contains(MainViewModel.MoudleMainObj.UploadIdValueField))
|
||||
{
|
||||
rtnString = dataRow[MainViewModel.MoudleMainObj.UploadIdValueField] + "";
|
||||
}
|
||||
}
|
||||
return rtnString;
|
||||
}
|
||||
}
|
||||
public FrmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
Load += OnFrmMainLoad;
|
||||
}
|
||||
/// <summary>
|
||||
/// 动态链接库Model
|
||||
/// </summary>
|
||||
public DynamicDllModel SysModel;
|
||||
/// <summary>
|
||||
/// 底部左侧搜索
|
||||
/// </summary>
|
||||
public MyControl BottomLeftSearchObj;
|
||||
/// <summary>
|
||||
/// 底部右侧搜索
|
||||
/// </summary>
|
||||
public MyControl BottomRightSearchObj;
|
||||
#region 事件
|
||||
/// <summary>
|
||||
/// 加载完成后
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnFrmMainLoad(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
MainViewModel = new ViewModel(SysModel)
|
||||
{
|
||||
LeftTabControl = tabControlLeft,
|
||||
RightTabControl = tabControlRight,
|
||||
BottomLeftGridEx = gmLeft_Control,
|
||||
BottomRightGridEx = gmRight_Control
|
||||
};
|
||||
InitControls(MainViewModel);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 底部左侧右键菜单回调
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnRightMenuLeftCallBack(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 底部右侧右键菜单回调
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnRightMenuRightCallBack(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 分隔条位置改变
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnSplitterPositionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (sender == this.splitMainControl)
|
||||
{
|
||||
IniHelper.Write(string.Format("Step_spliterPositionMain_{0}", this.MainViewModel.SysModel.ModuleCode), this.splitMainControl.SplitterPosition + "");
|
||||
}
|
||||
else if (sender == this.splitRightControl)
|
||||
{
|
||||
IniHelper.Write(string.Format("Step_spliterPositionRight_{0}", this.MainViewModel.SysModel.ModuleCode), this.splitRightControl.SplitterPosition + "");
|
||||
}
|
||||
else if (sender == this.splitBottomControl)
|
||||
{
|
||||
IniHelper.Write(string.Format("Step_spliterPositionBottom_{0}", this.MainViewModel.SysModel.ModuleCode), this.splitBottomControl.SplitterPosition + "");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 初始化控件
|
||||
/// </summary>
|
||||
private void InitControls(ViewModel mainViewModel)
|
||||
{
|
||||
InitializeSplitPosition();
|
||||
InitBottomGrid();
|
||||
InitLeftTabPages(mainViewModel.LeftDetailRows);
|
||||
InitRightTabPages(mainViewModel.RightDetailRows);
|
||||
InitDrag();
|
||||
//初始化后刷新数据
|
||||
ModuleGridDetail moduleGridDetail = MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
moduleGridDetail.SearchButton.PerformClick();
|
||||
tabControlLeft.TabControlObj.SelectedPageChanged += OnLeftTabControlPageChanged;
|
||||
tabControlRight.TabControlObj.SelectedPageChanged += OnRightTabControlPageChanged;
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化左侧页签
|
||||
/// </summary>
|
||||
/// <param name="gridDetailRows"></param>
|
||||
private void InitLeftTabPages(List<DataRow> gridDetailRows)
|
||||
{
|
||||
XtraTabPage mainPage = new XtraTabPage();
|
||||
mainPage.Text = MainViewModel.SysModel.FormText;
|
||||
ModuleGridDetail mainGridDetail = new ModuleGridDetail(null, SysModel.OtherParams());
|
||||
mainGridDetail.MainViewModel = MainViewModel;
|
||||
mainGridDetail.Dock = DockStyle.Fill;
|
||||
mainGridDetail.Tag = MainViewModel.SysModel;
|
||||
mainPage.Tag = mainGridDetail;
|
||||
mainPage.Controls.Add(mainGridDetail);
|
||||
tabControlLeft.TabControlObj.TabPages.Add(mainPage);
|
||||
|
||||
foreach (DataRow item in gridDetailRows)
|
||||
{
|
||||
if ((item["orderId"] + "").Equals("99") || (item["orderId"] + "").Equals("100"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
GridDetailModel model = new GridDetailModel(item);
|
||||
model.SystemModel = new ModuleModel(MainImpl.GetSystemdllTab(model.UnionModule));//获取主模块构建类
|
||||
XtraTabPage page = new XtraTabPage();
|
||||
page.Text = model.DetailName;
|
||||
ModuleGridDetail moduleGridDetail = new ModuleGridDetail(model, SysModel.OtherParams());
|
||||
moduleGridDetail.MainViewModel = MainViewModel;
|
||||
moduleGridDetail.Dock = DockStyle.Fill;
|
||||
moduleGridDetail.Tag = model;
|
||||
page.Tag = moduleGridDetail;
|
||||
page.Controls.Add(moduleGridDetail);
|
||||
tabControlLeft.TabControlObj.TabPages.Add(page);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化右侧页签
|
||||
/// </summary>
|
||||
/// <param name="gridDetailRows"></param>
|
||||
private void InitRightTabPages(List<DataRow> gridDetailRows)
|
||||
{
|
||||
foreach (DataRow item in gridDetailRows)
|
||||
{
|
||||
GridDetailModel model = new GridDetailModel(item);
|
||||
model.SystemModel = new ModuleModel(MainImpl.GetSystemdllTab(model.UnionModule));//获取主模块构建类
|
||||
XtraTabPage page = new XtraTabPage();
|
||||
page.Text = model.DetailName;
|
||||
ModuleGrid moduleGrid = new ModuleGrid(model);
|
||||
moduleGrid.MainViewModel = MainViewModel;
|
||||
moduleGrid.Dock = DockStyle.Fill;
|
||||
moduleGrid.Tag = model;
|
||||
page.Tag = moduleGrid;
|
||||
page.Controls.Add(moduleGrid);
|
||||
tabControlRight.TabControlObj.TabPages.Add(page);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化下方表格
|
||||
/// </summary>
|
||||
private void InitBottomGrid()
|
||||
{
|
||||
gmLeft_Control.GridView.OptionsSelection.MultiSelect = false;
|
||||
gmLeft_Control.GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect;
|
||||
gmRight_Control.GridView.OptionsSelection.MultiSelect = false;
|
||||
gmRight_Control.GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect;
|
||||
//左侧
|
||||
DataRow bottomLeftDetailRow = MainViewModel.LeftDetailRows.Where(n => (n["orderId"] + "").Equals("100")).FirstOrDefault();
|
||||
if (bottomLeftDetailRow != null)
|
||||
{
|
||||
GridDetailModel bottomLeftModel = new GridDetailModel(bottomLeftDetailRow);
|
||||
gmLeft_Control.Tag = bottomLeftModel;
|
||||
bottomLeftModel.SystemModel = new ModuleModel(MainImpl.GetSystemdllTab(bottomLeftModel.UnionModule));
|
||||
if (bottomLeftModel.IsReadOnly)
|
||||
{
|
||||
BottomLeftSearchObj = new MyControl(bottomLeftModel.DetailSql, gmLeft_Control);//构建主表mycontrol
|
||||
}
|
||||
else
|
||||
{
|
||||
BottomLeftSearchObj = new MyControl(bottomLeftModel.SystemModel.MenuSql, gmLeft_Control);//构建主表mycontrol
|
||||
}
|
||||
DataTable leftGridColumns = new DataTable();
|
||||
if (!string.IsNullOrEmpty(bottomLeftModel.UnionModule))
|
||||
{
|
||||
leftGridColumns = BaseModuleImpl.GetBaseGridColumns(bottomLeftModel.UnionModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
leftGridColumns = ReportImpl.GetReportDetailColumns(MainViewModel.SysModel.ModuleCode, bottomLeftModel.Id + "");
|
||||
}
|
||||
gmLeft_Control.GridView.OptionsBehavior.Editable = false;
|
||||
gmLeft_Control.SetReadOnlyColumns(leftGridColumns, GridCustomColumnStruct.BaseMainGridView + bottomLeftModel.FormKey);//明细
|
||||
DynamicModel leftDyncModel = new DynamicModuleModel(new string[] { bottomLeftModel.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, MainViewModel.SysModel.Privilege, bottomLeftModel.UnionModule, "0" });
|
||||
if (!string.IsNullOrEmpty(bottomLeftModel.SystemModel.ModeCode))
|
||||
{
|
||||
gmLeft_Control.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(bottomLeftModel.SystemModel.ModeCode), leftDyncModel, OnRightMenuLeftCallBack, BottomLeftSearchObj);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(bottomLeftModel.FormKey))
|
||||
{
|
||||
gmLeft_Control.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(bottomLeftModel.FormKey), leftDyncModel, OnRightMenuLeftCallBack, BottomLeftSearchObj);
|
||||
}
|
||||
//绑定行改变事件
|
||||
gmLeft_Control.GridView.FocusedRowChanged += OnGmLeftGridViewFocusedRowChanged;
|
||||
//BottomLeftSearchObj.SearchGrid();
|
||||
//右侧
|
||||
DataTable bottomRightDetailRows = BaseModuleImpl.GetBaseDetailPages(bottomLeftModel.UnionModule);//获取关联模块配置明细
|
||||
DataRow bottomRightDetailRow = bottomRightDetailRows.Rows.Count > 0 ? bottomRightDetailRows.Rows[0] : null;
|
||||
if (bottomRightDetailRow != null)
|
||||
{
|
||||
GridDetailModel bottomRightModel = new GridDetailModel(bottomRightDetailRow);
|
||||
gmRight_Control.Tag = bottomRightModel;
|
||||
bottomRightModel.SystemModel = new ModuleModel(MainImpl.GetSystemdllTab(bottomRightModel.UnionModule));
|
||||
if (bottomRightModel.IsReadOnly)
|
||||
{
|
||||
BottomRightSearchObj = new MyControl(bottomRightModel.DetailSql, gmRight_Control);//构建主表mycontrol
|
||||
}
|
||||
else
|
||||
{
|
||||
BottomRightSearchObj = new MyControl(bottomRightModel.SystemModel.MenuSql, gmRight_Control);//构建主表mycontrol
|
||||
}
|
||||
DataTable rightGridColumns = new DataTable();
|
||||
if (!string.IsNullOrEmpty(bottomRightModel.UnionModule))
|
||||
{
|
||||
rightGridColumns = BaseModuleImpl.GetBaseGridColumns(bottomRightModel.UnionModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
rightGridColumns = ReportImpl.GetReportDetailColumns(MainViewModel.SysModel.ModuleCode, bottomRightModel.Id + "");
|
||||
}
|
||||
gmRight_Control.GridView.OptionsBehavior.Editable = false;
|
||||
gmRight_Control.SetReadOnlyColumns(rightGridColumns, GridCustomColumnStruct.BaseMainGridView + bottomRightModel.FormKey);//明细
|
||||
DynamicModel rightDyncModel = new DynamicModuleModel(new string[] { bottomRightModel.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, MainViewModel.SysModel.Privilege, bottomRightModel.UnionModule, "0" });
|
||||
if (!string.IsNullOrEmpty(bottomRightModel.SystemModel.ModeCode))
|
||||
{
|
||||
gmRight_Control.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(bottomRightModel.SystemModel.ModeCode), rightDyncModel, OnRightMenuRightCallBack, BottomRightSearchObj);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(bottomRightModel.FormKey))
|
||||
{
|
||||
gmRight_Control.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(bottomRightModel.FormKey), rightDyncModel, OnRightMenuRightCallBack, BottomRightSearchObj);
|
||||
}
|
||||
//BottomRightSearchObj.SearchGrid();
|
||||
}
|
||||
if (bottomLeftDetailRow != null && bottomRightDetailRow != null)
|
||||
{
|
||||
splitBottomControl.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Both;
|
||||
}
|
||||
else if (bottomLeftDetailRow != null && bottomRightDetailRow == null)
|
||||
{
|
||||
splitBottomControl.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1;
|
||||
}
|
||||
else if (bottomLeftDetailRow == null && bottomRightDetailRow == null)
|
||||
{
|
||||
splitBottomControl.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化拖拽
|
||||
/// </summary>
|
||||
private void InitDrag()
|
||||
{
|
||||
////右上方向底部拖拽,经沟通不使用
|
||||
//foreach (XtraTabPage xtraTabPage in tabControlRight.TabControlObj.TabPages)
|
||||
//{
|
||||
// ModuleGrid moduleGrid = (ModuleGrid)xtraTabPage.Controls[0];
|
||||
// //右上方向底部左侧拖拽
|
||||
// GridDragGrid dragTopToBottomLeftGrid = new GridDragGrid(moduleGrid.MainGridEx.GridView, gmLeft_Control.GridView);
|
||||
// dragTopToBottomLeftGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragToBottomLeftGridCompleted);
|
||||
// //右上方向底部右侧侧拖拽
|
||||
// GridDragGrid dragTopToBottomRightGrid = new GridDragGrid(moduleGrid.MainGridEx.GridView, gmRight_Control.GridView);
|
||||
// dragTopToBottomRightGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragToBottomRightGridCompleted);
|
||||
//}
|
||||
//右上方向左侧拖拽
|
||||
foreach (XtraTabPage xtraTabPage in tabControlRight.TabControlObj.TabPages)
|
||||
{
|
||||
ModuleGrid moduleGrid = (ModuleGrid)xtraTabPage.Controls[0];
|
||||
foreach (XtraTabPage leftXtraTabPage in tabControlLeft.TabControlObj.TabPages)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = (ModuleGridDetail)leftXtraTabPage.Controls[0];
|
||||
//向左侧上方拖拽
|
||||
if (moduleGridDetail.DragDirection==0|| moduleGridDetail.DragDirection == 1)
|
||||
{
|
||||
GridDragGrid dragTopToLeftTopGrid = new GridDragGrid(moduleGrid.MainGridEx.GridView, moduleGridDetail.TopGridEx.GridView);
|
||||
dragTopToLeftTopGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragToLeftTopGridCompleted);
|
||||
}
|
||||
//向左侧下方拖拽
|
||||
if (moduleGridDetail.DragDirection == 0 || moduleGridDetail.DragDirection == 2)
|
||||
{
|
||||
GridDragGrid dragTopToLeftBottomGrid = new GridDragGrid(moduleGrid.MainGridEx.GridView, moduleGridDetail.BottomGridEx.GridView);
|
||||
dragTopToLeftBottomGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragToLeftBottomGridCompleted);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//底部左侧向右上方拖拽
|
||||
foreach (XtraTabPage xtraTabPage in tabControlRight.TabControlObj.TabPages)
|
||||
{
|
||||
ModuleGrid moduleGrid = (ModuleGrid)xtraTabPage.Controls[0];
|
||||
GridDragGrid dragBottomLeftToTopGrid = new GridDragGrid(gmLeft_Control.GridView, moduleGrid.MainGridEx.GridView);
|
||||
dragBottomLeftToTopGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragBottomLeftToTopGridCompleted);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 移动文件
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool MoveFile(DataRow rowItem, string sid, string tid, out string Msg, string typeid = "", string ver = "")
|
||||
{
|
||||
bool isMove = false;
|
||||
Msg = "";
|
||||
string postUrl = "";
|
||||
try
|
||||
{
|
||||
string fileId = rowItem["fileId"] + "";
|
||||
string sNameSql = $"select vName from P_fm_FileTab where fileId = '{rowItem["fileId"]}'";
|
||||
string sName = BaseImpl.GetResult(sNameSql) + "";
|
||||
if (string.IsNullOrEmpty(typeid))
|
||||
{
|
||||
postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&filename={2}&sid={3}&tid={4}&username={5}&userid={6}&method={7}";
|
||||
postUrl = string.Format(postUrl, SystemInfo.Instance.OAUrl, SysModel.ModuleCode, sName, sid, tid, ERPInfo.Instance.UserName, ERPInfo.Instance.UserId, "MoveFileTo");
|
||||
}
|
||||
else
|
||||
{
|
||||
postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&filename={2}&sid={3}&tid={4}&username={5}&userid={6}&typeid={7}&ver={8}&method={9}";
|
||||
postUrl = string.Format(postUrl, SystemInfo.Instance.OAUrl, SysModel.ModuleCode, sName, sid, tid, ERPInfo.Instance.UserName, ERPInfo.Instance.UserId, typeid, ver, "MoveFileTo");
|
||||
}
|
||||
HttpTools.setting("application/x-www-form-urlencoded", null, null);
|
||||
string result = "";
|
||||
CookieCollection cookieCollection = null;
|
||||
HttpWebResponse webResponse = HttpTools.Post(postUrl, null, null, HttpTools.Method.POST, out cookieCollection, out result);
|
||||
if (webResponse != null && !string.IsNullOrEmpty(result))
|
||||
{
|
||||
JObject jsonObject = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(result);
|
||||
string isSuccess = jsonObject["success"] + "";
|
||||
if (isSuccess.Equals("True", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
string searchSql = @"update P_fm_FileTab set Pid='{1}'
|
||||
where dllcoid = '{0}' and fileId='{2}' ";
|
||||
searchSql = string.Format(searchSql, this.MainViewModel.SysModel.ModuleCode, tid, fileId);
|
||||
SqlHelper.ExecuteNonQuery(searchSql);
|
||||
isMove = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (jsonObject.ContainsKey("msg"))
|
||||
{
|
||||
Msg = jsonObject["msg"] + "";
|
||||
}
|
||||
isMove = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isMove = false;
|
||||
Msg = "上传请求失败";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Msg = ex.Message;
|
||||
isMove = false;
|
||||
}
|
||||
return isMove;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取查询条件
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <param name="rowItem"></param>
|
||||
/// <returns></returns>
|
||||
public string GetSearchSql(GridDetailModel model, DataRow rowItem)
|
||||
{
|
||||
string fieldName = !string.IsNullOrEmpty(model.UnionParentField) && rowItem.Table.Columns.Contains(model.UnionParentField) ? model.UnionParentField : MainViewModel.MoudleMainObj.ParmaryKey;
|
||||
string sqlValue = model.IsReadOnly || model.IsChart ? model.DetailSql : model.SystemModel.MenuSql;
|
||||
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
|
||||
|
||||
if (ReplaceHelper.IsSelect(sqlValue) && !string.IsNullOrEmpty(model.UnionValue))
|
||||
{
|
||||
sqlValue = ReplaceHelper.ReplaceWhereCond(sqlValue) + string.Format(" and {0}='{1}'", model.UnionValue, rowItem[fieldName] + "");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.UnionCond))
|
||||
{
|
||||
string UnionCond = ReplaceHelper.ReplaceRowParam(rowItem, model.UnionCond);
|
||||
sqlValue += UnionCond;
|
||||
}
|
||||
return sqlValue;
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化分隔条
|
||||
/// </summary>
|
||||
private void InitializeSplitPosition()
|
||||
{
|
||||
this.splitMainControl.SplitterPositionChanged += new EventHandler(OnSplitterPositionChanged);
|
||||
this.splitRightControl.SplitterPositionChanged += new EventHandler(OnSplitterPositionChanged);
|
||||
this.splitBottomControl.SplitterPositionChanged += new EventHandler(OnSplitterPositionChanged);
|
||||
string mianSpliterPosition = IniHelper.Read(string.Format("Step_spliterPositionMain_{0}", this.MainViewModel.SysModel.ModuleCode));
|
||||
if (!string.IsNullOrEmpty(mianSpliterPosition)) this.splitMainControl.SplitterPosition = Convert.ToInt32(mianSpliterPosition);
|
||||
string rightSpliterPosition = IniHelper.Read(string.Format("Step_spliterPositionRight_{0}", this.MainViewModel.SysModel.ModuleCode));
|
||||
if (!string.IsNullOrEmpty(rightSpliterPosition)) this.splitRightControl.SplitterPosition = Convert.ToInt32(rightSpliterPosition);
|
||||
string bottomSpliterPosition = IniHelper.Read(string.Format("Step_spliterPositionBottom_{0}", this.MainViewModel.SysModel.ModuleCode));
|
||||
if (!string.IsNullOrEmpty(bottomSpliterPosition)) this.splitBottomControl.SplitterPosition = Convert.ToInt32(bottomSpliterPosition);
|
||||
}
|
||||
/// <summary>
|
||||
/// 向左侧上方拖拽完成时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnDragToLeftTopGridCompleted(object sender, GridDragGridArgs e)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = this.tabControlLeft.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
try//拖拽后执行文件分配
|
||||
{
|
||||
int[] selectRowIndexs = e.SourceGridViewObj.GetSelectedRows();
|
||||
DataRow[] selectRows = new DataRow[selectRowIndexs.Length];
|
||||
for (int i = 0; i < selectRowIndexs.Length; i++)
|
||||
{
|
||||
selectRows[i] = e.SourceGridViewObj.GetDataRow(selectRowIndexs[i]);
|
||||
}
|
||||
if (selectRows == null || selectRows.Length == 0) return;
|
||||
DataRow targetRow = moduleGridDetail.TopGridEx.GetViewFocusedDataRow();
|
||||
int[] records = new int[selectRows.Length];
|
||||
string resultStr = string.Empty;
|
||||
string result = string.Empty;
|
||||
for (int i = 0; i < selectRows.Length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
records[i] = ReplaceHelper.ReplaceRowParamCond(targetRow, MainViewModel.MoudleMainObj.DragCond) ? 1 : 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
records[i] = 0;
|
||||
}
|
||||
if (records[i] == 0)
|
||||
{
|
||||
resultStr += string.Format("文件{0}移动失败,原因:{1}\r\n", selectRows[i]["name"], "不满足移动条件");
|
||||
continue;
|
||||
}
|
||||
string sid = targetRow.Table.Columns.Contains(MainViewModel.MoudleMainObj.MoveIdValueField) ? targetRow[MainViewModel.MoudleMainObj.MoveIdValueField] + "" : "";
|
||||
bool isMove = MoveFile(selectRows[i], this.leftTopGridIdValue, sid, out result);
|
||||
if (!isMove)
|
||||
{
|
||||
resultStr += string.Format("文件{0}移动失败,原因:{1}\r\n", selectRows[i]["name"], result);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(resultStr))
|
||||
{
|
||||
MessageUtil.Show(resultStr);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
int focusedTopRowHandle = moduleGridDetail.TopGridEx.GridView.FocusedRowHandle;
|
||||
int focusedBottomRowHandle = moduleGridDetail.BottomGridEx.GridView.FocusedRowHandle;
|
||||
moduleGridDetail.SearchMainObj.SearchLastGrid();
|
||||
moduleGridDetail.RefushLeftDetail();
|
||||
moduleGridDetail.TopGridEx.GridView.FocusedRowHandle = focusedTopRowHandle;
|
||||
moduleGridDetail.BottomGridEx.GridView.FocusedRowHandle = focusedBottomRowHandle;
|
||||
moduleGridDetail.OnGridViewRowClick(null, null);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 向左侧下方拖拽完成时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnDragToLeftBottomGridCompleted(object sender, GridDragGridArgs e)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = this.tabControlLeft.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
try//拖拽后执行文件分配
|
||||
{
|
||||
int[] selectRowIndexs = e.SourceGridViewObj.GetSelectedRows();
|
||||
DataRow[] selectRows = new DataRow[selectRowIndexs.Length];
|
||||
for (int i = 0; i < selectRowIndexs.Length; i++)
|
||||
{
|
||||
selectRows[i] = e.SourceGridViewObj.GetDataRow(selectRowIndexs[i]);
|
||||
}
|
||||
if (selectRows == null || selectRows.Length == 0) return;
|
||||
DataRow[] targetRows = new DataRow[] { moduleGridDetail.BottomGridEx.GetViewFocusedDataRow() };
|
||||
if (selectRows.Length > 0 && targetRows.Length > 0)
|
||||
{
|
||||
int[,] records = new int[selectRows.Length, targetRows.Length];
|
||||
string resultStr = string.Empty;
|
||||
string result = string.Empty;
|
||||
for (int i = 0; i < selectRows.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < targetRows.Length; j++)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataRow targetRow = targetRows[j];
|
||||
records[i, j] = ReplaceHelper.ReplaceRowParamCond(targetRow, MainViewModel.MoudleMainObj.DragCond) ? 1 : 0;
|
||||
string sid = targetRow.Table.Columns.Contains(MainViewModel.MoudleMainObj.MoveIdValueField) ? targetRow[MainViewModel.MoudleMainObj.MoveIdValueField] + "" : "";
|
||||
bool isMove = MoveFile(selectRows[i], this.leftTopGridIdValue, sid, out result);
|
||||
if (!isMove)
|
||||
{
|
||||
resultStr += string.Format("文件{0}移动失败,原因:{1}\r\n", selectRows[i]["name"], result);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
records[i, j] = 0;
|
||||
}
|
||||
if (records[i, j] == 0)
|
||||
{
|
||||
resultStr += string.Format("文件{0}移动失败,原因:{1}\r\n", selectRows[i]["name"], "不满足移动条件");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(resultStr))
|
||||
{
|
||||
MessageUtil.Show(resultStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
int focusedTopRowHandle = moduleGridDetail.TopGridEx.GridView.FocusedRowHandle;
|
||||
int focusedBottomRowHandle = moduleGridDetail.BottomGridEx.GridView.FocusedRowHandle;
|
||||
moduleGridDetail.SearchMainObj.SearchLastGrid();
|
||||
moduleGridDetail.RefushLeftDetail();
|
||||
moduleGridDetail.TopGridEx.GridView.FocusedRowHandle = focusedTopRowHandle;
|
||||
moduleGridDetail.BottomGridEx.GridView.FocusedRowHandle = focusedBottomRowHandle;
|
||||
moduleGridDetail.OnGridViewRowClick(null, null);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 下方左侧向上方拖拽完成时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnDragBottomLeftToTopGridCompleted(object sender, GridDragGridArgs e)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = this.tabControlLeft.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
try//拖拽后执行文件分配
|
||||
{
|
||||
int[] selectRowIndexs = e.SourceGridViewObj.GetSelectedRows();
|
||||
DataRow[] selectRows = new DataRow[selectRowIndexs.Length];
|
||||
for (int i = 0; i < selectRowIndexs.Length; i++)
|
||||
{
|
||||
selectRows[i] = e.SourceGridViewObj.GetDataRow(selectRowIndexs[i]);
|
||||
}
|
||||
if (selectRows == null || selectRows.Length == 0) return;
|
||||
DataRow targetRow = moduleGridDetail.TopGridEx.GetViewFocusedDataRow();
|
||||
int[] records = new int[selectRows.Length];
|
||||
string resultStr = string.Empty;
|
||||
string result = string.Empty;
|
||||
for (int i = 0; i < selectRows.Length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
records[i] = ReplaceHelper.ReplaceRowParamCond(targetRow, MainViewModel.MoudleMainObj.DragCond) ? 1 : 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
records[i] = 0;
|
||||
}
|
||||
if (records[i] == 0)
|
||||
{
|
||||
resultStr += string.Format("文件{0}移动失败,原因:{1}\r\n", selectRows[i]["name"], "不满足移动条件");
|
||||
continue;
|
||||
}
|
||||
string sid = selectRows[i]["Pid"] + "";
|
||||
string tid = targetRow.Table.Columns.Contains(MainViewModel.MoudleMainObj.UploadIdValueField) ? targetRow[MainViewModel.MoudleMainObj.UploadIdValueField] + "" : "";
|
||||
bool isMove = MoveFile(selectRows[i], sid, tid, out result);
|
||||
if (!isMove)
|
||||
{
|
||||
resultStr += string.Format("文件{0}移动失败,原因:{1}\r\n", selectRows[i]["name"], result);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(resultStr))
|
||||
{
|
||||
MessageUtil.Show(resultStr);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
int focusedTopRowHandle = moduleGridDetail.TopGridEx.GridView.FocusedRowHandle;
|
||||
int focusedBottomRowHandle = moduleGridDetail.BottomGridEx.GridView.FocusedRowHandle;
|
||||
moduleGridDetail.SearchMainObj.SearchLastGrid();
|
||||
moduleGridDetail.RefushLeftDetail();
|
||||
moduleGridDetail.TopGridEx.GridView.FocusedRowHandle = focusedTopRowHandle;
|
||||
moduleGridDetail.BottomGridEx.GridView.FocusedRowHandle = focusedBottomRowHandle;
|
||||
moduleGridDetail.OnGridViewRowClick(null, null);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 底部左侧行选中改变时刷新右侧数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGmLeftGridViewFocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
|
||||
{
|
||||
GridView gridView = (GridView)sender;
|
||||
DataRow rowItem = gridView.GetFocusedDataRow();
|
||||
GridDetailModel gridDetailRightModel = gmRight_Control.Tag != null && gmRight_Control.Tag is GridDetailModel ? gmRight_Control.Tag as GridDetailModel : null;
|
||||
if (gridDetailRightModel != null)
|
||||
{
|
||||
string searchSql = this.GetSearchSql(gridDetailRightModel, rowItem);
|
||||
DataTable table = MainImpl.GetDataTableResult(searchSql);
|
||||
this.gmRight_Control.LastSearchSql = searchSql;
|
||||
this.gmRight_Control.SetGridViewDataSource(table);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 左侧页签选中改变时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnLeftTabControlPageChanged(object sender, TabPageChangedEventArgs e)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
moduleGridDetail.SearchButton.PerformClick();
|
||||
}
|
||||
/// <summary>
|
||||
/// 右侧页签选中改变时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnRightTabControlPageChanged(object sender, TabPageChangedEventArgs e)
|
||||
{
|
||||
ModuleGridDetail moduleGridDetail = MainViewModel.LeftTabControl.TabControlObj.SelectedTabPage.Controls[0] as ModuleGridDetail;
|
||||
moduleGridDetail.RefushWaitDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,218 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{92CBA618-8F1F-4A65-AB88-47E83F17CEA3}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Lskj.PubArtworkDynamic</RootNamespace>
|
||||
<AssemblyName>Lskj.PubArtworkDynamic</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Debug\Lib\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="API">
|
||||
<HintPath>..\..\引用DLL\GpyApi\API.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AxInterop.CamCaptureCtlLib">
|
||||
<HintPath>..\..\引用DLL\AxInterop.CamCaptureCtlLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.BonusSkins.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Data.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Printing.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.RichEdit.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Sparkline.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Spreadsheet.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Utils.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraCharts.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraCharts.v15.2.UI, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraPrinting.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraReports.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraReports.v15.2.Extensions, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraRichEdit.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraScheduler.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraScheduler.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraSpreadsheet.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraTreeList.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="FastReport">
|
||||
<HintPath>..\..\引用DLL\FastReport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Geckofx-Core">
|
||||
<HintPath>..\..\引用DLL\Geckofx-Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Geckofx-Winforms">
|
||||
<HintPath>..\..\引用DLL\Geckofx-Winforms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="IKVM.OpenJDK.Core">
|
||||
<HintPath>..\..\引用DLL\GpyApi\IKVM.OpenJDK.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="IKVM.OpenJDK.Security">
|
||||
<HintPath>..\..\引用DLL\GpyApi\IKVM.OpenJDK.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itextsharp">
|
||||
<HintPath>..\..\引用DLL\itextsharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="libzkfpcsharp">
|
||||
<HintPath>..\..\引用DLL\libzkfpcsharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.AutoUpdate">
|
||||
<HintPath>..\..\Debug\Lskj.AutoUpdate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.Business">
|
||||
<HintPath>..\..\Debug\Lskj.Business.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.Core">
|
||||
<HintPath>..\..\Debug\Lskj.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.Data">
|
||||
<HintPath>..\..\Debug\Lskj.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.Interface.Api">
|
||||
<HintPath>..\..\Debug\Lskj.Interface.Api.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.Model">
|
||||
<HintPath>..\..\Debug\Lskj.Model.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.Redis">
|
||||
<HintPath>..\Lskj.Redius\bin\Debug\Lskj.Redis.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.Util">
|
||||
<HintPath>..\..\Debug\Lskj.Util.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\Microsoft.WindowsAPICodePack.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NPOI">
|
||||
<HintPath>..\..\引用DLL\NPOI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="O2S.Components.PDFView4NET">
|
||||
<HintPath>..\..\引用DLL\O2S.Components.PDFView4NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="Spire.Barcode">
|
||||
<HintPath>..\..\引用DLL\Spire.Barcode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spire.Doc">
|
||||
<HintPath>..\..\引用DLL\Spire.Doc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spire.Pdf">
|
||||
<HintPath>..\..\引用DLL\Spire.Pdf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spire.XLS">
|
||||
<HintPath>..\..\引用DLL\Spire.XLS.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Drawing.Design" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Web" />
|
||||
<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" />
|
||||
<Reference Include="Xilium.CefGlue">
|
||||
<HintPath>..\..\..\引用DLL\Xilium.CefGlue.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Control\ModuleGrid.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Control\ModuleGrid.Designer.cs">
|
||||
<DependentUpon>ModuleGrid.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Control\ModuleGridDetail.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Control\ModuleGridDetail.Designer.cs">
|
||||
<DependentUpon>ModuleGridDetail.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DllBaseClass.cs" />
|
||||
<Compile Include="FrmMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmMain.Designer.cs">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ViewModel.cs" />
|
||||
<EmbeddedResource Include="Control\ModuleGrid.resx">
|
||||
<DependentUpon>ModuleGrid.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Control\ModuleGridDetail.resx">
|
||||
<DependentUpon>ModuleGridDetail.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FrmMain.resx">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<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>
|
||||
<ProjectReference Include="..\Lskj.Control\Lskj.Control.csproj">
|
||||
<Project>{447CDC40-659F-4CCA-9ED6-8E818B4CF8BF}</Project>
|
||||
<Name>Lskj.Control</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("Lskj.PubArtworkDynamic")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Lskj.PubArtworkDynamic")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("92cba618-8f1f-4a65-ab88-47e83f17cea3")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本: 4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace Lskj.PubArtworkDynamic.Properties
|
||||
{
|
||||
/// <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 ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Lskj.PubArtworkDynamic.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,29 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace Lskj.PubArtworkDynamic.Properties
|
||||
{
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,66 @@
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Lskj.PubArtworkDynamic
|
||||
{
|
||||
public class ViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 动态链接Model
|
||||
/// </summary>
|
||||
public DynamicDllModel SysModel { get; set; }
|
||||
/// <summary>
|
||||
/// 主模块类
|
||||
/// </summary>
|
||||
public ModuleModel MoudleMainObj { get; set; }
|
||||
/// <summary>
|
||||
/// 左侧页签明细数据
|
||||
/// </summary>
|
||||
public List<DataRow> LeftDetailRows { get; set; }
|
||||
/// <summary>
|
||||
/// 右侧页签明细数据
|
||||
/// </summary>
|
||||
public List<DataRow> RightDetailRows { get; set; }
|
||||
/// <summary>
|
||||
/// 左侧页签
|
||||
/// </summary>
|
||||
public TabControlEx LeftTabControl { get; set; }
|
||||
/// <summary>
|
||||
/// 右侧页签
|
||||
/// </summary>
|
||||
public TabControlEx RightTabControl { get; set; }
|
||||
/// <summary>
|
||||
/// 底部左侧表格
|
||||
/// </summary>
|
||||
public GridControlEx BottomLeftGridEx { get; set; }
|
||||
/// <summary>
|
||||
/// 底部右侧表格
|
||||
/// </summary>
|
||||
public GridControlEx BottomRightGridEx { get; set; }
|
||||
/// <summary>
|
||||
/// 初始化ViewModel
|
||||
/// </summary>
|
||||
/// <param name="_sysModel"></param>
|
||||
public ViewModel(DynamicDllModel _sysModel)
|
||||
{
|
||||
SysModel = _sysModel;
|
||||
if (SysModel != null && !string.IsNullOrEmpty(SysModel.ModuleCode))
|
||||
{
|
||||
MoudleMainObj = new ModuleModel(MainImpl.GetSystemdllTab(SysModel.ModuleCode));//获取主模块构建类
|
||||
MoudleMainObj.ParmaryKey = BaseImpl.GetBasePrimaryKey(SysModel.ModuleCode);
|
||||
DataTable moduleDetailTable = BaseModuleImpl.GetBaseDetailPages(SysModel.ModuleCode);//获取所有主表配置明细
|
||||
if (moduleDetailTable != null)
|
||||
{
|
||||
LeftDetailRows = moduleDetailTable.Rows.Cast<DataRow>().Where(n => Convert.ToInt32(n["orderId"] + "") >= 0).OrderBy(n => Convert.ToInt32(n["orderId"] + "")).ToList();
|
||||
RightDetailRows = moduleDetailTable.Rows.Cast<DataRow>().Where(n => Convert.ToInt32(n["orderId"] + "") < 0).OrderByDescending(n => Convert.ToInt32(n["orderId"] + "")).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NPOI" publicKeyToken="0df73ec7942b34e1" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.1.3.1" newVersion="2.1.3.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user