Example #1
0
 public void DelList()
 {
     string idlist = Parameters["pparm"];
     PortalProductListBiz biz = new PortalProductListBiz();
     ErrorEntity ErrInfo = new ErrorEntity();
     biz.Delete(idlist, out ErrInfo);
     Response.Write(ErrInfo.ToJson());
 }
Example #2
0
 public void GetGridData()
 {
     string _searchcontent = "";
     string _sortname = "";
     string _sortdirection = "";
     string _pagenumber = "";
     string _pagesize = "";
     _searchcontent = Parameters["psearchcontent"];
     _sortname = Parameters["psortname"];
     if (!string.IsNullOrEmpty(_sortname))
     {
         sSortName = _sortname;
     }
     _sortdirection = Parameters["psortdirection"];
     if (!string.IsNullOrEmpty(_sortdirection))
     {
         sSortDirection = _sortdirection;
     }
     _pagenumber = Parameters["ppagenumber"];
     if (!string.IsNullOrEmpty(_pagenumber))
     {
         sPageIndex = Convert.ToInt32(_pagenumber);
     }
     _pagesize = Parameters["ppagesize"];
     if (!string.IsNullOrEmpty(_pagesize))
     {
         sPageSize = Convert.ToInt32(_pagesize);
     }
     List<PortalProductList> lists = new List<PortalProductList>();
     PortalProductListBiz biz = new PortalProductListBiz();
     string _searchtext = _searchcontent;
     string _parentid = Parameters["pparentid"];
     string wheresql = "";
     if (string.IsNullOrEmpty(_parentid) || _parentid == "0")
     {
         wheresql = "(FParentListId is null)";
     }
     else
     {
         wheresql = "(FParentListId = " + _parentid + ")";
     }
     if (!string.IsNullOrEmpty(_searchtext))
     {
         wheresql += " and (FProductListName like '%" + _searchtext + "%')";
     }
     NameValueCollection where = new NameValueCollection();
     where.Add("condition", wheresql);
     NameValueCollection orderby = new NameValueCollection();
     orderby.Add(_sortname, _sortdirection);
     Int32 totalcount = 0;
     lists = biz.Select(where, orderby, Convert.ToInt32(sPageIndex), Convert.ToInt32(sPageSize), out totalcount);
     string datasource = Utils.GetRepeaterDatasource(lists, sPageIndex, sPageSize, totalcount);
     Response.Write(datasource);
 }
 public void GetListTitleName()
 {
     string _id = Parameters["plistid"];
     if (string.IsNullOrEmpty(_id) || _id == "0")
     {
         Response.Write("根目录");
     }
     else
     {
         string _titlename = "";
         PortalProductListBiz biz = new PortalProductListBiz();
         biz.GetListName(_id, ref _titlename);
         Response.Write(_titlename);
     }
 }
 public void GetProductList()
 {
     List<PortalProductListTree> lists = new List<PortalProductListTree>();
     List<PortalProductList> lists1 = new List<PortalProductList>();
     PortalProductListBiz biz = new PortalProductListBiz();
     lists1 = biz.Select();
     PortalProductListTreeBiz treebiz = new PortalProductListTreeBiz();
     lists = treebiz.select(lists1);
     PortalProductListTree newitem = new PortalProductListTree();
     newitem.FParentListId = 0;
     newitem.FProductListName = "根目录";
     newitem.FProductListOrder = 10;
     newitem.FParentListId = 0;
     newitem.children = lists;
     List<PortalProductListTree> newlists = new List<PortalProductListTree>();
     newlists.Add(newitem);
     string datasource = treebiz.ConvertToJson(newlists);
     Response.Write(datasource);
 }
 private void Getwheresql(string _listid, ref string _sqlwhere)
 {
     if (!string.IsNullOrEmpty(_sqlwhere))
     {
         _sqlwhere += " or ";
     }
     _sqlwhere += "(FProductListID =" + _listid + ")";
     NameValueCollection where = new NameValueCollection();
     where.Add("FParentListId", _listid);
     PortalProductListBiz biz = new PortalProductListBiz();
     List<PortalProductList> lists = new List<PortalProductList>();
     lists = biz.Select(where);
     foreach (PortalProductList item in lists)
     {
         Getwheresql(item.FProductListID.ToString(), ref _sqlwhere);
     }
 }
Example #6
0
 public void GetListItem()
 {
     string id = Parameters["pid"];
     PortalProductListBiz biz = new PortalProductListBiz();
     PortalProductList item = new PortalProductList();
     item = biz.Select(id);
     Response.Write(item.ToJson());
 }
Example #7
0
 public void SaveItem()
 {
     string _id = Parameters["plistid"];
     string _name = Parameters["plistname"];
     string _parentid = Parameters["pparentid"];
     string _order = Parameters["porder"];
     PortalProductList item = new PortalProductList();
     item.FProductListID = Convert.ToInt64(_id);
     item.FProductListName = _name;
     item.FProductListOrder = Convert.ToInt32(_order);
     item.FParentListId = Convert.ToInt64(_parentid);
     PortalProductListBiz biz = new PortalProductListBiz();
     ErrorEntity ErrInfo = new ErrorEntity();
     if (item.FProductListID == 0)
     {
         biz.Insert(item, out ErrInfo);
     }
     else
     {
         biz.Update(item, out ErrInfo);
     }
     Response.Write(ErrInfo.ToJson());
 }
Example #8
0
 public void GetParentId()
 {
     string id = Parameters["pchildid"];
     PortalProductListBiz biz = new PortalProductListBiz();
     PortalProductList item = new PortalProductList();
     item = biz.Select(id);
     if (item == null)
     {
         Response.Write("0");
     }
     else
     {
         if (string.IsNullOrEmpty(item.FParentListId.ToString()))
         {
             Response.Write("0");
         }
         else
         {
             Response.Write(item.FParentListId.ToString());
         }
     }
 }