Exemplo n.º 1
0
        protected override void OnRequest()
        {
            base.OnRequest();

            try
            {
                MerchantOrderDetail orderDetail = getModel <MerchantOrderDetail>("model");

                /*
                 * MerchantOrderDetail orderDetail = new MerchantOrderDetail();
                 * orderDetail.amount = 1234;
                 * orderDetail.amounttype = 0;
                 * orderDetail.buyerid = 11;
                 * orderDetail.comment = "按时发货";
                 * orderDetail.merchantid = 1;
                 * orderDetail.orderdate = DateTime.Now;
                 * orderDetail.orderlist = "圆钢1吨,角钢1吨";
                 */

                string OrderID = new Controller.Order().NewMerchantOrder(orderDetail);

                string message = string.Format("您有新的订单:\r\n日期:{0}\r\n清单:{1}\r\n价格({2}):{3}元", DateTime.Now, orderDetail.orderlist, orderDetail.amounttype == 0?"理论":"实际", orderDetail.amount);

                MerchantModel merchantInfo = new Controller.Merchant().GetMerchantInfo((uint)orderDetail.merchantid);

                new Controller.Message().AddMessage(merchantInfo.aid, message, orderDetail.buyerid, Controller.Message.MESSAGE_STATUS.UNREACH, Controller.Message.MESSAGE_STYLE.INFORMATION, "订单", Controller.Message.MESSAGE_TYPE.CHAT);

                WriteSuccess <string>(OrderID);
            }catch (Exception ex)
            {
                WriteException(ex);
            }
        }
Exemplo n.º 2
0
        protected override void OnRequest()
        {
            base.OnRequest();

            try
            {
                CargoOrderDetail orderDetail = getModel <CargoOrderDetail>("model");

                /*
                 * CargoOrderDetail orderDetail = new CargoOrderDetail();
                 * orderDetail.amount = 1234;
                 * orderDetail.buyerid = 11;
                 * orderDetail.comment = "按时发货";
                 * orderDetail.cargoid = 1;
                 * orderDetail.orderdate = DateTime.Now;
                 */


                string OrderID = new Controller.Order().NewCargoOrder(orderDetail);

                string message = string.Format("您有新的订单:\r\n日期:{0}\r\n留言:{1}\r\n价格:{2}元",
                                               DateTime.Now, orderDetail.comment, orderDetail.amount);

                CargoModel cargoInfo = new Controller.Cargo().GetCargoInfo((uint)orderDetail.cargoid);

                new Controller.Message().AddMessage(cargoInfo.aid, message, orderDetail.buyerid, Controller.Message.MESSAGE_STATUS.UNREACH, Controller.Message.MESSAGE_STYLE.INFORMATION, "订单", Controller.Message.MESSAGE_TYPE.CHAT);


                WriteSuccess <string>(OrderID);
            }
            catch (Exception ex)
            {
                WriteException(ex);
            }
        }
        protected override void OnRequest()
        {
            base.OnRequest();

            try
            {
                CargoOrderHistoryModel orderHistoryList = new Controller.Order().GetSellCargoHistory(this.aid);
                WriteSuccess <CargoOrderHistoryModel>(orderHistoryList);
            }
            catch (UnfulfilException ex)
            {
                WriteUnfulfil(ex.DisplayMessage);
            }
            catch (Database.Exception ex)
            {
                WriteException(ex);
            }
            catch (Exception ex)
            {
                WriteException(ex);
            }
        }