WebSalary.WebUI.F_SalaryAnnalPrint的声明上缺少 partial 修饰符;存在此类型的其他分部声明
vs03的代码 放到05里面 就出现了这样的错误。。 有谁知道为什么啊!!!
代码如下 :
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 WebSalary.Common;
using WebSalary.Common.Data;
using WebSalary.BussinessFacade;
using WebSalary.WebUI.report;
using WebUtils;
using System.Diagnostics;
namespace WebSalary.WebUI
{
/// <summary>
/// F_SalaryAnnalPrint 的摘要说明。
/// </summary>
public class F_SalaryAnnalPrint : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.DropDownList DDL_AccountDate;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.DropDownList DDL_dept;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.DropDownList DDL_section;
protected System.Web.UI.WebControls.Label Label7;
protected System.Web.UI.WebControls.DropDownList DDL_printer;
protected System.Web.UI.WebControls.Button BT_print;
protected System.Web.UI.WebControls.Button BT_preview;
protected System.Web.UI.WebControls.Label Label6;
public SectionData sections;
protected System.Web.UI.WebControls.Label Label5;
protected System.Web.UI.WebControls.TextBox TB_Pfrom;
protected System.Web.UI.WebControls.TextBox TB_Pto;
public DataSet depts;
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
getPrinter();
DDL_AccountDate.SelectedValue=Common.WebSalaryConfigurations.settleym.Substring(0,4);
filldata();
Page.DataBind();
}
this.Label6.Text="";
}
public void filldata()
{
DataRow dr;
depts=(new DataAccess.Sections()).LoadDept();
dr=depts.Tables[0].NewRow();
dr[0]="*";
depts.Tables[0].Rows.InsertAt(dr,0);
//
sections=(new DataAccess.Sections()).LoadSection();
dr=sections.Tables[0].NewRow();
dr[0]="*";
sections.Tables[0].Rows.InsertAt(dr,0);
}
public void getPrinter()
{
WebPrinters PrinterObj=(WebPrinters)Server.CreateObject("WebUtils.WebPrinters");
if (PrinterObj.PrinterCount!=0)
{
DDL_printer.Items.Add(new ListItem("默认打印机",""));
for (int i=0;i<=PrinterObj.PrinterCount;i++)
{
short j=Convert.ToInt16(i);
this.DDL_printer.Items.Add(new ListItem(PrinterObj.get_DeviceName(ref j),PrinterObj.get_DeviceName(ref j)));
}
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.BT_print.Click += new System.EventHandler(this.BT_print_Click);
this.BT_preview.Click += new System.EventHandler(this.BT_preview_Click);
this.Error += new System.EventHandler(this.F_SalaryAnnalPrint_Error);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void BT_preview_Click(object sender, System.EventArgs e)
{
string strdept;
string strsection;
/////////////////////////////////////////////
if (DDL_dept.SelectedValue=="*")
{
strdept="";
}
else
{
strdept=DDL_dept.SelectedValue;
}
////////////////////////////////////////////////
if (DDL_section.SelectedValue=="*")
{
strsection="";
}
else
{
strsection=DDL_section.SelectedValue;
}
//20070202
(new DataAccess.Security()).WriteLog(Context.User.Identity.Name,"预览","工资年表",this.DDL_AccountDate.SelectedValue);
this.Label6.Text="<script>window.open('F_SalaryAnnalPreview.aspx?settleYM="+DDL_AccountDate.SelectedValue+"&dept="+ strdept+"§ions="+ strsection +"')</script>";
//this.Label6.Text="<script>Form1.TB_empname.focus()</script>";
}
private void BT_print_Click(object sender, System.EventArgs e)
{
//20070202
(new DataAccess.Security()).WriteLog(Context.User.Identity.Name,"打印","工资年表",this.DDL_AccountDate.SelectedValue);
CR_SalaryAnnal cr=new CR_SalaryAnnal();
string strdept;
string strsection;
/////////////////////////////////////////////
if (DDL_dept.SelectedItem.Text=="*")
{
strdept="%";
}
else
{
strdept=DDL_dept.SelectedValue;
}
////////////////////////////////////////////////
if (DDL_section.SelectedItem.Text=="*")
{
strsection="%";
}
else
{
strsection=DDL_section.SelectedValue;
}
AnnalDS ds=(new DataAccess.querys()).LoadSalaryAnnal(this.DDL_AccountDate.SelectedValue,strdept,strsection);
cr.SetDataSource(ds);
// 选择打印机。
cr.PrintOptions.PrinterName=DDL_printer.SelectedValue;
try
{
//cr.PrintToPrinter(1,false,0,0);
cr.PrintToPrinter(1,false,int.Parse(this.TB_Pfrom.Text),int.Parse(this.TB_Pto.Text));//20061215
}
catch
{
this.Label6.Text="<script>window.alert('打印机状态出错,请重新选择!')</script>";
}
}
private void F_SalaryAnnalPrint_Error(object sender, System.EventArgs e)
{
if (!EventLog.Exists("Application"))
{
EventLog.CreateEventSource("Application","Application");
}
EventLog log=new EventLog();
log.Source="Application";
Exception exp=Server.GetLastError();
string msg="F_SalaryAnnalPrint --> 源:"+exp.Source+" --> 信息:"+exp.Message+" --> 堆栈:"+exp.StackTrace;
log.WriteEntry(msg,EventLogEntryType.Error,1);
log.Close();
log.Dispose();
//Server.ClearError();
}
}
}