⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 order.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
📖 第 1 页 / 共 3 页
字号:
                foreach (OrderItemInfo info in OrderItem.GetInfoListByOrderId(orderId))
                {
                    if (Product.CharacterIsExists(info.ProductCharacter, ProductCharacter.Practicality))
                    {
                        flag2 = true;
                        break;
                    }
                    if (Product.CharacterIsExists(info.ProductCharacter, ProductCharacter.Card))
                    {
                        flag3 = true;
                        break;
                    }
                    if (Product.CharacterIsExists(info.ProductCharacter, ProductCharacter.Service))
                    {
                        flag4 = true;
                        break;
                    }
                }
                if ((!flag2 && !flag3) && !flag4)
                {
                    Recieve(orderId);
                }
            }
            return flag;
        }

        private static OrderInfo DoHtmlDecode(OrderInfo orderInfo)
        {
            orderInfo.Address = DataSecurity.HtmlDecode(orderInfo.Address);
            orderInfo.ContacterName = DataSecurity.HtmlDecode(orderInfo.ContacterName);
            orderInfo.Email = DataSecurity.HtmlDecode(orderInfo.Email);
            orderInfo.InvoiceContent = DataSecurity.HtmlDecode(orderInfo.InvoiceContent);
            orderInfo.Memo = DataSecurity.HtmlDecode(orderInfo.Memo);
            orderInfo.Mobile = DataSecurity.HtmlDecode(orderInfo.Mobile);
            orderInfo.Phone = DataSecurity.HtmlDecode(orderInfo.Phone);
            orderInfo.Remark = DataSecurity.HtmlDecode(orderInfo.Remark);
            orderInfo.ZipCode = DataSecurity.HtmlDecode(orderInfo.ZipCode);
            return orderInfo;
        }

        private static OrderInfo DoHtmlEncode(OrderInfo orderInfo)
        {
            orderInfo.Address = DataSecurity.HtmlEncode(orderInfo.Address);
            orderInfo.ContacterName = DataSecurity.HtmlEncode(orderInfo.ContacterName);
            orderInfo.Email = DataSecurity.HtmlEncode(orderInfo.Email);
            orderInfo.InvoiceContent = DataSecurity.HtmlEncode(orderInfo.InvoiceContent);
            orderInfo.Memo = DataSecurity.HtmlEncode(orderInfo.Memo);
            orderInfo.Mobile = DataSecurity.HtmlEncode(orderInfo.Mobile);
            orderInfo.Phone = DataSecurity.HtmlEncode(orderInfo.Phone);
            orderInfo.Remark = DataSecurity.HtmlEncode(orderInfo.Remark);
            orderInfo.ZipCode = DataSecurity.HtmlEncode(orderInfo.ZipCode);
            return orderInfo;
        }

        public static int EndOrder(int orderId)
        {
            int num = 0;
            int totalPresentExp = 0;
            int totalPresentMoney = 0;
            int totalPresentPoint = 0;
            OrderInfo orderById = GetOrderById(orderId);
            if (orderById.Status <= OrderStatus.WaitForConfirm)
            {
                num = 1;
            }
            if (orderById.MoneyReceipt < orderById.MoneyTotal)
            {
                num = 2;
            }
            if (orderById.DeliverStatus <= DeliverStatus.Preparative)
            {
                num = 3;
            }
            if (num == 0)
            {
                orderById.Status = OrderStatus.End;
                Update(orderById);
                foreach (OrderItemInfo info2 in OrderItem.GetInfoListByOrderId(orderId))
                {
                    if (info2.PresentExp > 0)
                    {
                        totalPresentExp += info2.PresentExp * info2.Amount;
                    }
                    if (info2.PresentPoint > 0)
                    {
                        totalPresentPoint += info2.PresentPoint * info2.Amount;
                    }
                    if (info2.PresentMoney > 0M)
                    {
                        totalPresentMoney += Convert.ToInt32(info2.PresentMoney) * info2.Amount;
                    }
                }
                UpdateUserInfo(orderById, totalPresentExp, totalPresentPoint, totalPresentMoney);
                Coupon.Create(orderById);
            }
            return num;
        }

        public static IList<UserOrderCommonInfo> GetCardList(string userName)
        {
            if (string.IsNullOrEmpty(userName))
            {
                return new List<UserOrderCommonInfo>();
            }
            return dal.GetCardList(userName);
        }

        public static IList<UserOrderCommonInfo> GetDownList(string userName)
        {
            if (string.IsNullOrEmpty(userName))
            {
                return new List<UserOrderCommonInfo>();
            }
            return dal.GetDownList(userName);
        }

        public static UserOrderCommonInfo GetDownloadInfo(string userName, int orderItemId)
        {
            UserOrderCommonInfo downloadInfo = dal.GetDownloadInfo(userName, orderItemId);
            if (string.IsNullOrEmpty(downloadInfo.TableName))
            {
                PresentInfo presentById = Present.GetPresentById(downloadInfo.ProductId);
                downloadInfo.DownloadUrl = presentById.DownloadUrl;
                downloadInfo.Remark = presentById.Remark;
                return downloadInfo;
            }
            ProductInfo productById = Product.GetProductById(downloadInfo.ProductId);
            downloadInfo.DownloadUrl = productById.DownloadUrl;
            downloadInfo.Remark = productById.Remark;
            return downloadInfo;
        }

        public static string GetLastFunctionary()
        {
            return dal.GetLastFunctionary();
        }

        public static IList<OrderInfo> GetList(int startRowIndexId, int maxNumberRows, string searchType, string field, string keyword, string action)
        {
            string str25;
            if (!string.IsNullOrEmpty(keyword) && ((str25 = searchType) != null))
            {
                if (!(str25 == "10"))
                {
                    if (str25 == "20")
                    {
                        string[] strArray = keyword.Split(new char[] { '|' });
                        if (strArray.Length == 0x18)
                        {
                            string str = DataConverter.CLng(strArray[0]).ToString();
                            string str2 = DataConverter.CLng(strArray[1]).ToString();
                            string str3 = string.IsNullOrEmpty(strArray[2]) ? "" : DataConverter.CDate(strArray[2]).ToString("yyyy-MM-dd");
                            string str4 = string.IsNullOrEmpty(strArray[3]) ? "" : DataConverter.CDate(strArray[3]).ToString("yyyy-MM-dd");
                            string str5 = DataConverter.CDecimal(strArray[4]).ToString();
                            string str6 = DataConverter.CDecimal(strArray[5]).ToString();
                            string str7 = DataConverter.CLng(strArray[6]).ToString();
                            string str8 = DataConverter.CLng(strArray[7]).ToString();
                            string str9 = DataConverter.CLng(strArray[8]).ToString();
                            string str10 = DataSecurity.FilterBadChar(strArray[9]);
                            string str11 = DataSecurity.FilterBadChar(strArray[10]);
                            string str12 = DataSecurity.FilterBadChar(strArray[11]);
                            string str13 = DataSecurity.FilterBadChar(strArray[12]);
                            string str14 = DataSecurity.FilterBadChar(strArray[13]);
                            string str15 = DataSecurity.FilterBadChar(strArray[14]);
                            string str16 = DataSecurity.FilterBadChar(strArray[15]);
                            string str17 = DataSecurity.FilterBadChar(strArray[0x10]);
                            string str18 = DataSecurity.FilterBadChar(strArray[0x11]);
                            string str19 = DataSecurity.FilterBadChar(strArray[0x12]);
                            string str20 = DataConverter.CLng(strArray[0x13]).ToString();
                            string str21 = DataSecurity.FilterBadChar(strArray[20]);
                            string str22 = DataSecurity.FilterBadChar(strArray[0x15]);
                            string str23 = DataSecurity.FilterBadChar(strArray[0x16]);
                            string str24 = DataSecurity.FilterBadChar(strArray[0x17]);
                            keyword = string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}|{14}|{15}|{16}|{17}|{18}|{19}|{20}|{21}|{22}|{23}", new object[] { 
                                str, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12, str13, str14, str15, str16, 
                                str17, str18, str19, str20, str21, str22, str23, str24
                             });
                        }
                        else
                        {
                            searchType = "0";
                        }
                    }
                }
                else
                {
                    string str26;
                    if (((str26 = field) != null) && (str26 == "DateAndTime"))
                    {
                        keyword = DataConverter.CDate(keyword).ToString("yyyy-MM-dd");
                    }
                    else
                    {
                        keyword = DataSecurity.FilterBadChar(keyword);
                    }
                }
            }
            return dal.GetList(startRowIndexId, maxNumberRows, searchType, field, keyword, action);
        }

        public static IDictionary<int, string> GetListByUserName(string userName)
        {
            return dal.GetListByUserName(userName);
        }

        public static int GetMaxId()
        {
            return dal.GetMaxId();
        }

        private static StringBuilder GetMessageOrMailofCard(string content)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("<table width='80%' class='border' align='center' cellspacing='1' cellpadding='2'><tr class='title' align='center'><td>商品名称</td><td>充值卡类型</td><td>充值卡卡号</td><td>充值卡密码</td><td>充值卡面值</td><td>充值卡点数</td><td>充值截止日期</td></tr>");
            builder.Append(content);
            builder.Append("</table>");
            return builder;
        }

        private static void GetMessageOrMailofCard(StringBuilder content, CardInfo cartInfo, string productName)
        {
            content.Append("<tr class='tdbg' align='center'><td>" + productName + "</td>");
            content.Append("<td>");
            if (cartInfo.CardType == 0)
            {
                content.Append("本站充值卡");
            }
            else
            {
                content.Append("<font color='blue'>其他公司卡</font>");
            }
            content.Append("</td>");
            content.Append("<td>" + cartInfo.CardNum + "</td>");
            content.Append("<td>" + StringHelper.Base64StringDecode(cartInfo.Password) + "</td>");
            content.Append("<td>" + cartInfo.Money.ToString() + "</td>");
            content.Append(string.Concat(new object[] { "<td>", cartInfo.ValidNum, cartInfo.ValidUnit, "</td>" }));
            content.Append("<td>" + cartInfo.EndDate.ToString() + "</td>");
            content.Append("</tr>");
        }

        public static OrderInfo GetMyOrderById(int orderId, string userName)
        {
            if ((orderId > 0) && !string.IsNullOrEmpty(userName))
            {
                return dal.GetMyOrderById(orderId, userName);
            }
            return new OrderInfo(true);
        }

        public static OrderInfo GetOrderById(int orderId)
        {
            return GetOrderById(orderId, true);
        }

        public static OrderInfo GetOrderById(int orderId, bool isDecode)
        {
            OrderInfo orderById = dal.GetOrderById(orderId);
            if (isDecode)
            {
                DoHtmlDecode(orderById);
            }
            return orderById;
        }

        public static OrderInfo GetOrderByOrderNum(string orderNum)
        {
            return dal.GetOrderByOrderNum(orderNum);
        }

        public static string GetOrderNum()
        {
            return (SiteConfig.ShopConfig.PrefixOrderFormNum + Client.GetClientNum());
        }

        public static PayStatus GetPayStatus(OrderInfo info)
        {
            if (info.IsNull)
            {
                return PayStatus.WaitForPay;
            }
            if (info.MoneyTotal > info.MoneyReceipt)
            {
                if (info.MoneyReceipt > 0M)
                {
                    return PayStatus.ReceivedEarnest;
                }
                return PayStatus.WaitForPay;
            }
            return PayStatus.Payoff;
        }

        public static ArrayList GetTotalofMoneyAndReceipt()
        {
            return dal.GetTotalofMoneyAndReceipt();
        }

        public static ArrayList GetTotalofMoneyAndReceiptByAgentName(string agentName)
        {
            return dal.GetTotalofMoneyAndReceiptByAgentName(agentName);
        }

        public static ArrayList GetTotalofMoneyAndReceiptByUserName(string userName)
        {
            return dal.GetTotalofMoneyAndReceiptByUserName(userName);
        }

        public static int GetTotalOfOrder(string searchType, string field, string keyword, string action)
        {
            string.IsNullOrEmpty(searchType + keyword + field + action);
            return dal.GetTotalOfOrder();
        }

        public static ArrayList GetTotalofthisMoneyAndReceipt(string field)
        {
            return dal.GetTotalofthisMoneyAndReceipt(field);
        }

        public static bool GoPause(int orderId)
        {
            return dal.GoPause(orderId);
        }

        public static bool GoRubbish(int orderId)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -