Beispiel #1
0
        protected override void AttachChildControls()
        {
            DistributorsInfo currentDistributors = DistributorsBrower.GetCurrentDistributors(Globals.GetCurrentMemberUserId(false), true);

            if (currentDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                this.vshopcommssion = (VshopTemplatedRepeater)this.FindControl("vshopcommssion");
                CommissionsQuery commissionsQuery = new CommissionsQuery();
                commissionsQuery.StartTime = (commissionsQuery.EndTime = "");
                commissionsQuery.PageIndex = 1;
                commissionsQuery.PageSize  = 100000;
                commissionsQuery.UserId    = Globals.GetCurrentMemberUserId(false);
                DbQueryResult commissions = DistributorsBrower.GetCommissions(commissionsQuery);
                if (commissions.TotalRecords > 0)
                {
                    this.vshopcommssion.DataSource = commissions.Data;
                    this.vshopcommssion.DataBind();
                }
            }
        }
Beispiel #2
0
        private void BindProducts(int couponId)
        {
            System.Data.DataTable selectedProducts = this.GetSelectedProducts(couponId);
            string  text     = this.txt_name.Text;
            string  text2    = this.txt_minPrice.Text;
            string  text3    = this.txt_maxPrice.Text;
            decimal?minPrice = null;
            decimal?maxPrice = null;
            decimal value    = 0m;

            if (!this.bDecimal(text2, ref value))
            {
                minPrice = null;
            }
            else
            {
                minPrice = new decimal?(value);
            }
            if (!this.bDecimal(text3, ref value))
            {
                maxPrice = null;
            }
            else
            {
                maxPrice = new decimal?(value);
            }
            ProductQuery productQuery = new ProductQuery
            {
                Keywords    = text,
                ProductCode = "",
                CategoryId  = null,
                PageSize    = this.pager.PageSize,
                PageIndex   = this.pager.PageIndex,
                SortOrder   = SortAction.Desc,
                SortBy      = "DisplaySequence",
                StartDate   = null,
                BrandId     = null,
                EndDate     = null,
                TypeId      = null,
                SaleStatus  = this.status,
                minPrice    = minPrice,
                maxPrice    = maxPrice
            };

            Globals.EntityCoding(productQuery, true);
            DbQueryResult products = ProductHelper.GetProducts(productQuery);

            System.Data.DataTable dataTable = (System.Data.DataTable)products.Data;
            dataTable.Columns.Add("seledStatus");
            dataTable.Columns.Add("canSelStatus");
            dataTable.Columns.Add("canChkStatus");
            if (dataTable != null && selectedProducts != null)
            {
                if (dataTable.Rows.Count > 0 && selectedProducts.Rows.Count > 0)
                {
                    for (int i = 0; i < dataTable.Rows.Count; i++)
                    {
                        int num = int.Parse(dataTable.Rows[i]["ProductId"].ToString());
                        if (selectedProducts.Select(string.Format("ProductId={0}", num)).Length > 0)
                        {
                            dataTable.Rows[i]["seledStatus"]  = "''";
                            dataTable.Rows[i]["canSelStatus"] = "none";
                            dataTable.Rows[i]["canChkStatus"] = "disabled";
                        }
                        else
                        {
                            dataTable.Rows[i]["seledStatus"]  = "none";
                            dataTable.Rows[i]["canSelStatus"] = "''";
                            dataTable.Rows[i]["canChkStatus"] = string.Empty;
                        }
                    }
                }
                else if (dataTable.Rows.Count > 0)
                {
                    for (int j = 0; j < dataTable.Rows.Count; j++)
                    {
                        dataTable.Rows[j]["seledStatus"]  = "none";
                        dataTable.Rows[j]["canSelStatus"] = "''";
                        dataTable.Rows[j]["canChkStatus"] = string.Empty;
                    }
                }
            }
            this.grdProducts.DataSource = products.Data;
            this.grdProducts.DataBind();
            this.pager.TotalRecords = products.TotalRecords;
            this.lbsaleNumber.Text  = products.TotalRecords.ToString();
            this.lblJoin.Text       = ((selectedProducts != null) ? selectedProducts.Rows.Count.ToString() : "0");
            this.setInStock();
        }
Beispiel #3
0
        private void BindData()
        {
            decimal?minValue = null;
            decimal?maxValue = null;

            System.DateTime?beginDate = null;
            System.DateTime?endDate   = null;
            string          text      = this.txt_name.Text;
            decimal         value     = 0m;

            System.DateTime now = System.DateTime.Now;
            if (this.bDecimal(this.txt_minVal.Text, ref value))
            {
                minValue = new decimal?(value);
            }
            if (this.bDecimal(this.txt_maxVal.Text, ref value))
            {
                maxValue = new decimal?(value);
            }
            if (this.bDate(this.calendarStartDate.Text, ref now))
            {
                beginDate = new System.DateTime?(now);
            }
            if (this.bDate(this.calendarEndDate.Text, ref now))
            {
                endDate = new System.DateTime?(now);
            }
            DbQueryResult couponInfos = CouponHelper.GetCouponInfos(new CouponsSearch
            {
                CouponName = text,
                minValue   = minValue,
                maxValue   = maxValue,
                beginDate  = beginDate,
                endDate    = endDate,
                IsCount    = true,
                PageIndex  = this.pager1.PageIndex,
                PageSize   = this.pager1.PageSize,
                SortBy     = "CouponId",
                SortOrder  = SortAction.Desc
            });

            System.Data.DataTable dataTable = (System.Data.DataTable)couponInfos.Data;
            if (dataTable.Rows.Count > 0)
            {
                dataTable.Columns.Add("useConditon");
                dataTable.Columns.Add("ReceivNum");
                for (int i = 0; i < dataTable.Rows.Count; i++)
                {
                    decimal d = decimal.Parse(dataTable.Rows[i]["ConditionValue"].ToString());
                    if (d == 0m)
                    {
                        dataTable.Rows[i]["useConditon"] = "不限制";
                    }
                    else
                    {
                        dataTable.Rows[i]["useConditon"] = "满" + d.ToString("F2") + "可使用";
                    }
                    string text2 = dataTable.Rows[i]["maxReceivNum"].ToString();
                    if (text2 == "0")
                    {
                        dataTable.Rows[i]["ReceivNum"] = "无限制";
                    }
                    else
                    {
                        dataTable.Rows[i]["ReceivNum"] = text2 + "/张每人";
                    }
                }
            }
            this.grdCoupondsList.DataSource = dataTable;
            this.grdCoupondsList.DataBind();
            this.pager1.TotalRecords = couponInfos.TotalRecords;
        }
Beispiel #4
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("错误的商品信息!");
            }
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            this.litProdcutName      = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litSalePrice        = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litSoldCount        = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount");
            this.productImage        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("productImage");
            this.productLink         = (System.Web.UI.WebControls.HyperLink) this.FindControl("productLink");
            this.txtTotal            = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);

            if (productSimpleInfo == null)
            {
                base.GotoResourceNotFound("该件商品已经被管理员删除");
            }
            this.litProdcutName.SetWhenIsNotNull(productSimpleInfo.ProductName);
            this.litSalePrice.SetWhenIsNotNull(productSimpleInfo.MinSalePrice.ToString("F2"));
            this.litShortDescription.SetWhenIsNotNull(productSimpleInfo.ShortDescription);
            this.litSoldCount.SetWhenIsNotNull(productSimpleInfo.ShowSaleCounts.ToString());
            if (!string.IsNullOrEmpty(productSimpleInfo.ThumbnailUrl180))
            {
                this.productImage.Src = productSimpleInfo.ThumbnailUrl180;
            }
            else
            {
                this.productImage.Src = masterSettings.DefaultProductThumbnail5;
            }
            this.productLink.NavigateUrl = "ProductDetails.aspx?ProductId=" + productSimpleInfo.ProductId;
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 20;
            }
            ProductReviewQuery productReviewQuery = new ProductReviewQuery();

            productReviewQuery.productId = this.productId;
            productReviewQuery.IsCount   = true;
            productReviewQuery.PageIndex = pageIndex;
            productReviewQuery.PageSize  = pageSize;
            productReviewQuery.SortBy    = "ReviewId";
            productReviewQuery.SortOrder = SortAction.Desc;
            this.rptProducts             = (AliOHTemplatedRepeater)this.FindControl("rptProducts");
            DbQueryResult productReviews = ProductBrowser.GetProductReviews(productReviewQuery);

            this.rptProducts.DataSource = productReviews.Data;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(productReviews.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("商品评价");
        }
Beispiel #5
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 public DbQueryResponse(TResult result, DbQueryResult queryResult) : base(queryResult)
 {
     Result = result;
 }
Beispiel #6
0
        private void BindData()
        {
            string   text      = "";
            decimal? nullable  = null;
            decimal? nullable2 = null;
            DateTime?nullable3 = null;
            DateTime?nullable4 = null;

            text = this.txt_name.Text;
            decimal  i   = 0M;
            DateTime now = DateTime.Now;

            if (this.bDecimal(this.txt_minVal.Text, ref i))
            {
                nullable = new decimal?(i);
            }
            if (this.bDecimal(this.txt_maxVal.Text, ref i))
            {
                nullable2 = new decimal?(i);
            }
            if (this.bDate(this.calendarStartDate.Text, ref now))
            {
                nullable3 = new DateTime?(now);
            }
            if (this.bDate(this.calendarEndDate.Text, ref now))
            {
                nullable4 = new DateTime?(now);
            }
            CouponsSearch search = new CouponsSearch
            {
                CouponName = text,
                minValue   = nullable,
                maxValue   = nullable2,
                beginDate  = nullable3,
                endDate    = nullable4,
                IsCount    = true,
                PageIndex  = this.pager1.PageIndex,
                PageSize   = this.pager1.PageSize,
                SortBy     = "CouponId",
                SortOrder  = SortAction.Desc
            };
            DbQueryResult couponInfos = CouponHelper.GetCouponInfos(search);
            DataTable     data        = (DataTable)couponInfos.Data;

            if (data.Rows.Count > 0)
            {
                data.Columns.Add("useConditon");
                data.Columns.Add("ReceivNum");
                for (int j = 0; j < data.Rows.Count; j++)
                {
                    decimal num3 = decimal.Parse(data.Rows[j]["ConditionValue"].ToString());
                    if (num3 == 0M)
                    {
                        data.Rows[j]["useConditon"] = "不限制";
                    }
                    else
                    {
                        data.Rows[j]["useConditon"] = "满" + num3.ToString("F2") + "可使用";
                    }
                    string str2 = data.Rows[j]["maxReceivNum"].ToString();
                    if (str2 == "0")
                    {
                        data.Rows[j]["ReceivNum"] = "无限制";
                    }
                    else
                    {
                        data.Rows[j]["ReceivNum"] = str2 + "/张每人";
                    }
                }
            }
            this.grdCoupondsList.DataSource = data;
            this.grdCoupondsList.DataBind();
            this.pager1.TotalRecords = couponInfos.TotalRecords;
        }
Beispiel #7
0
        private void BindProducts(int couponId)
        {
            DataTable selectedProducts = this.GetSelectedProducts(couponId);
            string    text             = this.txt_name.Text;
            string    val       = this.txt_minPrice.Text;
            string    str3      = this.txt_maxPrice.Text;
            decimal?  nullable  = null;
            decimal?  nullable2 = null;
            decimal   i         = 0M;

            if (!this.bDecimal(val, ref i))
            {
                nullable = null;
            }
            else
            {
                nullable = new decimal?(i);
            }
            if (!this.bDecimal(str3, ref i))
            {
                nullable2 = null;
            }
            else
            {
                nullable2 = new decimal?(i);
            }
            ProductQuery entity = new ProductQuery
            {
                Keywords      = text,
                ProductCode   = "",
                CategoryId    = null,
                PageSize      = this.pager.PageSize,
                PageIndex     = this.pager.PageIndex,
                SortOrder     = SortAction.Desc,
                SortBy        = "DisplaySequence",
                StartDate     = null,
                BrandId       = null,
                EndDate       = null,
                TypeId        = null,
                SaleStatus    = this.status,
                minPrice      = nullable,
                maxPrice      = nullable2,
                TwoSaleStatus = "OnStock"
            };

            Globals.EntityCoding(entity, true);
            DbQueryResult products = ProductHelper.GetProducts(entity);
            DataTable     data     = (DataTable)products.Data;

            data.Columns.Add("seledStatus");
            data.Columns.Add("canSelStatus");
            data.Columns.Add("canChkStatus");
            if ((data != null) && (selectedProducts != null))
            {
                if ((data.Rows.Count > 0) && (selectedProducts.Rows.Count > 0))
                {
                    for (int j = 0; j < data.Rows.Count; j++)
                    {
                        int num3 = int.Parse(data.Rows[j]["ProductId"].ToString());
                        if (selectedProducts.Select(string.Format("ProductId={0}", num3)).Length > 0)
                        {
                            data.Rows[j]["seledStatus"]  = "''";
                            data.Rows[j]["canSelStatus"] = "none";
                            data.Rows[j]["canChkStatus"] = "disabled";
                        }
                        else
                        {
                            data.Rows[j]["seledStatus"]  = "none";
                            data.Rows[j]["canSelStatus"] = "''";
                            data.Rows[j]["canChkStatus"] = string.Empty;
                        }
                    }
                }
                else if (data.Rows.Count > 0)
                {
                    for (int k = 0; k < data.Rows.Count; k++)
                    {
                        data.Rows[k]["seledStatus"]  = "none";
                        data.Rows[k]["canSelStatus"] = "''";
                        data.Rows[k]["canChkStatus"] = string.Empty;
                    }
                }
            }
            this.grdProducts.DataSource = products.Data;
            this.grdProducts.DataBind();
            this.pager.TotalRecords = products.TotalRecords;
            this.lbwareNumber.Text  = products.TotalRecords.ToString();
            this.lblJoin.Text       = selectedProducts.Rows.Count.ToString();
            this.setInSale();
        }
Beispiel #8
0
        private DataGridViewModel <Dictionary <string, object> > GetOrderList(OrderQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();
            DbQueryResult orders = OrderHelper.GetOrders(query);

            dataGridViewModel.rows  = DataHelper.DataTableToDictionary(orders.Data);
            dataGridViewModel.total = orders.TotalRecords;
            string[] orderIds = (from d in dataGridViewModel.rows
                                 select d["OrderId"].ToString()).ToArray();
            List <RefundInfo> refundInfos = TradeHelper.GetRefundInfos(orderIds);

            foreach (Dictionary <string, object> row in dataGridViewModel.rows)
            {
                OrderInfo order = TradeHelper.GetOrderInfo(row["OrderId"].ToString());
                row.Add("OrderStatusText", OrderHelper.GetOrderStatusText(order.OrderStatus, order.ShippingModeId, order.IsConfirm, order.Gateway, 0, order.PreSaleId, order.DepositDate, false, order.ItemStatus, OrderType.NormalOrder));
                row.Add("CanConfirmOrder", order.CanConfirmOrder());
                row.Add("canCheckTake", order.CanConfirmTakeCode());
                row.Add("canCloseOrder", order.CanClose(base.CurrentSiteSetting.OpenMultStore, true));
                row.Add("canOfflineReceipt", OrderHelper.CanConfirmOfflineReceipt(order, true));
                row.Add("canSendGoods", order.CanSendGoods(base.CurrentSiteSetting.OpenMultStore));
                row.Add("canFinishTrade", order.OrderStatus == OrderStatus.SellerAlreadySent && order.ItemStatus == OrderItemStatus.Nomarl);
                row.Add("SupplierOrderTotals", order.OrderCostPrice + order.Freight);
                if (order.IsStoreCollect)
                {
                    row.Add("isShowCheckRefund", order.OrderStatus == OrderStatus.ApplyForRefund && order.StoreId == base.CurrentManager.StoreId);
                }
                row.Add("InvoiceTypeText", string.IsNullOrEmpty(order.InvoiceTitle) ? "" : EnumDescription.GetEnumDescription((Enum)(object)order.InvoiceType, 0));
                bool flag = false;
                if (order.FightGroupId > 0)
                {
                    FightGroupInfo fightGroup = VShopHelper.GetFightGroup(order.FightGroupId);
                    if (fightGroup != null)
                    {
                        row.Add("FightGroupActivityId", fightGroup.FightGroupActivityId);
                        if (fightGroup.Status == FightGroupStatus.FightGroupIn && order.OrderStatus != OrderStatus.WaitBuyerPay && order.OrderStatus != OrderStatus.Closed)
                        {
                            flag = true;
                        }
                    }
                }
                row.Add("FightGrouping", flag);
                row.Add("isGiftOrder", order.LineItems.Count <= 0);
                row["IsError"]      = order.IsError;
                row["ErrorMessage"] = order.ErrorMessage;
                RefundInfo refundInfo = refundInfos.FirstOrDefault((RefundInfo d) => d.OrderId == order.OrderId);
                if (refundInfo != null)
                {
                    row.Add("RefundId", refundInfo.RefundId);
                }
                int            num      = 0;
                int            num2     = 0;
                bool           flag2    = false;
                string         value    = "订单中有商品正在进行退货/退款";
                AfterSaleTypes?nullable = null;
                if (order.ItemStatus != 0 || order.OrderStatus == OrderStatus.ApplyForRefund)
                {
                    if (order.OrderStatus == OrderStatus.ApplyForRefund)
                    {
                        RefundInfo refundInfo2 = TradeHelper.GetRefundInfo(order.OrderId);
                        if (refundInfo2 != null)
                        {
                            flag2 = true;
                            value = "订单已申请退款";
                        }
                    }
                    else
                    {
                        int            num3           = 0;
                        AfterSaleTypes afterSaleTypes = AfterSaleTypes.ReturnAndRefund;
                        int            num4           = 0;
                        foreach (LineItemInfo value2 in order.LineItems.Values)
                        {
                            if (value2.ReturnInfo != null || value2.ReplaceInfo != null)
                            {
                                ReturnInfo  returnInfo  = value2.ReturnInfo;
                                ReplaceInfo replaceInfo = value2.ReplaceInfo;
                                if (num3 == 0 || (returnInfo != null && returnInfo.HandleStatus != ReturnStatus.Refused && returnInfo.HandleStatus != ReturnStatus.Returned) || (replaceInfo != null && (replaceInfo.HandleStatus != ReplaceStatus.Refused || replaceInfo.HandleStatus != ReplaceStatus.Replaced)))
                                {
                                    if (value2.ReturnInfo != null)
                                    {
                                        afterSaleTypes = AfterSaleTypes.ReturnAndRefund;
                                        num4           = value2.ReturnInfo.ReturnId;
                                    }
                                    else
                                    {
                                        afterSaleTypes = AfterSaleTypes.Replace;
                                        num4           = value2.ReplaceInfo.ReplaceId;
                                    }
                                }
                                num3++;
                            }
                        }
                        if (order.ItemStatus == OrderItemStatus.HasReturnOrReplace)
                        {
                            value = "订单中有商品正在退货/换货中";
                        }
                        else if (order.ItemStatus == OrderItemStatus.HasReplace)
                        {
                            value = "订单中有商品正在进行换货";
                        }
                        else if (order.ItemStatus == OrderItemStatus.HasReturn)
                        {
                            value = "订单中有商品在进行退货/退款操作";
                        }
                        else if (order.ReturnedCount > 0)
                        {
                            value = "订单中有商品已退货完成";
                        }
                        if (num3 > 0)
                        {
                            flag2    = true;
                            nullable = afterSaleTypes;
                            if (afterSaleTypes == AfterSaleTypes.ReturnAndRefund)
                            {
                                num = num4;
                            }
                            else
                            {
                                num2 = num4;
                            }
                        }
                    }
                }
                row.Add("ReturnId", num);
                row.Add("ReplaceId", num2);
                row.Add("AfterSaleType", nullable);
                row.Add("isShowRefund", flag2);
                row.Add("RefundStatus", value);
            }
            return(dataGridViewModel);
        }
Beispiel #9
0
 private void BindProducts(int eId)
 {
     if (this.exchangeId != 0)
     {
         string  text      = this.txt_name.Text;
         string  val       = this.txt_minPrice.Text;
         string  str3      = this.txt_maxPrice.Text;
         decimal?nullable  = null;
         decimal?nullable2 = null;
         decimal i         = 0M;
         if (!this.bDecimal(val, ref i))
         {
             nullable = null;
         }
         else
         {
             nullable = new decimal?(i);
         }
         if (!this.bDecimal(str3, ref i))
         {
             nullable2 = null;
         }
         else
         {
             nullable2 = new decimal?(i);
         }
         ProductQuery entity = new ProductQuery {
             Keywords    = text,
             ProductCode = "",
             CategoryId  = null,
             PageSize    = this.pager.PageSize,
             PageIndex   = this.pager.PageIndex,
             SortOrder   = SortAction.Desc,
             SortBy      = "DisplaySequence",
             StartDate   = null,
             BrandId     = null,
             EndDate     = null,
             TypeId      = null,
             SaleStatus  = this.status,
             minPrice    = nullable,
             maxPrice    = nullable2,
             selectQuery = string.Format(" ProductId  in (  select ProductId from Hishop_PointExChange_Products where exChangeId={0})", this.exchangeId)
         };
         Globals.EntityCoding(entity, true);
         DbQueryResult products = ProductHelper.GetProducts(entity);
         DataTable     data     = (DataTable)products.Data;
         data.Columns.Add("ProductNumber");
         data.Columns.Add("PointNumber");
         data.Columns.Add("eachMaxNumber");
         data.Columns.Add("status");
         data.Columns.Add("seledStatus");
         data.Columns.Add("canSelStatus");
         data.Columns.Add("canChkStatus");
         DataTable table2 = PointExChangeHelper.GetProducts(this.exchangeId);
         if ((data != null) && (data.Rows.Count > 0))
         {
             for (int j = data.Rows.Count - 1; j >= 0; j--)
             {
                 DataRow[] rowArray = table2.Select(" productId='" + data.Rows[j]["ProductId"].ToString() + "'");
                 if (rowArray.Length > 0)
                 {
                     data.Rows[j]["ProductNumber"] = rowArray[0]["ProductNumber"];
                     data.Rows[j]["PointNumber"]   = rowArray[0]["PointNumber"];
                     data.Rows[j]["eachMaxNumber"] = rowArray[0]["eachMaxNumber"];
                     data.Rows[j]["status"]        = rowArray[0]["status"];
                 }
                 else
                 {
                     data.Rows.RemoveAt(j);
                 }
             }
         }
         if (table2 != null)
         {
             if ((data.Rows.Count > 0) && (table2.Rows.Count > 0))
             {
                 for (int k = 0; k < data.Rows.Count; k++)
                 {
                     int num4 = int.Parse(data.Rows[k]["ProductId"].ToString());
                     if (table2.Select(string.Format("ProductId={0}", num4)).Length > 0)
                     {
                         data.Rows[k]["seledStatus"]  = "''";
                         data.Rows[k]["canSelStatus"] = "none";
                         data.Rows[k]["canChkStatus"] = "disabled";
                     }
                     else
                     {
                         data.Rows[k]["seledStatus"]  = "none";
                         data.Rows[k]["canSelStatus"] = "''";
                         data.Rows[k]["canChkStatus"] = string.Empty;
                     }
                 }
             }
             else if (data.Rows.Count > 0)
             {
                 for (int m = 0; m < data.Rows.Count; m++)
                 {
                     data.Rows[m]["seledStatus"]  = "none";
                     data.Rows[m]["canSelStatus"] = "''";
                     data.Rows[m]["canChkStatus"] = string.Empty;
                 }
             }
         }
         this.grdProducts.DataSource = products.Data;
         this.grdProducts.DataBind();
         this.pager.TotalRecords  = products.TotalRecords;
         this.lbSelectNumber.Text = (table2 != null) ? table2.Rows.Count.ToString() : "0";
         this.setInSaleAndStock();
     }
 }
Beispiel #10
0
        public DbQueryResult GetSaleStoreOrderLineItemsStatistics(SaleStatisticsQuery query)
        {
            //StringBuilder stringBuilder = new StringBuilder();
            //stringBuilder.AppendFormat(" 1=1 ");
            //if (query.StartDate.HasValue)
            //{
            //    stringBuilder.AppendFormat(" AND orderDate >= '{0}'", query.StartDate.Value);
            //}
            //if (query.EndDate.HasValue)
            //{
            //    stringBuilder.AppendFormat(" AND orderDate <= '{0}'", query.EndDate.Value.AddDays(1.0));
            //}
            //if (!string.IsNullOrEmpty(query.ProductName))
            //{
            //    stringBuilder.AppendFormat(" AND ProductName LIKE '%{0}%'", DataHelper.CleanSearchString(query.ProductName));
            //}
            //if (query.SupplierId.HasValue && query.SupplierId != 0)
            //{
            //    stringBuilder.AppendFormat(" AND SupplierId = {0}", query.SupplierId);
            //}
            //return DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "vw_Ecshop_SaleStoreDetails", "SkuId", (stringBuilder.Length > 0) ? stringBuilder.ToString() : null, "*");

            DbCommand storedProcCommand = this.database.GetStoredProcCommand("cp_Ecshop_SaleStoreDetails");

            this.database.AddInParameter(storedProcCommand, "PageIndex", DbType.Int32, query.PageIndex);
            this.database.AddInParameter(storedProcCommand, "PageSize", DbType.Int32, query.PageSize);
            this.database.AddInParameter(storedProcCommand, "IsCount", DbType.Boolean, query.IsCount);
            if (!query.StartDate.HasValue)
            {
                query.StartDate = new DateTime(2000, 1, 1);
            }
            this.database.AddInParameter(storedProcCommand, "ParamStartTime", DbType.DateTime, query.StartDate.Value);
            if (!query.EndDate.HasValue)
            {
                query.EndDate = DateTime.Now;
            }
            else
            {
                query.EndDate = query.EndDate.Value.AddDays(1);
            }
            this.database.AddInParameter(storedProcCommand, "ParamEndTime", DbType.DateTime, query.EndDate.Value);

            this.database.AddInParameter(storedProcCommand, "ParamProductName", DbType.String, DataHelper.CleanSearchString(query.ProductName));


            this.database.AddInParameter(storedProcCommand, "ParamSupplierId", DbType.Int32, query.SupplierId);

            this.database.AddOutParameter(storedProcCommand, "TotalProductSales", DbType.Int32, 4);
            DataTable result = null;

            using (IDataReader dataReader = this.database.ExecuteReader(storedProcCommand))
            {
                result = DataHelper.ConverDataReaderToDataTable(dataReader);
            }
            int           totalProductSales = (int)this.database.GetParameterValue(storedProcCommand, "TotalProductSales");
            DbQueryResult dbresult          = new DbQueryResult();

            dbresult.Data         = result;
            dbresult.TotalRecords = totalProductSales;
            return(dbresult);
        }
Beispiel #11
0
        public void BindData()
        {
            StoresInfo  storeById   = StoresHelper.GetStoreById(this.storeId);
            ManagerInfo managerInfo = ManagerHelper.FindManagerByStoreId(this.storeId, SystemRoles.StoreAdmin);

            if (storeById == null)
            {
                base.Response.Redirect("StoresList.aspx");
            }
            else
            {
                DbQueryResult storeDeliveryScop = StoresHelper.GetStoreDeliveryScop(new DeliveryScopeQuery
                {
                    StoreId   = storeById.StoreId,
                    PageIndex = 1,
                    PageSize  = 2147483647
                });
                this.repStoreDeliveryScop.DataSource = storeDeliveryScop.Data;
                this.repStoreDeliveryScop.DataBind();
                this.lblState.Text        = (storeById.State.Equals(0) ? "关闭" : "开启");
                this.lblUserName.Text     = managerInfo.UserName;
                this.lblStoreName.Text    = storeById.StoreName;
                this.lblRegions.Text      = RegionHelper.GetFullRegion(storeById.RegionId, string.Empty, true, 0);
                this.lblAddress.Text      = storeById.Address;
                this.lblContactMan.Text   = storeById.ContactMan;
                this.lblTel.Text          = storeById.Tel;
                this.lblCategoryName.Text = storeById.WXCategoryName;
                Literal literal  = this.lblServeRadius;
                double? nullable = storeById.ServeRadius;
                literal.Text = nullable.ToString();
                this.lblStoreOpenTime.Text  = (string.IsNullOrEmpty(storeById.StoreOpenTime) ? "无" : storeById.StoreOpenTime);
                this.lblIsAboveSelf.Text    = (storeById.IsAboveSelf ? "是" : "否");
                this.lblWXBusinessName.Text = storeById.WXBusinessName;
                this.lblWXBranchName.Text   = storeById.WXBranchName;
                this.lblWxAddress.Text      = storeById.WxAddress;
                HiddenField hiddenField = this.hfLongitude;
                nullable          = storeById.Longitude;
                hiddenField.Value = nullable.ToString();
                HiddenField hiddenField2 = this.hfLatitude;
                nullable                 = storeById.Latitude;
                hiddenField2.Value       = nullable.ToString();
                this.lblWXTelephone.Text = storeById.WXTelephone;
                Literal literal2  = this.lblWXAvgPrice;
                int?    nullable2 = storeById.WXAvgPrice;
                literal2.Text               = nullable2.ToString();
                this.lblWXOpenTime.Text     = storeById.WXOpenTime;
                this.lblWXRecommend.Text    = storeById.WXRecommend;
                this.lblWXSpecial.Text      = storeById.WXSpecial;
                this.lblWXIntroduction.Text = storeById.WXIntroduction;
                HiddenField hiddenField3 = this.hidIsWX;
                nullable2          = storeById.WXState;
                hiddenField3.Value = nullable2.ToString();
                if (!string.IsNullOrEmpty(storeById.StoreImages))
                {
                    string[] array = storeById.StoreImages.Split(',');
                    foreach (string text in array)
                    {
                        if (!string.IsNullOrEmpty(text.Trim()))
                        {
                            Literal literal3 = this.lblImages;
                            literal3.Text += $"<img src='{text}' width='98' height='98' style='padding:0 10px;'/>";
                        }
                    }
                }
            }
        }
        private void BindProducts(int couponId)
        {
            DataTable selectedProducts = this.GetSelectedProducts(couponId);
            string    text             = this.txt_name.Text;
            string    val       = this.txt_minPrice.Text;
            string    str3      = this.txt_maxPrice.Text;
            decimal?  nullable  = null;
            decimal?  nullable2 = null;
            decimal   i         = 0M;

            if (!this.bDecimal(val, ref i))
            {
                nullable = null;
            }
            else
            {
                nullable = new decimal?(i);
            }
            if (!this.bDecimal(str3, ref i))
            {
                nullable2 = null;
            }
            else
            {
                nullable2 = new decimal?(i);
            }
            ProductQuery entity = new ProductQuery
            {
                Keywords    = text,
                ProductCode = "",
                CategoryId  = null,
                PageSize    = this.pager.PageSize,
                PageIndex   = this.pager.PageIndex,
                SortOrder   = SortAction.Desc,
                SortBy      = "DisplaySequence",
                StartDate   = null,
                BrandId     = null,
                EndDate     = null,
                TypeId      = null,
                SaleStatus  = this._status,
                minPrice    = nullable,
                maxPrice    = nullable2,
                selectQuery = string.Format("productId in (select productId from Hishop_Activities_Product where ActivitiesId={0})", this._id)
            };

            Globals.EntityCoding(entity, true);
            DbQueryResult products = ProductHelper.GetProducts(entity);
            DataTable     data     = (DataTable)products.Data;

            data.Columns.Add("setStatus");
            if (((data != null) && (selectedProducts != null)) && ((data.Rows.Count > 0) && (selectedProducts.Rows.Count > 0)))
            {
                for (int j = 0; j < data.Rows.Count; j++)
                {
                    int       num3     = int.Parse(data.Rows[j]["ProductId"].ToString());
                    DataRow[] rowArray = selectedProducts.Select(string.Format("ProductId={0}", num3));
                    if (rowArray.Length > 0)
                    {
                        data.Rows[j]["setStatus"] = (rowArray[0]["status"].ToString() == "0") ? "暂停" : "恢复";
                    }
                }
            }
            this.grdProducts.DataSource = products.Data;
            this.grdProducts.DataBind();
            this.pager.TotalRecords = products.TotalRecords;
            this.lblJoin.Text       = (selectedProducts != null) ? selectedProducts.Rows.Count.ToString() : "0";
            this.setInSaleAndStock();
        }
Beispiel #13
0
        protected void BindSearch()
        {
            ProductBrowseQuery productBrowseQuery = this.GetCurrProductBrowseQuery();

            if (this.serach_text != null)
            {
                this.serach_text.Value = productBrowseQuery.Keywords;
            }
            if (search_Subtext != null)
            {
                search_Subtext.Value = productBrowseQuery.SubKeywords;
            }
            DbQueryResult browseProductList = ProductBrowser.GetCurrBrowseProductList(productBrowseQuery);

            this.rptProducts.DataSource = browseProductList.Data;
            this.rptProducts.DataBind();

            #region 获取控件品牌、产地过滤条件
            List <string> search_BrandStr     = new List <string>();
            List <string> search_ProducingStr = new List <string>();
            if (common_attributeslist != null)
            {
                DataTable dt = ProductBrowser.GetBrowseProductImportSourceIdAndBrandIdList(productBrowseQuery);
                foreach (DataRow r in dt.Rows)
                {
                    string str = r["BrandId"].ToString();
                    if (!search_BrandStr.Contains(str) && !string.IsNullOrWhiteSpace(str))
                    {
                        search_BrandStr.Add(str);
                    }
                    str = r["ImportSourceId"].ToString();
                    if (!search_ProducingStr.Contains(str) && !string.IsNullOrWhiteSpace(str) && !str.Equals("0"))
                    {
                        search_ProducingStr.Add(str);
                    }
                }
                //更新品牌、产地控件显示值

                this.common_attributeslist.search_BrandStr     = search_BrandStr;
                this.common_attributeslist.search_ProducingStr = search_ProducingStr;
            }
            #endregion

            this.hotSale = (Common_GoodsList_HotSale)this.FindControl("list_Common_GoodsList_HotSale");//销售排行
            if (this.hotSale != null)
            {
                int cid     = 0;
                int brandId = 0;
                if (!string.IsNullOrEmpty(this.Page.Request.QueryString["categoryId"]))
                {
                    int.TryParse(this.Page.Request.QueryString["categoryId"], out cid);
                }
                if (!string.IsNullOrEmpty(this.Page.Request.QueryString["brand"]))
                {
                    int.TryParse(this.Page.Request.QueryString["brand"], out brandId);
                }
                this.hotSale.DataSource = ProductBrowser.GetBrowseHotProductList(cid, brandId).DBHotSale;
                this.hotSale.DataBind();
            }

            this.pager.TotalRecords = browseProductList.TotalRecords;
            int pageCount = browseProductList.TotalRecords / this.pager.PageSize;
            if (browseProductList.TotalRecords % this.pager.PageSize > 0)
            {
                pageCount++;
            }

            if (pageCount <= 1)
            {
                //this.litSearchResultPage.Text = string.Format("共<span>{0}</span>件商品<span class=\"pager\">&lt;<span class=\"cur-page\">{1}</span>/<span class=\"total-page\">{1}</span>&gt;</span>", browseProductList.TotalRecords, pageCount);
                this.litSearchResultPage.Text = string.Format("<span class=\"fb\">共<span class=\"total-count\">{0}</span>件商品</span><span class=\"pager\"><span class=\"cur-page\">{1}</span>/<span class=\"total-page\">{1}页</span></span>", browseProductList.TotalRecords, pageCount);
                return;
            }
            #region 分页控件代码

            int pageIndex = 1;
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["pageindex"]))
            {
                int.TryParse(this.Page.Request.QueryString["pageindex"], out pageIndex);
            }
            if (browseProductList.TotalRecords <= 0)
            {
                pageIndex = 0;
            }

            string previousPager = "";
            string nextPager     = "";

            Regex           regex       = new Regex(@"(pageindex=\d+)");
            MatchCollection tempMatches = regex.Matches(this.Page.Request.RawUrl);
            if (tempMatches.Count == 0)
            {
                previousPager = this.Page.Request.RawUrl + (this.Page.Request.RawUrl.Contains("?") ? "&" : "?") + "pageindex=1";
                if (pageCount > 1)
                {
                    nextPager = this.Page.Request.RawUrl + (this.Page.Request.RawUrl.Contains("?") ? "&" : "?") + "pageindex=2";
                }
                else
                {
                    nextPager = previousPager;
                }
            }
            if (tempMatches.Count == 1)
            {
                foreach (Match item in tempMatches)
                {
                    string pagerInfo = item.Value;
                    if (pageIndex <= pageCount)
                    {
                        if ((pageIndex - 1) > 0)
                        {
                            previousPager = this.Page.Request.RawUrl.Replace(pagerInfo, "") + "pageindex=" + (pageIndex - 1);
                        }
                        else
                        {
                            previousPager = this.Page.Request.RawUrl.Replace(pagerInfo, "") + "pageindex=1";
                        }
                        if ((pageIndex + 1) <= pageCount)
                        {
                            nextPager = this.Page.Request.RawUrl.Replace(pagerInfo, "") + "pageindex=" + (pageIndex + 1);
                        }
                        else
                        {
                            nextPager = this.Page.Request.RawUrl.Replace(pagerInfo, "") + "pageindex=" + pageCount;
                        }
                    }
                }
            }

            #endregion

            if (pageCount > 1 && pageIndex == 1)
            {
                this.litSearchResultPage.Text = string.Format("<span class=\"fb\">共<span>{0}</span>件商品</span><span class=\"pager\"><span class=\"cur-page\">{2}</span>/<span class=\"total-page\">{3}页</span><a class=\"prev-page disabled\" href=\"{1}\">上一页</a><a class=\"next-page\" href=\"{4}\">下一页</a></span>", new object[]
                {
                    browseProductList.TotalRecords,
                    previousPager,
                    pageIndex,
                    pageCount,
                    nextPager
                });
            }
            else
            {
                this.litSearchResultPage.Text = string.Format("<span class=\"fb\">共<span>{0}</span>件商品</span><span class=\"pager\"><span class=\"cur-page\">{2}</span>/<span class=\"total-page\">{3}页</span><a class=\"prev-page\" href=\"{1}\">上一页</a><a class=\"next-page\" href=\"{4}\">下一页</a></span>", new object[]
                {
                    browseProductList.TotalRecords,
                    previousPager,
                    pageIndex,
                    pageCount,
                    nextPager
                });
            }
        }
        private void btnCreateReport_Click(object sender, System.EventArgs e)
        {
            ManagerHelper.CheckPrivilege(Privilege.ReconciOrdersDetailsExcel);
            string startDate = this.calendarStart.SelectedDate.ToString();
            string EndSdate  = this.calendarEnd.SelectedDate.ToString();

            if (string.IsNullOrEmpty(startDate) || string.IsNullOrEmpty(EndSdate))
            {
                this.ShowMsg("起止时间不能为空!", false);
                return;
            }

            System.TimeSpan ND   = Convert.ToDateTime(EndSdate) - Convert.ToDateTime(startDate);
            double          mday = ND.Days;

            if (mday > 31)
            {
                this.ShowMsg("查询起止时间不能大于31天!", false);
                return;
            }
            //获取搜索所有数据 PageIndex=0 为获取所有数据
            DbQueryResult ExpressFeeDetails = MemberHelper.GetReconciliationExpressFeeDetails(new ReconciliationExpressFeeQuery
            {
                BeginTime = !this.dateStart.HasValue ? "" : this.dateStart.Value.ToString("yyyy-MM-dd HH:mm:ss"),
                EndTime   = !this.dateEnd.HasValue ? "" : (this.dateEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59"),
                PageIndex = 0,
                PageSize  = 0,
                Supplier  = int.Parse(string.IsNullOrWhiteSpace(this.sysupperId) ? "0" : this.sysupperId)
            });
            DataTable dtResult = (DataTable)ExpressFeeDetails.Data;

            if (dtResult == null || dtResult.Rows.Count == 0)
            {
                this.ShowMsg("没有数据!", false);
                return;
            }
            foreach (DataColumn cl in dtResult.Columns)
            {
                if (cl.ColumnName == "OrderId")
                {
                    cl.ColumnName = "子订单编号";
                }
                else if (cl.ColumnName == "SupplierName")
                {
                    cl.ColumnName = "供应商";
                }
                else if (cl.ColumnName == "SourceOrderId")
                {
                    cl.ColumnName = "订单号";
                }
                else if (cl.ColumnName == "TradingTime")
                {
                    cl.ColumnName = "交易时间";
                }
                else if (cl.ColumnName == "ExpressCompanyName")
                {
                    cl.ColumnName = "快递公司";
                }
                else if (cl.ColumnName == "ShipOrderNumber")
                {
                    cl.ColumnName = "快递单号";
                }
                else if (cl.ColumnName.ToLower().Trim() == "shippingdate")
                {
                    cl.ColumnName = "发货时间";
                }
                else if (cl.ColumnName.ToLower().Trim() == "adjustedfreight")
                {
                    cl.ColumnName = "快递费用";
                }
            }
            MemoryStream ms = NPOIExcelHelper.ExportToExcel(dtResult, "快递费用报表明细");


            this.Page.Response.Clear();
            this.Page.Response.Buffer  = false;
            this.Page.Response.Charset = "GB2312";
            //this.Page.Response.AppendHeader("Content-Disposition", "attachment;filename=ReconciliationOrdersDetailed.xlsx");

            if (!(this.calendarStart.SelectedDate.HasValue && this.calendarEnd.SelectedDate.HasValue))
            {
                this.Page.Response.AppendHeader("Content-Disposition", "attachment;filename=快递费用报表明细.xlsx");
            }
            else
            {
                this.Page.Response.AppendHeader("Content-Disposition", "attachment;filename=快递费用报表明细_" + this.dateStart.Value.ToString("yyyyMMdd") + "-" + this.dateEnd.Value.ToString("yyyyMMdd") + ".xlsx");
            }
            this.Page.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            this.Page.Response.ContentType     = "application/octet-stream";
            this.Page.EnableViewState          = false;
            this.Page.Response.BinaryWrite(ms.ToArray());
            ms.Dispose();
            ms.Close();
            EventLogs.WriteOperationLog(Privilege.ReconciOrdersDetailsExcel, string.Format(CultureInfo.InvariantCulture, "用户{0}生成对快递费用明细报告成功", new object[]
            {
                this.User.Identity.Name
            }));

            this.Page.Response.End();
        }
Beispiel #15
0
        private void DoAction(string Action)
        {
            int    num = Globals.RequestFormNum("pageIndex");
            string s;

            if (num > 0)
            {
                int           userid = Globals.GetCurrentMemberUserId();
                DbQueryResult oneyuanPartInDataTable = OneyuanTaoHelp.GetOneyuanPartInDataTable(new OneyuanTaoPartInQuery
                {
                    PageIndex  = num,
                    PageSize   = 10,
                    ActivityId = "",
                    UserId     = Globals.GetCurrentMemberUserId(),
                    state      = 3,
                    SortBy     = "BuyTime",
                    IsPay      = -1
                });
                DataTable dataTable = new DataTable();
                if (oneyuanPartInDataTable.Data != null)
                {
                    dataTable = (DataTable)oneyuanPartInDataTable.Data;
                    dataTable.Columns.Add("LuckNumList");
                    dataTable.Columns.Add("PostSate");
                    dataTable.Columns.Add("PostBtn");
                    dataTable.Columns.Add("tabid");
                    System.Collections.IEnumerator enumerator = dataTable.Rows.GetEnumerator();
                    try
                    {
                        while (enumerator.MoveNext())
                        {
                            DataRow Item = (DataRow)enumerator.Current;
                            System.Collections.Generic.IList <LuckInfo> list = OneyuanTaoHelp.getLuckInfoList(true, Item["ActivityId"].ToString());
                            list = (from t in list
                                    where t.UserId == userid && t.Pid == Item["Pid"].ToString()
                                    select t).ToList <LuckInfo>();
                            Item["PostBtn"] = "0";
                            Item["tabid"]   = "0";
                            if (list != null)
                            {
                                System.Collections.Generic.List <string> list2 = new System.Collections.Generic.List <string>();
                                foreach (LuckInfo current in list)
                                {
                                    list2.Add(current.PrizeNum);
                                }
                                Item["LuckNumList"] = string.Join(",", list2);
                                DataTable dataTable2 = OneyuanTaoHelp.PrizesDeliveryRecord(Item["Pid"].ToString());
                                if (dataTable2 == null || dataTable2.Rows.Count == 0)
                                {
                                    Item["PostSate"] = "收货地址未确认";
                                }
                                else
                                {
                                    Item["PostSate"] = OneyuanTaoHelp.GetPrizesDeliveStatus(dataTable2.Rows[0]["status"].ToString());
                                    Item["PostBtn"]  = dataTable2.Rows[0]["status"].ToString();
                                    Item["tabid"]    = dataTable2.Rows[0]["Id"].ToString();
                                }
                            }
                        }
                    }
                    finally
                    {
                        System.IDisposable disposable = enumerator as System.IDisposable;
                        if (disposable != null)
                        {
                            disposable.Dispose();
                        }
                    }
                }
                string str = JsonConvert.SerializeObject(dataTable, new JsonConverter[]
                {
                    new IsoDateTimeConverter
                    {
                        DateTimeFormat = "yyyy-MM-dd HH:mm:ss"
                    }
                });
                s = "{\"state\":true,\"msg\":\"读取成功\",\"Data\":" + str + "}";
            }
            else
            {
                s = "{\"state\":false,\"msg\":\"参数不正确\"}";
            }
            this.Page.Response.ClearContent();
            this.Page.Response.ContentType = "application/json";
            this.Page.Response.Write(s);
            this.Page.Response.End();
        }
        public override void OnLoad(HttpContext context)
        {
            base.OnLoad(context);
            if (context.Request["flag"] == "GetFinishedVerificationRecord")
            {
                int storeId   = base.CurrentManager.StoreId;
                int managerId = 0;
                if (base.CurrentManager.RoleId == -3)
                {
                    managerId = base.CurrentManager.ManagerId;
                }
                string     keyword    = context.Request["keyword"].ToNullString();
                Pagination pagination = new Pagination();
                int        num        = context.Request["PageIndex"].ToInt(0);
                if (num < 1)
                {
                    num = 1;
                }
                int num2 = context.Request["PageSize"].ToInt(0);
                if (num2 < 1)
                {
                    num2 = 10;
                }
                pagination.PageIndex = num;
                pagination.PageSize  = num2;
                pagination.SortOrder = SortAction.Desc;
                pagination.SortBy    = "VerificationDate";
                DbQueryResult finishedVerificationRecord = OrderHelper.GetFinishedVerificationRecord(pagination, storeId, keyword, managerId);
                string        s = JsonConvert.SerializeObject(new
                {
                    Result = new
                    {
                        RecordCount = finishedVerificationRecord.TotalRecords,
                        List        = from d in finishedVerificationRecord.Data.AsEnumerable()
                                      select new
                        {
                            OrderId          = d.Field <string>("OrderId"),
                            ProductName      = d.Field <string>("ItemDescription"),
                            ThumbnailsUrl    = Globals.FullPath(d.Field <string>("ThumbnailsUrl")),
                            Price            = d.Field <decimal>("ItemAdjustedPrice").F2ToString("f2"),
                            num              = d.Field <int>("num"),
                            UserName         = d.Field <string>("UserName"),
                            VerificationDate = d.Field <DateTime>("VerificationDate").ToString("yyyy-MM-dd HH:mm:ss")
                        }
                    }
                });
                context.Response.Write(s);
                context.Response.End();
            }
            DateTime value;

            if (context.Request["flag"] == "CheckVerification")
            {
                int    storeId2             = base.CurrentManager.StoreId;
                string verificationPassword = context.Request["VerificationItems"];
                OrderVerificationItemInfo verificationInfoByPassword = OrderHelper.GetVerificationInfoByPassword(verificationPassword);
                if (verificationInfoByPassword == null)
                {
                    context.Response.Write(this.GetErrorJosn(801, "该核销码无效,请重新输入"));
                    return;
                }
                if (verificationInfoByPassword.StoreId != storeId2)
                {
                    context.Response.Write(this.GetErrorJosn(802, "非本门店核销码,请买家核对信息"));
                    return;
                }
                if (verificationInfoByPassword.VerificationStatus == 1)
                {
                    HttpResponse response = context.Response;
                    value = verificationInfoByPassword.VerificationDate.Value;
                    response.Write(this.GetErrorJosn(801, "该核销码 于" + value.ToString("yyyy-MM-dd HH:mm:ss") + "已核销"));
                    return;
                }
                if (verificationInfoByPassword.VerificationStatus == 3)
                {
                    context.Response.Write(this.GetErrorJosn(801, "核销码已过期,无法核销"));
                    return;
                }
                if (verificationInfoByPassword.VerificationStatus == 5)
                {
                    context.Response.Write(this.GetErrorJosn(801, "此核销码已进行售后,无法核销"));
                    return;
                }
                if (verificationInfoByPassword.VerificationStatus == 4)
                {
                    context.Response.Write(this.GetErrorJosn(801, "此核销码正在进行售后,无法核销"));
                    return;
                }
                string s2 = JsonConvert.SerializeObject(new
                {
                    Result = new
                    {
                        Success = new
                        {
                            Status = true,
                            Msg    = "核销码可用"
                        }
                    }
                });
                context.Response.Write(s2);
                context.Response.End();
            }
            decimal num3 = default(decimal);

            if (context.Request["flag"] == "OrderVerification")
            {
                int      storeId3 = base.CurrentManager.StoreId;
                string   text     = context.Request["VerificationItems"];
                string[] array    = text.Split(',');
                DateTime now      = DateTime.Now;
                string   text2    = "";
                OrderVerificationItemInfo orderVerificationItemInfo = null;
                for (int i = 0; i < array.Length; i++)
                {
                    if (!string.IsNullOrEmpty(array[i]))
                    {
                        OrderVerificationItemInfo verificationInfoByPassword2 = OrderHelper.GetVerificationInfoByPassword(array[i]);
                        if (i == 0)
                        {
                            orderVerificationItemInfo = verificationInfoByPassword2;
                            orderVerificationItemInfo.VerificationDate = DateTime.Now;
                        }
                        if (verificationInfoByPassword2 == null)
                        {
                            context.Response.Write(this.GetErrorJosn(801, "该核销码无效,请重新输入"));
                            return;
                        }
                        if (verificationInfoByPassword2.StoreId != storeId3)
                        {
                            context.Response.Write(this.GetErrorJosn(802, "非本门店核销码,请买家核对信息"));
                            return;
                        }
                        if (verificationInfoByPassword2.VerificationStatus == 1)
                        {
                            HttpResponse response2 = context.Response;
                            value = verificationInfoByPassword2.VerificationDate.Value;
                            response2.Write(this.GetErrorJosn(801, "该核销码 于" + value.ToString("yyyy-MM-dd HH:mm:ss") + "已核销"));
                            return;
                        }
                        if (verificationInfoByPassword2.VerificationStatus == 3)
                        {
                            context.Response.Write(this.GetErrorJosn(801, "核销码已过期,无法核销"));
                            return;
                        }
                        if (verificationInfoByPassword2.VerificationStatus == 5)
                        {
                            context.Response.Write(this.GetErrorJosn(801, "此核销码已进行售后,无法核销"));
                            return;
                        }
                        if (verificationInfoByPassword2.VerificationStatus == 4)
                        {
                            context.Response.Write(this.GetErrorJosn(801, "此核销码正在进行售后,无法核销"));
                            return;
                        }
                        verificationInfoByPassword2.VerificationStatus = 1;
                        verificationInfoByPassword2.VerificationDate   = now;
                        verificationInfoByPassword2.ManagerId          = base.CurrentManager.ManagerId;
                        verificationInfoByPassword2.UserName           = base.CurrentManager.UserName;
                        OrderHelper.UpdateVerificationItem(verificationInfoByPassword2);
                        text2 = verificationInfoByPassword2.OrderId;
                    }
                    WXAppletFormDataInfo wxFormData = WeChartAppletHelper.GetWxFormData(WXAppletEvent.ServiceProductValid, text2);
                    if (wxFormData != null)
                    {
                        wxFormData.EventValue += now.ToString("yyyyMMddHHmmss");
                        new WeChatAppletDao().Update(wxFormData, null);
                    }
                }
                OrderInfo serviceProductOrderInfo = OrderHelper.GetServiceProductOrderInfo(text2);
                if (serviceProductOrderInfo != null)
                {
                    num3 = serviceProductOrderInfo.GetTotal(false) / (decimal)serviceProductOrderInfo.GetBuyQuantity() * (decimal)array.Length;
                    MemberInfo user        = Users.GetUser(serviceProductOrderInfo.UserId);
                    string     storeName   = "";
                    string     productName = "";
                    if (serviceProductOrderInfo.StoreId > 0)
                    {
                        storeName = DepotHelper.GetStoreNameByStoreId(serviceProductOrderInfo.StoreId);
                    }
                    if (serviceProductOrderInfo.LineItems != null && serviceProductOrderInfo.LineItems.Count > 0)
                    {
                        productName = serviceProductOrderInfo.LineItems.Values.FirstOrDefault().ItemDescription;
                    }
                    Messenger.ServiceOrderValidSuccess(orderVerificationItemInfo, user, serviceProductOrderInfo, productName, storeName, text, num3);
                    if (OrderHelper.IsVerificationFinished(text2) && serviceProductOrderInfo.ItemStatus == OrderItemStatus.Nomarl)
                    {
                        serviceProductOrderInfo.OrderStatus = OrderStatus.Finished;
                        serviceProductOrderInfo.FinishDate  = DateTime.Now;
                        TradeHelper.UpdateOrderInfo(serviceProductOrderInfo);
                    }
                }
                string s3 = JsonConvert.SerializeObject(new
                {
                    Result = new
                    {
                        Status           = "SUCCESS",
                        VerificationDate = now.ToString("yyyy-MM-dd HH:mm:ss")
                    }
                });
                context.Response.Write(s3);
                context.Response.End();
            }
        }
Beispiel #17
0
        protected void btnExportButton_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ActitivyTitle"]))
            {
                this.ActitivyTitle = this.Page.Request.QueryString["ActitivyTitle"];
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["AddrReggion"]))
            {
                this.AddrReggion = base.Server.UrlDecode(this.Page.Request.QueryString["AddrReggion"]);
                this.SelReggion.SetSelectedRegionId(new int?(int.Parse(this.AddrReggion)));
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ShowTabNum"]))
            {
                this.ShowTabNum = base.Server.UrlDecode(this.Page.Request.QueryString["ShowTabNum"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["Receiver"]))
            {
                this.Receiver = base.Server.UrlDecode(this.Page.Request.QueryString["Receiver"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ProductName"]))
            {
                this.ProductName = base.Server.UrlDecode(this.Page.Request.QueryString["ProductName"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["StartDate"]))
            {
                this.StartDate = base.Server.UrlDecode(this.Page.Request.QueryString["StartDate"]);
                this.calendarStartDate.SelectedDate = new DateTime?(DateTime.Parse(this.StartDate));
            }
            else
            {
                this.StartDate = "";
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["EndDate"]))
            {
                this.EndDate = base.Server.UrlDecode(this.Page.Request.QueryString["EndDate"]);
                this.calendarEndDate.SelectedDate = new DateTime?(DateTime.Parse(this.EndDate));
            }
            else
            {
                this.EndDate = "";
            }
            PrizesDeliveQuery entity = new PrizesDeliveQuery {
                Status        = int.Parse(this.ShowTabNum) - 1,
                StartDate     = this.StartDate,
                EndDate       = this.EndDate,
                SortBy        = "WinTime",
                PrizeType     = 2,
                SortOrder     = SortAction.Desc,
                PageIndex     = this.pager.PageIndex,
                PageSize      = this.pager.PageSize,
                ProductName   = this.ProductName,
                Receiver      = this.Receiver,
                ReggionId     = this.AddrReggion,
                ActivityTitle = this.ActitivyTitle
            };

            Globals.EntityCoding(entity, true);
            DbQueryResult result  = GameHelper.GetAllPrizesDeliveryList(entity, "", "*");
            StringBuilder builder = new StringBuilder();

            builder.AppendLine("<table cellspacing=\"0\" cellpadding=\"5\" rules=\"all\" border=\"1\">");
            builder.AppendLine("<tr style=\"font-weight: bold; white-space: nowrap;\">");
            builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >活动名称</td>");
            builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >商品名称</td>");
            builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >奖品等级</td>");
            builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >中奖时间</td>");
            builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >收货人</td>");
            builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >联系电话</td>");
            builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >详细地址</td>");
            builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >快递公司</td>");
            builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >快递编号</td>");
            builder.AppendLine("</tr>");
            DataTable data = (DataTable)result.Data;
            string    str  = string.Empty;
            string    str2 = string.Empty;

            new List <int>();
            if (!string.IsNullOrEmpty(this.hidLogId.Value) || !string.IsNullOrEmpty(this.hidPid.Value))
            {
                str  = this.hidLogId.Value;
                str2 = this.hidPid.Value;
                string[]      collection = str.Split(new char[] { ',' });
                string[]      strArray2  = str2.Split(new char[] { ',' });
                List <string> list       = new List <string>(collection);
                List <string> list2      = new List <string>(strArray2);
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    string item = data.Rows[i]["LogId"].ToString();
                    string str4 = data.Rows[i]["Pid"].ToString();
                    if (list.Contains(item) || list2.Contains(str4))
                    {
                        builder.AppendLine("<tr>");
                        builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[i]["Title"] + "</td>");
                        builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[i]["ProductName"] + "</td>");
                        builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + GameHelper.GetPrizeGradeName(data.Rows[i]["PrizeGrade"].ToString()) + "</td>");
                        builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[i]["WinTime"] + "</td>");
                        builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[i]["Receiver"] + "</td>");
                        builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[i]["Tel"] + "</td>");
                        builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[i]["Address"] + "</td>");
                        builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[i]["ExpressName"] + "</td>");
                        builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[i]["CourierNumber"] + "</td>");
                        builder.AppendLine("</tr>");
                    }
                }
            }
            else
            {
                for (int j = 0; j < data.Rows.Count; j++)
                {
                    data.Rows[j]["LogId"].ToString();
                    builder.AppendLine("<tr>");
                    builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[j]["Title"] + "</td>");
                    builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[j]["ProductName"] + "</td>");
                    builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + GameHelper.GetPrizeGradeName(data.Rows[j]["PrizeGrade"].ToString()) + "</td>");
                    builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[j]["WinTime"] + "</td>");
                    builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[j]["Receiver"] + "</td>");
                    builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[j]["Tel"] + "</td>");
                    builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[j]["Address"] + "</td>");
                    builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[j]["ExpressName"] + "</td>");
                    builder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + data.Rows[j]["CourierNumber"] + "</td>");
                    builder.AppendLine("</tr>");
                }
            }
            if (data.Rows.Count == 0)
            {
                builder.AppendLine("<tr><td></td></tr>");
            }
            builder.AppendLine("</table>");
            this.Page.Response.Clear();
            this.Page.Response.Buffer  = false;
            this.Page.Response.Charset = "UTF-8";
            this.Page.Response.AppendHeader("Content-Disposition", "attachment;filename=PrizeLists_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls");
            this.Page.Response.ContentEncoding = Encoding.GetEncoding("UTF-8");
            this.Page.Response.ContentType     = "application/ms-excel";
            this.Page.EnableViewState          = false;
            this.Page.Response.Write(builder.ToString());
            this.Page.Response.End();
        }
Beispiel #18
0
        private string getOrderList(HttpContext context)
        {
            int num  = 0;
            int num2 = 0;

            num  = Convert.ToInt32(context.Request["PageSize"]);
            num2 = Convert.ToInt32(context.Request["Page"]);
            int    num3  = Convert.ToInt32(context.Request["OrderStatus"]);
            string text  = null;
            string text2 = null;

            if (!string.IsNullOrWhiteSpace(context.Request["Start_Modified"]))
            {
                text = context.Request["Start_Modified"];
            }
            if (!string.IsNullOrWhiteSpace(context.Request["End_Modified"]))
            {
                text2 = context.Request["End_Modified"];
            }
            OrderQuery orderQuery = new OrderQuery();

            switch (num3)
            {
            case 0:
                orderQuery.Status = OrderStatus.WaitBuyerPay;
                goto default;

            case 1:
                orderQuery.Status = OrderStatus.BuyerAlreadyPaid;
                goto default;

            case -1:
                return("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Order><Result>1</Result><OrderCount>0</OrderCount><OrderList></OrderList></Order>");

            default:
            {
                if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2))
                {
                    orderQuery.StartDate = DateTime.Parse(text);
                    orderQuery.EndDate   = DateTime.Parse(text2);
                }
                orderQuery.PageIndex  = num2;
                orderQuery.PageSize   = num;
                orderQuery.SupplierId = 0;
                DbQueryResult orders        = OrderHelper.GetOrders(orderQuery);
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                stringBuilder.Append("<Order>");
                stringBuilder.Append($"<OrderCount>{orders.TotalRecords}</OrderCount>");
                stringBuilder.Append("<Result>1</Result>");
                stringBuilder.Append("<Cause></Cause>");
                stringBuilder.Append($"<Page>{num2}</Page>");
                stringBuilder.Append("<OrderList>");
                DataTable data = orders.Data;
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    stringBuilder.Append(string.Format("<OrderNO>{0}</OrderNO>", data.Rows[i]["OrderId"]));
                }
                stringBuilder.Append("</OrderList>");
                stringBuilder.Append("</Order>");
                return(stringBuilder.ToString());
            }
            }
        }
Beispiel #19
0
        public IHttpActionResult HelpByCategory(int categoryId, string accessToken, int channel, int platform, string ver)
        {
            Logger.WriterLogger("Common.HelpByCategory, Params: " + string.Format("accessToken={0}&channel={1}&platform={2}&ver={3}&categoryId={4}", accessToken, channel, platform, ver, categoryId), LoggerType.Info);

            // 保存访问信息
            base.SaveVisitInfo("", channel, platform, ver);

            // 验证令牌
            int accessTookenCode = VerifyAccessToken(accessToken);

            if (accessTookenCode > 0)
            {
                return(base.JsonFaultResult(new CommonException(accessTookenCode).GetMessage(), "Common.HelpByCategory"));
            }

            IList <HelpCategoryInfo> categories = CommentBrowser.GetHelpCategorys();

            HelpQuery helpQuery = new HelpQuery();

            if (categoryId > 0)
            {
                helpQuery.CategoryId = categoryId;
            }
            helpQuery.PageIndex = 1;
            helpQuery.PageSize  = int.MaxValue;
            helpQuery.SortBy    = "AddedDate";
            helpQuery.SortOrder = EcShop.Core.Enums.SortAction.Desc;

            List <HelpListItem> items = new List <HelpListItem>();

            DbQueryResult dbQueryResult = CommentBrowser.GetHelpList(helpQuery);

            DataTable dt = dbQueryResult.Data as DataTable;

            if (dt != null)
            {
                HelpListItem item = null;

                foreach (DataRow row in dt.Rows)
                {
                    item = new HelpListItem();

                    item.CategoryId  = (int)row["CategoryId"];
                    item.Id          = (int)row["HelpId"];
                    item.Title       = (string)row["Title"];
                    item.Description = "";
                    if (row["Description"] != DBNull.Value)
                    {
                        item.Description = (string)row["Description"];
                    }
                    item.AddedDate = "";
                    if (row["AddedDate"] != DBNull.Value)
                    {
                        item.AddedDate = ((DateTime)row["AddedDate"]).ToString("yyyy-MM-dd HH:mm:ss");
                    }

                    items.Add(item);
                }
            }

            return(base.JsonActionResult(new StandardResult <ListResult <HelpListItem> >()
            {
                code = 0,
                msg = "",
                data = new ListResult <HelpListItem>()
                {
                    TotalNumOfRecords = items.Count,
                    Results = items
                }
            }));
        }
Beispiel #20
0
        private string findProduct(HttpContext context)
        {
            int num  = 0;
            int num2 = 0;

            num  = Convert.ToInt32(context.Request["PageSize"]);
            num2 = Convert.ToInt32(context.Request["Page"]);
            string            text        = null;
            string            productCode = null;
            string            keywords    = null;
            ProductSaleStatus saleStatus  = ProductSaleStatus.All;

            if (!string.IsNullOrWhiteSpace(context.Request["GoodsType"]))
            {
                text = context.Request["GoodsType"];
                if (text.Equals("Onsale"))
                {
                    saleStatus = ProductSaleStatus.OnSale;
                }
                else if (text.Equals("InStock"))
                {
                    saleStatus = ProductSaleStatus.OnStock;
                }
            }
            if (!string.IsNullOrWhiteSpace(context.Request["OuterID"]))
            {
                productCode = context.Request["OuterID"];
            }
            else if (!string.IsNullOrWhiteSpace(context.Request["GoodsName"]))
            {
                keywords = context.Request["GoodsName"];
            }
            ProductQuery productQuery = new ProductQuery
            {
                Keywords    = keywords,
                ProductCode = productCode,
                PageSize    = num,
                PageIndex   = num2,
                SortOrder   = SortAction.Desc,
                SortBy      = "DisplaySequence",
                SaleStatus  = saleStatus,
                SupplierId  = 0
            };

            Globals.EntityCoding(productQuery, true);
            DbQueryResult products      = ProductHelper.GetProducts(productQuery);
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            stringBuilder.Append("<Goods>");
            stringBuilder.Append($"<TotalCount>{products.TotalRecords}</TotalCount>");
            stringBuilder.Append("<Result>1</Result>");
            stringBuilder.Append("<Cause></Cause>");
            DataTable data = products.Data;

            for (int i = 0; i < data.Rows.Count; i++)
            {
                stringBuilder.Append("<Ware>");
                int num3 = Convert.ToInt32(data.Rows[i]["ProductId"]);
                int num4 = Convert.ToInt32(data.Rows[i]["HasSKU"]);
                stringBuilder.Append($"<ItemID>{num3}</ItemID>");
                stringBuilder.Append(string.Format("<ItemName><![CDATA[{0}]]></ItemName>", data.Rows[i]["ProductName"]));
                stringBuilder.Append(string.Format("<OuterID><![CDATA[{0}]]></OuterID>", data.Rows[i]["ProductCode"]));
                stringBuilder.Append(string.Format("<Price>{0}</Price>", data.Rows[i]["SalePrice"]));
                stringBuilder.Append(string.Format("<Num>{0}</Num>", data.Rows[i]["Stock"]));
                stringBuilder.Append($"<IsSku>{num4}</IsSku>");
                stringBuilder.Append("<Items>");
                if (num4 > 0)
                {
                    DataTable dataTable = ProductBrowser.ApiGetSkusByProductId(num3);
                    for (int j = 0; j < dataTable.Rows.Count; j++)
                    {
                        stringBuilder.Append("<Item>");
                        stringBuilder.Append(string.Format("<Unit>{0}</Unit>", dataTable.Rows[j]["valuestr"]));
                        stringBuilder.Append(string.Format("<SkuID>{0}</SkuID>", dataTable.Rows[j]["skuId"]));
                        stringBuilder.Append(string.Format("<Num>{0}</Num>", dataTable.Rows[j]["Stock"]));
                        stringBuilder.Append(string.Format("<SkuOuterID>{0}</SkuOuterID>", dataTable.Rows[j]["SKU"]));
                        stringBuilder.Append(string.Format("<SkuPrice>{0}</SkuPrice>", dataTable.Rows[j]["SalePrice"]));
                        stringBuilder.Append("</Item>");
                    }
                }
                stringBuilder.Append("</Items>");
                stringBuilder.Append("</Ware>");
            }
            stringBuilder.Append("</Goods>");
            return(stringBuilder.ToString());
        }
Beispiel #21
0
        private void BindData()
        {
            OneyuanTaoPartInQuery query = new OneyuanTaoPartInQuery {
                PageIndex = this.pager.PageIndex,
                PageSize  = this.pager.PageSize,
                IsPay     = 1,
                SortBy    = "Pid",
                UserName  = this.UserName,
                PayWay    = this.PayWay,
                CellPhone = this.phone,
                Atitle    = this.atitle
            };

            if (this.state == 0)
            {
                query.state = 5;
            }
            else
            {
                query.state = 4;
            }
            DbQueryResult oneyuanPartInDataTable = OneyuanTaoHelp.GetOneyuanPartInDataTable(query);

            if (oneyuanPartInDataTable.Data != null)
            {
                DataTable data = (DataTable)oneyuanPartInDataTable.Data;
                data.Columns.Add("ActionBtn");
                data.Columns.Add("ASate");
                foreach (DataRow row in data.Rows)
                {
                    if ((bool)row["IsRefund"])
                    {
                        row["ASate"] = "<span class='green'>已退款</span>";
                    }
                    else if ((bool)row["RefundErr"])
                    {
                        row["ASate"] = "<span class='red'>退款错误</span>";
                    }
                    else
                    {
                        row["ASate"] = "<span class='red'>待退款</span>";
                    }
                    string str = string.Concat(new object[] { "<a class=\"btn btn-xs btn-danger\"  onclick=\"DoRefund('", row["Pid"], "','", row["PayWay"], "')\" >退款</a> " });
                    if ((bool)row["RefundErr"])
                    {
                        str = "<a class=\"btn btn-xs btn-primary\"  Remark='" + Globals.HtmlEncode(row["Remark"].ToString()) + "' onclick=\"AView(this)\"  >原因</a> " + str;
                    }
                    if ((bool)row["IsRefund"])
                    {
                        str = "";
                        if (row["RefundTime"] != DBNull.Value)
                        {
                            str = "<span>" + ((DateTime)row["RefundTime"]).ToString("yyyy-MM-dd") + "</span> ";
                        }
                        this.actionTd.InnerText = "退款时间";
                    }
                    row["ActionBtn"] = str;
                }
                this.Datalist.DataSource = data;
                this.Datalist.DataBind();
                this.pager.TotalRecords = oneyuanPartInDataTable.TotalRecords;
                int hasRefund = 0;
                this.ListWait.Text = "待退款(" + OneyuanTaoHelp.GetRefundTotalNum(out hasRefund).ToString() + ")";
                this.ListEnd.Text  = "已退款(" + hasRefund.ToString() + ")";
            }
        }
Beispiel #22
0
        private void BindProducts(int couponId)
        {
            DataTable selectedProducts = this.GetSelectedProducts(couponId);
            string    text             = this.txt_name.Text;
            string    val       = this.txt_minPrice.Text;
            string    str3      = this.txt_maxPrice.Text;
            decimal?  nullable  = null;
            decimal?  nullable2 = null;
            decimal   i         = 0M;

            if (!this.bDecimal(val, ref i))
            {
                nullable = null;
            }
            else
            {
                nullable = new decimal?(i);
            }
            if (!this.bDecimal(str3, ref i))
            {
                nullable2 = null;
            }
            else
            {
                nullable2 = new decimal?(i);
            }
            ProductQuery entity = new ProductQuery {
                Keywords    = text,
                ProductCode = "",
                CategoryId  = null,
                PageSize    = this.pager.PageSize,
                PageIndex   = this.pager.PageIndex,
                SortOrder   = SortAction.Desc,
                SortBy      = "DisplaySequence",
                StartDate   = null,
                BrandId     = null,
                EndDate     = null,
                TypeId      = null,
                SaleStatus  = ProductSaleStatus.All,
                minPrice    = nullable,
                maxPrice    = nullable2
            };
            string str4 = string.Empty;

            foreach (DataRow row in selectedProducts.Rows)
            {
                str4 = str4 + row["ProductId"].ToString() + ",";
            }
            Globals.EntityCoding(entity, true);
            DbQueryResult productsFromGroup = ProductHelper.GetProductsFromGroup(entity, str4.TrimEnd(new char[] { ',' }));
            DataTable     data = (DataTable)productsFromGroup.Data;

            data.Columns.Add("canstopStatus");
            data.Columns.Add("canopenStatus");
            if ((data != null) && (selectedProducts != null))
            {
                if ((data.Rows.Count > 0) && (selectedProducts.Rows.Count > 0))
                {
                    for (int j = 0; j < data.Rows.Count; j++)
                    {
                        string str5 = data.Rows[j]["ProductId"].ToString();
                        if (selectedProducts.Select(" productId='" + str5 + "'")[0]["status"].ToString() == "0")
                        {
                            data.Rows[j]["canstopStatus"] = "''";
                            data.Rows[j]["canopenStatus"] = "none";
                        }
                        else
                        {
                            data.Rows[j]["canstopStatus"] = "none";
                            data.Rows[j]["canopenStatus"] = "''";
                        }
                    }
                }
                else if (data.Rows.Count > 0)
                {
                    for (int k = 0; k < data.Rows.Count; k++)
                    {
                        data.Rows[k]["canstopStatus"] = "none";
                        data.Rows[k]["canopenStatus"] = "''";
                    }
                }
            }
            this.grdProducts.DataSource = productsFromGroup.Data;
            this.grdProducts.DataBind();
            this.pager.TotalRecords = productsFromGroup.TotalRecords;
            this.lblJoin.Text       = selectedProducts.Rows.Count.ToString();
            this.setInSaleAndStock();
        }
Beispiel #23
0
        public static DbQueryResult GetPhotoList(string keyword, int?categoryId, int pageIndex, PhotoListOrder order, int type, int pagesize = 20)
        {
            DbQueryResult photoList = GalleryHelper.GetPhotoList(keyword, categoryId, pageIndex, pagesize, order, type);

            return(photoList);
        }
Beispiel #24
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList(OrderQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            if (query != null)
            {
                DbQueryResult orders = OrderHelper.GetOrders(query);
                dataGridViewModel.rows  = DataHelper.DataTableToDictionary(orders.Data);
                dataGridViewModel.total = orders.TotalRecords;
                string[] orderIds = (from d in dataGridViewModel.rows
                                     select d["OrderId"].ToString()).ToArray();
                List <RefundInfo> refundInfos = TradeHelper.GetRefundInfos(orderIds);
                foreach (Dictionary <string, object> row in dataGridViewModel.rows)
                {
                    OrderInfo order = TradeHelper.GetOrderInfo(row["OrderId"].ToString());
                    row.Add("OrderStatusText", OrderHelper.GetOrderStatusText(order.OrderStatus, order.ShippingModeId, order.IsConfirm, order.Gateway, 0, order.PreSaleId, order.DepositDate, false, order.ItemStatus, OrderType.NormalOrder));
                    row.Add("CanConfirmOrder", order.CanConfirmOrder());
                    row.Add("canCheckTake", order.CanConfirmTakeCode());
                    row.Add("canCloseOrder", this.CanClose(order, base.CurrentSiteSetting.OpenMultStore));
                    row.Add("canOfflineReceipt", OrderHelper.CanConfirmOfflineReceipt(order, false));
                    row.Add("CanEditPrice", this.CanEditPrice(order));
                    row.Add("InvoiceTypeText", string.IsNullOrEmpty(order.InvoiceTitle) ? "" : EnumDescription.GetEnumDescription((Enum)(object)order.InvoiceType, 0));
                    bool flag = order.CanSendGoods(base.CurrentSiteSetting.OpenMultStore);
                    if (base.CurrentSiteSetting.OpenMultStore && order.StoreId != 0)
                    {
                        flag = false;
                    }
                    row.Add("canSendGoods", flag);
                    row.Add("canFinishTrade", order.OrderStatus == OrderStatus.SellerAlreadySent && order.ItemStatus == OrderItemStatus.Nomarl);
                    bool flag2 = false;
                    if (base.CurrentSiteSetting.OpenMultStore && order.CountDownBuyId == 0 && order.BundlingId == 0 && order.ItemStatus == OrderItemStatus.Nomarl && (order.OrderStatus == OrderStatus.BuyerAlreadyPaid || (order.OrderStatus == OrderStatus.WaitBuyerPay && order.Gateway == "hishop.plugins.payment.podrequest")))
                    {
                        if (order.StoreId == -1)
                        {
                            flag2 = (order.LineItems.Count > 0);
                        }
                        else if (order.StoreId > 0)
                        {
                            flag2 = !order.IsConfirm;
                        }
                        else if (order.StoreId == 0)
                        {
                            flag2 = (order.ShippingModeId != -2 && order.LineItems.Count > 0);
                        }
                    }
                    row.Add("CanAllotStore", flag2);
                    RefundInfo refundInfo = refundInfos.FirstOrDefault((RefundInfo d) => d.OrderId == order.OrderId);
                    if (refundInfo != null)
                    {
                        row.Add("IsCheckRefund", order.OrderStatus == OrderStatus.ApplyForRefund && !order.IsStoreCollect);
                        row.Add("RefundId", refundInfo.RefundId);
                    }
                    bool   flag3  = false;
                    string value  = string.Empty;
                    string value2 = string.Empty;
                    if (order.ItemStatus != 0 || order.OrderStatus == OrderStatus.ApplyForRefund)
                    {
                        if (refundInfo != null && order.OrderStatus == OrderStatus.ApplyForRefund)
                        {
                            flag3  = true;
                            value2 = "订单已申请退款";
                            value  = "/Admin/sales/RefundApplyDetail?RefundId=" + refundInfo.RefundId;
                        }
                        else
                        {
                            int            num            = 0;
                            AfterSaleTypes afterSaleTypes = AfterSaleTypes.ReturnAndRefund;
                            int            num2           = 0;
                            foreach (LineItemInfo value4 in order.LineItems.Values)
                            {
                                if (value4.ReturnInfo != null || value4.ReplaceInfo != null)
                                {
                                    ReturnInfo  returnInfo  = value4.ReturnInfo;
                                    ReplaceInfo replaceInfo = value4.ReplaceInfo;
                                    if (num == 0 || (returnInfo != null && returnInfo.HandleStatus != ReturnStatus.Refused && returnInfo.HandleStatus != ReturnStatus.Returned) || (replaceInfo != null && (replaceInfo.HandleStatus != ReplaceStatus.Refused || replaceInfo.HandleStatus != ReplaceStatus.Replaced)))
                                    {
                                        if (value4.ReturnInfo != null)
                                        {
                                            afterSaleTypes = AfterSaleTypes.ReturnAndRefund;
                                            num2           = value4.ReturnInfo.ReturnId;
                                        }
                                        else
                                        {
                                            afterSaleTypes = AfterSaleTypes.Replace;
                                            num2           = value4.ReplaceInfo.ReplaceId;
                                        }
                                    }
                                    num++;
                                }
                            }
                            if (order.ItemStatus == OrderItemStatus.HasReturnOrReplace)
                            {
                                value2 = "订单中有商品正在退货/换货中";
                            }
                            else if (order.ReturnedCount > 0)
                            {
                                value2 = "订单中有商品已退货完成";
                            }
                            else if (order.ItemStatus == OrderItemStatus.HasReplace)
                            {
                                value2 = "订单中有商品正在进行换货操作";
                            }
                            else if (order.ItemStatus == OrderItemStatus.HasReturn)
                            {
                                value2 = "订单中有商品正在进行退货操作";
                            }
                            if (num > 0)
                            {
                                flag3 = true;
                                value = ((afterSaleTypes != AfterSaleTypes.ReturnAndRefund) ? ("ReplaceApplyDetail?ReplaceId=" + num2) : ("ReturnApplyDetail?ReturnId=" + num2));
                            }
                        }
                    }
                    row.Add("IsShowRefundIcon", flag3);
                    row.Add("RefundOperUrl", value);
                    row.Add("RefundTips", value2);
                    bool flag4 = false;
                    if (order.FightGroupId > 0)
                    {
                        FightGroupInfo fightGroup = VShopHelper.GetFightGroup(order.FightGroupId);
                        if (fightGroup != null)
                        {
                            row.Add("FightGroupActivityId", fightGroup.FightGroupActivityId);
                            if (fightGroup.Status == FightGroupStatus.FightGroupIn && order.OrderStatus != OrderStatus.WaitBuyerPay && order.OrderStatus != OrderStatus.Closed)
                            {
                                flag4 = true;
                            }
                        }
                    }
                    row.Add("FightGrouping", flag4);
                    if (order.StoreId > 0)
                    {
                        row.Add("StoreName", this.GetStoreName(order.StoreId));
                    }
                    if (order.LineItems.Count <= 0)
                    {
                        if (order.UserAwardRecordsId > 0)
                        {
                            row.Add("IsAwardOrder", true);
                        }
                        else
                        {
                            row.Add("IsGiftOrder", true);
                        }
                    }
                    if (order.PreSaleId > 0 && order.OrderStatus == OrderStatus.BuyerAlreadyPaid)
                    {
                        ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(order.PreSaleId);
                        if (productPreSaleInfo != null)
                        {
                            string   value3 = "";
                            DateTime dateTime;
                            if (productPreSaleInfo.DeliveryDate.HasValue)
                            {
                                dateTime = productPreSaleInfo.DeliveryDate.Value;
                                value3   = "<span>预计发货时间:" + dateTime.ToString("yyyy-MM-dd") + "</span>";
                            }
                            else
                            {
                                DateTime payDate = order.PayDate;
                                if (order.PayDate != DateTime.MinValue)
                                {
                                    dateTime = order.PayDate;
                                    dateTime = dateTime.AddDays((double)productPreSaleInfo.DeliveryDays);
                                    value3   = "<span>预计发货时间:" + dateTime.ToString("yyyy-MM-dd") + "</span>";
                                }
                            }
                            row.Add("SendGoodsTips", value3);
                        }
                    }
                }
            }
            return(dataGridViewModel);
        }
Beispiel #25
0
        private void BindData()
        {
            string   text          = "";
            string   selectedValue = "";
            decimal? nullable      = null;
            decimal? nullable2     = null;
            DateTime?selectedDate  = null;
            DateTime?nullable4     = null;

            text = this.txt_name.Text;
            decimal  i   = 0M;
            DateTime now = DateTime.Now;

            if (this.bDecimal(this.txt_minVal.Text, ref i))
            {
                nullable = new decimal?(i);
            }
            if (this.bDecimal(this.txt_maxVal.Text, ref i))
            {
                nullable2 = new decimal?(i);
            }
            selectedDate  = this.calendarStartDate.SelectedDate;
            nullable4     = this.calendarEndDate.SelectedDate;
            selectedValue = this.ddlCouponType.SelectedValue;
            CouponsSearch search = new CouponsSearch
            {
                CouponName = text,
                minValue   = nullable,
                maxValue   = nullable2,
                beginDate  = selectedDate,
                endDate    = nullable4,
                IsCount    = true,
                PageIndex  = this.pager1.PageIndex,
                PageSize   = this.pager1.PageSize,
                SortBy     = "CouponId",
                SortOrder  = SortAction.Desc,
                Finished   = new bool?(bFininshed),
                SearchType = new int?(string.IsNullOrEmpty(selectedValue) ? 0 : int.Parse(selectedValue))
            };
            DbQueryResult couponInfos = CouponHelper.GetCouponInfos(search);

            if (couponInfos != null)
            {
                DataTable data = (DataTable)couponInfos.Data;
                if (data.Rows.Count > 0)
                {
                    data.Columns.Add("useConditon");
                    data.Columns.Add("ReceivNum");
                    data.Columns.Add("expire");
                    for (int j = 0; j < data.Rows.Count; j++)
                    {
                        decimal num3 = decimal.Parse(data.Rows[j]["ConditionValue"].ToString());
                        if (num3 == 0M)
                        {
                            data.Rows[j]["useConditon"] = "不限制";
                        }
                        else
                        {
                            data.Rows[j]["useConditon"] = "满" + num3.ToString("F2") + "可使用";
                        }
                        string str3 = data.Rows[j]["maxReceivNum"].ToString();
                        if (str3 == "0")
                        {
                            data.Rows[j]["ReceivNum"] = "无限制";
                        }
                        else
                        {
                            data.Rows[j]["ReceivNum"] = str3 + "/张每人";
                        }
                        data.Rows[j]["expire"] = DateTime.Parse(data.Rows[j]["EndDate"].ToString()) <= DateTime.Now;
                    }
                }
                this.grdCoupondsList.DataSource = data;
                this.grdCoupondsList.DataBind();
            }
            this.pager1.TotalRecords = couponInfos.TotalRecords;
        }
Beispiel #26
0
        private void GetProducts(System.Web.HttpContext context)
        {
            int pageIndex = 1;
            int pageSize  = 10;

            if (!string.IsNullOrEmpty(context.Request["pageIndex"]))
            {
                int.TryParse(context.Request["pageIndex"], out pageIndex);
            }
            if (!string.IsNullOrEmpty(context.Request["pageSize"]))
            {
                int.TryParse(context.Request["pageSize"], out pageSize);
            }
            ProductBrowseQuery productBrowseQuery = new ProductBrowseQuery();

            productBrowseQuery.PageIndex = pageIndex;
            productBrowseQuery.PageSize  = pageSize;
            if (!string.IsNullOrEmpty(context.Request["cId"]))
            {
                int num = 0;
                int.TryParse(context.Request["cId"], out num);
                if (num != 0)
                {
                    productBrowseQuery.CategoryId = new int?(num);
                }
            }
            productBrowseQuery.Keywords  = context.Request["keyword"];
            productBrowseQuery.SortBy    = "DisplaySequence";
            productBrowseQuery.SortOrder = SortAction.Desc;
            if (!string.IsNullOrEmpty(context.Request["sortBy"]))
            {
                productBrowseQuery.SortBy = context.Request["sortBy"];
            }
            if (!string.IsNullOrEmpty(context.Request["sortOrder"]) && context.Request["sortOrder"] == "asc")
            {
                productBrowseQuery.SortOrder = SortAction.Asc;
            }
            DbQueryResult browseProductList = ProductBrowser.GetBrowseProductList(productBrowseQuery);

            System.Data.DataTable dataTable = (System.Data.DataTable)browseProductList.Data;
            if (dataTable == null || dataTable.Rows.Count == 0)
            {
                context.Response.Write(this.GetErrorJosn(103, "没获取到相应的商品"));
                return;
            }
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            stringBuilder.Append("{\"result\":{");
            stringBuilder.AppendFormat("\"totals\":{0},", browseProductList.TotalRecords);
            stringBuilder.Append("\"products\":[");
            foreach (System.Data.DataRow dataRow in dataTable.Rows)
            {
                stringBuilder.Append("{");
                stringBuilder.AppendFormat("\"pid\":{0},", dataRow["ProductId"]);
                stringBuilder.AppendFormat("\"name\":\"{0}\",", dataRow["ProductName"]);
                stringBuilder.AppendFormat("\"pic\":\"{0}\",", (dataRow["ThumbnailUrl60"] == System.DBNull.Value) ? Globals.FullPath(this.siteSettings.DefaultProductThumbnail4) : Globals.FullPath((string)dataRow["ThumbnailUrl60"]));
                stringBuilder.AppendFormat("\"price\":\"{0}\",", ((decimal)dataRow["SalePrice"]).ToString("F2"));
                stringBuilder.AppendFormat("\"saleCounts\":\"{0}\",", ((int)dataRow["SaleCounts"]).ToString());
                stringBuilder.AppendFormat("\"url\":\"{0}\"", Globals.FullPath(string.Format("/AppShop/ProductDetails.aspx?productId={0}", dataRow["ProductId"])));
                stringBuilder.Append("},");
            }
            stringBuilder.Remove(stringBuilder.Length - 1, 1);
            stringBuilder.Append("]}}");
            context.Response.Write(stringBuilder.ToString());
        }
Beispiel #27
0
        void BindData()
        {
            OneyuanTaoQuery query = new OneyuanTaoQuery();

            query.PageIndex = pager.PageIndex;
            query.PageSize  = pager.PageSize;
            query.title     = atitle;
            query.state     = state;
            query.ReachType = ReachType;
            DbQueryResult ListData = OneyuanTaoHelp.GetOneyuanTao(query);

            if (ListData.Data != null)
            {
                DataTable dt = (DataTable)ListData.Data;
                dt.Columns.Add("ActionBtn");  //显示的按钮
                dt.Columns.Add("ASate");      //当前状态
                dt.Columns.Add("PrizeState"); //开奖状态
                dt.Columns.Add("CanDel");     //开奖状态

                foreach (DataRow Item in dt.Rows)
                {
                    OneyuanTaoInfo   tempItem      = OneyuanTaoHelp.DataRowToOneyuanTaoInfo(Item);
                    OneTaoState      rowState      = OneyuanTaoHelp.getOneTaoState(tempItem);
                    OneTaoPrizeState rowPrizeState = OneyuanTaoHelp.getPrizeState(tempItem);

                    Item["ASate"]      = rowState;
                    Item["PrizeState"] = rowPrizeState;
                    Item["CanDel"]     = 0;

                    if (rowPrizeState == OneTaoPrizeState.成功开奖)
                    {
                        Item["PrizeState"] = "<span class='success'>" + rowPrizeState + "<span>";
                    }
                    else if (rowPrizeState == OneTaoPrizeState.已关闭)
                    {
                        Item["PrizeState"] = "<span class='normal'>" + rowPrizeState + "<span>";
                    }
                    else if (rowPrizeState == OneTaoPrizeState.待退款)
                    {
                        Item["PrizeState"] = "<span class='green'>" + rowPrizeState + "<span>";
                    }
                    else
                    {
                        Item["PrizeState"] = "<span class='errcss'>" + rowPrizeState + "<span>";
                    }


                    string btnstr = "<a class=\"btn btn-xs btn-primary\" onclick=\"AView('" + Item["ActivityId"] + "')\" >查看</a> ";

                    if (rowState == OneTaoState.进行中 || rowState == OneTaoState.未开始)
                    {
                        btnstr += "<a class=\"btn btn-xs btn-primary\" onclick=\"AEdit('" + Item["ActivityId"] + "')\"  >编辑</a> ";
                    }


                    if (rowState == OneTaoState.未开始)
                    {
                        btnstr += "<a class=\"btn btn-xs btn-success\" onclick=\"AStart('" + Item["ActivityId"] + "')\"  >开启</a> ";
                    }

                    if (rowState == OneTaoState.进行中)
                    {
                        btnstr += "<a class=\"btn btn-xs btn-danger\" onclick=\"AEnd('" + Item["ActivityId"] + "','" + Item["FinishedNum"] + "','" + Item["ReachType"] + "','" + Item["ReachNum"] + "')\"  >结束</a> ";
                    }


                    if ((rowState == OneTaoState.已结束 && (int)Item["FinishedNum"] == 0) || rowState == OneTaoState.未开始)
                    {
                        //可删除的活动,1未开始,2已结束且没有人参与的活动

                        btnstr        += "<a class=\"btn btn-xs btn-danger\" onclick=\"ADel('" + Item["ActivityId"] + "')\" >删除</a> ";
                        Item["CanDel"] = 1;
                    }


                    if (rowState == OneTaoState.开奖失败)
                    {
                        btnstr += "<a class=\"btn btn-xs btn-danger\" onclick=\"BatchRefund('" + Item["ActivityId"] + "')\" >批量退款</a> ";
                    }

                    Item["ActionBtn"] = btnstr;
                }


                Datalist.DataSource = dt;
                Datalist.DataBind();
                pager.TotalRecords = ListData.TotalRecords;

                int hasStart  = 0;
                int waitStart = 0;
                int Total     = 0;
                int hasEnd    = 0;

                Total = OneyuanTaoHelp.GetOneyuanTaoTotalNum(out hasStart, out waitStart, out hasEnd);

                ListTotal.Text = "所有夺宝(" + Total.ToString() + ")";
                ListStart.Text = "进行中(" + hasStart.ToString() + ")";
                ListWait.Text  = "未开始(" + waitStart.ToString() + ")";
                Listend.Text   = "已结束(" + hasEnd.ToString() + ")";
            }



            //DataTable dt = (DataTable)productSet.Data;
            //dt.Columns.Add("setStatus");

            pager.TotalRecords = ListData.TotalRecords;
        }
Beispiel #28
0
        private void BindProducts(int actId)
        {
            DataTable selectedProducts = this.GetSelectedProducts();
            string    text             = this.txt_name.Text;
            string    val       = this.txt_minPrice.Text;
            string    str3      = this.txt_maxPrice.Text;
            decimal?  nullable  = null;
            decimal?  nullable2 = null;
            decimal   i         = 0M;

            if (!this.bDecimal(val, ref i))
            {
                nullable = null;
            }
            else
            {
                nullable = new decimal?(i);
            }
            if (!this.bDecimal(str3, ref i))
            {
                nullable2 = null;
            }
            else
            {
                nullable2 = new decimal?(i);
            }
            ProductQuery entity = new ProductQuery {
                Keywords    = text,
                ProductCode = "",
                CategoryId  = null,
                PageSize    = this.pager.PageSize,
                PageIndex   = this.pager.PageIndex,
                SortOrder   = SortAction.Desc,
                SortBy      = "DisplaySequence",
                StartDate   = null,
                BrandId     = null,
                EndDate     = null,
                TypeId      = null,
                SaleStatus  = this._status,
                minPrice    = nullable,
                maxPrice    = nullable2
            };

            Globals.EntityCoding(entity, true);
            DbQueryResult products = ProductHelper.GetProducts(entity);
            DataTable     data     = (DataTable)products.Data;

            data.Columns.Add("seledStatus");
            data.Columns.Add("canSelStatus");
            data.Columns.Add("canChkStatus");
            data.Columns.Add("btnCode");
            if (data != null)
            {
                if (data.Rows.Count > 0)
                {
                    string str4 = "0";
                    for (int j = 0; j < data.Rows.Count; j++)
                    {
                        int       num3     = int.Parse(data.Rows[j]["ProductId"].ToString());
                        DataRow[] rowArray = selectedProducts.Select(string.Format("ProductId={0}", num3));
                        if (rowArray.Length > 0)
                        {
                            bool flag = false;
                            foreach (DataRow row in rowArray)
                            {
                                if (row["ActivitiesId"].ToString() == this._id.ToString())
                                {
                                    flag = true;
                                    break;
                                }
                                str4 = row["ActivitiesId"].ToString();
                            }
                            if (flag)
                            {
                                data.Rows[j]["btnCode"] = "<button type=\"button\" class=\"btn btn-success resetSize\" name=\"selectBtn\" disabled>已加入本次活动</button>";
                            }
                            else
                            {
                                data.Rows[j]["btnCode"] = "<a title=\"点击新窗口打开该活动\" href=\"AddProductToActivity.aspx?id=" + str4 + "\" target=\"_blank\" class=\"btn btn-warning resetSize\">已加入其他活动</button>";
                            }
                            continue;
                        }
                        data.Rows[j]["btnCode"] = "<input type=\"button\" class=\"btn btn-info resetSize\" name=\"selectBtn\" value=\"选取加入\" onclick=\"var obj=this;HiTipsShow('<strong>确定要加入该活动吗?</strong><p>加入该活动后,其他满减活动将不能选择该商品!</p>', 'confirmII', function () {saveSingle(" + data.Rows[j]["ProductId"].ToString() + ")});\"/>";
                    }
                }
                else if (data.Rows.Count > 0)
                {
                    for (int k = 0; k < data.Rows.Count; k++)
                    {
                    }
                }
            }
            this.grdProducts.DataSource = products.Data;
            this.grdProducts.DataBind();
            this.pager.TotalRecords = products.TotalRecords;
            this.lbsaleNumber.Text  = products.TotalRecords.ToString();
            DataTable table3 = this.GetSelectedProducts(actId);

            this.lblJoin.Text = (table3 != null) ? table3.Rows.Count.ToString() : "0";
            this.setInStock();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.RegisterTypeForAjax(typeof(DistributorList));
            this.localUrl = base.Request.Url.ToString();
            string str = base.Request.QueryString["task"];

            if (!base.IsPostBack)
            {
                string str2 = DateTime.Now.ToString("yyyyMMddHHmmss");
                this.hdVery.Value = str2;
                this.Session["modifyCommissionVeryCode"] = str2;
            }
            if (!string.IsNullOrEmpty(str))
            {
                string s = "{error:1,msg:'未定义操作!'}";
                if (str == "readinfo")
                {
                    int num;
                    if (int.TryParse(this.Page.Request.QueryString["UserId"], out num))
                    {
                        DistributorsQuery entity = new DistributorsQuery
                        {
                            UserId         = int.Parse(this.Page.Request.QueryString["UserId"]),
                            ReferralStatus = -1,
                            PageIndex      = 1,
                            PageSize       = 1,
                            SortOrder      = SortAction.Desc,
                            SortBy         = "userid"
                        };
                        Globals.EntityCoding(entity, true);
                        DbQueryResult result = VShopHelper.GetDistributors(entity, null, null);
                        if (result.Data != null)
                        {
                            DataTable data = new DataTable();
                            data = (DataTable)result.Data;
                            s    = s = "{error:0,Data:" + JsonConvert.SerializeObject(data) + "}";
                        }
                        else
                        {
                            s = "{error:1,msg:'分销商信息不存在'}";
                        }
                    }
                    else
                    {
                        s = "{error:1,msg:'userid错误'}";
                    }
                }
                base.Response.Write(s);
                base.Response.End();
            }
            this.reDistributor.ItemCommand += new RepeaterCommandEventHandler(this.reDistributor_ItemCommand);
            this.btnSearchButton.Click     += new EventHandler(this.btnSearchButton_Click);
            this.FrozenCheck.Click         += new EventHandler(this.FrozenCheck_Click);
            this.CancleCheck.Click         += new EventHandler(this.CancleCheck_Click);
            this.PassCheck.Click           += new EventHandler(this.PassCheck_Click);
            this.GradeCheck.Click          += new EventHandler(this.GradeCheck_Click);
            this.EditSave.Click            += new EventHandler(this.EditSave_Click);
            this.UpdateCommission.Click    += new EventHandler(this.UpdateCommission_Click);
            this.LoadParameters();
            if (!base.IsPostBack)
            {
                this.BindData();
                this.GradeCheckList.DataBind();
                this.DrGrade.DataBind();
                this.DrGrade.SelectedValue = new int?(int.Parse(this.Grade));
            }
        }
Beispiel #30
0
        protected void btnExportButton_Click(object sender, System.EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ActitivyTitle"]))
            {
                this.ActitivyTitle = this.Page.Request.QueryString["ActitivyTitle"];
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["AddrReggion"]))
            {
                this.AddrReggion = base.Server.UrlDecode(this.Page.Request.QueryString["AddrReggion"]);
                this.SelReggion.SetSelectedRegionId(new int?(int.Parse(this.AddrReggion)));
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ShowTabNum"]))
            {
                this.ShowTabNum = base.Server.UrlDecode(this.Page.Request.QueryString["ShowTabNum"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["Receiver"]))
            {
                this.Receiver = base.Server.UrlDecode(this.Page.Request.QueryString["Receiver"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ProductName"]))
            {
                this.ProductName = base.Server.UrlDecode(this.Page.Request.QueryString["ProductName"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["StartDate"]))
            {
                this.StartDate = base.Server.UrlDecode(this.Page.Request.QueryString["StartDate"]);
                this.calendarStartDate.SelectedDate = new System.DateTime?(System.DateTime.Parse(this.StartDate));
            }
            else
            {
                this.StartDate = "";
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["EndDate"]))
            {
                this.EndDate = base.Server.UrlDecode(this.Page.Request.QueryString["EndDate"]);
                this.calendarEndDate.SelectedDate = new System.DateTime?(System.DateTime.Parse(this.EndDate));
            }
            else
            {
                this.EndDate = "";
            }
            PrizesDeliveQuery prizesDeliveQuery = new PrizesDeliveQuery();

            prizesDeliveQuery.Status        = int.Parse(this.ShowTabNum) - 1;
            prizesDeliveQuery.StartDate     = this.StartDate;
            prizesDeliveQuery.EndDate       = this.EndDate;
            prizesDeliveQuery.SortBy        = "WinTime";
            prizesDeliveQuery.PrizeType     = 2;
            prizesDeliveQuery.SortOrder     = SortAction.Desc;
            prizesDeliveQuery.PageIndex     = this.pager.PageIndex;
            prizesDeliveQuery.PageSize      = this.pager.PageSize;
            prizesDeliveQuery.ProductName   = this.ProductName;
            prizesDeliveQuery.Receiver      = this.Receiver;
            prizesDeliveQuery.ReggionId     = this.AddrReggion;
            prizesDeliveQuery.ActivityTitle = this.ActitivyTitle;
            Globals.EntityCoding(prizesDeliveQuery, true);
            DbQueryResult allPrizesDeliveryList = GameHelper.GetAllPrizesDeliveryList(prizesDeliveQuery, "", "*");

            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            stringBuilder.AppendLine("<table cellspacing=\"0\" cellpadding=\"5\" rules=\"all\" border=\"1\">");
            stringBuilder.AppendLine("<tr style=\"font-weight: bold; white-space: nowrap;\">");
            stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >活动名称</td>");
            stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >商品名称</td>");
            stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >奖品等级</td>");
            stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >中奖时间</td>");
            stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >收货人</td>");
            stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >联系电话</td>");
            stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >详细地址</td>");
            stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >快递公司</td>");
            stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >快递编号</td>");
            stringBuilder.AppendLine("</tr>");
            System.Data.DataTable dataTable = (System.Data.DataTable)allPrizesDeliveryList.Data;
            string text = string.Empty;

            new System.Collections.Generic.List <int>();
            if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"]))
            {
                text = base.Request["CheckBoxGroup"];
                string[] collection = text.Split(new char[]
                {
                    ','
                });
                System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>(collection);
                for (int i = 0; i < dataTable.Rows.Count; i++)
                {
                    string item = dataTable.Rows[i]["LogId"].ToString();
                    if (list.Contains(item))
                    {
                        stringBuilder.AppendLine("<tr>");
                        stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[i]["Title"] + "</td>");
                        stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[i]["ProductName"] + "</td>");
                        stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + GameHelper.GetPrizeGradeName(dataTable.Rows[i]["PrizeGrade"].ToString()) + "</td>");
                        stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[i]["WinTime"] + "</td>");
                        stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[i]["Receiver"] + "</td>");
                        stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[i]["Tel"] + "</td>");
                        stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[i]["Address"] + "</td>");
                        stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[i]["ExpressName"] + "</td>");
                        stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[i]["CourierNumber"] + "</td>");
                        stringBuilder.AppendLine("</tr>");
                    }
                }
            }
            else
            {
                for (int j = 0; j < dataTable.Rows.Count; j++)
                {
                    dataTable.Rows[j]["LogId"].ToString();
                    stringBuilder.AppendLine("<tr>");
                    stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[j]["Title"] + "</td>");
                    stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[j]["ProductName"] + "</td>");
                    stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + GameHelper.GetPrizeGradeName(dataTable.Rows[j]["PrizeGrade"].ToString()) + "</td>");
                    stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[j]["WinTime"] + "</td>");
                    stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[j]["Receiver"] + "</td>");
                    stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[j]["Tel"] + "</td>");
                    stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[j]["Address"] + "</td>");
                    stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[j]["ExpressName"] + "</td>");
                    stringBuilder.AppendLine("<td style=\"vnd.ms-excel.numberformat: @;\" >" + dataTable.Rows[j]["CourierNumber"] + "</td>");
                    stringBuilder.AppendLine("</tr>");
                }
            }
            if (dataTable.Rows.Count == 0)
            {
                stringBuilder.AppendLine("<tr><td></td></tr>");
            }
            stringBuilder.AppendLine("</table>");
            this.Page.Response.Clear();
            this.Page.Response.Buffer  = false;
            this.Page.Response.Charset = "UTF-8";
            this.Page.Response.AppendHeader("Content-Disposition", "attachment;filename=PrizeLists_" + System.DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls");
            this.Page.Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
            this.Page.Response.ContentType     = "application/ms-excel";
            this.Page.EnableViewState          = false;
            this.Page.Response.Write(stringBuilder.ToString());
            this.Page.Response.End();
        }