using CY.Infrastructure.Common;
|
using CY.Infrastructure.Logging;
|
using CY.Model.OA;
|
using CY.SQLDAL;
|
using System;
|
using System.Collections.Generic;
|
using System.Data.SqlClient;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using static CY.WebForm.MainPage;
|
|
namespace CY.WebForm.Pages.business
|
{
|
public partial class DeliverPlanFujianShow : System.Web.UI.Page
|
{
|
/// <summary>
|
/// 合同附件集合
|
/// </summary>
|
List<OA_CorporateClientsContract> fileDataList { set; get; } = new List<OA_CorporateClientsContract>();
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
ReadList();
|
}
|
|
|
private void ReadList()
|
{
|
|
Guid Keyid = Request["Keyid"].ToGuid2();
|
|
string AttachmentType = Request["AttachmentType"];
|
|
if (Keyid == null)
|
{
|
JavaScript.MessageBox("未找到该客户", this, false, false);
|
return;
|
}
|
Database DC = new Database();
|
string sqlStr = string.Format(@" select * from [dbo].[OA_attachment] where [OA_Id]='{0}' and [AttachmentType]={1} order by [CreateTime] ", Keyid, AttachmentType);
|
int count = 0;
|
try
|
{
|
SqlCommand myCmd = new SqlCommand(sqlStr, DC.Connection);
|
//SqlDataAdapter myDa = new SqlDataAdapter(myCmd);
|
var a = myCmd.ExecuteReader();
|
//myDa.Dispose();
|
fileDataList = new List<OA_CorporateClientsContract>();
|
OA_CorporateClientsContract Contract;
|
var i = 1;
|
while (a.Read())
|
{ //注意如何将每次读取到的记录添加到listbox1中(因为第一次做时出错了,嘿嘿)
|
Contract = new OA_CorporateClientsContract();
|
// Contract.Keyid = a.GetInt32(0);
|
//Contract.CorporateClientsid = a.GetGuid(1);
|
//Contract.CorporateClientsName = a.GetString(4);
|
Contract.FileName = a[4].ToString();
|
Contract.PageCode = i;
|
Contract.FilePath = a.GetString(2);
|
// Contract.Remark = a.GetString(6);
|
i += 1;
|
|
fileDataList.Add(Contract);
|
}
|
a.Close(); //关闭sqldatareader
|
sqlStr = string.Format("select count(*) from [dbo].[OA_attachment] where [OA_Id]='{0}' and [AttachmentType]=3 ", Keyid);
|
myCmd = new SqlCommand(sqlStr, DC.Connection);
|
count = (int)myCmd.ExecuteScalar();
|
|
|
}
|
catch (Exception ee)
|
{
|
new Log4NetAdapter().Log("查找送货单图片出错:" + ee.Message);
|
|
}
|
finally
|
{
|
if (DC.Connection.State != System.Data.ConnectionState.Closed)
|
DC.Connection.Close();
|
}
|
|
|
|
|
this.RepClientList.DataSource = fileDataList;// fileDataList.AsEnumerable<OA_CorporateClientsContract>();
|
|
this.RepClientList.DataBind();
|
|
|
}
|
}
|
}
|