麻烦大家帮我检查一下下面程序有什么错误,就是打印那个模块不能实现
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Text;
using Mrp.Class;
using Mrp.Include;
namespace Mrp.OrderManage
{
/// <summary>
/// Index 的摘要说明。
/// </summary>
public class ProducePlanView : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label lblErrorMessage;
protected System.Web.UI.WebControls.DataGrid dgList;
protected System.Web.UI.WebControls.DropDownList ddlCustomer;
protected System.Web.UI.WebControls.LinkButton lnkbtnSave;
protected System.Web.UI.WebControls.LinkButton lnkbtnErase;
protected System.Web.UI.WebControls.TextBox txtDestination;
protected System.Web.UI.WebControls.LinkButton lnkbtnNewDetail;
protected System.Web.UI.WebControls.RequiredFieldValidator rfvDestination;
protected System.Web.UI.WebControls.Button btnBack;
protected int UserID;
protected StringBuilder ErrorMessage = new StringBuilder();
protected ProducePlan oInfo = new ProducePlan();
protected DataSet dsList;
protected System.Web.UI.WebControls.TextBox txtProducePlanHeadID;
protected System.Web.UI.WebControls.TextBox txtProducePlanNo;
protected System.Web.UI.WebControls.TextBox txtOverCIQDate;
protected System.Web.UI.WebControls.RequiredFieldValidator rfvOverCIQDate;
protected System.Web.UI.WebControls.TextBox txtGetOrderDate;
protected System.Web.UI.WebControls.TextBox txtMaterielDate;
protected System.Web.UI.WebControls.TextBox txtShipmentDate;
protected System.Web.UI.WebControls.TextBox txtProduceDate;
protected System.Web.UI.WebControls.TextBox txtInStorageDate;
protected System.Web.UI.WebControls.CheckBoxList chklProduceDept;
protected System.Web.UI.WebControls.RequiredFieldValidator rfvGetOrderDate;
protected System.Web.UI.WebControls.RequiredFieldValidator rfvMaterielDate;
protected System.Web.UI.WebControls.RequiredFieldValidator rfvShipmentDate;
protected System.Web.UI.WebControls.RequiredFieldValidator rfvProduceDate;
protected System.Web.UI.WebControls.RequiredFieldValidator rfvInStorageDate;
protected System.Web.UI.WebControls.Image imgMark;
protected System.Web.UI.WebControls.TextBox txtComment;
protected System.Web.UI.WebControls.TextBox txtRemark;
protected System.Web.UI.WebControls.LinkButton lnkbtnDesire;
protected System.Web.UI.HtmlControls.HtmlTable tblHead;
protected System.Web.UI.WebControls.LinkButton lnkbtnEdit;
protected System.Web.UI.WebControls.LinkButton lnkbtnCancel;
protected System.Web.UI.WebControls.Label lblFlowFlag;
protected System.Web.UI.WebControls.LinkButton lnkbtnPrint;
protected CapPaper oCapPaper = new CapPaper();
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if (! IsPostBack)
{
lnkbtnErase.Attributes.Add("onclick", "return confirmDialog()");
ShowCustomerList();
if (Request["ProducePlanHeadID"] != null)
{
lnkbtnCancel.Enabled = false;
lnkbtnSave.Enabled = false;
SetEnableControlHeadTable(false);
txtProducePlanHeadID.Text = Request["ProducePlanHeadID"].ToString();
oInfo.LoadInfo(Convert.ToInt32(txtProducePlanHeadID.Text));
txtProducePlanNo.Text = oInfo.ProducePlanNo;
txtOverCIQDate.Text = Common.DateFormatShort(oInfo.OverCIQDate);
ddlCustomer.SelectedValue = oInfo.CustomerID.ToString();
txtDestination.Text = oInfo.Destination;
txtGetOrderDate.Text = Common.DateFormatShort(oInfo.GetOrderDate);
txtMaterielDate.Text = Common.DateFormatShort(oInfo.MaterielDate);
txtProduceDate.Text = Common.DateFormatShort(oInfo.ProduceDate);
txtInStorageDate.Text = Common.DateFormatShort(oInfo.InStorageDate);
txtShipmentDate.Text = Common.DateFormatShort(oInfo.ShipmentDate);
txtRemark.Text = oInfo.Comment;
lblFlowFlag.Text = oInfo.FlowFlag.ToString();
string ProduceDept = oInfo.ProduceDept;
if (ProduceDept.IndexOf("T") > -1)
{
chklProduceDept.Items[0].Selected = true;
}
if (ProduceDept.IndexOf("M") > -1)
{
chklProduceDept.Items[1].Selected = true;
}
if (oInfo.MarkImageURL != "")
{
imgMark.Visible = true;
imgMark.ImageUrl = oInfo.MarkImageURL;
}
lnkbtnNewDetail.Attributes.Add("onclick", "return showDialog('" + txtProducePlanHeadID.Text + "')");
}
else
{
lnkbtnEdit.Enabled = false;
lnkbtnCancel.Enabled = false;
lnkbtnErase.Enabled = false;
lnkbtnDesire.Enabled = false;
lnkbtnPrint.Enabled = false;
lnkbtnNewDetail.Enabled = false;
}
GetdsList("true");
BindDgList();
ShowErrorMessage();
}
//Role Config
PrivilegeContorl();
//Send Parameters to CommonDialog
StringBuilder sqlString = new StringBuilder();
sqlString.Append("SELECT");
sqlString.Append(" D.OrderHeadID");
sqlString.Append(", H.OrderNo");
sqlString.Append(", D.OrderDetailID");
sqlString.Append(", D.ProductID");
sqlString.Append(", D.ProductName AS 货号");
sqlString.Append(", D.Surface AS 表面处理");
sqlString.Append(", D.PCS AS 包装方式");
sqlString.Append(", D.Qty AS 数量");
sqlString.Append(", D.PlanQty AS 已计划数量");
sqlString.Append(", D.Qty - D.PlanQty AS 剩余数量");
sqlString.Append(" FROM OrderDetail D");
sqlString.Append(" INNER JOIN OrderHead H ON H.OrderHeadID = D.OrderHeadID");
sqlString.Append(" WHERE H.IsValid = 1");
sqlString.Append(" AND H.FLowFlag = 10");
sqlString.Append(" AND Convert(nvarchar(10), H.SignDate, 120) = '" + txtOverCIQDate.Text + "'");
sqlString.Append(" AND H.CustomerID = " + Convert.ToInt32(ddlCustomer.SelectedValue));
sqlString.Append(" AND H.Destination = '" + Common.ToSQLString(txtDestination.Text) + "'");
sqlString.Append(" AND D.Qty > D.PlanQty");
StringBuilder queryField = new StringBuilder();
queryField.Append("货号\\\\ProductName");
int SelectCount = 0;
string NotVisibleColumns = "1, 2, 3, 4";
Session["CommonDialogArguments"] = CommonDialog.SetParameterSession(sqlString.ToString(), queryField.ToString(), SelectCount, NotVisibleColumns);
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lnkbtnEdit.Click += new System.EventHandler(this.lnkbtnEdit_Click);
this.lnkbtnCancel.Click += new System.EventHandler(this.lnkbtnCancel_Click);
this.lnkbtnSave.Click += new System.EventHandler(this.lnkbtnSave_Click);
this.lnkbtnErase.Click += new System.EventHandler(this.lnkbtnErase_Click);
this.lnkbtnDesire.Click += new System.EventHandler(this.lnkbtnDesire_Click);
this.lnkbtnPrint.Click += new System.EventHandler(this.lnkbtnPrint_Click);
this.lnkbtnNewDetail.Click += new System.EventHandler(this.lnkbtnNewDetail_Click);
this.dgList.CancelCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dgList_CancelCommand);
this.dgList.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dgList_EditCommand);
this.dgList.UpdateCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dgList_UpdateCommand);
this.dgList.DeleteCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dgList_DeleteCommand);
this.dgList.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dgList_ItemDataBound);