private void Add()
        {
            DataTable      newContentData = ContentManage.GetNewContentData(this.GetDataTableFromRepeater());
            UserGroupsInfo userGroupById  = UserGroups.GetUserGroupById(-2);

            if (userGroupById.IsNull || string.IsNullOrEmpty(userGroupById.GroupSetting))
            {
                DynamicPage.WriteErrMsg("匿名会员组不存在!");
            }
            else
            {
                UserPurviewInfo groupSetting = UserGroups.GetGroupSetting(userGroupById.GroupSetting);
                if (groupSetting.IsNull)
                {
                    DynamicPage.WriteErrMsg("匿名会员组没有进行权限设置!");
                }
                if (groupSetting.PublicInfoNoNeedCheck)
                {
                    DataRow[] rowArray = newContentData.Select("FieldName = 'status'");
                    if (rowArray[0]["FieldValue"].ToString() == "0")
                    {
                        rowArray[0]["FieldValue"] = "99";
                    }
                }
            }
            if (ContentManage.Add(this.m_ModelId, newContentData))
            {
                this.AddKeywordsToTable(newContentData);
                DynamicPage.WriteSuccessMsg("添加成功!", "../../Default.aspx");
            }
            else
            {
                DynamicPage.WriteErrMsg("添加失败!");
            }
        }
Beispiel #2
0
 private void CheckCode()
 {
     if (this.userSiteConfig.EnableCheckCodeOfReg && (string.Compare(this.TxtValidateCode.Text.Trim(), this.VcodeRegister.ValidateCodeValue, StringComparison.OrdinalIgnoreCase) != 0))
     {
         DynamicPage.WriteErrMsg("<li>您输入的验证码和系统产生的不一致,请重新输入。</li>");
     }
 }
Beispiel #3
0
        protected void BtnMoveFriend_Click(object sender, EventArgs e)
        {
            int groupId = DataConverter.CLng(this.DropFriendGroup.SelectedValue, -1);

            if (groupId < 0)
            {
                DynamicPage.WriteErrMsg("<li>请选择移动到的组别</li>");
            }
            else
            {
                string str = this.EgvFriend.SelectList.ToString();
                if (string.IsNullOrEmpty(str))
                {
                    DynamicPage.WriteErrMsg("<li>请选择要移动的用户</li>");
                }
                else if (UserFriend.MoveByGroupId(str, groupId))
                {
                    DynamicPage.WriteSuccessMsg("批量移动操作成功!", "FriendManage.aspx");
                }
                else
                {
                    DynamicPage.WriteErrMsg("<li>批量移动操作失败!</li>");
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int logId = BasePage.RequestInt32("LogID");

            if (!this.Page.IsPostBack)
            {
                UserPointLogInfo pointLogByIdAndUserName = UserPointLog.GetPointLogByIdAndUserName(logId);
                if (!pointLogByIdAndUserName.IsNull)
                {
                    this.LblLogTime.Text = pointLogByIdAndUserName.LogTime.ToString();
                    this.LblIP.Text      = pointLogByIdAndUserName.IP;
                    if (pointLogByIdAndUserName.IncomePayOut == 1)
                    {
                        this.LblIncomePayOut.Text = "收入 " + pointLogByIdAndUserName.Point.ToString();
                    }
                    else
                    {
                        this.LblIncomePayOut.Text = "支出 " + pointLogByIdAndUserName.Point.ToString();
                    }
                    this.LblTimes.Text  = pointLogByIdAndUserName.Times.ToString();
                    this.LblRemark.Text = pointLogByIdAndUserName.Remark;
                }
                else
                {
                    DynamicPage.WriteErrMsg("<li>找不到对应记录!</li>");
                }
            }
        }
Beispiel #5
0
        protected void AddToCart()
        {
            ShopConfig shopConfig = SiteConfig.ShopConfig;

            if ((shopConfig.OrderProductNumber != 0) && (shopConfig.OrderProductNumber <= ShoppingCart.GetInfoByCart(this.cartId, false).Count))
            {
                DynamicPage.WriteErrMsg("<li>超出系统所设置的购物车商品种类数量:" + shopConfig.OrderProductNumber + "</li>", "ShoppingCart.aspx");
            }
            ShoppingCartInfo shoppingcartinfo   = new ShoppingCartInfo();
            int             productId           = 0;
            string          tableName           = string.Empty;
            CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(BasePage.RequestInt32("ID"));

            if (commonModelInfoById.IsNull)
            {
                DynamicPage.WriteErrMsg("<li>找不到指定的商品</li>");
            }
            else
            {
                productId = commonModelInfoById.ItemId;
                tableName = commonModelInfoById.TableName;
            }
            int         num3        = Order.CountBuyNum(PEContext.Current.User.UserName, productId);
            ProductInfo productById = Product.GetProductById(productId);
            int         minimum     = DataConverter.CLng(this.Page.Request.QueryString["Num"]);

            if ((productById.Minimum > minimum) && (productById.Minimum > 0))
            {
                minimum = productById.Minimum;
            }
            else if (minimum == 0)
            {
                minimum = 1;
            }
            if ((productById.LimitNum > 0) && ((num3 + minimum) > productById.LimitNum))
            {
                DynamicPage.WriteErrMsg(string.Concat(new object[] { "您订购了", num3, productById.Unit, productById.ProductName, ",曾经购买了", num3, productById.Unit, ",而此商品每人限购数量为", productById.LimitNum, productById.Unit, ",请重新调整您的购物车!" }), "ShoppingCart.aspx");
            }
            string property = DataSecurity.FilterBadChar(BasePage.RequestString("Property"));

            if (!this.ProductExist(this.cartId, productId, tableName, property))
            {
                if (Product.IsEnableSale(productId, tableName, property, this.cartId))
                {
                    shoppingcartinfo.Quantity   = minimum;
                    shoppingcartinfo.ProductId  = productId;
                    shoppingcartinfo.TableName  = tableName;
                    shoppingcartinfo.Property   = property;
                    shoppingcartinfo.UserName   = this.m_UserName;
                    shoppingcartinfo.UpdateTime = DateTime.Now;
                    shoppingcartinfo.IsPresent  = false;
                    shoppingcartinfo.CartId     = this.cartId;
                    ShoppingCart.Add(shoppingcartinfo);
                }
                else
                {
                    DynamicPage.WriteErrMsg(Product.ErrMsgOfEnableSale);
                }
            }
        }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_UserName = PEContext.Current.User.UserName;
     if (!this.Page.IsPostBack && (base.PreviousPage != null))
     {
         if (!SiteConfig.UserConfig.EnableRegCompany)
         {
             DynamicPage.WriteErrMsg("系统禁用了企业注册功能,不能注册!");
         }
         RegCompany previousPage = base.PreviousPage as RegCompany;
         string     companyName  = previousPage.CompanyName;
         if (string.IsNullOrEmpty(companyName))
         {
             DynamicPage.WriteErrMsg("<li>请输入企业名称!</li>");
         }
         this.CheckUserInfo();
         EasyOne.Model.Crm.CompanyInfo byCompanyName = Company.GetByCompanyName(companyName);
         if (byCompanyName.IsNull)
         {
             this.PnlDifferent.Visible = true;
             this.Company1.CompanyName = companyName;
         }
         else
         {
             this.PnlSame.Visible     = true;
             this.LblName.Text        = companyName;
             this.LblCompanyName.Text = byCompanyName.CompanyName;
             this.LblAddress.Text     = byCompanyName.Address;
             this.LblCountry.Text     = byCompanyName.Country;
             this.LblProvince.Text    = byCompanyName.Province;
             this.LblCity.Text        = byCompanyName.City;
         }
     }
 }
Beispiel #7
0
        private void ExecuteMessageSave()
        {
            MessageInfo messageInfo = new MessageInfo();

            messageInfo.Title    = StringHelper.RemoveXss(this.TxtTitle.Text.Trim());
            messageInfo.Content  = StringHelper.RemoveXss(this.EditorContent.Value);
            messageInfo.Sender   = PEContext.Current.User.UserName;
            messageInfo.SendTime = DateTime.Now;
            messageInfo.Incept   = this.TxtInceptUser.Text;
            messageInfo.IsSend   = 0;
            messageInfo.IsRead   = 0;
            bool flag = false;

            if (BasePage.RequestString("Action") == "Edit")
            {
                messageInfo.MessageId = DataConverter.CLng(this.HdnMessageID.Value);
                flag = EasyOne.Accessories.Message.Update(messageInfo);
            }
            else
            {
                flag = EasyOne.Accessories.Message.Add(messageInfo);
            }
            if (flag)
            {
                DynamicPage.WriteSuccessMsg("<li>恭喜您,保存短信息成功。</li><br /><li>短消息保存在您的草稿箱中。</li>", "MessageManager.aspx");
            }
            else
            {
                DynamicPage.WriteErrMsg("保存失败!");
            }
        }
        protected void BtnBuy_OnClick(object sender, EventArgs e)
        {
            StringBuilder selectList = new StringBuilder();

            selectList = this.EgvProduct.SelectList;
            if (selectList.Length == 0)
            {
                DynamicPage.WriteErrMsg("<li>对不起,您还没选择要批发的商品!</li>", "Wholesale.aspx");
            }
            StringBuilder sb = new StringBuilder();

            string[] strArray = selectList.ToString().Split(new char[] { ',' });
            for (int i = 0; i < this.EgvProduct.Rows.Count; i++)
            {
                HiddenField field = this.EgvProduct.Rows[i].FindControl("HdnGeneralId") as HiddenField;
                foreach (string str in strArray)
                {
                    if (str == field.Value)
                    {
                        StringHelper.AppendString(sb, str + "$$$" + DataConverter.CLng((this.EgvProduct.Rows[i].FindControl("TxtAmount") as TextBox).Text, 10).ToString());
                        break;
                    }
                }
            }
            base.Response.Redirect("~/Shop/ShoppingCart.aspx?Action=Wholesale&IDList=" + sb);
        }
Beispiel #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         int urlid    = BasePage.RequestInt32("urlid");
         int id       = BasePage.RequestInt32("id", 0);
         int serverid = BasePage.RequestInt32("serverid", 0);
         if (id <= 0)
         {
             DynamicPage.WriteErrMsg("错误的下载参数!", SiteConfig.SiteInfo.VirtualPath + "Default.aspx");
         }
         ChargeManage manage = new ChargeManage();
         if (manage.CheckPermission())
         {
             manage.ExecuteContentCharge();
         }
         if (!string.IsNullOrEmpty(manage.ErrMsg))
         {
             DynamicPage.WriteErrMsg(manage.ErrMsg, SiteConfig.SiteInfo.VirtualPath + "Default.aspx");
         }
         string newurl = this.ParseDownLoadPath(urlid, id, serverid);
         this.UpdateHits(id);
         this.DownloadSoft(newurl);
     }
 }
Beispiel #10
0
        private bool CheckUserConentInputPurview(int nodeId)
        {
            UserPrincipal user = PEContext.Current.User;

            this.m_UserInfo = Users.GetUsersByUserName(user.UserName);
            this.m_IsManageStatusPassContent = this.m_UserInfo.UserPurview.ManageSelfPublicInfo;
            if (this.m_IsManageStatusPassContent)
            {
                this.m_arrNodeIdInput = UserPermissions.GetRoleNodeId(user.RoleId, OperateCode.NodeContentInput, user.UserInfo.IsInheritGroupRole ? 1 : 0);
                if (StringHelper.FoundCharInArr(this.m_arrNodeIdInput, "-1"))
                {
                    return(true);
                }
                if (nodeId > 0)
                {
                    string   findStr       = nodeId.ToString();
                    NodeInfo cacheNodeById = Nodes.GetCacheNodeById(nodeId);
                    if (cacheNodeById.IsNull)
                    {
                        DynamicPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        findStr = findStr + "," + cacheNodeById.ParentPath;
                    }
                    return(StringHelper.FoundCharInArr(this.m_arrNodeIdInput, findStr));
                }
            }
            return(false);
        }
Beispiel #11
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            if (this.TxtPasswords.Text != this.TxtConfirmPassword.Text)
            {
                DynamicPage.WriteErrMsg("<li>确认密码与新密码不一致!</li>");
            }
            UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);

            if (StringHelper.MD5(this.TxtOldPassword.Text.Trim()) != usersByUserName.UserPassword)
            {
                DynamicPage.WriteErrMsg("<li>输入的旧密码不正确!</li>");
            }
            else
            {
                usersByUserName.UserPassword = StringHelper.MD5(this.TxtPasswords.Text);
                if (ApiData.IsAPiEnable())
                {
                    string str = ApiFunction.UpdateUser(usersByUserName.UserName, this.TxtPasswords.Text, null, null, null, null, null, null, null, null, null, null, null, null, null);
                    if (str != "true")
                    {
                        DynamicPage.WriteErrMsg("<li>" + str + "</li>");
                    }
                }
                Users.Update(usersByUserName);
                DynamicPage.WriteSuccessMsg("<li>密码修改成功!</li>");
            }
        }
        private void CheckUserName()
        {
            if (StringHelper.FoundCharInArr(this.userSiteConfig.UserNameRegDisabled, this.TxtRegUserName.Text, "|"))
            {
                DynamicPage.WriteErrMsg("<li>该用户名禁止注册,请输入不同的用户名!</li>");
            }
            if (Users.Exists(Users.UserNamefilter(this.TxtRegUserName.Text)))
            {
                DynamicPage.WriteErrMsg("<li>该用户名已被他人占用,请输入不同的用户名!</li>");
            }
            if (Users.UserNamefilter(this.TxtUserName.Text).Length != this.TxtUserName.Text.Length)
            {
                DynamicPage.WriteErrMsg("<li>注册用户名中有非法字符!</li>");
            }
            int userNameLimit = 1;
            int userNameMax   = 20;

            if (this.userSiteConfig.UserNameLimit > 0)
            {
                userNameLimit = this.userSiteConfig.UserNameLimit;
            }
            if (this.userSiteConfig.UserNameMax >= userNameLimit)
            {
                userNameMax = this.userSiteConfig.UserNameMax;
            }
            if ((this.TxtRegUserName.Text.Length < userNameLimit) || (userNameLimit > userNameMax))
            {
                DynamicPage.WriteErrMsg("用户名必须大于" + userNameLimit.ToString() + "个字符并且不能超过" + userNameMax.ToString() + "个字符");
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!SiteConfig.UserConfig.EnableRegCompany)
     {
         DynamicPage.WriteErrMsg("系统禁用了企业注册功能,不能注册!");
     }
 }
 private void CheckEmail()
 {
     if (!this.userSiteConfig.EnableMultiRegPerEmail && !Users.GetUsersByEmail(this.TxtEmail.Text).IsNull)
     {
         DynamicPage.WriteErrMsg("<li>Email已被他人注册,请输入不同的Email!</li>");
     }
 }
Beispiel #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_Path = base.BasePath;
     this.m_Path = this.Page.Request.Url.Scheme + "://" + this.Page.Request.Url.Authority + this.m_Path;
     if (!string.IsNullOrEmpty(PEContext.Current.User.UserName))
     {
         UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);
         this.TxtUserName.Text    = usersByUserName.UserName;
         this.TxtEmail.Text       = usersByUserName.Email;
         this.TxtUserName.Enabled = false;
         this.TxtEmail.Enabled    = false;
     }
     if (!base.IsPostBack)
     {
         int    num       = BasePage.RequestInt32("ID");
         int    commentId = BasePage.RequestInt32("CommentID");
         string str       = BasePage.RequestString("Title");
         if (num == 0)
         {
             DynamicPage.WriteErrMsg("<li>没有找到隶属信息评论,请返回。</li>");
         }
         else
         {
             CommentInfo extendCommentInfo = Comment.GetExtendCommentInfo(commentId);
             if (!base.User.Identity.IsAuthenticated)
             {
                 this.ChkIsPrivate.Enabled = false;
             }
             this.LblTitle.Text = str;
             if (!string.IsNullOrEmpty(extendCommentInfo.UserFace))
             {
                 this.ImgUserFace.ImageUrl = DataSecurity.UrlEncode(extendCommentInfo.UserFace);
                 this.ImgUserFace.Width    = extendCommentInfo.FaceWidth;
                 this.ImgUserFace.Height   = extendCommentInfo.FaceHeight;
             }
             else
             {
                 this.ImgUserFace.ImageUrl = this.m_Path + "Images/Comment/01.gif";
                 this.ImgUserFace.Width    = Unit.Parse("80");
                 this.ImgUserFace.Height   = Unit.Parse("90");
             }
             this.LblUserName.Text    = extendCommentInfo.UserName;
             this.LblPassedItems.Text = extendCommentInfo.PassedItems.ToString();
             this.LblUserExp.Text     = extendCommentInfo.UserExp.ToString();
             this.LblUserRegTime.Text = extendCommentInfo.UserRegTime.ToString("yyyy-MM-dd");
             if (PEContext.Current.User.Identity.IsAuthenticated)
             {
                 this.LblMessage.Text = "<a href='" + this.m_Path + "User/Message/Message.aspx?inceptUser="******"'><img alt='发送短信' src='" + this.m_Path + "Images/Comment/message.gif' border='0' /></a>";
             }
             this.LblEmail.Text          = "<a href='mailto:" + extendCommentInfo.Email + "'><img alt='邮箱' src='" + this.m_Path + "Images/Comment/email.gif' border='0' /></a>";
             this.LblContent.Text        = extendCommentInfo.Content;
             this.LblUpdateDateTime.Text = extendCommentInfo.UpdateDateTime.ToString("yyyy-MM-dd");
             this.TxtCommentRestore.Text = extendCommentInfo.Content;
         }
         if (!SiteConfig.SiteOption.EnablePointMoneyExp)
         {
             this.UserExp.Style.Add("display", "none");
         }
     }
 }
        protected void BtnDelCompany_Click(object sender, EventArgs e)
        {
            UserInfo usersByUserName = Users.GetUsersByUserName(this.LblUserName.Text);

            if (!usersByUserName.IsNull)
            {
                if (usersByUserName.UserType != UserType.Creator)
                {
                    DynamicPage.WriteErrMsg("<li>你不是企业创建者,不能注销企业!</li>");
                }
                if (usersByUserName.ClientId > 0)
                {
                    DynamicPage.WriteErrMsg("<li>你已经是客户,不能注销企业!</li>");
                }
                if (Users.DeleteCompany(usersByUserName.CompanyId))
                {
                    DynamicPage.WriteSuccessMsg("您已经成功注销企业!", "Default.aspx");
                }
                else
                {
                    DynamicPage.WriteErrMsg("<li>注销企业失败!</li>");
                }
            }
            else
            {
                DynamicPage.WriteErrMsg("<li>未找到您的用户信息!</li>");
            }
        }
Beispiel #17
0
        private string GetParameterList(string checkboxId, string productIdControlId, string numberControlId, string tableNameControlId, string propertyControlId)
        {
            string                   str     = "";
            string                   str2    = "";
            string                   str3    = "";
            StringBuilder            builder = new StringBuilder("");
            IList <ShoppingCartInfo> list    = this.ViewState["CartList"] as IList <ShoppingCartInfo>;
            StringBuilder            sb      = new StringBuilder();

            foreach (ShoppingCartInfo info in list)
            {
                if (!info.IsPresent)
                {
                    StringHelper.AppendString(sb, info.ProductId + "|" + info.TableName);
                }
            }
            for (int i = this.RptShoppingCart.Items.Count - 1; i >= 0; i--)
            {
                if ((this.RptShoppingCart.Items[i].ItemType == ListItemType.Item) || (this.RptShoppingCart.Items[i].ItemType == ListItemType.AlternatingItem))
                {
                    CheckBox box = (CheckBox)this.RptShoppingCart.Items[i].FindControl(checkboxId);
                    if ((box != null) && box.Checked)
                    {
                        string str4 = "";
                        str = ((HiddenField)this.RptShoppingCart.Items[i].FindControl(productIdControlId)).Value;
                        int amount = DataConverter.CLng(((TextBox)this.RptShoppingCart.Items[i].FindControl(numberControlId)).Text, 1);
                        if (amount <= 0)
                        {
                            amount = 1;
                        }
                        str2 = ((HiddenField)this.RptShoppingCart.Items[i].FindControl(tableNameControlId)).Value;
                        str3 = ((HiddenField)this.RptShoppingCart.Items[i].FindControl(propertyControlId)).Value;
                        if (list != null)
                        {
                            str4 = Product.CheckStocks(list[i].ProductInfomation, list[i].Property, amount, sb);
                        }
                        if (string.IsNullOrEmpty(str4))
                        {
                            if (builder.Length != 0)
                            {
                                builder.Append("$$$");
                            }
                            builder.Append(str);
                            builder.Append(",");
                            builder.Append(str2);
                            builder.Append(",");
                            builder.Append(amount.ToString());
                            builder.Append(",");
                            builder.Append(str3);
                        }
                        else
                        {
                            DynamicPage.WriteErrMsg(str4);
                            break;
                        }
                    }
                }
            }
            return(builder.ToString());
        }
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            int nodeId = DataConverter.CLng(this.DropCategoryId.SelectedValue);

            if (nodeId == 0)
            {
                nodeId = this.m_NodeId;
            }
            if (nodeId == 0)
            {
                DynamicPage.WriteErrMsg("<li>节点ID不存在!</li>");
            }
            NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId);

            if (cacheNodeById.IsNull)
            {
                DynamicPage.WriteErrMsg("<li>栏目节点不存在!</li>");
            }
            DataTable contentData    = this.GetContentData(nodeId);
            string    successMessage = "您的留言已经提交请等待管理员的审核!";

            if (cacheNodeById.WorkFlowId == -1)
            {
                contentData.Select("FieldName = 'status'")[0]["FieldValue"] = "99";
                successMessage = "您的留言已经发送成功!";
            }
            if (ContentManage.Add(this.m_ModelId, contentData))
            {
                DynamicPage.WriteSuccessMsg(successMessage, SiteConfig.SiteInfo.VirtualPath + "Category_" + this.m_NodeId.ToString() + "/index.aspx");
            }
            else
            {
                DynamicPage.WriteErrMsg("发表留言失败!");
            }
        }
Beispiel #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);

            this.m_UserId = usersByUserName.UserId;
            this.OdsFavorite.SelectParameters["userId"].DefaultValue = this.m_UserId.ToString();
            if (!base.IsPostBack)
            {
                FavoriteInfo favoriteInfo = new FavoriteInfo();
                favoriteInfo.FavoriteTime = DateTime.Now;
                favoriteInfo.InfoId       = BasePage.RequestInt32("Id");
                favoriteInfo.UserId       = this.m_UserId;
                string str = BasePage.RequestStringToLower("Action");
                if (str != null)
                {
                    if (!(str == "add"))
                    {
                        if (!(str == "delete"))
                        {
                            return;
                        }
                    }
                    else
                    {
                        if (favoriteInfo.InfoId <= 0)
                        {
                            DynamicPage.WriteErrMsg("你收藏的内容不存在!", "Index.aspx");
                        }
                        UserPurviewInfo userPurview  = usersByUserName.UserPurview;
                        int             maxSaveInfos = 0;
                        if (!userPurview.IsNull)
                        {
                            maxSaveInfos = userPurview.MaxSaveInfos;
                        }
                        if (maxSaveInfos <= 0)
                        {
                            DynamicPage.WriteErrMsg("你没有收藏权限,请与网站管理员联系!", "Index.aspx");
                        }
                        if (maxSaveInfos > Favorite.GetUserFavoiteCount(this.m_UserId))
                        {
                            Favorite.Add(favoriteInfo);
                            DynamicPage.WriteSuccessMsg("收藏成功", "~/Item/" + favoriteInfo.InfoId.ToString() + ".aspx");
                            return;
                        }
                        DynamicPage.WriteErrMsg("你收藏的内容已达到最大收藏数");
                        return;
                    }
                    if (favoriteInfo.InfoId <= 0)
                    {
                        DynamicPage.WriteUserErrMsg("你收藏的内容不存在!", "Favorite.aspx");
                    }
                    if (!Favorite.Delete(this.m_UserId, BasePage.RequestInt32("Id")))
                    {
                        DynamicPage.WriteUserErrMsg("取消失败");
                    }
                }
            }
        }
Beispiel #20
0
        private void CheckForm(SurveyFieldInfo fieldInfo, string answer)
        {
            switch (fieldInfo.QuestionType)
            {
            case 0:
            case 1:
                if (!string.IsNullOrEmpty(answer) || !fieldInfo.EnableNull)
                {
                    break;
                }
                DynamicPage.WriteErrMsg(fieldInfo.QuestionContent + "不能为空!");
                return;

            case 2:
            case 3:
            case 4:
            case 5:
            case 7:
                if (!string.IsNullOrEmpty(answer) || !fieldInfo.EnableNull)
                {
                    break;
                }
                DynamicPage.WriteErrMsg("请选择" + fieldInfo.QuestionContent);
                return;

            case 6:
                DateTime time;
                if (fieldInfo.EnableNull && string.IsNullOrEmpty(answer))
                {
                    DynamicPage.WriteErrMsg(fieldInfo.QuestionContent + "不能为空!");
                }
                if (DateTime.TryParse(answer, out time))
                {
                    break;
                }
                DynamicPage.WriteErrMsg(fieldInfo.QuestionContent + " 填写的日期格式不正确!");
                return;

            case 8:
                if (DataValidator.IsNumber(answer) || !fieldInfo.EnableNull)
                {
                    break;
                }
                DynamicPage.WriteErrMsg(fieldInfo.QuestionContent + "中输入的不是数字!");
                return;

            case 9:
                if (!DataValidator.IsEmail(answer) && fieldInfo.EnableNull)
                {
                    DynamicPage.WriteErrMsg("请选择正确的Emial地址!");
                }
                break;

            default:
                return;
            }
        }
 protected void BtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         string text = this.TxtGroupName.Text;
         if (this.m_Action != "modify")
         {
             UserInfo usersByUserName = Users.GetUsersByUserName(this.m_UserName);
             if (usersByUserName.IsNull)
             {
                 DynamicPage.WriteErrMsg("<li>找不到对应的会员信息!</li>");
             }
             else if (string.IsNullOrEmpty(usersByUserName.UserFriendGroup))
             {
                 DynamicPage.WriteErrMsg("<li>数据库信息错误或删除了网站默认组!</li>");
             }
             else
             {
                 int length = usersByUserName.UserFriendGroup.Split(new char[] { '$' }).Length;
                 if ((length < 1) || (length > 7))
                 {
                     DynamicPage.WriteErrMsg("<li>数据库信息错误或删除了网站默认组或添加组超过8个了!</li>");
                 }
                 else
                 {
                     StringBuilder builder = new StringBuilder();
                     builder.Append(usersByUserName.UserFriendGroup);
                     if (!usersByUserName.UserFriendGroup.EndsWith("$", StringComparison.Ordinal))
                     {
                         builder.Append("$");
                     }
                     builder.Append(text);
                     if (Users.UpdateUserFriendGroup(this.m_UserName, builder.ToString()))
                     {
                         DynamicPage.WriteSuccessMsg("添加成功!", "FriendGroupManage.aspx");
                     }
                 }
             }
         }
         else
         {
             if (this.m_GroupId == 0)
             {
                 DynamicPage.WriteErrMsg("<li>该成员组名称不允许修改</li>");
             }
             if (Users.UpdateFriendGroupName(this.m_UserName, this.m_GroupId, text))
             {
                 DynamicPage.WriteSuccessMsg("修改成功!", "FriendGroupManage.aspx");
             }
             else
             {
                 DynamicPage.WriteErrMsg("<li>修改失败!</li>");
             }
         }
     }
 }
 protected void BtnunRegisterBuy_Click(object sender, EventArgs e)
 {
     if (SiteConfig.ShopConfig.EnableGuestBuy)
     {
         BasePage.ResponseRedirect("Payment.aspx");
     }
     else
     {
         DynamicPage.WriteErrMsg("<li>不允许游客购买商品,请返回上一页注册后再购买!</li>");
     }
 }
Beispiel #23
0
 protected void BtnSubmitMoney_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);
         int      howMany         = 0;
         decimal  d    = Convert.ToDecimal(this.TxtMoney.Text);
         decimal  num3 = DataConverter.CDecimal(usersByUserName.UserPurview.Overdraft);
         if (d > (usersByUserName.Balance + num3))
         {
             DynamicPage.WriteErrMsg("<li>您的余额不足以进行此次兑换!</li>");
         }
         if (SiteConfig.UserConfig.MoneyExchangePoint <= 0.0)
         {
             DynamicPage.WriteErrMsg("<li>兑换功能关闭,请与管理员联系!</li>", "../Default.aspx");
         }
         if (d <= 0M)
         {
             DynamicPage.WriteErrMsg("<li>填写资金必须大于0!</li>");
         }
         howMany = (int)(((double)d) / SiteConfig.UserConfig.MoneyExchangePoint);
         if (((howMany == 0) || (howMany < 0)) || (howMany > 0x5f5e100))
         {
             DynamicPage.WriteErrMsg("<li>输入资金有误或兑换比率有误!</li>");
         }
         usersByUserName.Balance -= d;
         if (Users.Update(usersByUserName))
         {
             UserPoint point  = new UserPoint();
             string    reason = string.Concat(new object[] { PEContext.Current.User.UserName, "用", d, "元资金兑换", howMany, SiteConfig.UserConfig.PointName });
             if (point.IncreaseForUsers(usersByUserName.UserId.ToString(), howMany, reason, true, ""))
             {
                 BankrollItemInfo bankrollItemInfo = new BankrollItemInfo();
                 bankrollItemInfo.UserName     = usersByUserName.UserName;
                 bankrollItemInfo.MoneyType    = 4;
                 bankrollItemInfo.CurrencyType = 3;
                 bankrollItemInfo.DateAndTime  = new DateTime?(DateTime.Now);
                 bankrollItemInfo.Inputer      = PEContext.Current.User.UserName;
                 bankrollItemInfo.IP           = PEContext.Current.UserHostAddress;
                 bankrollItemInfo.LogTime      = new DateTime?(DateTime.Now);
                 bankrollItemInfo.Money        = -(d);
                 bankrollItemInfo.Remark       = string.Concat(new object[] { "用于", SiteConfig.UserConfig.PointName, "兑换,消费", d, "元资金,增加", SiteConfig.UserConfig.PointName, howMany, SiteConfig.UserConfig.PointUnit });
                 bankrollItemInfo.Status       = BankrollItemStatus.Confirm;
                 BankrollItem.Add(bankrollItemInfo);
                 DynamicPage.WriteSuccessMsg("<li>会员" + SiteConfig.UserConfig.PointName + "兑换成功!</li>", "ExchangePoint.aspx");
             }
             else
             {
                 DynamicPage.WriteErrMsg("<li>会员" + SiteConfig.UserConfig.PointName + "兑换失败!</li>");
             }
         }
     }
 }
Beispiel #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);
         if (!usersByUserName.UserPurview.EnableGivePointToOthers)
         {
             DynamicPage.WriteErrMsg("对不起,您没有自助赠送点券权限!");
         }
         this.showUserInfo.UserInfo = usersByUserName;
     }
 }
Beispiel #25
0
 private void ShowModifyInfo(MessageInfo info, string action)
 {
     if (info == null)
     {
         DynamicPage.WriteErrMsg("参数错误!");
     }
     else
     {
         StringBuilder builder = new StringBuilder();
         string        sender  = info.Sender;
         string        str2    = info.SendTime.ToLongTimeString();
         string        str3    = action;
         if (str3 != null)
         {
             if (!(str3 == "Edit"))
             {
                 if (!(str3 == "Reply"))
                 {
                     if (str3 == "Forward")
                     {
                         base.Title         = "转发短消息";
                         this.TxtTitle.Text = "Fw: " + info.Title;
                         builder.Append("============== 下面是转发信息 ==============<br />");
                         builder.Append("原发件人:" + sender + "<br />");
                         builder.Append("原发件内容:<br />");
                         builder.Append(info.Content);
                         builder.Append("<br />================================================<br />");
                         this.EditorContent.Value = builder.ToString();
                     }
                     return;
                 }
             }
             else
             {
                 base.Title = "编辑短消息";
                 this.TxtInceptUser.Text  = info.Incept;
                 this.TxtTitle.Text       = info.Title;
                 this.HdnMessageID.Value  = info.MessageId.ToString();
                 this.EditorContent.Value = info.Content;
                 return;
             }
             base.Title = "回复短消息";
             this.TxtInceptUser.Text = info.Sender;
             this.TxtTitle.Text      = "Re: " + info.Title;
             builder.Append("======在 ");
             builder.Append(str2);
             builder.Append(" 您来信中写道:======<br />");
             builder.Append(info.Content);
             builder.Append("<br />================================================<br />");
             this.EditorContent.Value = builder.ToString();
         }
     }
 }
Beispiel #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);
         if (!usersByUserName.UserPurview.EnableBuyPoint)
         {
             DynamicPage.WriteErrMsg("对不起,您没有购买" + SiteConfig.UserConfig.PointName + "的权限!");
         }
         this.showUserInfo.UserInfo = usersByUserName;
         this.InitBuyPoint();
     }
 }
Beispiel #27
0
 protected void BtnMoneySubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);
         double   input           = 0.0;
         decimal  d    = Convert.ToDecimal(this.TxtMoney.Text);
         decimal  num3 = DataConverter.CDecimal(usersByUserName.UserPurview.Overdraft);
         if (d > (usersByUserName.Balance + num3))
         {
             DynamicPage.WriteErrMsg("<li>您的余额不足以进行此次兑换!</li>");
         }
         if (SiteConfig.UserConfig.MoneyExchangeValidDay <= 0.0)
         {
             DynamicPage.WriteErrMsg("<li>兑换功能关闭,请与管理员联系!</li>");
         }
         if (d <= 0M)
         {
             DynamicPage.WriteErrMsg("<li>填写资金必须大于0!</li>");
         }
         input = ((double)d) / SiteConfig.UserConfig.MoneyExchangeValidDay;
         if (input <= 0.0)
         {
             DynamicPage.WriteErrMsg("<li>有效期兑换比率有误!</li>");
         }
         usersByUserName.Balance -= d;
         if (Users.Update(usersByUserName))
         {
             UserDate date   = new UserDate();
             string   reason = string.Concat(new object[] { PEContext.Current.User.UserName, "用", d, "元资金兑换", input, "天有效期" });
             if (date.IncreaseForUsers(usersByUserName.UserId.ToString(), DataConverter.CLng(input), reason, true, ""))
             {
                 BankrollItemInfo bankrollItemInfo = new BankrollItemInfo();
                 bankrollItemInfo.Inputer     = "System";
                 bankrollItemInfo.UserName    = PEContext.Current.User.UserName;
                 bankrollItemInfo.ClientId    = usersByUserName.ClientId;
                 bankrollItemInfo.Money       = -(d);
                 bankrollItemInfo.MoneyType   = 4;
                 bankrollItemInfo.Remark      = string.Concat(new object[] { PEContext.Current.User.UserName, "用", d, "元资金兑换", input, "天有效期" });
                 bankrollItemInfo.DateAndTime = new DateTime?(DateTime.Now);
                 BankrollItem.Add(bankrollItemInfo);
                 DynamicPage.WriteSuccessMsg("<li>会员有效期兑换成功!</li>", "ExchangeValidDate.aspx");
             }
             else
             {
                 DynamicPage.WriteErrMsg("<li>会员有效期兑换失败!</li>");
             }
         }
     }
 }
Beispiel #28
0
 protected void EgvFriend_RowCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         if (UserFriend.Delete(e.CommandArgument.ToString()))
         {
             DynamicPage.WriteSuccessMsg("删除成功!", "FriendManage.aspx");
         }
         else
         {
             DynamicPage.WriteErrMsg("<li>删除失败</li>");
         }
     }
 }
Beispiel #29
0
        private string ParseDownLoadPath(int urlid, int id, int serverid)
        {
            DataTable contentDataById = ContentManage.GetContentDataById(id);

            if (contentDataById.Rows.Count <= 0)
            {
                DynamicPage.WriteErrMsg("此资源不存在!", SiteConfig.SiteInfo.VirtualPath + "Default.aspx");
            }
            string         str            = "";
            DownServerInfo downServerById = DownServer.GetDownServerById(serverid);
            string         weburl         = "";

            if (contentDataById.Rows.Count > 0)
            {
                str = contentDataById.Rows[0]["DownloadUrl"].ToString();
                int num = 0;
                foreach (string str3 in str.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries))
                {
                    string[] strArray2 = str3.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                    if (num == urlid)
                    {
                        weburl = strArray2[1];
                    }
                    num++;
                }
            }
            if (downServerById.IsNull)
            {
                this.downloadurl = Utility.ConvertAbsolutePath(SiteConfig.SiteInfo.VirtualPath + SiteConfig.SiteOption.UploadDir + "/", weburl, true);
                return(weburl);
            }
            string str4 = downServerById.ServerUrl.ToString();

            if (!str4.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
            {
                str4 = "http://" + str4;
            }
            if (!str4.EndsWith("/", StringComparison.Ordinal))
            {
                str4 = str4 + "/";
            }
            if (weburl.StartsWith("/", StringComparison.Ordinal) || weburl.Contains("://"))
            {
                this.downloadurl = weburl;
                return(weburl);
            }
            this.downloadurl = str4 + weburl;
            return(weburl);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_NodeId  = BasePage.RequestInt32("id");
     this.m_ModelId = BasePage.RequestInt32("modelId");
     this.DropGuestImages.Attributes.Add("onchange", "document.getElementById('showphoto').src = '../Images/Comment/' + this.value + '.gif';");
     if (this.m_ModelId == 0)
     {
         DynamicPage.WriteErrMsg("没有模型ID!");
     }
     if (PEContext.Current.User.Identity.IsAuthenticated)
     {
         UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);
         if (usersByUserName.IsNull)
         {
             DynamicPage.WriteErrMsg("登录用户不存在!");
         }
         this.TxtGuestName.Visible     = false;
         this.ValrGuestName.Visible    = false;
         this.TxtGuestEmail.Visible    = false;
         this.ValrEmail.Visible        = false;
         this.Vmail.Visible            = false;
         this.TxtGuestOicq.Visible     = false;
         this.TxtGuestMsn.Visible      = false;
         this.TxtGuestHomepage.Visible = false;
         this.LblGuestName.Visible     = true;
         this.LblGuestEmail.Visible    = true;
         this.LblGuestOicq.Visible     = true;
         this.LblGuestMsn.Visible      = true;
         this.LblGuestHomepage.Visible = true;
         this.LblGuestName.Text        = usersByUserName.UserName;
         this.LblGuestEmail.Text       = usersByUserName.Email;
         ContacterInfo contacterByUserName = new ContacterInfo();
         contacterByUserName = Contacter.GetContacterByUserName(usersByUserName.UserName);
         if (contacterByUserName != null)
         {
             this.LblGuestOicq.Text     = contacterByUserName.QQ;
             this.LblGuestMsn.Text      = contacterByUserName.Msn;
             this.LblGuestHomepage.Text = contacterByUserName.Homepage;
         }
     }
     if (!this.Page.IsPostBack)
     {
         IList <NodeInfo> nodesListByParentId = EasyOne.Contents.Nodes.GetNodesListByParentId(this.m_NodeId);
         this.DropCategoryId.DataSource     = nodesListByParentId;
         this.DropCategoryId.DataTextField  = "NodeName";
         this.DropCategoryId.DataValueField = "NodeID";
         this.DropCategoryId.DataBind();
     }
 }