private void PopulateControls()
    {
        int userId = Convert.ToInt32(Session["UserID"]);
        string itemName = "";
        if (Request.QueryString["term"] != null && Request.QueryString["term"] != "")
        {
            itemName = Request.QueryString["term"];
        }

        ItemTableBLL bll = new ItemTableBLL();
        DataTable dt = bll.GetItemPriceListByItemName(userId, itemName);

        StringBuilder items = new StringBuilder();
        items.Append("[");

        if (dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                items.Append("{\"label\":" + "\"" + Convert.ToDouble(dr["ItemPrice"]).ToString("0.0##") + "\"},");
            }
            items.Remove(items.ToString().LastIndexOf(','), 1);
        }

        items.Append("]");

        Response.Write(items.ToString());
        Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        int    userId   = Convert.ToInt32(Session["UserID"]);
        string keywords = "";

        if (Request.QueryString["term"] != "" && Request.QueryString["term"] != null)
        {
            keywords = Request.QueryString["term"].Replace("%", "");

            StringBuilder items = new StringBuilder();
            items.Append("[");

            ItemTableBLL bll = new ItemTableBLL();
            DataTable    dt  = bll.GetItemNameListByKeywords(userId, keywords);
            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    items.Append("{");
                    items.Append("\"id\":" + "\"" + dr["ItemName"].ToString() + "\",");
                    items.Append("\"label\":" + "\"" + dr["ItemName"].ToString() + "\"");
                    items.Append("},");
                }
                items.Remove(items.ToString().LastIndexOf(','), 1);
            }

            items.Append("]");

            Response.Write(items.ToString());
            Response.End();
        }
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int userId = Convert.ToInt32(Session["UserID"]);
        string keywords = "";

        if (Request.QueryString["term"] != "" && Request.QueryString["term"] != null)
        {
            keywords = Request.QueryString["term"].Replace("%", "");

            StringBuilder items = new StringBuilder();
            items.Append("[");

            ItemTableBLL bll = new ItemTableBLL();
            DataTable dt = bll.GetItemNameListByKeywords(userId, keywords);
            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    items.Append("{");
                    items.Append("\"id\":" + "\"" + dr["ItemName"].ToString() + "\",");
                    items.Append("\"label\":" + "\"" + dr["ItemName"].ToString() + "\"");
                    items.Append("},");
                }
                items.Remove(items.ToString().LastIndexOf(','), 1);
            }

            items.Append("]");

            Response.Write(items.ToString());
            Response.End();
        }
    }
    private void PopulateControls()
    {
        int userId    = Convert.ToInt32(Session["UserID"]);
        int catTypeId = 0;

        if (Request.QueryString["term"] != null && Request.QueryString["term"] != "")
        {
            catTypeId = Convert.ToInt32(Request.QueryString["term"]);
        }

        ItemTableBLL bll = new ItemTableBLL();
        DataTable    dt  = bll.GetItemNameListByCategoryId(userId, catTypeId);

        StringBuilder items = new StringBuilder();

        items.Append("[");

        if (dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                items.Append("{\"label\":" + "\"" + dr["ItemName"].ToString() + "\"},");
            }
            items.Remove(items.ToString().LastIndexOf(','), 1);
        }

        items.Append("]");

        Response.Write(items.ToString());
        Response.End();
    }
    private void PopulateControls()
    {
        int userId = Convert.ToInt32(Session["UserID"]);
        int catTypeId = 0;
        if (Request.QueryString["term"] != null && Request.QueryString["term"] != "")
        {
            catTypeId = Convert.ToInt32(Request.QueryString["term"]);
        }

        ItemTableBLL bll = new ItemTableBLL();
        DataTable dt = bll.GetItemNameListByCategoryId(userId, catTypeId);

        StringBuilder items = new StringBuilder();
        items.Append("[");

        if (dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                items.Append("{\"label\":" + "\"" + dr["ItemName"].ToString() + "\"},");
            }
            items.Remove(items.ToString().LastIndexOf(','), 1);
        }

        items.Append("]");

        Response.Write(items.ToString());
        Response.End();
    }
    private void PopulateControls()
    {
        int    userId   = Convert.ToInt32(Session["UserID"]);
        string itemName = "";

        if (Request.QueryString["term"] != null && Request.QueryString["term"] != "")
        {
            itemName = Request.QueryString["term"];
        }

        ItemTableBLL bll = new ItemTableBLL();
        DataTable    dt  = bll.GetItemPriceListByItemName(userId, itemName);

        StringBuilder items = new StringBuilder();

        items.Append("[");

        if (dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                items.Append("{\"label\":" + "\"" + Convert.ToDouble(dr["ItemPrice"]).ToString("0.0##") + "\"},");
            }
            items.Remove(items.ToString().LastIndexOf(','), 1);
        }

        items.Append("]");

        Response.Write(items.ToString());
        Response.End();
    }
        // GET api/<controller>
        public async Task <IHttpActionResult> Get([FromUri] DataSourceLoadOptions loadOptions)
        {
            ItemTableBLL bll     = new ItemTableBLL();
            var          results = bll.GetAll();

            loadOptions.PrimaryKey = new[] { "ItemID" };
            //loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(results, loadOptions)));
        }
        // GET api/<controller>
        public DataSourceResult Get([FromUri] DataSourceRequest request)
        {
            var grid = new DataSourceResult();

            try
            {
                ItemTableBLL bll = new ItemTableBLL();
                grid = bll.GetDapperDataSource(request);
            }
            catch (Exception ex)
            {
                grid.Errors = "加载出错!";
                log.Info(ex);
            }

            return(grid);
        }
示例#9
0
    //搜索按钮
    protected void SubmitButtom_Click(object sender, EventArgs e)
    {
        int userId = Convert.ToInt32(Session["UserID"]);

        string keywords = this.Keywords.Text.Trim().Replace("%", "");

        if (keywords == "")
        {
            Utility.Alert(this, "关键字不能为空!");
            return;
        }

        ItemTableBLL bll   = new ItemTableBLL();
        DataTable    lists = bll.GetItemListByKeywords(userId, keywords);

        SearchItemList.DataSource = lists;
        SearchItemList.DataBind();

        //更新总价
        UpdateTotalPrice(lists);
    }
    private void PopulateControls()
    {
        int userId = Convert.ToInt32(Session["UserID"]);

        string begin = Request.QueryString["begin"];
        string end   = Request.QueryString["end"];

        string begin2 = Request.QueryString["begin2"];
        string end2   = Request.QueryString["end2"];

        string query = Request.QueryString["query"];
        string sub   = Request.QueryString["sub"];

        string sort = Request.QueryString["sort"];
        string by   = Request.QueryString["by"];

        ItemTableBLL bll      = new ItemTableBLL();
        DataTable    newlists = new DataTable();
        DataTable    lists    = bll.GetItemListByCompare(userId, Convert.ToDateTime(begin), Convert.ToDateTime(end), Convert.ToDateTime(begin2), Convert.ToDateTime(end2), query, sub, "asc");

        if (lists.Rows.Count > 0)
        {
            DataRow[] rows = lists.Select("1=1", string.Format("{0} {1}", sort, by));
            if (rows.Length > 0)
            {
                newlists = rows.CopyToDataTable();
            }
        }

        StringBuilder items = new StringBuilder();

        items.Append("<table border=\"0\" class=\"tablelist\">");
        if (lists.Rows.Count > 0)
        {
            foreach (DataRow dr in newlists.Rows)
            {
                items.Append("<tr>");
                items.Append("<td style=\"width:140px;\">" + dr["MyLabel"].ToString() + "</td>");
                items.Append("<td style=\"width:116px;\" class=\"countcolor\">" + dr["CountNumPrev"].ToString() + "</td>");
                items.Append("<td style=\"width:116px;\" class=\"countcolor\">" + dr["CountNumCur"].ToString() + "</td>");
                items.Append("<td style=\"width:116px;\" class=\"shoucolor\">" + QueryHelper.GetPriceDot(dr["ShouRuPricePrev"], "sr") + "</td>");
                items.Append("<td style=\"width:116px;\" class=\"shoucolor\">" + QueryHelper.GetPriceDot(dr["ShouRuPriceCur"], "sr") + "</td>");
                items.Append("<td style=\"width:116px;\" class=\"zhicolor\">" + QueryHelper.GetPriceDot(dr["ZhiChuPricePrev"], "zc") + "</td>");
                items.Append("<td style=\"width:116px;\" class=\"zhicolor\">" + QueryHelper.GetPriceDot(dr["ZhiChuPriceCur"], "zc") + "</td>");
                if (sub == "ItemBuyDate")
                {
                    items.Append("<td class=\"cellleft\"><a href=\"ItemQuery.aspx?date=" + dr["MyLabel"].ToString() + "&showType=d\" class=\"baselink\">查看</a></td>");
                }
                else if (sub == "ItemName")
                {
                    items.Append("<td class=\"cellleft\"><a href=\"javascript:void(0);\" class=\"itemdown baselink\" ref=\"" + dr["MyLabel"].ToString() + "\" query=\"" + query + "\">展开</a></td>");
                }
                else
                {
                    items.Append("<td class=\"cellleft\"><a href=\"javascript:void(0);\" class=\"detaildown baselink\" ref=\"" + dr["MyLabel"].ToString() + "\" query=\"" + query + "\">展开</a></td>");
                }
                items.Append("</tr>");
            }
        }
        else
        {
            items.Append("<tr>");
            items.Append("<td colspan=\"9\">没有消费记录。</td>");
            items.Append("</tr>");
        }
        items.Append("</table>");

        Response.Write(items.ToString());
        Response.End();
    }
示例#11
0
 public void Init()
 {
     bll = new ItemTableBLL();
 }
示例#12
0
    private void PopulateControls()
    {
        int userId = Convert.ToInt32(Session["UserID"]);

        string begin = Request.QueryString["begin"];
        string end = Request.QueryString["end"];

        string query = Request.QueryString["query"];
        string sub = Request.QueryString["sub"];

        string sort = Request.QueryString["sort"];
        string by = Request.QueryString["by"];

        ItemTableBLL bll = new ItemTableBLL();
        DataTable newlists = new DataTable();
        DataTable lists = bll.GetItemListByGroup(userId, Convert.ToDateTime(begin), Convert.ToDateTime(end), query, sub, "asc");
        if (lists.Rows.Count > 0)
        {
            DataRow[] rows = lists.Select("1=1", string.Format("{0} {1}", sort, by));
            if (rows.Length > 0)
            {
                newlists = rows.CopyToDataTable();
            }
        }

        StringBuilder items = new StringBuilder();

        items.Append("<table border=\"0\" class=\"tablelist\">");
        if (lists.Rows.Count > 0)
        {
            foreach (DataRow dr in newlists.Rows)
            {
                items.Append("<tr>");
                items.Append("<td style=\"width:140px;\">" + dr["MyLabel"].ToString() + "</td>");
                items.Append("<td style=\"width:100px;\" class=\"countcolor\">" + dr["CountNum"].ToString() + "</td>");
                items.Append("<td style=\"width:100px;\" class=\"shoucolor\">" + QueryHelper.GetPriceDot(dr["ShouRuPrice"], "sr") + "</td>");
                items.Append("<td style=\"width:100px;\" class=\"zhicolor\">" + QueryHelper.GetPriceDot(dr["ZhiChuPrice"], "zc") + "</td>");
                items.Append("<td style=\"width:100px;\" class=\"shoucolor\">" + QueryHelper.GetPriceDot(dr["JieRuPrice"], "jr") + "</td>");
                items.Append("<td style=\"width:100px;\" class=\"zhicolor\">" + QueryHelper.GetPriceDot(dr["HuanChuPrice"], "hc") + "</td>");
                items.Append("<td style=\"width:100px;\" class=\"shoucolor\">" + QueryHelper.GetPriceDot(dr["HuanRuPrice"], "hr") + "</td>");
                items.Append("<td style=\"width:100px;\" class=\"zhicolor\">" + QueryHelper.GetPriceDot(dr["JieChuPrice"], "jc") + "</td>");
                if (sub == "ItemBuyDate")
                {
                    items.Append("<td class=\"cellleft\"><a href=\"ItemQuery.aspx?date=" + dr["MyLabel"].ToString() + "&showType=d\" class=\"baselink\">查看</a></td>");
                }
                else if (sub == "ItemName")
                {
                    items.Append("<td class=\"cellleft\"><a href=\"javascript:void(0);\" class=\"itemdown baselink\" ref=\"" + dr["MyLabel"].ToString() + "\" query=\"" + query + "\">展开</a></td>");
                }
                else
                {
                    items.Append("<td class=\"cellleft\"><a href=\"javascript:void(0);\" class=\"detaildown baselink\" ref=\"" + dr["MyLabel"].ToString() + "\" query=\"" + query + "\">展开</a></td>");
                }
                items.Append("</tr>");
            }
        }
        else
        {
            items.Append("<tr>");
            items.Append("<td colspan=\"9\">没有消费记录。</td>");
            items.Append("</tr>");
        }
        items.Append("</table>");

        Response.Write(items.ToString());
        Response.End();
    }
示例#13
0
    //搜索按钮
    protected void SubmitButtom_Click(object sender, EventArgs e)
    {
        int userId = Convert.ToInt32(Session["UserID"]);

        string keywords = this.Keywords.Text.Trim().Replace("%", "");
        if (keywords == "")
        {
            Utility.Alert(this, "关键字不能为空!");
            return;
        }

        ItemTableBLL bll = new ItemTableBLL();
        DataTable lists = bll.GetItemListByKeywords(userId, keywords);
        SearchItemList.DataSource = lists;
        SearchItemList.DataBind();

        //更新总价
        UpdateTotalPrice(lists);
    }
示例#14
0
 public void Init()
 {
     bll = new ItemTableBLL();
 }