83 lines
2.5 KiB
C#
83 lines
2.5 KiB
C#
using Lskj.Business.Impl;
|
|
using Lskj.Control;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Core;
|
|
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.PubBillManagement
|
|
{
|
|
public partial class FrmScanCodeAssociation : BaseForm
|
|
{
|
|
|
|
/// <summary>
|
|
/// 系统模块实体对象
|
|
/// </summary>
|
|
/// <value>The system model.</value>
|
|
public ModuleModel SysModel { get; private set; }
|
|
/// <summary>
|
|
///主表条件控件
|
|
/// </summary>
|
|
public MyControl SearchMainObj;
|
|
/// <summary>
|
|
///扫码内容
|
|
/// </summary>
|
|
public string ScanCodeData;
|
|
/// <summary>
|
|
//选中的串码
|
|
/// </summary>
|
|
public string StringCodes;
|
|
|
|
public FrmScanCodeAssociation()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public FrmScanCodeAssociation(DataRow modelRow, string scanCodeData)
|
|
{
|
|
InitializeComponent();
|
|
this.ScanCodeData = scanCodeData;
|
|
//根据传入的模块号获取模块信息
|
|
this.SysModel = new ModuleModel(modelRow);
|
|
DataTable mainGridColumns = BaseModuleImpl.GetBaseGridColumns(this.SysModel.ModeCode);
|
|
this.gcMain.SetReadOnlyColumns(mainGridColumns, GridCustomColumnStruct.BaseMainGridView + this.SysModel.FormKey);//创建列
|
|
string sql = ReplaceHelper.ReplaceParamToValue(SysModel.MenuSql, "{value}", this.ScanCodeData);
|
|
DataTable dt = BillImpl.GetDataTableResult(sql);
|
|
this.gcMain.GridControl.DataSource = dt;
|
|
//加载复选框
|
|
GridDragGrid.GridAddCheckBox(this.gcMain.GridView);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void simpleButton1_Click(object sender, EventArgs e)
|
|
{
|
|
DataRow[] dataRows = this.gcMain.GetViewFocusedDataRows();
|
|
if (dataRows.Length > 0)
|
|
{
|
|
string name=this.gcMain.GridView.Columns[0].FieldName;
|
|
string text = string.Empty;
|
|
for (int i = 0; i < dataRows.Length; i++)
|
|
{
|
|
text += dataRows[i][name] + ";";
|
|
}
|
|
|
|
StringCodes = text.Trim(';');
|
|
this.Close();
|
|
this.DialogResult = System.Windows.Forms.DialogResult.OK;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|