Example #1
0
    public void FindAllOrder()
    {
        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  OrderStatus  = Context.Request.Form["OrderStatus"];//by tony add 2017-6-6
        string  contract     = Context.Request.Form["contract"];
        string  startTime    = Context.Request.Form["startTime"];
        string  endTime      = Context.Request.Form["endTime"];
        int     count        = _bal.FindAllOrderCount(orderNo, partsdrawing, startTime, endTime, OrderStatus, contract);
        DataSet ds           = _bal.FindAllOrder(orderNo, partsdrawing, startTime, endTime, rows, page, OrderStatus, contract);

        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));
    }