Ejemplo n.º 1
0
    /// <summary>
    /// 更新订单
    /// </summary>
    /// <returns></returns>
    public Dictionary <string, object> UpdateOrdersStatus()
    {
        Dictionary <string, object> dicResult = new Dictionary <string, object>();

        if (!Request.Params.AllKeys.Contains("ordersId") ||
            !Request.Params.AllKeys.Contains("orderStatus") || !Request.Params.AllKeys.Contains("staFlag") ||
            !Request.Params.AllKeys.Contains("staMessage"))
        {
            dicResult.Add("response_id", 0);
            dicResult.Add("response_msg", "接口缺少参数!");
            return(dicResult);
        }

        var token       = Request["token"];
        var ordersId    = Convert.ToInt32(Request["ordersId"]);
        var orderStatus = Convert.ToInt32(Request["orderStatus"]);
        var staFlag     = Convert.ToInt32(Request["staFlag"]);
        var staMessage  = Request["staMessage"];

        //var picList = Request["PicList"];
        if (!new Sys.BLL.Account().CheckToken(token))
        {
            dicResult.Add("response_id", 0);
            dicResult.Add("response_msg", "Token验证失败!");
            return(dicResult);
        }

        string message;
        var    bllOrder = new Sys.BLL.Orders();

        if (!bllOrder.OrdersStatusCheck(ordersId, orderStatus, staFlag, out message))
        {
            dicResult.Add("response_id", 0);
            dicResult.Add("response_msg", message);
        }
        else
        {
            var picList = UploadPhotos();
            var result  = bllOrder.UpdateOrdersStatus(ordersId, orderStatus, staFlag, picList, staMessage);
            if (result)
            {
                dicResult.Add("response_id", 1);
                dicResult.Add("response_msg", "订单状态更新成功!");
            }
        }

        return(dicResult);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 更新订单
    /// </summary>
    /// <param name="dicParams"></param>
    /// <returns></returns>
    public Dictionary <string, object> UpdateOrdersStatus(Dictionary <string, object> dicParams)
    {
        Dictionary <string, object> dicResult = new Dictionary <string, object>();

        //int ordersId, string orderStatus, int staFlag
        if (!dicParams.ContainsKey("token") || !dicParams.ContainsKey("ordersId") ||
            !dicParams.ContainsKey("orderStatus") || !dicParams.ContainsKey("staFlag") ||
            !dicParams.ContainsKey("PicList") || !dicParams.ContainsKey("staMessage"))
        {
            dicResult.Add("response_id", 0);
            dicResult.Add("response_msg", "接口缺少参数!");
            return(dicResult);
        }
        if (!new Sys.BLL.Account().CheckToken(dicParams["token"].ToString()))
        {
            dicResult.Add("response_id", 0);
            dicResult.Add("response_msg", "Token验证失败!");
            return(dicResult);
        }
        int    ordersId    = Convert.ToInt32(dicParams["ordersId"]);
        int    orderStatus = Convert.ToInt32(dicParams["orderStatus"]);
        int    staFlag     = Convert.ToInt32(dicParams["staFlag"]);
        string picList     = dicParams["PicList"].ToString();
        string staMessage  = dicParams["staMessage"].ToString();

        string message;
        var    bllOrder = new Sys.BLL.Orders();

        if (!bllOrder.OrdersStatusCheck(ordersId, orderStatus, staFlag, out message))
        {
            dicResult.Add("response_id", 0);
            dicResult.Add("response_msg", message);
        }
        else
        {
            var result = bllOrder.UpdateOrdersStatus(ordersId, orderStatus, staFlag, picList, staMessage);
            if (result)
            {
                dicResult.Add("response_id", 1);
                dicResult.Add("response_msg", "订单状态更新成功!");
            }
        }

        return(dicResult);
    }