Example #1
0
        public void GetProductPic(ProductInfo productInfo)
        {
            productInfo.ProductPic = this.FileUploadProductPic.FilePath;
            string oldValue          = base.BasePath + SiteConfig.SiteOption.UploadDir;
            string originalImagePath = productInfo.ProductPic.Replace(oldValue, "");

            if (this.ChkThumb.Checked)
            {
                if (!string.IsNullOrEmpty(productInfo.ProductPic))
                {
                    try
                    {
                        string extension = Path.GetExtension(productInfo.ProductPic);
                        string str4      = productInfo.ProductPic.Replace(extension, "_S" + extension);
                        productInfo.ProductThumb = Thumbs.GetThumbsPath(originalImagePath, str4.Replace(oldValue, ""));
                    }
                    catch (ArgumentException)
                    {
                        BaseUserControl.WriteErrMsg("<li>生成缩略图的路径中具有非法字符!</li>");
                    }
                }
            }
            else
            {
                productInfo.ProductThumb = this.FileUploadProductThumb.FilePath;
            }
            if (this.ChkProductPicWatermark.Checked && !string.IsNullOrEmpty(productInfo.ProductPic))
            {
                WaterMark.AddWaterMark(originalImagePath);
            }
            if (((this.ChkProductPicWatermark.Checked && this.ChkThumb.Checked) || this.ChkProductThumbWatermark.Checked) && !string.IsNullOrEmpty(productInfo.ProductThumb))
            {
                WaterMark.AddWaterMark(productInfo.ProductThumb.Replace(oldValue, ""));
            }
        }
        protected void EgvCompanyMember_RowCommand(object sender, CommandEventArgs e)
        {
            string userName       = e.CommandArgument.ToString();
            bool   flag           = false;
            string successMessage = "";
            string commandName    = e.CommandName;

            if (commandName != null)
            {
                if (!(commandName == "RemoveFromCompany"))
                {
                    if (commandName == "AddToAdmin")
                    {
                        flag           = Users.AddToAdminCompany(userName);
                        successMessage = "已经将 " + userName + " 升级为管理员!";
                    }
                    else if (commandName == "RemoveFromAdmin")
                    {
                        flag           = Users.RemoveFromAdminCompany(userName);
                        successMessage = "已经将 " + userName + " 降为普通成员!";
                    }
                    else if (commandName == "Agree")
                    {
                        int companyClientId = 0;
                        EasyOne.Model.Crm.CompanyInfo compayById = Company.GetCompayById(this.CompanyId);
                        if (!compayById.IsNull)
                        {
                            companyClientId = compayById.ClientId;
                        }
                        flag           = Users.AgreeJoinCompany(userName, companyClientId);
                        successMessage = "已经批准 " + userName + " 加入企业中!";
                    }
                    else if (commandName == "Reject")
                    {
                        flag           = Users.RemoveFromCompany(userName);
                        successMessage = "已经拒绝 " + userName + " 加入企业中!";
                    }
                }
                else
                {
                    flag           = Users.RemoveFromCompany(userName);
                    successMessage = "已经将 " + userName + " 从企业中删除!";
                }
            }
            if (flag)
            {
                BaseUserControl.WriteSuccessMsg(successMessage, this.ReturnAddress);
            }
            else
            {
                BaseUserControl.WriteErrMsg("<li>操作失败!</li>");
            }
        }
 protected void GdvMessageList_RowCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         if (Message.Delete(MessageDelType.Id, e.CommandArgument.ToString()))
         {
             this.GdvMessageList.DataBind();
         }
         else
         {
             BaseUserControl.WriteErrMsg("<li>删除失败!!</li>");
         }
     }
 }
Example #4
0
 protected void GdvMessageList_RowCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         if (Message.Clear(this.ManageType, PEContext.Current.User.UserName, e.CommandArgument.ToString()))
         {
             this.GdvMessageList.DataBind();
         }
         else
         {
             BaseUserControl.WriteErrMsg("<li>删除失败!!</li>");
         }
     }
 }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_GeneralId      = BaseUserControl.RequestInt32("GeneralID");
     this.contentDataTable = ContentManage.GetContentDataById(this.m_GeneralId);
     if (this.contentDataTable.Rows.Count > 0)
     {
         ModelInfo modelInfoById = ModelManager.GetModelInfoById(DataConverter.CLng(this.contentDataTable.Rows[0]["ModelID"].ToString()));
         this.InitSigin(this.m_GeneralId, modelInfoById.EnableSignIn);
     }
     else
     {
         BaseUserControl.WriteErrMsg("对不起,错误的参数!", SiteConfig.SiteInfo.VirtualPath + "Default.aspx");
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         EasyOne.Model.UserManage.UserInfo userInfo = this.UserInfo;
         if (userInfo == null)
         {
             userInfo = Users.GetUserById(DataConverter.CLng(base.Request.QueryString["UserID"]));
             this.ViewState["UserInfo"] = userInfo;
         }
         if (userInfo.IsNull)
         {
             BaseUserControl.WriteErrMsg("<li>找不到指定的会员!</li>");
         }
         else
         {
             if (string.IsNullOrEmpty(userInfo.GroupName))
             {
                 userInfo.GroupName = UserGroups.GetUserGroupById(userInfo.GroupId).GroupName;
             }
             this.LblUserName.Text  = userInfo.UserName;
             this.LblUserGroup.Text = userInfo.GroupName;
             if (!SiteConfig.SiteOption.EnablePointMoneyExp)
             {
                 this.Balance.Style.Add("display", "none");
                 this.Point.Style.Add("display", "none");
                 this.UserExp.Style.Add("display", "none");
                 this.EndTime.Style.Add("display", "none");
             }
             else
             {
                 this.LblBalance.Text = userInfo.Balance.ToString("0.00");
                 this.LblPoint.Text   = userInfo.UserPoint.ToString();
                 if (!userInfo.EndTime.HasValue)
                 {
                     this.LblEndTime.Text = "";
                 }
                 else
                 {
                     this.LblEndTime.Text = userInfo.EndTime.Value.ToString("yyyy-MM-dd");
                 }
                 this.LblUserExp.Text   = userInfo.UserExp.ToString();
                 this.LblValidDays.Text = Users.GetValidNum(userInfo.EndTime);
             }
         }
     }
 }
        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            StringBuilder selectList = this.GdvMessageList.SelectList;

            if (selectList.Length == 0)
            {
                BaseUserControl.WriteErrMsg("<li>对不起,您还没选择要删除的短消息!</li>");
            }
            else if (Message.Delete(MessageDelType.Id, selectList.ToString()))
            {
                this.GdvMessageList.DataBind();
            }
            else
            {
                BaseUserControl.WriteErrMsg("<li>删除失败!!</li>");
            }
        }
Example #8
0
        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            StringBuilder selectList = this.GdvMessageList.SelectList;

            if (selectList.Length == 0)
            {
                BaseUserControl.WriteErrMsg("<li>对不起,您还没选择要删除的短消息!</li>");
            }
            else if (Message.Clear(this.ManageType, PEContext.Current.User.UserName, selectList.ToString()))
            {
                this.GdvMessageList.DataBind();
            }
            else
            {
                BaseUserControl.WriteErrMsg("<li>删除失败!!</li>");
            }
        }
Example #9
0
 protected void BtnDeleteAll_Click(object sender, EventArgs e)
 {
     if (Message.Clear(this.ManageType, PEContext.Current.User.UserName))
     {
         if (this.ManageType == MessageManageType.Recycle)
         {
             BaseUserControl.WriteSuccessMsg("删除短信息成功。", "MessageManager.aspx?ManageType=" + this.ManageType.ToString("D"));
         }
         else
         {
             BaseUserControl.WriteSuccessMsg("删除短消息成功。删除的消息将转移到您的废件箱中。", "MessageManager.aspx?ManageType=" + this.ManageType.ToString("D"));
         }
     }
     else
     {
         BaseUserControl.WriteErrMsg("删除失败!");
     }
 }
        protected void EgvFeedback_RowCommand(object sender, CommandEventArgs e)
        {
            string commandName = e.CommandName;

            if (commandName != null)
            {
                if (!(commandName == "Del"))
                {
                    if (!(commandName == "DelReply"))
                    {
                        if (commandName == "ReplyContent")
                        {
                            BaseUserControl.ResponseRedirect("OrderFeedbackModify.aspx?Action=ReplyContent&ID=" + e.CommandArgument.ToString());
                        }
                        return;
                    }
                }
                else
                {
                    if (OrderFeedback.Delete(e.CommandArgument.ToString()))
                    {
                        BaseUserControl.WriteSuccessMsg("删除反馈信息成功", "OrderManage.aspx?OrderID=" + this.OrderId);
                        return;
                    }
                    BaseUserControl.WriteErrMsg("删除反馈信息失败");
                    return;
                }
                OrderFeedbackInfo orderFeedbackById = OrderFeedback.GetOrderFeedbackById(DataConverter.CLng(e.CommandArgument));
                if (!orderFeedbackById.IsNull)
                {
                    orderFeedbackById.ReplyContent = string.Empty;
                    orderFeedbackById.ReplyName    = string.Empty;
                }
                if (OrderFeedback.Update(orderFeedbackById))
                {
                    BaseUserControl.WriteSuccessMsg("删除回复信息成功!", "OrderManage.aspx?OrderID=" + this.OrderId);
                }
                else
                {
                    BaseUserControl.WriteErrMsg("删除回复信息失败!");
                }
            }
        }
        protected void InitComment()
        {
            if (this.m_GeneralId == 0)
            {
                BaseUserControl.WriteErrMsg("<li>没有找到隶属信息评论,请返回!</li>");
            }
            else
            {
                string s = BaseUserControl.RequestString("Title");
                this.LblTitle.Text = s;
                string returnurl = this.ViewFile + "?GeneralID=" + this.m_GeneralId.ToString() + "&title=" + base.Server.UrlEncode(s);
                int    commentId = BaseUserControl.RequestInt32("CommentID");
                switch (BaseUserControl.RequestString("Action"))
                {
                case "Delete":
                    if (Comment.Delete(commentId))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>删除指定信息评论成功!</li>", returnurl);
                    }
                    break;

                case "Audited":
                    if (Comment.SetStatus(commentId, true))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>指定信息评论审核成功!</li>", returnurl);
                    }
                    break;

                case "UnAudited":
                    if (Comment.SetStatus(commentId, false))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>已取消指定评论审核!</li>", returnurl);
                    }
                    break;

                case "Premier":
                    if (Comment.Elite(commentId, true))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>设定指定评论精华成功!</li>", returnurl);
                    }
                    break;

                case "UnPremier":
                    if (Comment.Elite(commentId, false))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>已取消指定评论精华!</li>", returnurl);
                    }
                    break;

                case "AddPKZone":
                {
                    CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo();
                    commentPKZoneInfo.CommentId  = commentId;
                    commentPKZoneInfo.Content    = base.Request["ItemContent"];
                    commentPKZoneInfo.Position   = DataConverter.CLng(base.Request["RadlPosition"]);
                    commentPKZoneInfo.IP         = PEContext.Current.UserHostAddress;
                    commentPKZoneInfo.UpdateTime = DateTime.Now;
                    commentPKZoneInfo.UserName   = "******";
                    CommentPKZone.Add(commentPKZoneInfo);
                    BaseUserControl.WriteSuccessMsg("<li>感谢您的参与,添加辩论成功!</li>", returnurl);
                    break;
                }
                }
                this.CommentBindData();
            }
        }
 protected void BtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         if (this.TxtPrincipalOrder.Text == this.TxtSubordinateOrder.Text)
         {
             BaseUserControl.WriteErrMsg("<li>合并的订单不能为同一个订单!</li>");
         }
         OrderInfo orderByOrderNum = Order.GetOrderByOrderNum(this.TxtPrincipalOrder.Text);
         if (orderByOrderNum.IsNull)
         {
             BaseUserControl.WriteErrMsg("<li>主订单(" + this.TxtPrincipalOrder.Text + ")不存在!</li>");
         }
         if (orderByOrderNum.Status > OrderStatus.WaitForConfirm)
         {
             BaseUserControl.WriteErrMsg("<li>合并的主订单必须为未确认的订单!</li>");
         }
         OrderInfo info2 = Order.GetOrderByOrderNum(this.TxtSubordinateOrder.Text);
         if (info2.IsNull)
         {
             BaseUserControl.WriteErrMsg("<li>从订单(" + this.TxtSubordinateOrder.Text + ")不存在!</li>");
         }
         if (info2.Status > OrderStatus.WaitForConfirm)
         {
             BaseUserControl.WriteErrMsg("<li>合并的订单必须为未确认的订单!</li>");
         }
         if (orderByOrderNum.UserName != info2.UserName)
         {
             BaseUserControl.WriteErrMsg("<li>合并的订单必须属于同个用户</li>");
         }
         if (!string.IsNullOrEmpty(this.OrderUserName) && (this.OrderUserName != orderByOrderNum.UserName))
         {
             BaseUserControl.WriteErrMsg("<li>只能合并属于自己的订单!</li>");
         }
         IList <OrderItemInfo> infoListByOrderId = OrderItem.GetInfoListByOrderId(orderByOrderNum.OrderId);
         foreach (OrderItemInfo info3 in OrderItem.GetInfoListByOrderId(info2.OrderId))
         {
             info3.OrderId = orderByOrderNum.OrderId;
             OrderItem.Update(info3);
             infoListByOrderId.Add(info3);
         }
         string selectedValue = this.RadlMergeType.SelectedValue;
         if (selectedValue != null)
         {
             if (!(selectedValue == "1"))
             {
                 if (selectedValue == "2")
                 {
                     orderByOrderNum.Remark = orderByOrderNum.Remark + info2.Remark;
                     orderByOrderNum.Memo   = orderByOrderNum.Memo + info2.Memo;
                 }
             }
             else
             {
                 orderByOrderNum.Remark = info2.Remark;
                 orderByOrderNum.Memo   = info2.Memo;
             }
         }
         Order.UpdateOrderInfo(orderByOrderNum, infoListByOrderId);
         Order.Delete(info2.OrderId.ToString());
         BaseUserControl.WriteSuccessMsg("订单合并成功!", this.Returnurl + "?OrderID=" + orderByOrderNum.OrderId.ToString());
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            string basePath = "";

            basePath = base.BasePath;
            basePath = this.Page.Request.Url.Scheme + "://" + this.Page.Request.Url.Authority + basePath;
            this.Adrp.DropArrowImageUrl = basePath + "Admin/Images/sitelist.gif";
            int  nodeId       = BaseUserControl.RequestInt32("NodeID");
            bool isSuperAdmin = PEContext.Current.Admin.IsSuperAdmin;
            bool flag2        = false;
            bool flag3        = false;

            if (!isSuperAdmin)
            {
                string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentInput);
                string checkStr   = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
                if (nodeId > 0)
                {
                    string   findStr       = nodeId.ToString();
                    NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId);
                    if (cacheNodeById.IsNull)
                    {
                        BaseUserControl.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        findStr = findStr + "," + cacheNodeById.ParentPath;
                    }
                    flag3 = StringHelper.FoundCharInArr(checkStr, findStr);
                    flag2 = StringHelper.FoundCharInArr(roleNodeId, findStr);
                }
                else
                {
                    flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
                    flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, -1);
                }
                if (!flag2)
                {
                    this.LblAddProduct.Enabled     = false;
                    this.ELnkProductImport.Enabled = false;
                }
                if (!flag3)
                {
                    this.ELnkContentList.Enabled        = false;
                    this.ELnkProductRecycle.Enabled     = false;
                    this.ELnkProductStockManage.Enabled = false;
                    this.ELnkProductBatchModify.Enabled = false;
                    this.ELnkProductHtml.Enabled        = false;
                }
            }
            if ((nodeId > 0) && ((flag2 || flag3) || isSuperAdmin))
            {
                DataTable shopModelListByNodeId = ModelManager.GetShopModelListByNodeId(nodeId, true);
                if (shopModelListByNodeId.Rows.Count <= 1)
                {
                    this.LblAddProduct.Visible = false;
                }
                else
                {
                    this.RptModelList.DataSource = shopModelListByNodeId;
                    this.RptModelList.DataBind();
                }
                if (shopModelListByNodeId.Rows.Count == 1)
                {
                    this.HlkModel.Visible = true;
                    string str5 = "";
                    str5 = string.Concat(new object[] { "~/Admin/Shop/", shopModelListByNodeId.Rows[0]["AddInfoFilePath"].ToString(), "?Action=add&modelId=", shopModelListByNodeId.Rows[0]["ModelId"].ToString(), "&NodeID=", BaseUserControl.RequestInt32("NodeID") });
                    this.HlkModel.NavigateUrl = str5;
                    this.HlkModel.Text        = "添加" + shopModelListByNodeId.Rows[0]["ItemName"].ToString();
                }
                if (!this.LblAddProduct.Visible && !this.HlkModel.Visible)
                {
                    this.LitSeparator.Visible = false;
                }
            }
            else
            {
                this.LblAddProduct.Visible = false;
                this.HlkModel.Visible      = false;
                this.LitSeparator.Visible  = false;
            }
        }
Example #14
0
        private void InitPurview()
        {
            string str;

            this.xmlDoc = new XmlDocument();
            HttpContext current = HttpContext.Current;

            if (current != null)
            {
                str = current.Server.MapPath("~/Admin/Common/MainMenu.xml");
            }
            else
            {
                str = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Admin/Common/MainMenu.xml");
            }
            try
            {
                this.xmlDoc.Load(str);
            }
            catch (XmlException exception)
            {
                BaseUserControl.WriteErrMsg("MainMenu.xml配置文件不符合XML规范,具体错误信息:" + exception.Message);
            }
            XmlNode       node = this.xmlDoc.SelectSingleNode(this.xmlPath);
            StringBuilder sb   = new StringBuilder();

            if (node == null)
            {
                BaseUserControl.WriteErrMsg("MainMenu.xml配置文件不存在menu根元素");
            }
            if ((this.m_Action == "Modify") && !this.Page.IsPostBack)
            {
                foreach (RoleModulePermissionsInfo info in RolePermissions.GetModelPermissionsById(this.m_RoleId))
                {
                    string name = Enum.GetName(typeof(OperateCode), info.OperateCode);
                    foreach (XmlNode node2 in this.xmlDoc.SelectNodes("//*[@operateCode='" + name + "']"))
                    {
                        if (node2 != null)
                        {
                            ((XmlElement)node2).SetAttribute("IsChoose", "true");
                        }
                    }
                }
            }
            if (node.HasChildNodes)
            {
                foreach (XmlNode node3 in node)
                {
                    string str3           = this.Checked(node3);
                    string attributeValue = this.GetAttributeValue(node3, "id");
                    if ((attributeValue != "MenuMyDeskTop") && (this.GetAttributeValue(node3, "ShowOnForm") == "true"))
                    {
                        sb.Append("<tr>");
                        sb.Append("  <td style='width:100%;'>");
                        sb.Append("     <input type='checkbox' name='ModelPurview' value='" + this.GetAttributeValue(node3, "operateCode") + "' " + str3 + " id='" + attributeValue + "'  onclick=\"javascript:CheckModel(this);\" />&nbsp;");
                        sb.Append(this.GetAttributeValue(node3, "title"));
                        sb.Append("&nbsp;&nbsp;&nbsp;&nbsp;" + this.Description(node3));
                        sb.Append("  </td>");
                        sb.Append("</tr>");
                        this.InitChannelMenuLi(sb, attributeValue);
                    }
                }
            }
            this.LblModelPurview.Text = sb.ToString();
        }
Example #15
0
        protected void RptShoppingCart_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            ShopConfig shopConfig = SiteConfig.ShopConfig;
            bool       isPaymentShowProducdtThumb = true;
            int        paymentThumbsWidth         = 0;
            int        paymentThumbsHeight        = 0;
            bool       isShowPaymentProductType   = true;
            bool       isShowPaymentSaleType      = true;
            bool       isShowPaymentMarkPrice     = true;

            if (this.IsPreview == 0)
            {
                isPaymentShowProducdtThumb = shopConfig.IsPaymentShowProducdtThumb;
                isShowPaymentProductType   = shopConfig.IsShowPaymentProductType;
                isShowPaymentSaleType      = shopConfig.IsShowPaymentSaleType;
                isShowPaymentMarkPrice     = shopConfig.IsShowPaymentMarkPrice;
                paymentThumbsWidth         = shopConfig.PaymentThumbsWidth;
                paymentThumbsHeight        = shopConfig.PaymentThumbsHeight;
            }
            else if (this.IsPreview == 1)
            {
                isPaymentShowProducdtThumb = shopConfig.IsPreviewShowProducdtThumb;
                isShowPaymentProductType   = shopConfig.IsShowPreviewProductType;
                isShowPaymentSaleType      = shopConfig.IsShowPreviewSaleType;
                isShowPaymentMarkPrice     = shopConfig.IsShowPreviewMarkPrice;
                paymentThumbsWidth         = shopConfig.PreviewThumbsWidth;
                paymentThumbsHeight        = shopConfig.PreviewThumbsHeight;
            }
            if ((e.Item.ItemType != ListItemType.Item) && (e.Item.ItemType != ListItemType.AlternatingItem))
            {
                if (e.Item.ItemType == ListItemType.Footer)
                {
                    PresentProjectInfo presentProInfo = new PresentProjectInfo(true);
                    if (this.m_IsPreview != 3)
                    {
                        presentProInfo            = PresentProject.GetPresentProjectByTotalMoney(this.total);
                        this.presentExpInfomation = this.ShowPresentExp(presentProInfo).ToString();
                    }
                    if (this.m_IsPreview == 1)
                    {
                        int         presentId = DataConverter.CLng(this.PresentId);
                        PlaceHolder holder    = (PlaceHolder)e.Item.FindControl("PlhPresentInfo");
                        holder.Visible = false;
                        if (((presentId > 0) && !presentProInfo.IsNull) && (presentProInfo.PresentContent.Contains("1") && (presentId > 0)))
                        {
                            holder.Visible = true;
                            AbstractItemInfo info7 = new ConcretePresentProject(presentId, presentProInfo);
                            info7.GetItemInfo();
                            Label label2 = (Label)e.Item.FindControl("LblProductName");
                            Label label3 = (Label)e.Item.FindControl("LblUnit");
                            Label label4 = (Label)e.Item.FindControl("LblPresentPriceMarket");
                            Label label5 = (Label)e.Item.FindControl("LblPresentPrice");
                            Label label6 = (Label)e.Item.FindControl("LblPresentPrice1");
                            label2.Text  = info7.ProductName;
                            label3.Text  = info7.Unit;
                            label4.Text  = info7.PriceMarket.ToString("0.00");
                            label5.Text  = info7.Price.ToString("0.00");
                            label6.Text  = info7.Price.ToString("0.00");
                            this.weight += info7.TotalWeight;
                            this.total  += info7.Price;
                        }
                        ((PlaceHolder)e.Item.FindControl("PlhMoneyInfo")).Visible = true;
                        Label       label7  = (Label)e.Item.FindControl("LblDeliverCharge");
                        Label       label8  = (Label)e.Item.FindControl("LblTaxRate");
                        Label       label9  = (Label)e.Item.FindControl("LblIncludeTax");
                        Label       label10 = (Label)e.Item.FindControl("LblCoupon");
                        Label       label11 = (Label)e.Item.FindControl("LblTotalMoney");
                        Label       label12 = (Label)e.Item.FindControl("LblTrueTotalMoney");
                        PackageInfo packageByGoodsWeight = Package.GetPackageByGoodsWeight(this.weight);
                        if (!packageByGoodsWeight.IsNull)
                        {
                            this.weight += packageByGoodsWeight.PackageWeight;
                        }
                        decimal         num7            = DeliverCharge.GetDeliverCharge(this.m_DeliverType, this.weight, this.m_ZipCode, this.total, this.m_NeedInvoice);
                        DeliverTypeInfo deliverTypeById = EasyOne.Shop.DeliverType.GetDeliverTypeById(this.m_DeliverType);
                        label7.Text = num7.ToString("0.00");
                        label8.Text = deliverTypeById.TaxRate.ToString();
                        if ((deliverTypeById.IncludeTax == TaxRateType.IncludeTaxNoInvoiceFavourable) || (deliverTypeById.IncludeTax == TaxRateType.IncludeTaxNoInvoiceNoFavourable))
                        {
                            label9.Text = "是";
                        }
                        else
                        {
                            label9.Text = "否";
                        }
                        decimal num8 = this.total + num7;
                        if (this.m_CouponMoney > 0M)
                        {
                            label10.Visible = true;
                            decimal num9 = this.total - this.m_CouponMoney;
                            if (num9 < 0M)
                            {
                                num9 = 0M;
                            }
                            num8         = num9 + num7;
                            label10.Text = "使用优惠券,面值为:" + this.m_CouponMoney.ToString("0.00") + "元,商品实际价格为:" + num9.ToString("0.00") + "元 <br>";
                            label11.Text = num9.ToString("0.00") + "+" + num7.ToString("0.00") + "=" + num8.ToString("0.00") + "元";
                            label12.Text = num8.ToString("0.00");
                        }
                        else
                        {
                            label10.Visible = false;
                            label11.Text    = this.total.ToString("0.00") + "+" + num7.ToString("0.00") + "=" + num8.ToString("0.00") + "元";
                            label12.Text    = num8.ToString("0.00");
                        }
                        this.ViewState["TrueTotalMoney"] = num8;
                    }
                    else
                    {
                        ((PlaceHolder)e.Item.FindControl("PlhMoneyInfo")).Visible = false;
                    }
                    ExtendedImage image3    = (ExtendedImage)e.Item.FindControl("presentImage");
                    Control       control9  = e.Item.FindControl("footerPresentImage");
                    Control       control10 = e.Item.FindControl("footerTdThemeImage");
                    Control       control11 = e.Item.FindControl("footerTdProductType");
                    Control       control12 = e.Item.FindControl("footerTdSaleType");
                    Control       control13 = e.Item.FindControl("footerTdMarkPrice");
                    Control       control14 = e.Item.FindControl("footerTdThemeImage");
                    Control       control15 = e.Item.FindControl("footerTdMoneyInfoSaleType");
                    Control       control16 = e.Item.FindControl("footerTdMoneyInfoMarkPrice");
                    Control       control17 = e.Item.FindControl("footerPresentType");
                    Control       control18 = e.Item.FindControl("footerPresentSaleType");
                    Control       control19 = e.Item.FindControl("footerPresentMarkPrice");
                    if (!isPaymentShowProducdtThumb)
                    {
                        control10.Visible = false;
                        control9.Visible  = false;
                    }
                    else
                    {
                        PresentInfo presentById = Present.GetPresentById(DataConverter.CLng(this.PresentId));
                        if (!string.IsNullOrEmpty(presentById.PresentThumb))
                        {
                            image3.Src = presentById.PresentThumb;
                        }
                        else
                        {
                            image3.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif";
                        }
                        image3.Width  = paymentThumbsWidth;
                        image3.Height = paymentThumbsHeight;
                    }
                    if (!isShowPaymentProductType)
                    {
                        control11.Visible = false;
                        control14.Visible = false;
                        control17.Visible = false;
                    }
                    if (!isShowPaymentSaleType)
                    {
                        control12.Visible = false;
                        control15.Visible = false;
                        control18.Visible = false;
                    }
                    if (!isShowPaymentMarkPrice)
                    {
                        control13.Visible = false;
                        control16.Visible = false;
                        control19.Visible = false;
                        return;
                    }
                }
                else if (e.Item.ItemType == ListItemType.Header)
                {
                    Control control20 = e.Item.FindControl("ProductImageTitle");
                    Control control21 = e.Item.FindControl("tdProductTypeTitle");
                    Control control22 = e.Item.FindControl("tdSaleTypeTitle");
                    Control control23 = e.Item.FindControl("tdMarkPriceTitle");
                    if (!isPaymentShowProducdtThumb)
                    {
                        control20.Visible = false;
                    }
                    if (!isShowPaymentProductType)
                    {
                        control21.Visible = false;
                    }
                    if (!isShowPaymentSaleType)
                    {
                        control22.Visible = false;
                    }
                    if (!isShowPaymentMarkPrice)
                    {
                        control23.Visible = false;
                    }
                }
                return;
            }
            int              productNum = 0;
            string           str        = "";
            string           str2       = "";
            decimal          subTotal   = 0M;
            ShoppingCartInfo dataItem   = (ShoppingCartInfo)e.Item.DataItem;

            if (dataItem == null)
            {
                return;
            }
            productNum = dataItem.Quantity;
            bool haveWholesalePurview = Convert.ToBoolean(this.ViewState["HaveWholesalePurview"]);

            str2 = ShoppingCart.GetSaleType(dataItem.ProductInfomation, productNum, haveWholesalePurview);
            str  = ShoppingCart.GetProductType(dataItem.ProductInfomation, productNum, haveWholesalePurview);
            AbstractItemInfo info2 = new ConcreteProductInfo(productNum, dataItem.Property, dataItem.ProductInfomation, this.m_UserInfo, false, false, haveWholesalePurview);

            info2.GetItemInfo();
            subTotal         = info2.SubTotal;
            this.total      += subTotal;
            this.totalExp   += dataItem.ProductInfomation.PresentExp * productNum;
            this.totalMoney += dataItem.ProductInfomation.PresentMoney * productNum;
            this.totalPoint += dataItem.ProductInfomation.PresentPoint * productNum;
            this.weight     += info2.TotalWeight;
            if (!string.IsNullOrEmpty(dataItem.Property))
            {
                ((Literal)e.Item.FindControl("LitProperty")).Text = "(" + info2.Property + ")";
            }
            InsideStaticLabel label = new InsideStaticLabel();
            string            str3  = "<a href='";

            str3 = (str3 + label.GetInfoPath(info2.ProductId.ToString())) + "' Target='_blank'>" + info2.ProductName + "</a>";
            ((Literal)e.Item.FindControl("LitProductName")).Text = str3;
            ((Literal)e.Item.FindControl("LitProductUnit")).Text = info2.Unit;
            ((Literal)e.Item.FindControl("LitTruePrice")).Text   = info2.Price.ToString("0.00");
            ((Literal)e.Item.FindControl("LitSubTotal")).Text    = subTotal.ToString("0.00");
            ExtendedImage image    = (ExtendedImage)e.Item.FindControl("extendedImage");
            ExtendedImage image2   = (ExtendedImage)e.Item.FindControl("extendedPresentImage");
            Control       control  = e.Item.FindControl("ProductImage");
            Control       control2 = e.Item.FindControl("presentImage");

            if (!isPaymentShowProducdtThumb)
            {
                image.Visible    = false;
                control.Visible  = false;
                control2.Visible = false;
            }
            else
            {
                if (!string.IsNullOrEmpty(dataItem.ProductInfomation.ProductThumb))
                {
                    image.Src = dataItem.ProductInfomation.ProductThumb;
                }
                else
                {
                    image.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif";
                }
                image.ImageHeight = paymentThumbsHeight;
                image.ImageWidth  = paymentThumbsWidth;
                if (dataItem.ProductInfomation.PresentId > 0)
                {
                    PresentInfo info3 = Present.GetPresentById(dataItem.ProductInfomation.PresentId);
                    if (!string.IsNullOrEmpty(info3.PresentThumb))
                    {
                        image2.Src = info3.PresentThumb;
                    }
                    else
                    {
                        image2.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif";
                    }
                    image2.ImageHeight = paymentThumbsHeight;
                    image2.ImageWidth  = paymentThumbsWidth;
                }
            }
            if (!isShowPaymentProductType)
            {
                e.Item.FindControl("tdProductType").Visible = false;
            }
            else
            {
                ((Literal)e.Item.FindControl("LitProductType")).Text = str;
            }
            if (!isShowPaymentSaleType)
            {
                e.Item.FindControl("tdSaleType").Visible = false;
            }
            else
            {
                ((Literal)e.Item.FindControl("LitSaleType")).Text = str2;
            }
            if (!isShowPaymentMarkPrice)
            {
                e.Item.FindControl("tdMarkPrice").Visible = false;
            }
            else
            {
                ((Literal)e.Item.FindControl("LitPriceMarket")).Text = info2.PriceMarket.ToString("0.00");
            }
            int         num5        = Order.CountBuyNum(PEContext.Current.User.UserName, dataItem.ProductId);
            ProductInfo productById = Product.GetProductById(dataItem.ProductId);

            if ((productById.LimitNum > 0) && ((dataItem.Quantity + num5) > productById.LimitNum))
            {
                BaseUserControl.WriteErrMsg(string.Concat(new object[] { "您订购了", num5, productById.Unit, productById.ProductName, ",曾经购买了", num5, productById.Unit, ",而此商品每人限购数量为", productById.LimitNum, productById.Unit, ",请重新调整您的购物车!" }), "ShoppingCart.aspx");
            }
            if ((dataItem.ProductInfomation.SalePromotionType <= 0) || (productNum < dataItem.ProductInfomation.MinNumber))
            {
                return;
            }
            e.Item.FindControl("PresentInfomation").Visible = true;
            string           str4  = "";
            string           str5  = "";
            string           str6  = "";
            AbstractItemInfo info5 = new ConcreteSalePromotionType(productNum, dataItem.ProductInfomation, false, null);

            info5.GetItemInfo();
            switch (dataItem.ProductInfomation.SalePromotionType)
            {
            case 1:
            case 3:
                str5 = "<font color=red>(赠品)</font>";
                str4 = "赠送礼品";
                str6 = "赠送";
                goto Label_06A1;

            case 2:
            case 4:
                if (info5.Price <= 0M)
                {
                    str5 = "<font color=red>(赠送赠品)</font>";
                    str6 = "赠送";
                    break;
                }
                str5 = "<font color=red>(换购赠品)</font>";
                str6 = "换购";
                break;

            default:
                goto Label_06A1;
            }
            str4 = "促销礼品";
Label_06A1:
            if (this.PresentExist(this.m_CartId, info5.Id))
            {
                ((HiddenField)e.Item.FindControl("HdnPresentId")).Value = info5.Id.ToString();
                ExtendedLiteral literal = (ExtendedLiteral)e.Item.FindControl("LitPresentName");
                literal.Text   = info5.ProductName;
                literal.EndTag = str5;
                ((Literal)e.Item.FindControl("LitPresentUnit")).Text      = info5.Unit;
                ((Literal)e.Item.FindControl("LitPresentNum")).Text       = info5.Amount.ToString();
                ((Literal)e.Item.FindControl("LitPresentTruePrice")).Text = info5.Price.ToString("0.00");
                ((Literal)e.Item.FindControl("LitPresentSubtotal")).Text  = info5.SubTotal.ToString("0.00");
                this.total  += info5.SubTotal;
                this.weight += info5.TotalWeight;
            }
            if (!isShowPaymentProductType)
            {
                e.Item.FindControl("tdPresentType").Visible = false;
            }
            else
            {
                ((Literal)e.Item.FindControl("LitPresentType")).Text = str4;
            }
            if (!isShowPaymentSaleType)
            {
                e.Item.FindControl("tdPresentSaleType").Visible = false;
            }
            else
            {
                ((Literal)e.Item.FindControl("LitPresentSaleType")).Text = str6;
            }
            if (!isShowPaymentMarkPrice)
            {
                e.Item.FindControl("tdPresentMarkPrice").Visible = false;
            }
            else
            {
                ((Literal)e.Item.FindControl("LitPresentPriceOriginal")).Text = info5.PriceMarket.ToString("0.00");
            }
        }
Example #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ContentChargeInfo info4;
            int generalId = BaseUserControl.RequestInt32("GeneralID");

            this.contentDataTable = ContentManage.GetContentDataById(generalId);
            if ((this.contentDataTable == null) || (this.contentDataTable.Rows.Count == 0))
            {
                BaseUserControl.WriteErrMsg("指定的信息不存在!");
            }
            if (ModelManager.GetModelInfoById(DataConverter.CLng(this.contentDataTable.Rows[0]["ModelID"].ToString())).IsNull)
            {
                BaseUserControl.WriteErrMsg("信息隶属模型不存在!");
            }
            IList <UserGroupsInfo> userGroupList             = UserGroups.GetUserGroupList(0, 0);
            ContentPermissionInfo  contentPermissionInfoById = PermissionContent.GetContentPermissionInfoById(generalId);

            if (!contentPermissionInfoById.IsNull)
            {
                switch (contentPermissionInfoById.PermissionType)
                {
                case 0:
                    this.LitInfoPurview.Text = "继承栏目权限";
                    goto Label_0186;

                case 1:
                    this.LitInfoPurview.Text = "所有会员";
                    goto Label_0186;
                }
                this.LitInfoPurview.Text = "指定会员组:";
                if (!string.IsNullOrEmpty(contentPermissionInfoById.ArrGroupId))
                {
                    string[] strArray = contentPermissionInfoById.ArrGroupId.Split(new char[] { ',' });
                    for (int i = 0; i < strArray.Length; i++)
                    {
                        foreach (UserGroupsInfo info3 in userGroupList)
                        {
                            if (info3.GroupId == DataConverter.CLng(strArray[i]))
                            {
                                this.LitInfoPurview.Text = this.LitInfoPurview.Text + " " + info3.GroupName;
                                break;
                            }
                        }
                    }
                }
            }
Label_0186:
            info4 = EasyOne.Contents.ContentCharge.GetContentChargeInfoById(generalId);
            if (!info4.IsNull)
            {
                this.LblInfoPoint.Text = DataConverter.CLng(info4.InfoPoint).ToString();
                switch (info4.ChargeType)
                {
                case 1:
                    this.LblChargeType.Text = "距离上次收费时间" + DataConverter.CLng(info4.PitchTime).ToString() + "小时后重新收费";
                    break;

                case 2:
                    this.LblChargeType.Text = "会员重复阅读此文章" + DataConverter.CLng(info4.ReadTimes).ToString() + "次后重新收费";
                    break;

                case 3:
                    this.LblChargeType.Text = "上述两者都满足时重新收费";
                    break;

                case 4:
                    this.LblChargeType.Text = "上述两者任一个满足时就重新收费";
                    break;

                case 5:
                    this.LblChargeType.Text = "每阅读一次就重复收费一次(建议不要使用)";
                    break;

                default:
                    this.LblChargeType.Text = "不重复收费";
                    break;
                }
                this.LblDividePercent.Text = DataConverter.CLng(info4.DividePercent).ToString() + "%";
            }
        }