WebSalary.WebUI.F_SalaryAnnalPrint的声明上缺少 partial 修饰符;存在此类型的其他分部声明

Louis-Lv 2011-05-12 03:17:59
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();
}
}
}
...全文
318 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Louis-Lv 2011-08-05
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 god_girl 的回复:]
老火 我还是 遇到这个错了 我是 在 类里面遇到的
[/Quote]
在aspx。cs页面里面 加个partail就好了
public partial class _Default
  • 打赏
  • 举报
回复
老火 我还是 遇到这个错了 我是 在 类里面遇到的
Louis-Lv 2011-06-22
  • 打赏
  • 举报
回复
技术贴就这样的啊啊啊
来个人我结贴啊
Louis-Lv 2011-05-25
  • 打赏
  • 举报
回复
好吧。。 我个人问题。。 尽然不小心给忘了 不好意思不好意思
Louis-Lv 2011-05-23
  • 打赏
  • 举报
回复
悲剧啊。。 怎么都没人啊

111,098

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧