一些东西!!
换地方工作,我的CSDN博客怎么打不开,一些东西先记到这吧:
js重锚点并刷新页面
<script type="text/javascript">
var url = location.href;
//aflag是父页面传的锚点
if (url.indexOf("aflag") > 0) {
url = url.substring(0, url.indexOf("aflag") - 1);
}
if (url.indexOf("#") > 0) {
url = url.substring(0, url.indexOf("#"));
}
if("<%=aflag %>"!="")
{
location.href=url+"#<%=aflag %>";
}
</script>
父页面传值:
var url = parent.location.href;
if (url.indexOf(""aflag"") > 0) {
url = url.substring(0, url.indexOf(""aflag"") - 1);
}
if (url.indexOf(""#"") > 0) {
url = url.substring(0, url.indexOf(""#""));
}
parent.location.href=url+'&aflag=" + VendItemId + @"';
//四舍五入 v表示要转换的值 e表示要保留的位数
function round(v, e) {
var t = 1;
for (; e > 0; t *= 10, e--);
for (; e < 0; t /= 10, e++);
return Math.round(v * t) / t;
}
/// <summary>
/// 执行添加事务
/// </summary>
/// <param name="sqls"></param>
/// <returns></returns>
public int AddList(List<String> sqls)
{
return DbHelperSQL.ExecuteSqlTran(sqls);
}
BLL.cs
/// <summary>
/// 执行添加事务
/// </summary>
/// <param name="sqls"></param>
/// <returns></returns>
public bool AddList(List<M_Pact_ItemMoney> list)
{
List<String> sqls = new List<String>();
foreach (M_Pact_ItemMoney model in list)
{
sqls.Add(@" insert into Pact_ItemMoney(PactCode,ItemName,ItemCent)
values
('" + model.PactCode + @"','" + model.ItemName + @"','" + model.ItemCent + @"')");
}
if (dal.AddList(sqls) > 0)
{
return true;
}
else
{
return false;
}
}
sql添加字段并加备注、默认值
ALTER TABLE Pact ADD ReceiveOtherPrice numeric(18,2) default 0
GO
EXEC sp_addextendedproperty 'MS_Description', @value=N'验收其他费用' ,@level0type=N'USER', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Pact', @level2type=N'COLUMN', @level2name=N'ReceiveOtherPrice'
------解决方案--------------------那你结贴吧,嘿嘿。
------解决方案--------------------还有这种情况,
------解决方案--------------------这是啥情况
------解决方案--------------------呵呵 楼主真有意思