@ys930126
2017-07-06T10:36:51.000000Z
字数 3123
阅读 116
常用代码
$.ajaxjson(actionUrl + "?action=Delete", "moduleId=" + row.Id, function (obj) {
if (obj.Success) {
msg.ok("删除成功!");
grid.reload();
} else {
msg.error(obj.Message);
}
});
HttpUtility.UrlEncode(frameName, System.Text.Encoding.UTF8)
使用 escape(value) 方法
onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"
$.ajax({ url: actionUrl + "?Action=RemarkNum", timeout: 3000, cache: false, async: false }).responseText;
function UploadExcel() {
$.ajaxFileUpload({
url: actionUrl+"?Action=Upload",//服务器端程序
secureuri: false,
fileElementId: 'uploadFile',//input框的ID
dataType: 'json',//返回数据类型
success: function (data,statu) {//上传成功
if (data.Success == true) {
alert("更新成功"+data.Message);
} else {
alert("更新失败",data.Message);
}
}
});
//页面需要引入下方资源
<link href="/Reply/css/replycss.css" rel="stylesheet" />
<script type="text/javascript" src="/Reply/js/lodingreply.js"></script>
//html文件需要嵌入下方div
<div id="replyContent" style=" border: solid 1px #95B8E7;"></div>
<div id="yc">
<input id="ReplyId" type="hidden" />
<input type="hidden" id="ModuleName" />
<input type="hidden" id="ForeignerId" />
</div>
//js 需要加入以下代码
$("#ForeignerId").val(worksPointId);
$("#ModuleName").val("Design");
moduleReply(1);
DECLARE name CURSOR FOR
select 语句
OPEN name
fetch next from name into @Paras
while @@fetch_status<>-1
begin
--xxx 这里输入循环体语句
fetch next from name into @Paras
end
close name
deallocate name
DATEDIFF(day,'2014-10-10',createtime)<=0
var msg = new JsonMessage() {Success = true};
try
{
}
catch (DbEntityValidationException dex)
{
msg.Message = dex.Message;
msg.Success = false;
foreach (var error in dex.EntityValidationErrors)
{
msg.Message = string.Format("{0}\r\n:{1}", msg.Message, string.Join(";", error.ValidationErrors.Select(v => v.ErrorMessage)));
}
}
catch (Exception ex)
{
msg.Success = false;
var sbMsg = new StringBuilder(ex.Message);
while (ex.InnerException != null)
{
sbMsg.AppendFormat(">>{0}", ex.InnerException.Message);
ex = ex.InnerException;
}
msg.Message = sbMsg.ToString();
}
return msg;
if (string.IsNullOrEmpty(pg.Order?.OrderFields))
{
pg.Order = new Pagination.OrderBy()
{
OrderFields = "CreateTime",
OrderType = Pagination.EOrderType.DESC
};
}
AutoMapper.Mapper.DynamicMap
System.Configuration.ConfigurationManager.AppSettings
DbHelperSQL.GetSingleToString("SELECT IDENT_CURRENT('Report_TableName')");
.AsNoTracking() //该字段为了去缓存
for (int i = 0; i < context.Request.Files.Count; i++)
{
HttpPostedFile aFile = context.Request.Files[i];
if (aFile.ContentLength == 0 || String.IsNullOrEmpty(aFile.FileName))
continue;
string uploadPath = "";
fileName = aFile.FileName;
string realFileName = "";
//上传图片
{
uploadPath = Const.getConstructionDataUploadPath(timePath);
realFileName = uploadPath + fileName;
aFile.SaveAs(realFileName);
//Warterfontmark.AddTextWatermark(realFileName, realFileName, markStr);
}
}
case "eq": return " 等于 ";
case "gt": return " 大于 ";
case "ge": return " 大于等于 ";
case "nu": return " 为空 ";
case "nn": return " 不为空 ";
case "lt": return " 小于 ";
case "le": return " 小于等于 ";
case "cn": return " 包含 ";
case "ncn": return " 不包含 ";
case "bw": return " 包含 ";
case "ew": return " 包含 ";
case "ne": return " 不等于 ";
case "in": return " 包含于 ";
case "ni": return " 不包含于 ";
default: return " 等于 ";
#3CB9F8