鲸鱼夫妇120107,仙神记,生活大爆炸第二季mp4
<asp:fileupload id="fileupload附件" runat="server" width="200px" />
protected void btnedit_click(object sender, eventargs e)
{
if (txtcarplatenumber.text.trim() == "")
{
clientscript.registerstartupscript(gettype(), "", "alert('请输入车牌号!');", true);
return;
}
int id = 0;
if (string.isnullorempty(request.params["id"]) == false)
{
id = int.parse(request.params["id"]);
}
modelblackwhitelist model = new modelblackwhitelist();
model.id = id;
model.carplatetype = ddlcarplatetype.selecteditem.text;
model.carplatenumber = txtcarplatenumber.text.trim();
model.company = txtcompany.text.trim();
model.bwflag = ddlbwflag.selecteditem.value;
model.operatorname = this.userlogin;
model.createdatetime = datetime.now;
string commandname = request.params["commandname"].tostring();
switch (commandname)
{
case "upd":
{
if (fileupload附件.postedfile.filename.trim().length != 0)
{
string savepath;
string filename = datetime.now.tostring("yyyymmddhhmmssms");
if (fileupload附件.hasfile && fileupload附件.postedfile.filename.contains(".jpg"))
{
savepath = server.mappath("~/upload/");//指定上传文件在服务器上的保存路径
//检查服务器上是否存在这个物理路径,如果不存在则创建
if (!system.io.directory.exists(savepath))
{
system.io.directory.createdirectory(savepath);
}
savepath = savepath + filename + ".jpg";
fileupload附件.saveas(savepath);
model.carpicpath = "/upload /" + filename + ".jpg";
}
else
{
clientscript.registerstartupscript(gettype(), "", "alert('请选择jpg图片文件!');", true);
return;
}
}
int result = sqlsugarclienthelper.sqldbconnection.updateable<modelblackwhitelist>(model).executecommand();
if (result > 0)
{
clientscript.registerstartupscript(gettype(), "", "alert('保存成功!');window.location = 'blackwhitelistmanage.aspx';", true);
}
else
{
clientscript.registerstartupscript(gettype(), "", "alert('保存失败!');", true);
}
break;
}
case "new":
{
if (fileupload附件.postedfile.filename.trim().length != 0)
{
string savepath;
string filename = datetime.now.tostring("yyyymmddhhmmssms");
if (fileupload附件.hasfile && fileupload附件.postedfile.filename.contains(".jpg"))
{
savepath = server.mappath("~/upload/bwflag/");//指定上传文件在服务器上的保存路径
//检查服务器上是否存在这个物理路径,如果不存在则创建
if (!system.io.directory.exists(savepath))
{
system.io.directory.createdirectory(savepath);
}
savepath = savepath + filename + ".jpg";
fileupload附件.saveas(savepath);
model.carpicpath = "/upload/bwflag/" + filename + ".jpg";
}
else
{
clientscript.registerstartupscript(gettype(), "", "alert('请选择jpg图片文件!');", true);
return;
}
}
int result = sqlsugarclienthelper.sqldbconnection.insertable<modelblackwhitelist>(model).executecommand();
if (result > 0)
{
clientscript.registerstartupscript(gettype(), "", "alert('保存成功!');window.location = 'blackwhitelistmanage.aspx';", true);
}
else
{
clientscript.registerstartupscript(gettype(), "", "alert('保存失败!');", true);
}
break;
}
}
}
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论