大四女毕业生实习求救
private void btn_Save_Click(object sender, System.EventArgs e)
{
#region
try
{
StfDev_WithTrans sStfDev_WithTrans = new StfDev_WithTrans();
CNStfDev get_StfDev = new CNStfDev();
get_StfDev.StfDev_Id = this.txt_StfDev_Id.Text.Trim();
get_StfDev.Name = this.txt_Name.Text.Trim();
if(this.txt_Number.Text.Trim().Length == 0)
get_StfDev.Number = "null";
else
get_StfDev.Number = this.txt_Number.Text.Trim();
get_StfDev.Unit = this.txt_Unit.Text.Trim();
get_StfDev.Unit_Price = this.txt_Unit_Price.Text.Trim();
StfDev_NoTrans sStfDev_NoTrans = new StfDev_NoTrans();
if(this.dgrd_List.SelectedIndex == -1)
// error CS0246: 找不到类型或命名空间名称“StfDev_NoTrans”(是否缺少 using 指令或程序集引用?) {
sStfDev_WithTrans.Add_StfDev(get_StfDev);
SetMessage("保存成功");
this.div_Save.Visible = false;
this.div_List.Visible = false;
}
else
{
sStfDev_WithTrans.Update_StfDev(get_StfDev);
get_StfDev.StfDev_Id = this.txt_Q_StfDev_Id.Text;
get_StfDev.Name= this.txt_Q_Name.Text;
DataSet dst_Result = sStfDev_NoTrans.Query_StfDev(get_StfDev);
int temp = dst_Result.Tables[0].Rows.Count;
if ((temp % this.dgrd_List.PageSize == 0) && (this.dgrd_List.CurrentPageIndex * this.dgrd_List.PageSize == temp))
if (this.dgrd_List.CurrentPageIndex > 1) this.dgrd_List.CurrentPageIndex --;
else this.dgrd_List.CurrentPageIndex = 0;
SetMessage("更新成功");
Session.Add("StfDev",dst_Result);
this.BindDataGrid();
this.dgrd_List.SelectedIndex = -1;
this.div_List.Visible = true;
this.div_Save.Visible = false;
}
}
catch(FormatException)
{
this.Result.Text = "某些字段格式有错误";
}
catch(Exception objError)
{
SetMessage(ExceptionManager.PublishException(objError));
}
为什么啊:
StfDev_NoTrans sStfDev_NoTrans = new StfDev_NoTrans();
if(this.dgrd_List.SelectedIndex == -1)
// error CS0246: 找不到类型或命名空间名称“StfDev_NoTrans”(是否缺少 using 指令或程序集引用?) {