Exemplo n.º 1
0
        public ContentResult GetList()
        {
            int pageIndex = 1;
            int pageSize = int.MaxValue;
            string search = "";
            string str = "";
            if (pageIndex == 0)
            {
                pageIndex = 1;
            }
            var sb = new StringBuilder();

               // SMS.Model.Result.ResultContactorGroupList _rcg = new SMS.Model.Result.ResultContactorGroupList();
            var _conactorBll = new SMS.BLL.Addr.ContactorGroupManager();

              var  _rcg = _conactorBll.GetGroups(this.LoginInfo.UserID, 0, pageIndex, pageSize, search);
            if (_rcg != null && _rcg.CGroups != null && _rcg.CGroups.Count > 0)
            {

                int y = 0;
                foreach (var obj in _rcg.CGroups)
                {
                    var currentPage = Math.Floor(Convert.ToDouble(y / 10)) + 1;
                    sb.Append("<li page='" + currentPage + "'  id='li" + obj.ContactorGroupID + "' style='cursor: pointer'><div id='divShowGroup" + obj.ContactorGroupID + "' class='group-user-show' onclick=\"li_click('li" + obj.ContactorGroupID + "','" + obj.ContactorGroupName + "')\"><a>" + obj.ContactorGroupName + "</a><span id='spCount" + obj.ContactorGroupID + "' class='badge badge-hover3'>" + obj.ContactorCount + "</span><span class='badge badge-hover2' title='编辑' onclick=\"javascript:li_dblclick('" + obj.ContactorGroupID + "','" + obj.ContactorGroupName + "')\"><span><i class='icon-pencil icon-white'></i></span></span><span class='badge badge-hover' title='删除' onclick=\"javascript:li_delclick('li" + obj.ContactorGroupID + "')\" ><span><i class='icon-trash icon-white'></i></span></span></div><div style='position:relative' id='divEditGroup" + obj.ContactorGroupID + "' class='group-user-edit form-inline'><div style='padding-right:130px'><input type='text' id='txtEdit" + obj.ContactorGroupID + "' class='input-small' value='" + obj.ContactorGroupName + "'  style='width:100%;' /></div><div style='position: absolute;right:2px;top: 4px;'><input type='button' id='btnOK' onclick=\"SaveGroupByLeft('" + obj.ContactorGroupID + "')\" value='确定' class='btn btn-primary' />&nbsp;<input type='button' id='btnCancel' onclick=\"CloseGroupByLeft('" + obj.ContactorGroupID + "')\" value='取消' class='btn' /></div></div></li>");

                    y++;

                }
                str = sb.ToString();
            }
            return Content(str);
        }
Exemplo n.º 2
0
        public ContentResult GetGroupCount()
        {
            string groupId = QueryString.F("groupId");
            string search =  QueryString.F("search");
            var _conactorBll = new SMS.BLL.Addr.ContactorGroupManager();
            var _rcg = _conactorBll.GetContactorsCount(this.LoginInfo.UserID, Convert.ToInt32(groupId), 0, search);
            if (_rcg.State)
            {
                return Content(_rcg.Value.ToString());
            }

            return   Content("0");
        }