예제 #1
0
        public static bool Add(TransferLogInfo info)
        {
            bool          flag      = false;
            OrderInfo     orderById = Order.GetOrderById(info.OrderId);
            StringBuilder builder   = new StringBuilder();

            if (orderById.IsNull)
            {
                builder.Append("<li>找不到指定的订单!</li>");
                flag = false;
            }
            else
            {
                bool     flag2;
                string   str;
                UserInfo info3;
                CheckValidation(info, orderById, out flag2, out str, out info3);
                if (flag2)
                {
                    builder.Append(str);
                    flag = false;
                }
                else
                {
                    int num;
                    GetTransferLogInfo(ref info, out num, orderById, info3);
                    if (info.Poundage > 0M)
                    {
                        BankrollItemInfo info4;
                        GetBankrollItemInfo(info, orderById, info3, num, out info4);
                        if (!BankrollItem.Add(info4))
                        {
                            builder.Append("<li>资金明细记录添加失败!</li>");
                        }
                    }
                    if (dal.Add(info))
                    {
                        if (!Order.Transfer(info.OrderId, info3.ClientId, info3.UserName))
                        {
                            flag = false;
                        }
                        else
                        {
                            s_SuccessMsg = "已经成功将编号为:<font color='red'>" + orderById.OrderNum + "</font> 的订单(原所有者:<font color='red'>" + orderById.UserName + "</font>)过户给:<font color='red'>" + info3.UserName + "</font>!";
                            s_SuccessMsg = string.Concat(new object[] { s_SuccessMsg, "<br><p align='center'><a href='OrderManage.aspx?OrderID=", info.OrderId, "'>点此查看订单信息</a></p>" });
                            flag         = true;
                        }
                    }
                }
            }
            s_ErrMsg = builder.ToString();
            return(flag);
        }