无法将bool隐式转换成int,求大神看看
String Stime = txttime.Value.Trim();
String Shedaline = txtheadline.Text.Trim();
String path = "/Uplode/";
String SSfaccessory = Saccessory.FileName;
String savepath = path + Saccessory;
Saccessory.SaveAs(Server.MapPath(savepath));
Maticsoft.Model.SSF SSFModel = new Model.SSF();
SSFModel.SSFID = 0;
SSFModel.time = Convert.ToDateTime(Stime);
SSFModel.headline = Shedaline;
SSFModel.accessory = SSfaccessory;
Maticsoft.BLL.SSF SSFService=new BLL.SSF();
int id = SSFService.Add(SSFModel);【就是提示这一句的错误】
if (id>0)
{
Maticsoft.Common.MessageBox.ShowAndRedirect(this.Page, "专项计划信息添加成功", "List.aspx");
}
else
{
Maticsoft.Common.MessageBox.Show(this.Page, "专项计划信息添加失败");
}
------解决方案--------------------int id =Convert.ToInt32( SSFService.Add(SSFModel));
这样也不行吗?
------解决方案--------------------int id = 0;
if(SSFService.Add(SSFModel))
{id = 1;}
if (id>0)
{
Maticsoft.Common.MessageBox.ShowAndRedirect(this.Page, "专项计划信息添加成功", "List.aspx");
}
else
{
Maticsoft.Common.MessageBox.Show(this.Page, "专项计划信息添加失败");
}