码迷,mamicode.com
首页 > Web开发 > 详细

【盟友88物通网——物流专线管理】jquery循环Reaper某一列的值

时间:2014-07-09 16:10:38      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   java   color   strong   

VIEW

bubuko.com,布布扣
                <table id="table_list" width="720" class="tb2" cellpadding="0" cellspacing="0">
                  <tr >
                      <td class="dh strong" width="40"><input type="checkbox" ></td>
                    <td class="dh strong" width="100">搬出省市</td>
                    <td class="dh strong" width="100">搬入省市</td>
                    <td class="dh strong" width="50">联系人</td>
                    <td class="dh strong" width="80">联系电话</td>
                    <td class="dh strong" width="80">发布日期</td>
                @*    <td class="dh strong" width="80">信息竞价</td>*@                   
                    <td class="dh strong" width="50">搬家状态</td>
                    <td class="dh strong" width="50">操作</td>
                    <td class="dh strong" width="30">查看</td>
                    <td class="dh strong" width="30">修改</td>
                    <td class="dh strong" width="50">删除</td>
                  </tr>
                  @foreach (var item in Model)
                  {
                      <tr id="tr_list1" data="@item.Id" data1="@item.Type">
                          <td width="40"><input type="checkbox" ></td>
                        <td>@item.StartArea</td>
                        <td>@item.EndArea</td>
                        <td>@item.LinkName</td>
                        <td style="line-height:15px;">@item.LinkPhone<br>@item.LinkMobile</td>
                        <td>@String.Format("{0:yyyy-MM-dd}", item.AddDate)</td>
                      @*  <td><input type="button" class="btn2"></td>*@
                        <td >@((item.Type) == true ? "已搬" : "未搬")</td>
                        <td><input type="button"  value="@((item.Type) == true ? "确认未搬" : "确认已搬")"  class="btnUpdateMoved" ></td>
                        <td><a href="/MoveHouseInfo/@item.Id"><img src="/images/find.png" width="19" height="19"></a></td>
                        <td><a href="/Member/PublishMoveHouseInfo/?type=get&id=@item.Id"><img src="/images/xg.png" width="16" height="16"></a></td>
                        <td><a href="javascript:void" class="del"><img src="/images/del.png" width="19" height="19"></a></td>
                      </tr>
                  }
                </table>
View Code
<script type="text/javascript">
    $(function () {
        $(".btnUpdateMoved").click(function () {
            var $parent = $(this).parent().parent();
            var _id = $parent.attr("data");
            var _type = $parent.attr("data1");
            $.post("/Member/UpdateType/", { id: _id, type: _type }, function (json) {
                if (json.code == 0) {
                    //成功     
                    location = location;                              
                    return true;
                }
                else {
                    //失败
                    alert(json.msg);
                    return false;
                }
            });
            $parent.each(function () {
                $parent.find("td:eq(6)").each(function () {
                    if ($(this).html() == "已搬") {
                        $(this).html("未搬");
                    }
                    else {
                        $(this).html("已搬");
                    }
                });
            });
        });
        $(".del").click(function () {
            if (confirm("确实要删除此记录?")) {
                var $this = $(this).parent().parent();
                var _id = $this.attr("data");
                $.post("/Member/DelMoveHouseInfo/", { id: _id }, function (json) {
                    if (json.code == 0) {
                        //成功
                        $this.remove();
                        return true;
                    }
                    else {
                        //失败
                        alert(json.msg);
                        return false;
                    }
                });
            }
        });
    });    
</script>

Control

 //修改专线状态  
        public JsonResult UpdateSpecial(int id, bool special)
        {
            special = special == true ? false : true;
            if (Models.DAL.ExpressLine.UpdateSpecial(id, special) > 0)
            {

                return Json(new { code = 0, msg = "" });
            }
            else
            {
                return Json(new { code = 1, msg = "修改失败" });
            }

        }      

SQLServerDAL

        #region 修改快递线路状态
        /// <summary>
        ///根据自动编号、快递线路状态修改快递线路信息
        /// </summary>
        /// <param name="Id">自动编号</param>
        /// <param name="IsSpecial">是否专线</param>
        /// <returns></returns>

        public int UpdateSpecial(int Id, bool IsSpecial)
        {            
            string str = string.Format("update ExpressLine set IsSpecial={0} where Id={1}", Convert.ToInt32(IsSpecial), Id);
            return DBUtility.SqlHelper.ExecuteNonQuery(ConnString.conn, CommandType.Text, str, null);
        }
        #endregion

 

【盟友88物通网——物流专线管理】jquery循环Reaper某一列的值,布布扣,bubuko.com

【盟友88物通网——物流专线管理】jquery循环Reaper某一列的值

标签:style   blog   http   java   color   strong   

原文地址:http://www.cnblogs.com/haozhenjie819/p/3832069.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!