Exemple #1
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);
                }
            }
        }
Exemple #2
0
 private void SavePemotePic(string contentFieldName, CommonModelInfo commonModelInfo, NodeInfo nodeInfo, DataTable content)
 {
     string[] strArray = new string[0];
     if (!SiteConfig.SiteOption.EnableUploadFiles)
     {
         base.Response.Write("权限错误:你当前的系统配置没有开启上传功能,所以不能获取远程图片。");
     }
     else if (nodeInfo.IsNull)
     {
         base.Response.Write("获取错误:缺少栏目ID,所以不能得到保存地址。");
     }
     else
     {
         if (contentFieldName.IndexOf('$') > 0)
         {
             strArray = contentFieldName.Split(new string[] { "$" }, StringSplitOptions.None);
             for (int i = 0; i < strArray.Length; i++)
             {
                 content = ContentManage.SavePemotePic(content, nodeInfo, strArray[i]);
             }
         }
         else
         {
             content = ContentManage.SavePemotePic(content, nodeInfo, contentFieldName);
         }
         ContentManage.UpdateField(commonModelInfo.ItemId, commonModelInfo.TableName, contentFieldName, content);
     }
 }
        private void SavePresentExp(DataTable dataTable, bool isAdd)
        {
            string          userName            = PEContext.Current.Admin.UserName;
            CommonModelInfo commonModelInfoById = null;

            if (!isAdd)
            {
                commonModelInfoById = ContentManage.GetCommonModelInfoById(BasePage.RequestInt32("GeneralID"));
                userName            = commonModelInfoById.Inputer;
            }
            UserInfo usersByUserName = Users.GetUsersByUserName(userName);

            if (!usersByUserName.IsNull)
            {
                int             statusFromDataTable = GetStatusFromDataTable(dataTable);
                UserPurviewInfo userPurview         = usersByUserName.UserPurview;
                if (userPurview.IsNull)
                {
                    userPurview.MaxPublicInfoOneDay = -1;
                    userPurview.GetExp = 1;
                }
                if (userPurview.GetExp == 0)
                {
                    userPurview.GetExp = 1;
                }
                int num3 = EasyOne.Contents.Nodes.GetCacheNodeById(this.m_NodeId).Settings.PresentExp *userPurview.GetExp;
                if (isAdd)
                {
                    int generalId = GetGeneralId(dataTable);
                    if (statusFromDataTable == 0x63)
                    {
                        usersByUserName.UserExp += num3;
                        usersByUserName.PassedItems++;
                    }
                    usersByUserName.PostItems++;
                }
                else
                {
                    if ((statusFromDataTable == 0x63) && (commonModelInfoById.Status < 0x63))
                    {
                        usersByUserName.UserExp += num3;
                        usersByUserName.PassedItems++;
                    }
                    if ((commonModelInfoById.Status == 0x63) && (statusFromDataTable < 0x63))
                    {
                        usersByUserName.UserExp -= num3;
                        usersByUserName.PassedItems--;
                    }
                    if (statusFromDataTable == -2)
                    {
                        usersByUserName.RejectItems++;
                    }
                    if (statusFromDataTable == -3)
                    {
                        usersByUserName.DelItems++;
                    }
                }
                Users.Update(usersByUserName);
            }
        }
Exemple #4
0
        private static string ItemTemplateFilePath(CommonModelInfo commonModelInfo)
        {
            string defaultTemplateFile = "";

            if (!string.IsNullOrEmpty(commonModelInfo.TemplateFile))
            {
                return(commonModelInfo.TemplateFile);
            }
            NodesModelTemplateRelationShipInfo nodesModelTemplateRelationShip = ModelManager.GetNodesModelTemplateRelationShip(commonModelInfo.NodeId, commonModelInfo.ModelId);

            if (!nodesModelTemplateRelationShip.IsNull)
            {
                if (!string.IsNullOrEmpty(nodesModelTemplateRelationShip.DefaultTemplateFile))
                {
                    defaultTemplateFile = nodesModelTemplateRelationShip.DefaultTemplateFile;
                }
                return(defaultTemplateFile);
            }
            ModelInfo modelInfoById = ModelManager.GetModelInfoById(commonModelInfo.ModelId);

            if (!string.IsNullOrEmpty(modelInfoById.DefaultTemplateFile))
            {
                defaultTemplateFile = modelInfoById.DefaultTemplateFile;
            }
            return(defaultTemplateFile);
        }
Exemple #5
0
        private string TemplatePageName(CommonModelInfo commonModelInfo, NodeInfo node)
        {
            string contentPageHtmlRule = node.ContentPageHtmlRule;
            int    index = contentPageHtmlRule.IndexOf(".");

            contentPageHtmlRule = (contentPageHtmlRule.Substring(0, index) + "_{$pageid/}" + contentPageHtmlRule.Substring(index, contentPageHtmlRule.Length - index)).ToLower().Replace("{$categorydir}", node.ParentDir + node.NodeDir).Replace("{$year}", commonModelInfo.InputTime.Year.ToString("0000")).Replace("{$month}", commonModelInfo.InputTime.Month.ToString("00")).Replace("{$day}", commonModelInfo.InputTime.Day.ToString("00")).Replace("{$pinyinoftitle}", commonModelInfo.PinyinTitle).Replace("{$time}", commonModelInfo.InputTime.Hour.ToString("00") + commonModelInfo.InputTime.Minute.ToString("00") + commonModelInfo.InputTime.Second.ToString("00"));
            contentPageHtmlRule = (this.SiteUrl + SiteConfig.SiteOption.CreateHtmlPath + contentPageHtmlRule.Replace("{$infoid}", commonModelInfo.GeneralId.ToString())).Replace("//", "/");
            return("http://" + contentPageHtmlRule);
        }
Exemple #6
0
 protected void EgvContent_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         CommonModelInfo dataItem = (CommonModelInfo)e.Row.DataItem;
         Label           label    = e.Row.FindControl("LTitle") as Label;
         label.Text = StringHelper.SubString(dataItem.Title, 40, "...");
     }
 }
 public static bool BatchUpdate(CommonModelInfo commonModelInfo, string itemId, Dictionary <string, bool> checkItem, int batchType)
 {
     if (!DataValidator.IsValidId(itemId))
     {
         return(false);
     }
     if (!checkItem.ContainsValue(true))
     {
         return(false);
     }
     return(dal.BatchUpdate(commonModelInfo, itemId, checkItem, batchType));
 }
Exemple #8
0
 protected override void Render(HtmlTextWriter writer)
 {
     if (!this.Page.IsPostBack)
     {
         int    generalId = BasePage.RequestInt32("id");
         string str       = BasePage.RequestStringToLower("HitsType");
         this.modelInfo = ContentManage.GetCommonModelInfoById(generalId);
         if (string.IsNullOrEmpty(str))
         {
             this.UpdateHits(generalId);
         }
         this.ShowHits(generalId, str);
     }
 }
Exemple #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int generalId = BasePage.RequestInt32("itemid");

            if (PEContext.Current.Admin.Identity.IsAuthenticated)
            {
                CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId);
                int             nodeId = commonModelInfoById.NodeId;
                bool            flag   = false;
                if (PEContext.Current.Admin.IsSuperAdmin)
                {
                    flag = true;
                }
                else
                {
                    bool flag2 = false;
                    bool flag3 = false;
                    bool flag4 = false;
                    flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, nodeId);
                    flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeId);
                    flag4 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeId);
                    if ((flag2 || flag4) || flag3)
                    {
                        flag = true;
                    }
                }
                if (flag)
                {
                    string    manageDir     = SiteConfig.SiteOption.ManageDir;
                    ModelInfo modelInfoById = ModelManager.GetModelInfoById(commonModelInfoById.ModelId);
                    if (modelInfoById.IsEshop)
                    {
                        this.Session["IndexRightUrl"] = string.Concat(new object[] { base.BasePath, manageDir, "/shop/", modelInfoById.AddInfoFilePath, "?Action=Modify&NodeID=", commonModelInfoById.NodeId.ToString(), "&GeneralID=", generalId, "&ModelID=", commonModelInfoById.ModelId.ToString(), "&LinkType=", commonModelInfoById.LinkType });
                    }
                    else
                    {
                        this.Session["IndexRightUrl"] = string.Concat(new object[] { base.BasePath, manageDir, "/Contents/", modelInfoById.AddInfoFilePath, "?Action=Modify&NodeID=", commonModelInfoById.NodeId.ToString(), "&GeneralID=", generalId, "&ModelID=", commonModelInfoById.ModelId.ToString(), "&LinkType=", commonModelInfoById.LinkType });
                    }
                    BasePage.ResponseRedirect("~/" + manageDir + "/Index.aspx");
                }
                else
                {
                    BasePage.ResponseRedirect("~/Item/" + generalId + ".aspx");
                }
            }
            else
            {
                BasePage.ResponseRedirect("~/Item/" + generalId + ".aspx");
            }
        }
Exemple #10
0
        private void UpdateHits(int id)
        {
            CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(id);

            if (!commonModelInfoById.IsNull)
            {
                DateTime time;
                if (!commonModelInfoById.LastHitTime.HasValue)
                {
                    time = DateTime.Now;
                }
                else
                {
                    time = commonModelInfoById.LastHitTime.Value;
                }
                this.hits      = commonModelInfoById.Hits + 1;
                this.dayHits   = commonModelInfoById.DayHits;
                this.weekHits  = commonModelInfoById.WeekHits;
                this.monthHits = commonModelInfoById.MonthHits;
                DateTime now = DateTime.Now;
                if (string.Compare(time.ToShortDateString(), DateTime.Now.ToShortDateString(), StringComparison.OrdinalIgnoreCase) == 0)
                {
                    this.dayHits++;
                }
                else
                {
                    this.dayHits = 1;
                }
                DateTime time3 = now.AddDays((double)-this.GetDays(now.DayOfWeek));
                DateTime time4 = time3.AddDays(7.0);
                if ((DateTime.Compare(time, time3) >= 0) && (DateTime.Compare(time, time4) <= 0))
                {
                    this.weekHits++;
                }
                else
                {
                    this.weekHits = 1;
                }
                if ((string.Compare(time.Year.ToString(), now.Year.ToString(), StringComparison.Ordinal) == 0) && (string.Compare(time.Month.ToString(), now.Month.ToString(), StringComparison.Ordinal) == 0))
                {
                    this.monthHits++;
                }
                else
                {
                    this.monthHits = 1;
                }
                time = DateTime.Now;
                ContentManage.UpdateHits(id, this.hits, this.dayHits, this.weekHits, this.monthHits, time);
            }
        }
        private CommonModelInfo GetCommonModelInfo()
        {
            CommonModelInfo info = new CommonModelInfo();

            info.EliteLevel   = DataConverter.CLng(this.TxtEliteLevel.Text.Trim());
            info.Priority     = DataConverter.CLng(this.TxtPriority.Text.Trim());
            info.Hits         = DataConverter.CLng(this.TxtHits.Text.Trim());
            info.DayHits      = DataConverter.CLng(this.TxtDayHits.Text.Trim());
            info.WeekHits     = DataConverter.CLng(this.TxtWeekHits.Text.Trim());
            info.MonthHits    = DataConverter.CLng(this.TxtMonthHits.Text.Trim());
            info.UpdateTime   = this.DpkUpdateTime.Date;
            info.TemplateFile = this.FileCTemplate.Text;
            return(info);
        }
        public static string ContentHtmlName(CommonModelInfo commonModelInfo, NodeInfo node, int pageIndex)
        {
            string contentPageHtmlRule = node.ContentPageHtmlRule;

            if (string.IsNullOrEmpty(contentPageHtmlRule))
            {
                return(string.Empty);
            }
            int index = contentPageHtmlRule.IndexOf(".");

            if (pageIndex > 0)
            {
                contentPageHtmlRule = contentPageHtmlRule.Substring(0, index) + "_" + pageIndex.ToString() + contentPageHtmlRule.Substring(index, contentPageHtmlRule.Length - index);
            }
            return(contentPageHtmlRule.ToLower().Replace("{$categorydir}", node.ParentDir + node.NodeDir).Replace("{$year}", commonModelInfo.InputTime.Year.ToString("0000")).Replace("{$month}", commonModelInfo.InputTime.Month.ToString("00")).Replace("{$day}", commonModelInfo.InputTime.Day.ToString("00")).Replace("{$pinyinoftitle}", commonModelInfo.PinyinTitle).Replace("{$time}", commonModelInfo.InputTime.Hour.ToString("00") + commonModelInfo.InputTime.Minute.ToString("00") + commonModelInfo.InputTime.Second.ToString("00")).Replace("{$infoid}", commonModelInfo.GeneralId.ToString()));
        }
        protected void Page_PreRender(object sender, EventArgs e)
        {
            base.Response.Clear();
            base.Response.Buffer  = true;
            base.Response.Charset = "utf-8";
            base.Response.AddHeader("contenttype", "text/vnd.wap.wml");
            base.Response.ContentEncoding = Encoding.GetEncoding("utf-8");
            base.Response.ContentType     = "text/vnd.wap.wml";
            this.m_GeneralId = BasePage.RequestInt32("id");
            if (this.m_GeneralId <= 0)
            {
                base.Response.End();
            }
            this.m_ItemInfo = ContentManage.GetCommonModelInfoById(this.m_GeneralId);
            if (this.m_ItemInfo.IsNull)
            {
                base.Response.End();
            }
            else
            {
                this.m_ModelInfo = ModelManager.GetModelInfoById(this.m_ItemInfo.ModelId);
                if (!this.m_ModelInfo.IsEshop && (this.m_ItemInfo.Status != 0x63))
                {
                    base.Response.End();
                }
            }
            TemplateInfo templateInfo = new TemplateInfo();

            templateInfo.QueryList = base.Request.QueryString;
            templateInfo.PageName  = DynamicPage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString);
            string path = "/其他模板/Wap内容页模板.html";

            foreach (FrontTemplate template in SiteConfig.FrontTemplateList)
            {
                if (string.Compare(this.PageFileName, template.Key, true, CultureInfo.CurrentCulture) == 0)
                {
                    path = template.Value;
                    break;
                }
            }
            templateInfo.TemplateContent = Template.GetTemplateContent(path);
            templateInfo.RootPath        = HttpContext.Current.Request.PhysicalApplicationPath;
            templateInfo.CurrentPage     = DataConverter.CLng(base.Request.QueryString["page"], 1);
            templateInfo = TemplateTransform.GetHtml(templateInfo);
            base.Response.Write(templateInfo.TemplateContent);
            base.Response.End();
        }
Exemple #14
0
        private static bool CheckModelForUseCoupon(string cartId, string modelIdList)
        {
            IList <ShoppingCartInfo> infoByCart = ShoppingCart.GetInfoByCart(cartId, false);

            string[] strArray = modelIdList.Split(new char[] { ',' });
            foreach (ShoppingCartInfo info in infoByCart)
            {
                CommonModelInfo commonModelInfo = ContentManage.GetCommonModelInfo(info.ProductId, info.TableName);
                foreach (string str in strArray)
                {
                    if (commonModelInfo.ModelId.ToString() == str)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
        public ChargeManage()
        {
            int generalId = DataConverter.CLng(HttpContext.Current.Request["id"]);

            this.m_UserInfo          = PEContext.Current.User.UserInfo;
            this.m_CommonModelInfo   = ContentManage.GetCommonModelInfoById(generalId);
            this.m_ModelInfo         = ModelManager.GetModelInfoById(this.m_CommonModelInfo.ModelId);
            this.m_NodeInfo          = Nodes.GetCacheNodeById(this.m_CommonModelInfo.NodeId);
            this.m_contentChargeInfo = ContentCharge.GetContentChargeInfoById(this.m_CommonModelInfo.GeneralId);
            this.m_UserTrueIP        = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (string.IsNullOrEmpty(this.m_UserTrueIP))
            {
                this.m_UserTrueIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
            }
            this.m_UserTrueIP       = DataSecurity.FilterBadChar(this.m_UserTrueIP);
            this.m_Pay              = HttpContext.Current.Request["Pay"];
            this.m_errMsg_NoLogin   = this.m_errMsg_NoLogin.Replace("{$InstallDir}", SiteConfig.SiteInfo.VirtualPath);
            this.m_errMsg_NoLogin   = this.m_errMsg_NoLogin.Replace("{$ItemName}", this.m_ModelInfo.ItemName);
            this.m_errMsg_NoLogin   = this.m_errMsg_NoLogin.Replace("{$ReturnUrl}", DataSecurity.HtmlEncode(HttpContext.Current.Request.RawUrl).Replace("&", "%26"));
            this.m_errMsg_OutTime   = this.m_errMsg_OutTime.Replace("{$ItemName}", this.m_ModelInfo.ItemName);
            this.m_errMsg_NeedPoint = this.m_errMsg_NeedPoint.Replace("{$ItemName}", this.m_ModelInfo.ItemName);
            this.m_errMsg_NeedPoint = this.m_errMsg_NeedPoint.Replace("{$InfoPoint}", this.m_contentChargeInfo.InfoPoint.ToString());
            this.m_errMsg_NeedPoint = this.m_errMsg_NeedPoint.Replace("{$NeedPoint}", this.m_contentChargeInfo.InfoPoint.ToString());
            this.m_errMsg_NeedPoint = this.m_errMsg_NeedPoint.Replace("{$NowPoint}", this.m_UserInfo.UserPoint.ToString());
            this.m_errMsg_NeedPoint = this.m_errMsg_NeedPoint.Replace("{$PointName}", SiteConfig.UserConfig.PointName);
            this.m_errMsg_NeedPoint = this.m_errMsg_NeedPoint.Replace("{$PointUnit}", SiteConfig.UserConfig.PointUnit);
            this.m_errMsg_UsePoint  = this.m_errMsg_UsePoint.Replace("{$ItemName}", this.m_ModelInfo.ItemName);
            this.m_errMsg_UsePoint  = this.m_errMsg_UsePoint.Replace("{$InfoPoint}", this.m_contentChargeInfo.InfoPoint.ToString());
            this.m_errMsg_UsePoint  = this.m_errMsg_UsePoint.Replace("{$NowPoint}", this.m_UserInfo.UserPoint.ToString());
            this.m_errMsg_UsePoint  = this.m_errMsg_UsePoint.Replace("{$FinalPoint}", (this.m_UserInfo.UserPoint - this.m_contentChargeInfo.InfoPoint).ToString());
            if (HttpContext.Current.Request.RawUrl.Contains("?"))
            {
                this.m_errMsg_UsePoint = this.m_errMsg_UsePoint.Replace("{$url}", HttpContext.Current.Request.RawUrl + "&Pay=yes");
            }
            else
            {
                this.m_errMsg_UsePoint = this.m_errMsg_UsePoint.Replace("{$url}", HttpContext.Current.Request.RawUrl + "?Pay=yes");
            }
            this.m_errMsg_UsePoint = this.m_errMsg_UsePoint.Replace("{$InstallDir}", SiteConfig.SiteInfo.VirtualPath);
            this.m_errMsg_UsePoint = this.m_errMsg_UsePoint.Replace("{$PointName}", SiteConfig.UserConfig.PointName);
            this.m_errMsg_UsePoint = this.m_errMsg_UsePoint.Replace("{$PointUnit}", SiteConfig.UserConfig.PointUnit);
        }
 public override void OnInitTemplatePage(EventArgs e)
 {
     this.m_GeneralId = BasePage.RequestInt32("id");
     if (this.m_GeneralId <= 0)
     {
         TemplatePage.WriteErrMsg("您访问的内容信息不存在", "Default.aspx");
     }
     this.m_ItemInfo = ContentManage.GetCommonModelInfoById(this.m_GeneralId);
     if (this.m_ItemInfo == null)
     {
         TemplatePage.WriteErrMsg("您访问的内容信息不存在", "Default.aspx");
     }
     this.m_NodeInfo  = Nodes.GetCacheNodeById(this.m_ItemInfo.NodeId);
     this.m_ModelInfo = ModelManager.GetModelInfoById(this.m_ItemInfo.ModelId);
     if (this.m_ModelInfo.IsNull || string.IsNullOrEmpty(this.m_ModelInfo.PrintTemplate))
     {
         TemplatePage.WriteErrMsg("没有指定模型打印页模板", "Default.aspx");
     }
     this.CheckPermission();
 }
Exemple #17
0
        protected void EBtnPass_Click(object sender, EventArgs e)
        {
            this.PermissionDetection(this.m_isCheck);
            StringBuilder selectList = this.EgvContent.SelectList;

            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要审核的项目!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
            else
            {
                int nodeWorkFlowId = Nodes.GetNodeWorkFlowId(this.m_NodeId);
                RolePermissions.BusinessAccessCheck(OperateCode.NodeContentCheck, this.m_NodeId);
                if (this.m_Administrator)
                {
                    UpdateStatus(selectList.ToString(), 0x63, SiteConfig.SmsConfig.IsAutoSendStateMessage, this.EgvContent, this.m_Administrator);
                }
                else if (Nodes.GetNodeById(BasePage.RequestInt32("NodeID")).Child == 0)
                {
                    UpdateStatus(selectList.ToString(), UserPass(nodeWorkFlowId), SiteConfig.SmsConfig.IsAutoSendStateMessage, this.EgvContent, this.m_Administrator);
                }
                else
                {
                    CommonModelInfo info2 = new CommonModelInfo();
                    if (selectList.ToString().IndexOf(",", StringComparison.Ordinal) > 0)
                    {
                        foreach (string str in selectList.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))
                        {
                            nodeWorkFlowId = Nodes.GetNodeWorkFlowId(Nodes.GetNodeById(ContentManage.GetCommonModelInfoById(DataConverter.CLng(str)).NodeId).WorkFlowId);
                            ContentManage.UpdateStatus(str, UserPass(nodeWorkFlowId));
                        }
                        AdminPage.WriteSuccessMsg("<li>审核通过!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
                    }
                    else
                    {
                        nodeWorkFlowId = Nodes.GetNodeWorkFlowId(Nodes.GetNodeById(ContentManage.GetCommonModelInfoById(DataConverter.CLng(selectList.ToString())).NodeId).WorkFlowId);
                        UpdateStatus(selectList.ToString(), UserPass(nodeWorkFlowId), SiteConfig.SmsConfig.IsAutoSendStateMessage, this.EgvContent, this.m_Administrator);
                    }
                }
            }
        }
Exemple #18
0
        private void BatchAddToCart()
        {
            string str = BasePage.RequestString("IDList");

            if (string.IsNullOrEmpty(str))
            {
                DynamicPage.WriteErrMsg("对不起,传递的参数不正确,请从正确的路径访问!");
            }
            foreach (string str2 in str.Split(new char[] { ',' }))
            {
                string[] strArray2 = str2.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries);
                string   property  = string.Empty;
                if (strArray2.Length == 3)
                {
                    property = strArray2[2];
                }
                int generalId = DataConverter.CLng(strArray2[0]);
                int num2      = DataConverter.CLng(strArray2[1], 1);
                ShoppingCartInfo shoppingcartinfo   = new ShoppingCartInfo();
                int             productId           = 0;
                string          tableName           = string.Empty;
                CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId);
                if (!commonModelInfoById.IsNull)
                {
                    productId = commonModelInfoById.ItemId;
                    tableName = commonModelInfoById.TableName;
                }
                if (!this.ProductExist(this.cartId, productId, tableName, property) && Product.IsEnableSale(productId, tableName, property, this.cartId))
                {
                    shoppingcartinfo.Quantity   = num2;
                    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);
                }
            }
        }
Exemple #19
0
        private static bool CheckModel(OrderInfo orderInfo, string modelIdList)
        {
            IList <OrderItemInfo> infoListByOrderId = OrderItem.GetInfoListByOrderId(orderInfo.OrderId);

            string[] strArray = modelIdList.Split(new char[] { ',' });
            foreach (OrderItemInfo info in infoListByOrderId)
            {
                if (!string.IsNullOrEmpty(info.TableName))
                {
                    CommonModelInfo commonModelInfo = ContentManage.GetCommonModelInfo(info.ProductId, info.TableName);
                    foreach (string str in strArray)
                    {
                        if (commonModelInfo.ModelId.ToString() == str)
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
Exemple #20
0
 public override void OnInitTemplatePage(EventArgs e)
 {
     this.m_GeneralId = BasePage.RequestInt32("id");
     if (this.m_GeneralId <= 0)
     {
         TemplatePage.WriteErrMsg("您访问的内容信息不存在", base.BasePath + "Default.aspx");
     }
     this.m_ItemInfo = ContentManage.GetCommonModelInfoById(this.m_GeneralId);
     if (this.m_ItemInfo.IsNull)
     {
         TemplatePage.WriteErrMsg("您访问的内容信息不存在", base.BasePath + "Default.aspx");
     }
     else
     {
         this.m_ModelInfo = ModelManager.GetModelInfoById(this.m_ItemInfo.ModelId);
         if (!this.m_ModelInfo.IsEshop && (this.m_ItemInfo.Status != 0x63))
         {
             TemplatePage.WriteErrMsg("您访问的内容信息需要经过审核才能浏览", base.BasePath + "Default.aspx");
         }
     }
     this.m_NodeInfo = Nodes.GetCacheNodeById(this.m_ItemInfo.NodeId);
 }
Exemple #21
0
        public bool Delete(string generalIdList)
        {
            string[]      strArray = generalIdList.Split(new char[] { ',' });
            ContentManage manage   = new ContentManage();
            ProductCommon common   = new ProductCommon();
            ProductData   data     = new ProductData();
            ProductPrice  price    = new ProductPrice();

            for (int i = 0; i < strArray.Length; i++)
            {
                CommonModelInfo commonModelInfoById = manage.GetCommonModelInfoById(DataConverter.CLng(strArray[i]));
                if (!commonModelInfoById.IsNull && (DataConverter.CLng(commonModelInfoById.LinkType) == 0))
                {
                    manage.DeleteVirtualContent(DataConverter.CLng(strArray[i]));
                    DBHelper.ExecuteSql("DELETE FROM " + DBHelper.FilterBadChar(commonModelInfoById.TableName) + " WHERE ID = " + commonModelInfoById.ItemId.ToString());
                    common.DeleteById(commonModelInfoById.ItemId, commonModelInfoById.TableName);
                    data.DeleteByProduct(commonModelInfoById.ItemId, commonModelInfoById.TableName);
                    price.Delete(commonModelInfoById.ItemId, commonModelInfoById.TableName);
                }
            }
            return(DBHelper.ExecuteSql("DELETE FROM PE_CommonModel WHERE GeneralId IN(" + DBHelper.ToValidId(generalIdList) + ")"));
        }
Exemple #22
0
 protected void EgvContent_RowCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "DeleteContent")
     {
         int             generalId           = DataConverter.CLng(e.CommandArgument.ToString());
         CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId);
         this.m_IsInput = this.CheckUserConentInputPurview(commonModelInfoById.NodeId);
         if (!this.m_IsInput)
         {
             DynamicPage.WriteUserErrMsg("<li>没有删除权限!</li>");
         }
         if (ContentManage.UpdateStatusByUserName(e.CommandArgument.ToString(), -3))
         {
             PermissionContent.Delete(generalId);
             ContentCharge.Delete(generalId);
             DynamicPage.WriteUserSuccessMsg("<li>删除成功!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
         }
         else
         {
             DynamicPage.WriteUserErrMsg("<li>删除失败!</li>");
         }
     }
 }
        private static void PresentExp(CommonModelInfo commonInfo, int status)
        {
            UserInfo usersByUserName = Users.GetUsersByUserName(commonInfo.Inputer);

            if (!usersByUserName.IsNull)
            {
                UserPurviewInfo userPurview = usersByUserName.UserPurview;
                if (userPurview.IsNull)
                {
                    userPurview.MaxPublicInfoOneDay = -1;
                    userPurview.GetExp = 1;
                }
                if (userPurview.GetExp == 0)
                {
                    userPurview.GetExp = 1;
                }
                int num = EasyOne.Contents.Nodes.GetCacheNodeById(commonInfo.NodeId).Settings.PresentExp *userPurview.GetExp;
                if ((status == 0x63) && (commonInfo.Status < 0x63))
                {
                    usersByUserName.UserExp += num;
                    usersByUserName.PassedItems++;
                }
                if ((commonInfo.Status == 0x63) && (status < 0x63))
                {
                    usersByUserName.UserExp -= num;
                    if (status == -2)
                    {
                        usersByUserName.RejectItems++;
                    }
                    if (status == -3)
                    {
                        usersByUserName.DelItems++;
                    }
                }
                Users.Update(usersByUserName);
            }
        }
 protected void EgvContent_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         CommonModelInfo dataItem = (CommonModelInfo)e.Row.DataItem;
         int             nodeId   = dataItem.NodeId;
         string          s        = "";
         if (this.m_NodeInfoDictionary.ContainsKey(dataItem.NodeId))
         {
             s = this.m_NodeInfoDictionary[dataItem.NodeId].NodeName;
         }
         else
         {
             NodeInfo cacheNodeById = Nodes.GetCacheNodeById(dataItem.NodeId);
             if (!cacheNodeById.IsNull)
             {
                 s = cacheNodeById.NodeName;
                 this.m_NodeInfoDictionary.Add(dataItem.NodeId, cacheNodeById);
             }
         }
         HyperLink link = e.Row.FindControl("LnkNodeLink") as HyperLink;
         link.Text        = s;
         link.NavigateUrl = base.BasePath + SiteConfig.SiteOption.ManageDir + "/Contents/ContentManage.aspx?NodeID=" + dataItem.NodeId.ToString() + "&NodeName=" + base.Server.UrlEncode(s);
         HyperLink link2 = (HyperLink)e.Row.FindControl("HypTitle");
         link2.ToolTip = dataItem.Title;
         link2.Text    = StringHelper.SubString(dataItem.Title, 0x19, "...");
         string str2 = "javascript:OpenLink(\"Contents/NodeTree.aspx\",\"Contents/ContentView.aspx?";
         if (dataItem.IsEshop)
         {
             link2.NavigateUrl = str2 + "IsEschop=true&GeneralID=" + dataItem.GeneralId.ToString() + "\")";
         }
         else
         {
             link2.NavigateUrl = str2 + "GeneralID=" + dataItem.GeneralId.ToString() + "\")";
         }
         HyperLink link3 = (HyperLink)e.Row.FindControl("ContentModify");
         link3.Text        = "修改";
         link3.NavigateUrl = string.Concat(new object[] { base.BasePath, SiteConfig.SiteOption.ManageDir, "/Contents/Content.aspx?Action=Modify&NodeID=", nodeId.ToString(), "&GeneralID=", dataItem.GeneralId, "&ModelID=", dataItem.ModelId.ToString(), "&LinkType=", dataItem.LinkType.ToString() });
         if (!this.m_Administrator)
         {
             string   checkStr = nodeId.ToString();
             NodeInfo info3    = new NodeInfo();
             if (this.m_NodeInfoDictionary.ContainsKey(dataItem.NodeId))
             {
                 info3 = this.m_NodeInfoDictionary[dataItem.NodeId];
             }
             else
             {
                 info3 = Nodes.GetCacheNodeById(nodeId);
             }
             if (info3.ParentId > 0)
             {
                 checkStr = checkStr + "," + info3.ParentPath;
             }
             if (!StringHelper.FoundCharInArr(checkStr, this.m_arrNodeIdManage))
             {
                 link3.Enabled = false;
             }
         }
     }
 }
 protected void EgvContentSignin_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         CommonModelInfo dataItem      = (CommonModelInfo)e.Row.DataItem;
         NodeInfo        cacheNodeById = new NodeInfo(true);
         int             length        = 0;
         int             nodeId        = BasePage.RequestInt32("NodeID");
         string          nodeName      = "";
         if (dataItem.NodeId != nodeId)
         {
             nodeId = dataItem.NodeId;
             if (this.m_NodeNameDictionary.ContainsKey(dataItem.NodeId))
             {
                 nodeName = this.m_NodeNameDictionary[dataItem.NodeId];
             }
             else
             {
                 cacheNodeById = Nodes.GetCacheNodeById(dataItem.NodeId);
                 if (!cacheNodeById.IsNull)
                 {
                     nodeName = cacheNodeById.NodeName;
                     this.m_NodeNameDictionary.Add(dataItem.NodeId, nodeName);
                 }
             }
             ExtendedHyperLink link = e.Row.FindControl("LnkNodeLink") as ExtendedHyperLink;
             link.BeginTag    = "<strong>[";
             link.Text        = nodeName;
             link.EndTag      = "]</strong>";
             link.NavigateUrl = "ContentHtml.aspx?NodeID=" + dataItem.NodeId.ToString() + "&NodeName=" + base.Server.UrlEncode(nodeName);
             length           = StringHelper.SubStringLength(nodeName) + 2;
         }
         Label label = e.Row.FindControl("LblIsCreateHtml") as Label;
         if (!dataItem.CreateTime.HasValue || (dataItem.CreateTime.Value <= dataItem.UpdateTime))
         {
             label.Text = "<span style=\"color:Red\"><b>\x00d7</b></span>";
         }
         else
         {
             label.Text = "<b>√</b>";
         }
         LinkImage image    = e.Row.FindControl("LinkImageModel") as LinkImage;
         string    itemIcon = ModelManager.GetCacheModelById(dataItem.ModelId).ItemIcon;
         if (string.IsNullOrEmpty(itemIcon))
         {
             itemIcon = "Default.gif";
         }
         image.Icon = itemIcon;
         if (dataItem.LinkType != 0)
         {
             image.IsShowLink = true;
         }
         Label                 label2 = e.Row.FindControl("lblSigninStatus") as Label;
         SignInContentInfo     signInContentByGeneralId = SignInContent.GetSignInContentByGeneralId(dataItem.GeneralId);
         string                signInUsers = SignInLog.GetSignInUsers(dataItem.GeneralId);
         IList <SignInLogInfo> list        = SignInLog.GetList(dataItem.GeneralId);
         StringBuilder         sb          = new StringBuilder();
         StringBuilder         builder2    = new StringBuilder();
         foreach (SignInLogInfo info4 in list)
         {
             if (info4.IsSignIn)
             {
                 StringHelper.AppendString(sb, info4.UserName);
             }
             else
             {
                 StringHelper.AppendString(builder2, info4.UserName);
             }
         }
         string str4 = "";
         if (!signInContentByGeneralId.IsNull)
         {
             str4        = "<font color=" + ((signInContentByGeneralId.Status == SignInStatus.NotSignIn) ? "red" : "green") + ">[" + BasePage.EnumToHtml <SignInStatus>(signInContentByGeneralId.Status) + "]</font>";
             label2.Text = "<a href='' onclick='return false' title='要求签收用户:" + signInUsers + " &#13;已经签收用户:" + sb.ToString() + "&#13;尚未签收用户:" + builder2.ToString() + "'>" + str4 + "</a>";
         }
         HyperLink link2 = e.Row.FindControl("HypTitle") as HyperLink;
         length            = 0x25 - length;
         link2.Text        = StringHelper.SubString(dataItem.Title, length, "...");
         link2.ToolTip     = dataItem.Title;
         link2.NavigateUrl = "ContentView.aspx?GeneralID=" + dataItem.GeneralId.ToString();
         HyperLink link3 = (HyperLink)e.Row.FindControl("EahContentModify");
         link3.NavigateUrl = "Content.aspx?Action=Modify&GeneralID=" + dataItem.GeneralId.ToString() + "&NodeID=" + dataItem.NodeId.ToString();
         if (!this.m_Administrator)
         {
             string checkStr = nodeId.ToString();
             if (cacheNodeById.IsNull)
             {
                 cacheNodeById = Nodes.GetCacheNodeById(nodeId);
             }
             if (cacheNodeById.ParentId > 0)
             {
                 checkStr = checkStr + "," + cacheNodeById.ParentPath;
             }
             if (!StringHelper.FoundCharInArr(checkStr, this.m_arrContentNodeIdManage))
             {
                 ((HyperLink)e.Row.FindControl("EahContentModify")).Enabled = false;
                 ((LinkButton)e.Row.FindControl("ELbtnDelete")).Enabled     = false;
             }
         }
     }
 }
 private void ErrorUrlData(int type, int id)
 {
     if (type == 1)
     {
         DataTable contentDataById = ContentManage.GetContentDataById(id);
         if (contentDataById == null)
         {
             DynamicPage.WriteErrMsg("对不起,错误的参数!");
         }
         if (contentDataById.Rows.Count > 0)
         {
             string    str    = contentDataById.Rows[0]["DownloadUrl"].ToString();
             string    str2   = contentDataById.Rows[0]["arrServerName"].ToString();
             DataTable table2 = new DataTable();
             table2.Columns.Add("urlId", typeof(int));
             table2.Columns.Add("infoId", typeof(int));
             table2.Columns.Add("urlname", typeof(string));
             table2.Columns.Add("serverId", typeof(int));
             if (string.IsNullOrEmpty(str))
             {
                 CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(id);
                 DataRow         row = table2.NewRow();
                 row["urlId"]    = 0;
                 row["infoId"]   = id;
                 row["urlname"]  = commonModelInfoById.Title;
                 row["serverId"] = 0;
                 table2.Rows.Add(row);
             }
             else
             {
                 int num = 0;
                 if (string.IsNullOrEmpty(str2))
                 {
                     foreach (string str3 in str.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries))
                     {
                         string[] strArray2 = str3.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                         DataRow  row2      = table2.NewRow();
                         row2["urlId"]    = num;
                         row2["infoId"]   = id;
                         row2["urlname"]  = strArray2[0];
                         row2["serverId"] = 0;
                         table2.Rows.Add(row2);
                         num++;
                     }
                 }
                 else
                 {
                     string[] strArray3 = str.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries);
                     num = 0;
                     string[] strArray10 = strArray3;
                     for (int i = 0; i < strArray10.Length; i++)
                     {
                         string text1 = strArray10[i];
                         foreach (string str4 in str2.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries))
                         {
                             string[] strArray5 = str4.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                             DataRow  row3      = table2.NewRow();
                             row3["urlId"]    = num;
                             row3["infoId"]   = id;
                             row3["urlname"]  = strArray5[0];
                             row3["serverId"] = strArray5[1];
                             table2.Rows.Add(row3);
                         }
                         num++;
                     }
                 }
             }
             this.EgvDownloadError.DataSource = table2;
             this.EgvDownloadError.DataBind();
         }
         else
         {
             DynamicPage.WriteErrMsg("对不起,错误的参数!");
         }
     }
     else
     {
         CommonModelInfo info2 = ContentManage.GetCommonModelInfoById(id);
         if (info2.IsNull)
         {
             DynamicPage.WriteErrMsg("对不起,错误的参数!");
         }
         DataTable table3 = new DataTable();
         table3.Columns.Add("urlId", typeof(int));
         table3.Columns.Add("infoId", typeof(int));
         table3.Columns.Add("urlname", typeof(string));
         table3.Columns.Add("serverId", typeof(int));
         DataRow row4 = table3.NewRow();
         row4["urlId"]    = 0;
         row4["infoId"]   = id;
         row4["urlname"]  = info2.Title;
         row4["serverId"] = 0;
         table3.Rows.Add(row4);
         this.EgvDownloadError.DataSource = table3;
         this.EgvDownloadError.DataBind();
     }
 }
Exemple #27
0
 protected void EgvContent_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         CommonModelInfo dataItem = (CommonModelInfo)e.Row.DataItem;
         int             nodeId   = dataItem.NodeId;
         string          s        = "";
         int             length   = 0;
         if (this.m_NodeInfoDictionary.ContainsKey(dataItem.NodeId))
         {
             s = this.m_NodeInfoDictionary[dataItem.NodeId].NodeName;
         }
         else
         {
             NodeInfo cacheNodeById = Nodes.GetCacheNodeById(dataItem.NodeId);
             if (!cacheNodeById.IsNull)
             {
                 s = cacheNodeById.NodeName;
                 this.m_NodeInfoDictionary.Add(dataItem.NodeId, cacheNodeById);
             }
         }
         if (dataItem.NodeId != this.m_NodeId)
         {
             ExtendedHyperLink link = e.Row.FindControl("LnkNodeLink") as ExtendedHyperLink;
             link.BeginTag    = "<strong>[";
             link.Text        = s;
             link.EndTag      = "]</strong>";
             link.NavigateUrl = "ContentManage.aspx?NodeID=" + dataItem.NodeId.ToString() + "&NodeName=" + base.Server.UrlEncode(s);
             length           = StringHelper.SubStringLength(s) + 2;
         }
         HyperLink link2    = e.Row.FindControl("HypTitle") as HyperLink;
         LinkImage image    = e.Row.FindControl("LinkImageModel") as LinkImage;
         string    itemIcon = ModelManager.GetCacheModelById(dataItem.ModelId).ItemIcon;
         if (string.IsNullOrEmpty(itemIcon))
         {
             itemIcon = "Default.gif";
         }
         image.Icon = itemIcon;
         if (dataItem.LinkType != 0)
         {
             image.IsShowLink = true;
         }
         if (this.m_ModelPreviewDictionary.ContainsKey(dataItem.ModelId))
         {
             link2.NavigateUrl = this.m_ModelPreviewDictionary[dataItem.ModelId] + "?GeneralID=" + dataItem.GeneralId;
         }
         else
         {
             ModelInfo modelInfoById = ModelManager.GetModelInfoById(dataItem.ModelId);
             link2.NavigateUrl = modelInfoById.PreviewInfoFilePath + "?GeneralID=" + dataItem.GeneralId;
             this.m_ModelPreviewDictionary.Add(dataItem.ModelId, modelInfoById.PreviewInfoFilePath);
         }
         dataItem.Title = dataItem.Title;
         length         = 0x25 - length;
         link2.Text     = StringHelper.SubString(dataItem.Title, length, "...");
         link2.ToolTip  = "标    题:" + dataItem.Title + "\r\n录 入 者:" + dataItem.Inputer + "\r\n更新时间:" + dataItem.UpdateTime.ToString();
         Label label = e.Row.FindControl("LblIsCreateHtml") as Label;
         if (!dataItem.CreateTime.HasValue || (dataItem.CreateTime.Value <= dataItem.UpdateTime))
         {
             label.Text = "<span style=\"color:Red\"><b>\x00d7</b></span>";
         }
         else
         {
             label.Text = "<b>√</b>";
         }
         LinkButton button  = (LinkButton)e.Row.FindControl("CancelArchiving");
         LinkButton button2 = (LinkButton)e.Row.FindControl("ContentDelete");
         button.Text             = "取消归档";
         button.CommandName      = "CancelArchiving";
         button.CommandArgument  = dataItem.GeneralId.ToString();
         button.OnClientClick    = "if(!this.disabled) return confirm('确实要还原此归档信息吗?');";
         button2.Text            = "删除";
         button2.CommandName     = "DeleteContent";
         button2.CommandArgument = dataItem.GeneralId.ToString();
         button2.OnClientClick   = "if(!this.disabled) return confirm('确实要删除此信息吗?删除后你还可以从回收站中还原!');";
         if (ModelManager.GetCacheModelById(dataItem.ModelId).Disabled)
         {
             button2.Enabled = false;
             button.Enabled  = false;
         }
     }
 }
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            int num = BasePage.RequestInt32("NodeId");

            if (num < 1)
            {
                DynamicPage.WriteErrMsg("<li>请选择隶属栏目!</li>");
            }
            CommentInfo commentInfo = new CommentInfo();

            if (!HttpContext.Current.User.Identity.IsAuthenticated)
            {
                commentInfo.UserName = "******";
            }
            else
            {
                commentInfo.UserName = PEContext.Current.User.UserName;
            }
            commentInfo.GeneralId      = BasePage.RequestInt32("ID");
            commentInfo.TopicId        = 1;
            commentInfo.NodeId         = num;
            commentInfo.CommentTitle   = StringHelper.RemoveXss(this.TxtCommentTitle.Text);
            commentInfo.Content        = StringHelper.RemoveXss(this.TxtCommentRestore.Text);
            commentInfo.UpdateDateTime = DateTime.Now;
            commentInfo.Score          = DataConverter.CLng(this.RadlScore.SelectedValue);
            commentInfo.Position       = DataConverter.CLng(this.RadlPosition.SelectedValue);
            commentInfo.IP             = PEContext.Current.UserHostAddress;
            commentInfo.IsPrivate      = this.ChkIsPrivate.Checked;
            int             num2 = string.Compare(commentInfo.UserName, "游客", StringComparison.CurrentCultureIgnoreCase);
            CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(commentInfo.GeneralId);

            if (commonModelInfoById.IsNull)
            {
                DynamicPage.WriteErrMsg("<li>评论不存在,请检查评论是否被删除!</li>");
            }
            NodeInfo cacheNodeById = Nodes.GetCacheNodeById(commonModelInfoById.NodeId);

            if (cacheNodeById.IsNull)
            {
                DynamicPage.WriteErrMsg("<li>栏目不存在,请检查栏目!</li>");
            }
            commentInfo.Status = cacheNodeById.Settings.CommentNeedCheck;
            UserPurviewInfo userPurview = null;

            if (num2 != 0)
            {
                userPurview = PEContext.Current.User.UserInfo.UserPurview;
                if (userPurview.CommentNeedCheck)
                {
                    commentInfo.Status = true;
                }
                else
                {
                    commentInfo.Status = !cacheNodeById.Settings.CommentNeedCheck;
                }
            }
            else if (!cacheNodeById.Settings.EnableTouristsComment)
            {
                DynamicPage.WriteErrMsg("<li>此栏目已禁止游客发表评论!</li>");
            }
            else
            {
                commentInfo.Status = !cacheNodeById.Settings.CommentNeedCheck;
            }
            bool enableComment    = false;
            bool commentNeedCheck = false;

            if (userPurview != null)
            {
                enableComment    = userPurview.EnableComment;
                commentNeedCheck = userPurview.CommentNeedCheck;
            }
            if (cacheNodeById.Settings.EnableComment || enableComment)
            {
                if (Comment.Add(commentInfo))
                {
                    string returnurl = "../Item/" + BasePage.RequestInt32("ID").ToString() + ".aspx";
                    if (commentInfo.Status || commentNeedCheck)
                    {
                        DynamicPage.WriteSuccessMsg("<li>添加评论成功!</li>", returnurl);
                    }
                    else
                    {
                        DynamicPage.WriteSuccessMsg("<li>发表评论成功,请等待管理员审核。</li>", returnurl);
                    }
                }
                else
                {
                    DynamicPage.WriteErrMsg("<li>添加评论失败,请返回!</li>");
                }
            }
            else
            {
                DynamicPage.WriteErrMsg("<li>此栏目已禁止发表评论!</li>");
            }
        }
 protected void EgvContents_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         CommonModelInfo commonModelInfo = new CommonModelInfo();
         commonModelInfo = (CommonModelInfo)e.Row.DataItem;
         int      nodeId        = BasePage.RequestInt32("NodeID");
         string   s             = "";
         int      length        = 0;
         NodeInfo cacheNodeById = new NodeInfo(true);
         if (commonModelInfo.NodeId != nodeId)
         {
             nodeId = commonModelInfo.NodeId;
             if (this.m_NodeNameDictionary.ContainsKey(commonModelInfo.NodeId))
             {
                 cacheNodeById = this.m_NodeNameDictionary[commonModelInfo.NodeId];
                 s             = cacheNodeById.NodeName;
             }
             else
             {
                 cacheNodeById = Nodes.GetCacheNodeById(commonModelInfo.NodeId);
                 if (cacheNodeById != null)
                 {
                     s = cacheNodeById.NodeName;
                     this.m_NodeNameDictionary.Add(commonModelInfo.NodeId, cacheNodeById);
                 }
             }
             ExtendedHyperLink link = e.Row.FindControl("LnkNodeLink") as ExtendedHyperLink;
             link.BeginTag    = "<strong>[";
             link.Text        = s;
             link.EndTag      = "]</strong>";
             link.NavigateUrl = "ContentHtml.aspx?NodeID=" + commonModelInfo.NodeId.ToString() + "&NodeName=" + base.Server.UrlEncode(s);
             length           = StringHelper.SubStringLength(s) + 2;
         }
         LinkImage image    = e.Row.FindControl("LinkImageModel") as LinkImage;
         string    itemIcon = ModelManager.GetCacheModelById(commonModelInfo.ModelId).ItemIcon;
         if (string.IsNullOrEmpty(itemIcon))
         {
             itemIcon = "Default.gif";
         }
         image.Icon = itemIcon;
         if (commonModelInfo.LinkType != 0)
         {
             image.IsShowLink = true;
         }
         HyperLink link2 = e.Row.FindControl("HypTitle") as HyperLink;
         if (this.m_ModelPreviewDictionary.ContainsKey(commonModelInfo.ModelId))
         {
             link2.NavigateUrl = this.m_ModelPreviewDictionary[commonModelInfo.ModelId] + "?GeneralID=" + commonModelInfo.GeneralId;
         }
         else
         {
             ModelInfo modelInfoById = ModelManager.GetModelInfoById(commonModelInfo.ModelId);
             link2.NavigateUrl = modelInfoById.PreviewInfoFilePath + "?GeneralID=" + commonModelInfo.GeneralId;
             this.m_ModelPreviewDictionary.Add(commonModelInfo.ModelId, modelInfoById.PreviewInfoFilePath);
         }
         commonModelInfo.Title = commonModelInfo.Title;
         length        = 0x25 - length;
         link2.Text    = StringHelper.SubString(commonModelInfo.Title, length, "...");
         link2.ToolTip = commonModelInfo.Title;
         Label label = e.Row.FindControl("LblIsCreateHtml") as Label;
         if (!commonModelInfo.CreateTime.HasValue || (commonModelInfo.CreateTime.Value <= commonModelInfo.UpdateTime))
         {
             label.Text = "<span style=\"color:Red\"><b>\x00d7</b></span>";
             ((HyperLink)e.Row.FindControl("LnkHtmlView")).Enabled    = false;
             ((LinkButton)e.Row.FindControl("LnkDeleteHtml")).Enabled = false;
         }
         else
         {
             if (this.m_NodeNameDictionary.ContainsKey(commonModelInfo.NodeId))
             {
                 cacheNodeById = this.m_NodeNameDictionary[commonModelInfo.NodeId];
             }
             else
             {
                 cacheNodeById = Nodes.GetCacheNodeById(commonModelInfo.NodeId);
                 if (!cacheNodeById.IsNull)
                 {
                     s = cacheNodeById.NodeName;
                     this.m_NodeNameDictionary.Add(commonModelInfo.NodeId, cacheNodeById);
                 }
             }
             label.Text = "<b>√</b>";
             string str3 = (SiteConfig.SiteInfo.VirtualPath + VirtualPathUtility.AppendTrailingSlash(SiteConfig.SiteOption.CreateHtmlPath) + ContentManage.ContentHtmlName(commonModelInfo, cacheNodeById, 0)).Replace("//", "/");
             ((HyperLink)e.Row.FindControl("LnkHtmlView")).NavigateUrl = str3;
         }
         if (!this.m_Administrator)
         {
             string checkStr = nodeId.ToString();
             if (cacheNodeById.IsNull)
             {
                 cacheNodeById = Nodes.GetCacheNodeById(nodeId);
             }
             if (cacheNodeById.ParentId > 0)
             {
                 checkStr = checkStr + "," + cacheNodeById.ParentPath;
             }
             if (!StringHelper.FoundCharInArr(checkStr, this.m_arrContentNodeIdManage))
             {
                 ((LinkButton)e.Row.FindControl("LnkCreateHtml")).Enabled = false;
                 ((HyperLink)e.Row.FindControl("LnkHtmlView")).Enabled    = false;
                 ((LinkButton)e.Row.FindControl("LnkDeleteHtml")).Enabled = false;
             }
         }
     }
 }
        private void InitPage()
        {
            this.m_GeneralId = BasePage.RequestInt32("GeneralID");
            if (base.Request.UrlReferrer != null)
            {
                this.ViewState["UrlReferrer"] = base.Request.UrlReferrer.ToString();
            }
            this.contentDataTable = ContentManage.GetContentDataById(this.m_GeneralId);
            if ((this.contentDataTable == null) || (this.contentDataTable.Rows.Count == 0))
            {
                AdminPage.WriteErrMsg("<li>指定项目不存在!</li>");
            }
            this.InitContent();
            int nodeId = DataConverter.CLng(this.contentDataTable.Rows[0]["NodeId"]);

            if (!PEContext.Current.Admin.IsSuperAdmin)
            {
                bool   flag       = false;
                string roleNodeId = 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)
                    {
                        AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (!RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, cacheNodeById.NodeId))
                    {
                        AdminPage.WriteErrMsg("您没有查看该信息的权限!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        findStr = findStr + "," + cacheNodeById.ParentPath;
                    }
                    flag = StringHelper.FoundCharInArr(roleNodeId, findStr);
                }
                else
                {
                    flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
                }
                if (!flag)
                {
                    this.EBtnModify.Enabled = false;
                    this.EBtnDelete.Enabled = false;
                }
            }
            CommonModelInfo prevInfo = ContentManage.GetPrevInfo(nodeId, this.m_GeneralId);

            if (!prevInfo.IsNull)
            {
                this.LnkGetPrevInfo.Text        = prevInfo.Title;
                this.LnkGetPrevInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + prevInfo.GeneralId.ToString();
            }
            else
            {
                this.LnkGetPrevInfo.Text = "没有了";
            }
            CommonModelInfo nextInfo = ContentManage.GetNextInfo(nodeId, this.m_GeneralId);

            if (!nextInfo.IsNull)
            {
                this.LnkGetNextInfo.Text        = nextInfo.Title;
                this.LnkGetNextInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + nextInfo.GeneralId.ToString();
            }
            else
            {
                this.LnkGetNextInfo.Text = "没有了";
            }
            this.SmpNavigator.AdditionalNode = EasyOne.Contents.Nodes.ShowNodeNavigation(nodeId);
            if (!string.IsNullOrEmpty(this.SmpNavigator.AdditionalNode))
            {
                this.SmpNavigator.AdditionalNode = this.SmpNavigator.AdditionalNode.Replace("根节点 >>", "");
            }
            if (!this.Page.IsPostBack)
            {
                int             nodeWorkFlowId     = EasyOne.Contents.Nodes.GetNodeWorkFlowId(nodeId);
                string          roles              = PEContext.Current.Admin.Roles;
                FlowProcessInfo flowProcessByRoles = FlowProcess.GetFlowProcessByRoles(nodeWorkFlowId, roles);
                int             passActionStatus   = 0;
                if (PEContext.Current.Admin.IsSuperAdmin || (nodeWorkFlowId == -1))
                {
                    passActionStatus = 0x63;
                }
                else if (!flowProcessByRoles.IsNull)
                {
                    passActionStatus = flowProcessByRoles.PassActionStatus;
                }
                else
                {
                    this.EBtnCheck.Visible = false;
                }
                if ((passActionStatus > 0) && (passActionStatus > DataConverter.CLng(this.contentDataTable.Rows[0]["Status"])))
                {
                    this.EBtnCheck.CommandArgument = passActionStatus.ToString();
                    this.EBtnCheck.Text            = "审核通过";
                }
                else
                {
                    this.EBtnCheck.CommandArgument = "0";
                    this.EBtnCheck.Text            = "取消审核";
                }
            }
        }