using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using SQLHelper;
|
using DBUtility;
|
using System.Data;
|
|
namespace DAL
|
{
|
public class Cls_S_Xt_BaseBill
|
{
|
|
public string mvarReportTitle;
|
public string mvarItemKey;
|
public string ViewName = "";
|
public string sCondtion = "";
|
public string sOrderSql = "";
|
public string sKeyCol = "";
|
public string sShowItemSql = "";
|
//================================
|
public string mvarReportTitle2;
|
public string mvarItemKey2;
|
public string ViewName2 = "";
|
public string sCondtion2 = "";
|
public string sOrderSql2 = "";
|
public string sKeyCol2 = "";
|
public string sShowItemSql2 = "";
|
public DAL.frmHlpBillList oFrm = new DAL.frmHlpBillList();
|
public List<DBUtility.BillSelect> oBillSelectColl = new List<DBUtility.BillSelect>();
|
public List<DBUtility.BillSelect_A3> oBillSelectColl2 = new List<DBUtility.BillSelect_A3>();
|
//
|
public Cls_S_Xt_BaseBill()
|
{
|
//---
|
}
|
|
|
//显示数据
|
/// <summary>
|
/// 显示数据
|
/// </summary>
|
/// <param name="sWhere">主SQL</param>
|
/// <param name="sCondtion">过滤条件</param>
|
/// <param name="sOrderSql">排序条件</param>
|
/// <param name="sKeyCol">不可重复列</param>
|
/// <returns></returns>
|
public virtual bool Refresh(string sWhere)
|
{
|
string sErr = "";
|
int MainIDCol, SubIDCol, BillNoCol;
|
string tSQL;
|
ClsCN oCn = new ClsCN();
|
tSQL = sWhere + sCondtion + sOrderSql;
|
try
|
{
|
oFrm.sPrimaryCol = sKeyCol;
|
oFrm.Text = mvarReportTitle;
|
oFrm.lblCaption.Text = mvarReportTitle;
|
oFrm.tSQL = tSQL;
|
oFrm.ViewName = ViewName;
|
|
oFrm.ShowDialog();
|
if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
|
{
|
//返回数据到集合中
|
oBillSelectColl.Clear();
|
MainIDCol = oFrm.Fun_GetCol("hmainid");
|
SubIDCol = oFrm.Fun_GetCol("hsubid");
|
BillNoCol = oFrm.Fun_GetCol("单据号");
|
|
//循环 选中行
|
for (int i = 0; i < oFrm.grdMain.SelectedRows.Count; i++)
|
{
|
BillSelect oSelect = new BillSelect();
|
oSelect.BillNo = ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[BillNoCol].Value);
|
oSelect.BillMainID = ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
|
oSelect.BillSubID = ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[SubIDCol].Value);
|
oSelect.BillTitle = mvarReportTitle;
|
oSelect.BillType = mvarItemKey;
|
oBillSelectColl.Add(oSelect);
|
}
|
}
|
//
|
if (oBillSelectColl.Count > 0)
|
return true;
|
else
|
return false;
|
}
|
catch (Exception e)
|
{
|
sErr = e.Message;
|
}
|
return true;
|
}
|
|
|
//显示数据2
|
/// <summary>
|
/// 显示数据2
|
/// </summary>
|
/// <param name="sWhere">主SQL</param>
|
/// <param name="sCondtion">过滤条件</param>
|
/// <param name="sOrderSql">排序条件</param>
|
/// <param name="sKeyCol">不可重复列</param>
|
/// <returns></returns>
|
public virtual bool Refresh2(string sWhere)
|
{
|
string sErr = "";
|
int MainIDCol, SubIDCol, BillNoCol;
|
string tSQL;
|
ClsCN oCn = new ClsCN();
|
tSQL = sWhere + sCondtion2 + sOrderSql2;
|
try
|
{
|
oFrm.sPrimaryCol = sKeyCol2;
|
oFrm.Text = mvarReportTitle2;
|
oFrm.lblCaption.Text = mvarReportTitle2;
|
oFrm.tSQL = tSQL;
|
oFrm.ViewName = ViewName2;
|
oFrm.ShowDialog();
|
if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
|
{
|
//返回数据到集合中
|
oBillSelectColl.Clear();
|
MainIDCol = oFrm.Fun_GetCol("hmainid");
|
SubIDCol = oFrm.Fun_GetCol("hsubid");
|
BillNoCol = oFrm.Fun_GetCol("单据号");
|
//循环 选中行
|
for (int i = 0; i < oFrm.grdMain.SelectedRows.Count; i++)
|
{
|
BillSelect oSelect = new BillSelect();
|
oSelect.BillNo = ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[BillNoCol].Value);
|
oSelect.BillMainID = ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
|
oSelect.BillSubID = ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[SubIDCol].Value);
|
oSelect.BillTitle = mvarReportTitle2;
|
oSelect.BillType = mvarItemKey2;
|
oBillSelectColl.Add(oSelect);
|
}
|
}
|
//
|
if (oBillSelectColl.Count > 0)
|
return true;
|
else
|
return false;
|
}
|
catch (Exception e)
|
{
|
sErr = e.Message;
|
}
|
return true;
|
}
|
|
//显示数据3
|
/// <summary>
|
/// 显示数据3
|
/// </summary>
|
/// <param name="sWhere">主SQL</param>
|
/// <param name="sCondtion">过滤条件</param>
|
/// <param name="sOrderSql">排序条件</param>
|
/// <param name="sKeyCol">不可重复列</param>
|
/// <returns></returns>
|
public virtual bool Refresh_A3(string sWhere)
|
{
|
string sErr = "";
|
int MainIDCol, SubIDCol, BillNoCol;
|
string tSQL;
|
ClsCN oCn = new ClsCN();
|
tSQL = sWhere + sCondtion2 + sOrderSql2;
|
try
|
{
|
oFrm.sPrimaryCol = sKeyCol2;
|
oFrm.Text = mvarReportTitle2;
|
oFrm.lblCaption.Text = mvarReportTitle2;
|
oFrm.tSQL = tSQL;
|
oFrm.ViewName = ViewName2;
|
oFrm.ShowDialog();
|
if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
|
{
|
//返回数据到集合中
|
oBillSelectColl2.Clear();
|
MainIDCol = oFrm.Fun_GetCol("hmainid");
|
SubIDCol = oFrm.Fun_GetCol("hsubid");
|
BillNoCol = oFrm.Fun_GetCol("单据号");
|
//循环 选中行
|
for (int i = 0; i < oFrm.grdMain.SelectedRows.Count; i++)
|
{
|
BillSelect_A3 oSelect = new BillSelect_A3();
|
oSelect.BillNo = ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[BillNoCol].Value);
|
oSelect.BillMainID = ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
|
oSelect.BillSubID = ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[SubIDCol].Value);
|
oSelect.BillTitle = mvarReportTitle2;
|
oSelect.BillType = mvarItemKey2;
|
oBillSelectColl2.Add(oSelect);
|
}
|
}
|
//
|
if (oBillSelectColl2.Count > 0)
|
return true;
|
else
|
return false;
|
}
|
catch (Exception e)
|
{
|
sErr = e.Message;
|
}
|
return true;
|
}
|
|
|
|
|
|
//返回单据列表
|
/// <summary>
|
/// 返回单据列表
|
/// </summary>
|
/// <param name="sWhere">过滤条件</param>
|
public DataSet DisSourceBillList(string sWhere)
|
{
|
try
|
{
|
ClsCN oCn = new ClsCN();
|
return oCn.RunProcReturn("select "+sShowItemSql+" from " + ViewName + " " + sWhere + sCondtion + sOrderSql, ViewName, ref DBUtility.ClsPub.sExeReturnInfo);
|
}
|
catch (Exception e)
|
{
|
DBUtility.ClsPub.sExeReturnInfo += "返回单据列表失败!" + e.Message;
|
return null;
|
}
|
}
|
|
//返回单据列表
|
/// <summary>
|
/// 返回单据列表
|
/// </summary>
|
/// <param name="sWhere">过滤条件</param>
|
public DataSet DisSourceBillList2(string sWhere)
|
{
|
try
|
{
|
ClsCN oCn = new ClsCN();
|
return oCn.RunProcReturn("select " + sShowItemSql2 + " from " + ViewName2 + " " + sWhere + sCondtion2 + sOrderSql2, ViewName2, ref DBUtility.ClsPub.sExeReturnInfo);
|
}
|
catch (Exception e)
|
{
|
DBUtility.ClsPub.sExeReturnInfo += "返回单据列表失败!" + e.Message;
|
return null;
|
}
|
}
|
|
public virtual bool Refresh3(string sWhere)
|
{
|
string sErr = "";
|
int MainIDCol, SubIDCol, BillNoCol;
|
string tSQL;
|
ClsCN oCn = new ClsCN();
|
tSQL = sWhere + sCondtion + sOrderSql;
|
try
|
{
|
oFrm.sPrimaryCol = sKeyCol;
|
oFrm.Text = mvarReportTitle;
|
oFrm.lblCaption.Text = mvarReportTitle;
|
oFrm.tSQL = tSQL;
|
oFrm.ViewName = ViewName;
|
oFrm.ShowDialog();
|
//返回数据到集合中
|
oBillSelectColl.Clear();
|
if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
|
{
|
MainIDCol = oFrm.Fun_GetCol("HMaterID");
|
//SubIDCol = oFrm.Fun_GetCol("hsubid");
|
//BillNoCol = oFrm.Fun_GetCol("单据号");
|
//循环 选中行
|
for (int i = 0; i < oFrm.grdMain.SelectedRows.Count; i++)
|
{
|
BillSelect oSelect = new BillSelect();
|
//oSelect.BillNo = ClsPub.isStrNull(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[BillNoCol].Value);
|
oSelect.BillMainID = ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
|
//oSelect.BillSubID = ClsPub.isLong(oFrm.grdMain.Rows[oFrm.grdMain.SelectedRows[i].Index].Cells[SubIDCol].Value);
|
oSelect.BillTitle = mvarReportTitle;
|
oSelect.BillType = mvarItemKey;
|
oBillSelectColl.Add(oSelect);
|
}
|
}
|
//
|
if (oBillSelectColl.Count > 0)
|
return true;
|
else
|
return false;
|
}
|
catch (Exception e)
|
{
|
sErr = e.Message;
|
}
|
return true;
|
}
|
|
|
}
|
}
|