Exemplo n.º 1
0
    public void FindAllPublishOrder()
    {
        string  rows         = Context.Request.Form["rows"];
        string  page         = Context.Request.Form["page"];
        string  orderNo      = Context.Request.Form["orderNo"];
        string  partsdrawing = Context.Request.Form["partsdrawing"];
        string  startTime    = Context.Request.Form["startTime"];
        string  endTime      = Context.Request.Form["endTime"];
        int     count        = _bal.FindAllPublishOrderCount(orderNo, partsdrawing, startTime, endTime);
        DataSet ds           = _bal.FindAllPublishOrder(orderNo, partsdrawing, startTime, endTime, rows, page);

        if (ds != null && ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (ds.Tables[0].Rows[i]["CREATED_BY"] != null)
                {
                    ds.Tables[0].Rows[i]["CREATED_BY"] = FindUserNameByCode(ds.Tables[0].Rows[i]["CREATED_BY"].ToString());
                }
            }
        }
        Dictionary <String, Object> map = new Dictionary <String, Object>();

        //if (count > 0)
        //{

        map.Add("total", count);
        map.Add("rows", ds.Tables[0]);


        //}
        Context.Response.Write(JsonConvert.SerializeObject(map));
    }