Beispiel #1
0
        /// <summary>
        /// 导出下单报表
        /// </summary>
        /// <param name="order"></param>
        /// <param name="contract"></param>
        /// <param name="begin"></param>
        /// <param name="end"></param>
        /// <param name="person"></param>
        /// <param name="adTarget"></param>
        /// <param name="makeTarget"></param>
        public void OrderList_output(string order, string contract, string begin, string end, string person, string adTarget, string makeTarget)
        {
            DaOrderInfo dal = new DaOrderInfo();
            DataTable dt = dal.getDataTable(order, contract, begin, end, person, adTarget, makeTarget);

            if (dt.Rows.Count > 0)
            {
                string filename = "myOrderList.xls";
                System.IO.StringWriter tw = new System.IO.StringWriter();
                System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
                DataGrid dgGrid = new DataGrid();
                dgGrid.DataSource = dt;
                dgGrid.DataBind();

                //Get the HTML for the control.
                dgGrid.RenderControl(hw);
                //Write the HTML back to the browser.
                //Response.ContentType = application/vnd.ms-excel;
                Response.ContentType = "application/vnd.ms-excel";
                Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
                Response.Write(tw.ToString());
            }
            else
            {
                Response.Write("无数据可导出!");
            }

            Response.End();
        }
Beispiel #2
0
        /// <summary>
        /// 搜索下单列表
        /// </summary>
        /// <returns></returns>
        public JsonResult OrderList_search(string order, string contract, string begin, string end, string person, string adTarget, string makeTarget)
        {
            DaOrderInfo dal = new DaOrderInfo();
            IList<OrderInfo> contracts = dal.getList(order, contract, begin, end, person, adTarget, makeTarget, BaseHelper.getCookie().id.ToString());

            var result = new CustomJsonResult();
            result.dateFormat = "yyyy-MM-dd";
            result.Data = new { total = contracts.Count, rows = contracts };
            return result;
        }
Beispiel #3
0
        /// <summary>
        /// 获取下单列表
        /// </summary>
        /// <returns></returns>
        public JsonResult OrderList_getList()
        {
            DaOrderInfo dal = new DaOrderInfo();
            IList<OrderInfo> contracts = dal.getList(BaseHelper.getCookie().id.ToString());

            var result = new CustomJsonResult();
            result.dateFormat = "yyyy-MM-dd";
            result.Data = new { total = contracts.Count, rows = contracts };
            return result;
        }
Beispiel #4
0
        /// <summary>
        /// 根据订单编号获取订单信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult Order_getOrderInfo(string id)
        {
            DaOrderInfo dal = new DaOrderInfo();
            OrderInfo en = dal.getOrderInfo(id);

            var result = new CustomJsonResult();
            result.dateFormat = "yyyy-MM-dd";
            result.Data = en;
            return result;
        }
Beispiel #5
0
        /// <summary>
        /// 获取最新的订单编号
        /// </summary>
        /// <returns></returns>
        public JsonResult Order_getOrderID()
        {
            DaOrderInfo dal = new DaOrderInfo();
            string id = dal.buildOrderIDofDay();

            var result = new CustomJsonResult();
            result.Data = id;
            return result;
        }
Beispiel #6
0
        /// <summary>
        /// 获取订单列表
        /// </summary>
        /// <returns></returns>
        public JsonResult Order_getList()
        {
            DaOrderInfo dal = new DaOrderInfo();
            IList<OrderInfo> orders = dal.getList(BaseHelper.getCookie().id.ToString());

            var result = new CustomJsonResult();
            result.Data = new { total = orders.Count, rows = orders };
            return result;
        }
Beispiel #7
0
        public JsonResult Order_edit(string id, string orderID, string adCost, string makeCost, string num, string begin, string end, string memo)
        {
            if (num.Trim() == "")
                num = "0";

            OrderInfo en = new OrderInfo();
            en.id = Convert.ToInt32(id);
            en.orderID = orderID;
            en.costTargetID = Convert.ToInt32(adCost);
            en.makeTargetID = Convert.ToInt32(makeCost);
            en.roomNum = Convert.ToInt32(num);
            en.begintime = Convert.ToDateTime(begin);
            en.endtime = Convert.ToDateTime(end);
            en.memo = memo;

            DaOrderInfo dal = new DaOrderInfo();
            var result = new CustomJsonResult();
            result.Data = dal.update(en);
            return result;
        }