示例#1
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <param name="paging"></param>
 /// <param name="condition"></param>
 /// <returns></returns>
 public static List<CateAttrValueExpandInfo> GetCateAttrValueList(Paging paging, string condition)
 {
     string sql = string.Format("select * from [Cate_View_Attr] {0}", condition);
     var result = db.Page<CateAttrValueExpandInfo>(paging.PageIndex, paging.PageSize, sql);
     paging.RecordCount = result.TotalItems;
     return result.Items;
 }
示例#2
0
 /// <summary>
 /// 获取系统错误信息列表
 /// </summary>
 /// <param name="paging"></param>
 /// <param name="condition"></param>
 /// <returns></returns>
 public static List<ErrorInfo> GetErrorList(Paging paging, string condition)
 {
     string sql = string.Format("select * from [Error] {0}", condition);
     var result = db.Page<ErrorInfo>(paging.PageIndex, paging.PageSize, sql);
     paging.RecordCount = result.TotalItems;
     return result.Items;
 }
示例#3
0
        private void Bind()
        {
            int status = RequestHelper.QueryInt("searchStatus");
            string keytype = RequestHelper.Query("keytype");
            string keyword = RequestHelper.Query("keyword");

            List<string> statusResult = BaseStatusCtrl.GetStatusHtml(status);
            this.searchStatus.Text = statusResult[0];
            this.selectStatus.Text = statusResult[1];
            this.targetStatus.Text = statusResult[2];

            StringBuilder condition = new StringBuilder("where 1=1");

            if (status != (int)BaseStatus.全部)
            {
                condition.AppendFormat("and status={0}", status);
            }

            if (!string.IsNullOrEmpty(keytype) && !string.IsNullOrEmpty(keyword))
            {
                switch (keytype)
                {
                    case "attrId":
                        condition.AppendFormat(" and AttrId={0}", Utils.StrToInt(keyword));
                        break;
                    case "attr":
                        condition.AppendFormat(" and attr='{0}'", keyword);
                        break;
                    case "valueId":
                        condition.AppendFormat(" and ValueId={0}", Utils.StrToInt(keyword));
                        break;
                    case "value":
                        condition.AppendFormat(" and Value='{0}'", keyword);
                        break;
                }
                this.keytype.Value = keytype;
                this.keyword.Value = keyword;

            }
            condition.AppendFormat(" order by ValueId desc");

            Paging paging = new Paging(30);
            this.DateList.DataSource = AttrValueService.GetAttrValueList(paging, condition.ToString());
            this.DateList.DataBind();
            this.paging.Text = paging.GetHtml();
        }
示例#4
0
        private void Get()
        {
            int size = RequestHelper.QueryInt("pageSize");
            StringBuilder sb = new StringBuilder();
            StringBuilder sbb = new StringBuilder();
            Paging paging = new Paging(size);
            List<AttachmentInfo> list = AttachmentCtrl.GetAttachmentList(paging, "order by CreateTime desc");

            foreach (AttachmentInfo info in list)
            {
                sbb.Append(",{");
                sbb.AppendFormat("src: '{0}'", ImageHelper.GetPhotoUrl(info.Url, 100, 100, 0));
                sbb.Append("}");
            }

            if (sbb.Length > 0)
            {
                sbb.Remove(0, 1);
            }

            sb.Append("{");
            sb.AppendFormat("count: {0}", paging.RecordCount);
            sb.AppendFormat(",size: {0}", paging.PageSize);
            sb.AppendFormat(",page: {0}", paging.PageIndex);
            sb.AppendFormat(",list: [{0}]", sbb.ToString());
            sb.Append("}");
            Response.Write(sb.ToString());
            Response.End();
        }
示例#5
0
 /// <summary>
 /// 获取扩展列表
 /// </summary>
 /// <param name="paging"></param>
 /// <param name="condition"></param>
 /// <returns></returns>
 public List<AttrValueExpandInfo> GetAttrValueExpandList(Paging paging, string condition)
 {
     return _attrValueMapper.GetExpandList(paging,condition);
 }
示例#6
0
        private void Bind()
        {
            int status = RequestHelper.QueryInt("searchStatus");
            string keytype = RequestHelper.Query("keytype");
            string keyword = RequestHelper.Query("keyword");
            int cateId = RequestHelper.QueryInt("cateList");

            List<string> statusResult = BaseStatusCtrl.GetStatusHtml(status);
            this.searchStatus.Text = statusResult[0];
            this.selectStatus.Text = statusResult[1];
            this.targetStatus.Text = statusResult[2];

            Dictionary<int, string> categoryList = CateService.GetCateDropList("cateList", 0, 0);
            this.cateList.DataSource = categoryList;
            this.cateList.DataValueField = "Key";
            this.cateList.DataTextField = "Value";
            this.cateList.DataBind();
            this.cateList.Items.Insert(0, new ListItem("请选择", ""));

            this.targetCateList.DataSource = categoryList;
            this.targetCateList.DataValueField = "Key";
            this.targetCateList.DataTextField = "Value";
            this.targetCateList.DataBind();

            StringBuilder condition = new StringBuilder("where 1=1");

            if (status != (int)BaseStatus.全部)
            {
                condition.AppendFormat("and status={0}", status);
            }

            if (cateId > 0)
            {
                CateInfo categoryInfo = CateService.GetCateInfo(cateId);
                if (categoryInfo != null)
                {
                    condition.AppendFormat(" and Lid={0} and Rid={1}", categoryInfo.Lid, categoryInfo.Rid);
                    this.cateList.Value = cateId.ToString();
                }
            }

            if (!string.IsNullOrEmpty(keytype) && !string.IsNullOrEmpty(keyword))
            {
                switch (keytype)
                {
                    case "attrId":
                        condition.AppendFormat(" and AttrId={0}", Utils.StrToInt(keyword));
                        break;
                    case "attr":
                        condition.AppendFormat(" and Attr='{0}'", keyword);
                        break;
                }
                this.keytype.Value = keytype;
                this.keyword.Value = keyword;

            }
            condition.AppendFormat(" order by AttrId desc");

            Paging paging = new Paging(30);
            this.DateList.DataSource = AttrService.GetAttrList(paging, condition.ToString());
            this.DateList.DataBind();
            this.paging.Text = paging.GetHtml();
        }