574 lines
24 KiB
C#
574 lines
24 KiB
C#
using DevExpress.Utils;
|
|
using DevExpress.XtraGrid.Views.Base;
|
|
using DevExpress.XtraGrid.Views.Grid;
|
|
using Lskj.Business;
|
|
using Lskj.Business.Impl;
|
|
using Lskj.Control;
|
|
using Lskj.Control.BrowserSetting;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Core;
|
|
using Lskj.PubPdfSign.Model;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Data.Common;
|
|
using System.Data.SqlClient;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Lskj.PubPdfSign
|
|
{
|
|
public partial class FrmDesign : BaseForm
|
|
{
|
|
public FrmDesign()
|
|
{
|
|
InitializeComponent();
|
|
this.Load += OnFrmMainLoad;
|
|
this.FormClosed += OnFrmMainClosed;
|
|
}
|
|
/// <summary>
|
|
/// 关闭窗口
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnFrmMainClosed(object sender, FormClosedEventArgs e)
|
|
{
|
|
this.pdfEditorEx.CloseDocument();
|
|
}
|
|
/// <summary>
|
|
/// model
|
|
/// </summary>
|
|
public DynamicPdfSignModel PdfSignModel;
|
|
/// <summary>
|
|
/// 外部数据源
|
|
/// </summary>
|
|
public DataRow SourceRow;
|
|
/// <summary>
|
|
/// AdapterObj
|
|
/// </summary>
|
|
public DbDataAdapter AdapterObj { get; set; }
|
|
/// <summary>
|
|
/// 初始化控件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnFrmMainLoad(object sender, EventArgs e)
|
|
{
|
|
this.pdfEditorEx.EditToolStrip.Items.Add(new ToolStripSeparator());
|
|
ToolStripButton saveSignBtn = new ToolStripButton()
|
|
{
|
|
Text = "保存",
|
|
DisplayStyle = ToolStripItemDisplayStyle.Text,
|
|
Font = new Font("微软雅黑", (float)10.8)
|
|
};
|
|
saveSignBtn.Click += this.pdfEditorEx.OnBtnSaveClick;
|
|
this.pdfEditorEx.EditToolStrip.Items.Add(saveSignBtn);
|
|
|
|
this.pdfEditorEx.EditToolStrip.Items.Add(new ToolStripSeparator());
|
|
ToolStripButton addSignBtn = new ToolStripButton()
|
|
{
|
|
Text = "添加签名",
|
|
DisplayStyle = ToolStripItemDisplayStyle.Text,
|
|
Font = new Font("微软雅黑", (float)10.8)
|
|
};
|
|
addSignBtn.Click += this.pdfEditorEx.OnBtnAddSignClick;
|
|
this.pdfEditorEx.EditToolStrip.Items.Add(addSignBtn);
|
|
|
|
this.pdfEditorEx.EditToolStrip.Items.Add(new ToolStripSeparator());
|
|
ToolStripButton aditionalBtn = new ToolStripButton()
|
|
{
|
|
Text = "添加附加",
|
|
DisplayStyle = ToolStripItemDisplayStyle.Text,
|
|
Font = new Font("微软雅黑", (float)10.8)
|
|
};
|
|
aditionalBtn.Click += this.OnBtnAdditionalClick;
|
|
this.pdfEditorEx.EditToolStrip.Items.Add(aditionalBtn);
|
|
this.btn_Add.Click += OnBtnAddClick;
|
|
this.btn_Update.Click += OnBtnUpdateClick;
|
|
this.btn_Delete.Click += OnBtnDeleteClick;
|
|
this.gridView.RowClick += OnGridViewRowClick;
|
|
this.gridView.FocusedRowObjectChanged += OnGridViewFocusedRowObjectChanged;
|
|
this.gridView.CustomDrawCell += OnGridViewCustomDrawCell;
|
|
this.gridView.CustomDrawRowIndicator += OnGridViewCustomDrawRowIndicator;
|
|
|
|
this.pdfEditorEx.OnAfterSignSaveCallback += OnAfterSignSaveCallback;
|
|
this.pdfEditorEx.OnAfterSignAddCallback += OnAfterSignAddCallback;
|
|
pdfEditorEx.StepTable = MainImpl.GetDataTableResult($"SELECT stepCode, stepName FROM P_systemdlltabflow WHERE typecode = '{PdfSignModel.TypeCode}' UNION ALL SELECT '9999' AS stepCode, '时间' AS stepName;");
|
|
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"));
|
|
}
|
|
/// <summary>
|
|
/// 同步
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnSameSizeClick(object sender, EventArgs e)
|
|
{
|
|
Lskj.PubPdfSign.Controls.SignBox selectedSignBox = this.pdfEditorEx._selectedSignBox;
|
|
if (selectedSignBox != null)
|
|
{
|
|
foreach (var rowHandle in gridView1.GetSelectedRows())
|
|
{
|
|
string stepName = gridView1.GetRowCellValue(rowHandle, "StepName").ToString();
|
|
Lskj.PubPdfSign.Controls.SignBox signBox = this.pdfEditorEx._signBoxList.FirstOrDefault(s => s.StepName == stepName);
|
|
if (signBox != null)
|
|
{
|
|
signBox.SignWidth = selectedSignBox.SignWidth;
|
|
signBox.SignHeight = selectedSignBox.SignHeight;
|
|
signBox.ParentPicBox.Width = selectedSignBox.SignWidth;
|
|
signBox.ParentPicBox.Height = selectedSignBox.SignHeight;
|
|
signBox.UpdateLocation();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 水平设置
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnHorizontalSpacingClick(object sender, EventArgs e)
|
|
{
|
|
Lskj.PubPdfSign.Controls.SignBox selectedSignBox = this.pdfEditorEx._selectedSignBox;
|
|
if (selectedSignBox != null)
|
|
{
|
|
int offset = int.Parse(txt_offset.Text);
|
|
int currentX = selectedSignBox.SignLeft;
|
|
int lastWidth = selectedSignBox.SignWidth;
|
|
foreach (var rowHandle in gridView1.GetSelectedRows())
|
|
{
|
|
string stepName = gridView1.GetRowCellValue(rowHandle, "StepName").ToString();
|
|
if (stepName.Equals(selectedSignBox.StepName)) continue;
|
|
Lskj.PubPdfSign.Controls.SignBox signBox = this.pdfEditorEx._signBoxList.FirstOrDefault(s => s.StepName == stepName);
|
|
if (signBox != null)
|
|
{
|
|
currentX += (offset + lastWidth);
|
|
signBox.SignLeft = currentX;
|
|
signBox.SignTop = selectedSignBox.SignTop;
|
|
signBox.ParentPicBox.Left = currentX;
|
|
signBox.UpdateLocation();
|
|
lastWidth = signBox.SignWidth;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 垂直设置
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnVerticalSpacingClick(object sender, EventArgs e)
|
|
{
|
|
Lskj.PubPdfSign.Controls.SignBox selectedSignBox = this.pdfEditorEx._selectedSignBox;
|
|
if (selectedSignBox != null)
|
|
{
|
|
int offset = int.Parse(txt_offset.Text);
|
|
int currentY = selectedSignBox.SignTop;
|
|
int lastHeight = selectedSignBox.SignHeight;
|
|
foreach (var rowHandle in gridView1.GetSelectedRows())
|
|
{
|
|
string stepName = gridView1.GetRowCellValue(rowHandle, "StepName").ToString();
|
|
if (stepName.Equals(selectedSignBox.StepName)) continue;
|
|
Lskj.PubPdfSign.Controls.SignBox signBox = this.pdfEditorEx._signBoxList.FirstOrDefault(s => s.StepName == stepName);
|
|
if (signBox != null)
|
|
{
|
|
currentY += (offset + lastHeight);
|
|
signBox.SignTop = currentY;
|
|
signBox.SignLeft = selectedSignBox.SignLeft;
|
|
signBox.ParentPicBox.Top = currentY;
|
|
signBox.UpdateLocation();
|
|
lastHeight = signBox.SignHeight;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 保存完成后
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnAfterSignSaveCallback(object sender, EventArgs e)
|
|
{
|
|
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"), true);
|
|
}
|
|
/// <summary>
|
|
/// 添加完成完成后
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnAfterSignAddCallback(object sender, EventArgs e)
|
|
{
|
|
OnSignDesignUpd();
|
|
}
|
|
/// <summary>
|
|
/// 删除按钮点击
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnBtnDeleteClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
int[] rowids = this.gridView.GetSelectedRows();
|
|
if (rowids == null || rowids.Length == 0)
|
|
{
|
|
MessageUtil.Show("请选择需要删除的数据");
|
|
}
|
|
else
|
|
{
|
|
DialogResult result = MessageUtil.Show($"确定要删除选中{rowids.Length}条数据?", MessageBoxButtons.YesNo);
|
|
if (result == DialogResult.Yes)
|
|
{
|
|
ArrayList localDeletes = new ArrayList();
|
|
List<UploadModel> mList = new List<UploadModel>();
|
|
List<string> delToPosts = new List<string>();
|
|
foreach (int rowid in rowids)
|
|
{
|
|
DataRow rowData = this.gridView.GetDataRow(rowid);
|
|
if (rowData.RowState != DataRowState.Added)
|
|
{
|
|
string fieldValue = rowData["id"] + "";
|
|
string webPath = rowData["pdfUrl"] + "";
|
|
string sqlValue = string.Format("delete from P_SignTempTable where id = '{0}' and typecode = '{1}'", fieldValue, PdfSignModel.TypeCode);
|
|
mList.Add(new UploadModel() { FileId = fieldValue, Webpath = webPath, ExecSql = sqlValue });
|
|
}
|
|
else
|
|
{
|
|
localDeletes.Add(rowid);
|
|
}
|
|
}
|
|
if (mList.Count > 0)
|
|
{
|
|
string hintMsg = "删除结果如下:\n";
|
|
foreach (UploadModel uploadModel in mList)
|
|
{
|
|
try
|
|
{
|
|
string deleteSql = uploadModel.ExecSql;
|
|
SqlHelper.ExecuteNonQuery(deleteSql);
|
|
WaitForm.ShowForm();
|
|
bool isDelete = FileUploadUtil.DeleteFile(uploadModel);
|
|
WaitForm.HideForm();
|
|
if (isDelete)
|
|
{
|
|
hintMsg += "记录[" + uploadModel.FileId + "]删除成功.\n";
|
|
}
|
|
else
|
|
{
|
|
hintMsg += "记录[" + uploadModel.FileId + "]删除失败,原因:" + uploadModel.Msg + "\n";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
hintMsg += "记录[" + uploadModel.FileId + "]删除失败,原因:" + ex.Message + "\n";
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (localDeletes.Count > 0)
|
|
{
|
|
// 删除选中且未保存的数据
|
|
for (int i = localDeletes.Count - 1; i >= 0; i--)
|
|
{
|
|
this.gridView.DeleteRow((int)localDeletes[i]);
|
|
}
|
|
MessageUtil.Show("删除成功");
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show("无法删除");
|
|
}
|
|
}
|
|
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"), true);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageUtil.Show(ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 更新按钮点击
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnBtnUpdateClick(object sender, EventArgs e)
|
|
{
|
|
DataRow dataRow = this.gridView.GetFocusedDataRow();
|
|
if (dataRow != null)
|
|
{
|
|
string fileName = Path.GetFileName(dataRow["pdfUrl"] + "");
|
|
string versionName = dataRow["versionName"] + "";
|
|
using (FrmAdd frmAdd = new FrmAdd())
|
|
{
|
|
frmAdd.ShowDialog();
|
|
frmAdd.FileName = fileName;
|
|
frmAdd.VersionName = versionName;
|
|
if (frmAdd.DialogResult == DialogResult.OK)
|
|
{
|
|
DataTable dataTable = this.gcMain.DataSource as DataTable;
|
|
int result = this.AdapterObj.Update(dataTable);
|
|
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"), true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 添加按钮点击
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnBtnAddClick(object sender, EventArgs e)
|
|
{
|
|
using (OpenFileDialog dialog = new OpenFileDialog())
|
|
{
|
|
dialog.Multiselect = false;//该值确定是否可以选择多个文件
|
|
dialog.Title = "请选择文件";
|
|
dialog.Filter = "PDF文件(*.pdf)|*.pdf";
|
|
if (dialog.ShowDialog() == DialogResult.OK)
|
|
{
|
|
string fileFullName = dialog.FileName;
|
|
UploadModel uploadModel = new UploadModel();
|
|
uploadModel.FileName = Path.GetFileName(fileFullName);
|
|
using (FrmAdd frmAdd = new FrmAdd())
|
|
{
|
|
frmAdd.FileName = Path.GetFileName(fileFullName);
|
|
frmAdd.StartPosition = FormStartPosition.Manual;
|
|
frmAdd.Location = new Point(this.Left + 50, this.Bottom - frmAdd.Height - 50);
|
|
if (frmAdd.ShowDialog() == DialogResult.OK)
|
|
{
|
|
uploadModel.Version = frmAdd.VersionName;
|
|
WaitForm.ShowForm();
|
|
bool isUpload = FileUploadUtil.UploadFile(fileFullName, PdfSignModel, ref uploadModel);
|
|
WaitForm.HideForm();
|
|
if (!isUpload)
|
|
{
|
|
MessageUtil.Show(uploadModel.Msg);
|
|
return;
|
|
}
|
|
DataRow dataRow = AddGridViewRecord(uploadModel);
|
|
try
|
|
{
|
|
DataTable dataTable = this.gcMain.DataSource as DataTable;
|
|
int result = this.AdapterObj.Update(dataTable);
|
|
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"), true);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageUtil.Show($"保存失败,原因:{ex.Message}");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 条件附加模块
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
public void OnBtnAdditionalClick(object sender, EventArgs e)
|
|
{
|
|
using (OpenFileDialog dialog = new OpenFileDialog())
|
|
{
|
|
dialog.Multiselect = false;//该值确定是否可以选择多个文件
|
|
dialog.Title = "请选择文件";
|
|
dialog.Filter = "图片文件 (*.bmp, *.jpg, *.jpeg, *.png, *.gif, *.tiff, *.tif, *.webp)|*.bmp;*.jpg;*.jpeg;*.png;*.gif;*.tiff;*.tif;*.webp";
|
|
if (dialog.ShowDialog() == DialogResult.OK)
|
|
{
|
|
string fileFullName = dialog.FileName;
|
|
UploadModel uploadModel = new UploadModel();
|
|
uploadModel.isAdditional = true;
|
|
uploadModel.FileName = Path.GetFileName(fileFullName);
|
|
WaitForm.ShowForm();
|
|
bool isUpload = FileUploadUtil.UploadFile(fileFullName, PdfSignModel, ref uploadModel);
|
|
WaitForm.HideForm();
|
|
if (!isUpload)
|
|
{
|
|
MessageUtil.Show(uploadModel.Msg);
|
|
return;
|
|
}
|
|
string url = uploadModel.Webpath.StartsWith("http") ? uploadModel.Webpath : SystemInfo.Instance.OAUrl + uploadModel.Webpath;
|
|
this.pdfEditorEx.AddSignPicControl("", url);
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 点击指定行
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnGridViewRowClick(object sender, RowClickEventArgs e)
|
|
{
|
|
DataRow dataRow = this.gridView.GetDataRow(e.RowHandle);
|
|
if (dataRow != null)
|
|
{
|
|
string versionCode = dataRow.Table.Columns.Contains("id") ? dataRow["id"] + "" : "";
|
|
this.pdfEditorEx.VersionCode = versionCode;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 选中行改变时
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnGridViewFocusedRowObjectChanged(object sender, FocusedRowObjectChangedEventArgs e)
|
|
{
|
|
DataRow dataRow = this.gridView.GetFocusedDataRow();
|
|
if (dataRow != null)
|
|
{
|
|
string versionCode = dataRow.Table.Columns.Contains("id") ? dataRow["id"] + "" : "";
|
|
this.pdfEditorEx.VersionCode = versionCode;
|
|
this.pdfEditorEx.OpenLocalFile(dataRow);
|
|
}
|
|
this.OnSignDesignUpd();
|
|
}
|
|
/// <summary>
|
|
/// 更新右侧所有设计器值
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
public void OnSignDesignUpd()
|
|
{
|
|
if (this.pdfEditorEx._signBoxList != null && this.pdfEditorEx._signBoxList.Count > 0)
|
|
{
|
|
DataTable dataTable = new DataTable();
|
|
dataTable.Columns.Add("StepName");
|
|
foreach (Lskj.PubPdfSign.Controls.SignBox signBox in this.pdfEditorEx._signBoxList)
|
|
{
|
|
if (!string.IsNullOrEmpty(signBox.StepName))
|
|
{
|
|
DataRow dr = dataTable.NewRow();
|
|
dr["StepName"] = signBox.StepName;
|
|
dataTable.Rows.Add(dr);
|
|
}
|
|
}
|
|
StepControl.DataSource = dataTable;
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// 选中行颜色
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnGridViewCustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
|
|
{
|
|
if (e.RowHandle == gridView.FocusedRowHandle)
|
|
{
|
|
e.Appearance.BackColor = ColorTranslator.FromHtml("#9feb6a");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 显示表格序号
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnGridViewCustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
e.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
|
|
if (e.Info.IsRowIndicator)
|
|
{
|
|
if (e.RowHandle >= 0)
|
|
{
|
|
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 设置数据源
|
|
/// </summary>
|
|
private int SetGridViewDataSource(DbDataAdapter adapter, bool selectRowHandler = true)
|
|
{
|
|
if (adapter == null) return 0;
|
|
|
|
try
|
|
{
|
|
int focusedRowHandle = this.gridView.FocusedRowHandle;
|
|
this.AdapterObj = adapter;
|
|
DataSet dataSet = new DataSet();
|
|
adapter.Fill(dataSet, "SetGridViewDataSource");
|
|
//SqlCommandBuilder cb = new SqlCommandBuilder(this.AdapterObj);
|
|
|
|
DbCommandBuilder cb = SqlHelper.dbFactory.CreateCommandBuilder();
|
|
cb.DataAdapter = this.AdapterObj;
|
|
|
|
DataTable dt = dataSet.Tables[0];
|
|
this.gcMain.DataSource = dt;
|
|
this.gridView.BestFitColumns();
|
|
int splitPosition = versionName.Width + this.gridView.IndicatorWidth + 10;
|
|
this.splitMainControl.SplitterPosition = splitPosition > 400 ? splitPosition : 400;
|
|
if (selectRowHandler)
|
|
{
|
|
this.gridView.FocusedRowHandle = focusedRowHandle;
|
|
}
|
|
if (dt.Rows.Count == 0)
|
|
{
|
|
pdfEditorEx.CloseDocument();
|
|
}
|
|
return dataSet.Tables[0] != null ? dataSet.Tables[0].Rows.Count : 0;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageUtil.Show(ex.Message);
|
|
}
|
|
return 0;
|
|
}
|
|
/// <summary>
|
|
/// 直接表格添加数据
|
|
/// </summary>
|
|
/// <param name="fullName"></param>
|
|
private DataRow AddGridViewRecord(UploadModel uploadModel)
|
|
{
|
|
DataRow dataRow = null;
|
|
try
|
|
{
|
|
DataTable dt = this.gcMain.DataSource as DataTable;
|
|
dataRow = dt.NewRow();
|
|
dataRow["pdfUrl"] = uploadModel.Webpath;
|
|
dataRow["versionName"] = uploadModel.Version;
|
|
dataRow["typecode"] = PdfSignModel.TypeCode;
|
|
dt.Rows.Add(dataRow);
|
|
this.gridView.UpdateCurrentRow();
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
return dataRow;
|
|
}
|
|
/// <summary>
|
|
/// 获取数据
|
|
/// </summary>
|
|
/// <param name="sqlValue"></param>
|
|
/// <returns></returns>
|
|
private DbDataAdapter GetAdapterResult(string sqlValue)
|
|
{
|
|
DbDataAdapter dbDataAdapter = SqlHelper.dbFactory.CreateDataAdapter();
|
|
try
|
|
{
|
|
if (string.IsNullOrWhiteSpace(sqlValue)) return dbDataAdapter;
|
|
return SqlHelper.ExecuteAdapter(CommandType.Text, sqlValue);
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
return dbDataAdapter;
|
|
}
|
|
}
|
|
}
|