Ejemplo n.º 1
0
        protected void EBtnBatchDelete_Click(object sender, EventArgs e)
        {
            this.PermissionDetection();
            StringBuilder selectList = this.EgvContent.SelectList;

            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要删除的项目!</li>", string.Concat(new object[] { "ContentArchivingManage.aspx?NodeID=", BasePage.RequestInt32("NodeID"), "&ListType=", this.HdnListType.Value }));
            }
            else if (ContentManage.UpdateStatus(selectList.ToString(), -3))
            {
                PermissionContent.Delete(selectList.ToString());
                EasyOne.Contents.ContentCharge.Delete(selectList.ToString());
                SiteCache.Remove("CK_Page_Category_" + this.m_NodeId.ToString());
                if (SiteConfig.SmsConfig.IsAutoSendStateMessage)
                {
                    AdminPage.WriteSuccessMsg("<li>删除成功!</li><br /> " + this.ChangeStateSendMessageToUser(-3), string.Concat(new object[] { "ContentArchivingManage.aspx?NodeID=", BasePage.RequestInt32("NodeID"), "&ListType=", this.HdnListType.Value }));
                }
                else
                {
                    AdminPage.WriteSuccessMsg("<li>删除成功!</li>", string.Concat(new object[] { "ContentArchivingManage.aspx?NodeID=", BasePage.RequestInt32("NodeID"), "&ListType=", this.HdnListType.Value }));
                }
            }
            else
            {
                AdminPage.WriteErrMsg("<li>删除项目失败!</li>", string.Concat(new object[] { "ContentArchivingManage.aspx?NodeID=", BasePage.RequestInt32("NodeID"), "&ListType=", this.HdnListType.Value }));
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        private void Update()
        {
            DataTable dataTableFromRepeater = this.GetDataTableFromRepeater();
            int       generalId             = BasePage.RequestInt32("GeneralID");

            this.SavePresentExp(dataTableFromRepeater, false);
            if (ContentManage.Update(generalId, ContentManage.GetNewContentData(dataTableFromRepeater)))
            {
                ModelInfo modelInfoById = ModelManager.GetModelInfoById(this.m_ModelId);
                this.AddPermissionAndCharge(dataTableFromRepeater, modelInfoById.EnableCharge);
                if (modelInfoById.EnableSignIn)
                {
                    this.UpdateSignin(generalId, dataTableFromRepeater);
                }
                if (((SignInType)Enum.Parse(typeof(SignInType), this.DrpSigninType.SelectedValue)) != SignInType.EnableSignInPrivate)
                {
                    HtmlContent.CreateHtml(dataTableFromRepeater);
                }
                this.UpdateKeywordsToTable(generalId, dataTableFromRepeater);
                if (modelInfoById.EnbaleVote)
                {
                    this.Vote.Add(generalId);
                }
                SiteCache.Remove("CK_Page_Category_" + this.m_NodeId.ToString());
                BasePage.ResponseRedirect(AdminPage.AppendSecurityCode("ContentShowSuccess.aspx?Action=Modify&GeneralID=" + generalId.ToString() + "&NodeID=" + this.m_NodeId.ToString() + "&ModelID=" + this.m_ModelId.ToString() + "&ContentFieldName=" + this.m_ContentFieldName));
            }
            else
            {
                AdminPage.WriteErrMsg("修改失败!");
            }
        }
Ejemplo n.º 4
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);
                }
            }
        }
Ejemplo n.º 5
0
        private void AdminEditCheck(int generalId)
        {
            string str = "CanNotEdit";

            if (PEContext.Current.Admin.Identity.IsAuthenticated)
            {
                int  nodeId = ContentManage.GetCommonModelInfoById(generalId).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)
                {
                    str = "OK";
                }
            }
            this.XmlResponseWriter.WriteElementString("status", str);
        }
Ejemplo n.º 6
0
        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("发表留言失败!");
            }
        }
        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("添加失败!");
            }
        }
Ejemplo n.º 8
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);
     }
 }
Ejemplo n.º 9
0
 private void ShowPop()
 {
     if (PEContext.Current.Admin.Identity.IsAuthenticated)
     {
         if (string.Compare(SiteConfig.SiteInfo.ProductEdition, "eshop", StringComparison.OrdinalIgnoreCase) == 0)
         {
             Order.CountByOrderStatus(OrderStatus.WaitForConfirm);
             Product.GetStockAlarmCount(2);
             Order.CountByNoConsignment();
         }
         if (RolePermissions.AccessCheck(OperateCode.OrderConfirm))
         {
             this.XmlResponseWriter.WriteElementString("ordercount", Order.CountByOrderStatus(OrderStatus.WaitForConfirm).ToString());
         }
         this.XmlResponseWriter.WriteElementString("messagecount", Message.UnreadMessageCount(PEContext.Current.Admin.UserName).ToString());
         if (RolePermissions.AccessCheck(OperateCode.ContentManage))
         {
             this.XmlResponseWriter.WriteElementString("articlestatuscount", ContentManage.GetCountByStatus(0).ToString());
         }
         if (RolePermissions.AccessCheck(OperateCode.CommentManage))
         {
             this.XmlResponseWriter.WriteElementString("commentcount", Comment.GetCountByStatus(2).ToString());
         }
         this.XmlResponseWriter.WriteElementString("articlesignincount", ContentManage.GetCountBySignIn(PEContext.Current.Admin.UserName, false).ToString());
         if (RolePermissions.AccessCheck(OperateCode.StockManage))
         {
             this.XmlResponseWriter.WriteElementString("productstockalarmcount", Product.GetStockAlarmCount(2).ToString());
         }
         if (RolePermissions.AccessCheck(OperateCode.OrderSendOrReturnGoods))
         {
             this.XmlResponseWriter.WriteElementString("ordercountbynoconsignment", Order.CountByNoConsignment().ToString());
         }
     }
 }
Ejemplo n.º 10
0
 protected void BtnRecycle_Click(object sender, EventArgs e)
 {
     if (this.nodeId > 0)
     {
         ContentManage.RecycleAll(Nodes.GetCacheNodeById(this.nodeId).ArrChildId);
         if (SiteConfig.SmsConfig.IsAutoSendStateMessage)
         {
             AdminPage.WriteSuccessMsg("<li>还原成功!</li><br /> " + this.ChangeStateSendMessageToUser(0), "ContentRecycle.aspx?NodeID=" + this.nodeId);
         }
         else
         {
             AdminPage.WriteSuccessMsg("<li>还原成功!</li>", "ContentRecycle.aspx?NodeID=" + this.nodeId);
         }
     }
     else
     {
         ContentManage.RecycleAll("0");
         if (SiteConfig.SmsConfig.IsAutoSendStateMessage)
         {
             AdminPage.WriteSuccessMsg("<li>还原成功!</li><br /> " + this.ChangeStateSendMessageToUser(0), "ContentRecycle.aspx?NodeID=" + this.nodeId);
         }
         else
         {
             AdminPage.WriteSuccessMsg("<li>还原成功!</li>", "ContentRecycle.aspx?NodeID=" + this.nodeId);
         }
     }
 }
Ejemplo n.º 11
0
        protected void EgvContentRecycle_RowCommand(object sender, CommandEventArgs e)
        {
            int generalId = DataConverter.CLng(e.CommandArgument.ToString());

            if (e.CommandName == "RestoreContent")
            {
                if (ContentManage.UpdateStatus(generalId, 0))
                {
                    AdminPage.WriteSuccessMsg("<li>还原成功!</li>", "ContentRecycle.aspx?NodeID=" + this.nodeId);
                }
                else
                {
                    AdminPage.WriteErrMsg("<li>还原失败!</li>");
                }
            }
            if (e.CommandName == "DeleteContent")
            {
                if (ContentManage.Delete(generalId.ToString()))
                {
                    AdminPage.WriteSuccessMsg("<li>删除成功!</li>", "ContentRecycle.aspx?NodeID=" + this.nodeId);
                }
                else
                {
                    AdminPage.WriteErrMsg("<li>删除失败!</li>");
                }
            }
        }
Ejemplo n.º 12
0
 protected void BtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         DateTime                  endDate           = DataConverter.CDate(this.DpkEndDate.Text);
         DateTime                  beginDate         = DataConverter.CDate(this.DpkStartDate.Text);
         DataTable                 dataTable         = ContentManage.GetCountByEditorAndMonth(DataConverter.CLng(this.DrpCategory.SelectedValue), this.DrpInputer.SelectedValue, beginDate, endDate);
         StringBuilder             sb                = new StringBuilder("<table class=\"border\" id=\"statistics\" width=\"100%\" cellspacing=\"1\" cellpadding=\"2\" border=\"0\">");
         int                       dateIntervalMonth = this.GetDateIntervalMonth(beginDate, endDate);
         IList <AdministratorInfo> adminList         = new List <AdministratorInfo>();
         if (string.IsNullOrEmpty(this.DrpInputer.SelectedValue))
         {
             adminList = Administrators.AdminList(0, 0);
         }
         else
         {
             AdministratorInfo item = new AdministratorInfo();
             item.AdminName = this.DrpInputer.SelectedValue;
             adminList.Add(item);
         }
         this.BuildTableHead(sb, dateIntervalMonth, beginDate);
         this.BuildTableBody(sb, dateIntervalMonth, beginDate, dataTable, adminList);
         this.BuildTableFooter(sb, dateIntervalMonth);
         sb.Append("</table>");
         this.SpanCount.InnerHtml = sb.ToString();
     }
 }
 protected void BtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         int              nodeId    = DataConverter.CLng(this.DrpCategory.SelectedValue);
         DataTable        dataTable = ContentManage.GetCountByNodeAndInputer(nodeId, null, DataConverter.CDate(this.DpkStartDate.Text.Trim()), DataConverter.CDate(this.DpkEndDate.Text.Trim()));
         IList <NodeInfo> nodeList  = new List <NodeInfo>();
         if (nodeId > 0)
         {
             NodeInfo item = new NodeInfo();
             item.NodeId   = nodeId;
             item.NodeName = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId).NodeName;
             nodeList.Add(item);
         }
         else
         {
             nodeList = EasyOne.Contents.Nodes.GetNodesList(NodeType.Container);
         }
         IList <UserInfo> usersByPost = Users.GetUsersByPost();
         StringBuilder    sb          = new StringBuilder("<table class=\"border\" id=\"statistics\" cellspacing=\"1\" width=\"100%\" cellpadding=\"2\" border=\"0\">");
         this.BuildTableHead(sb, usersByPost);
         this.BuildTableBody(sb, dataTable, nodeList, usersByPost);
         this.BuildTableFooter(sb, usersByPost.Count);
         sb.Append("</table>");
         this.SpanCount.InnerHtml = sb.ToString();
     }
 }
Ejemplo n.º 14
0
        private void Add()
        {
            DataTable newContentData = ContentManage.GetNewContentData(this.GetDataTableFromRepeater());

            if (ContentManage.Add(this.m_ModelId, newContentData))
            {
                ModelInfo modelInfoById = ModelManager.GetModelInfoById(this.m_ModelId);
                if (modelInfoById.EnableSignIn)
                {
                    this.AddSignin(newContentData);
                }
                this.AddPermissionAndCharge(newContentData, modelInfoById.EnableCharge);
                this.SavePresentExp(newContentData, true);
                if (((SignInType)Enum.Parse(typeof(SignInType), this.DrpSigninType.SelectedValue)) != SignInType.EnableSignInPrivate)
                {
                    HtmlContent.CreateHtml(newContentData);
                }
                this.AddKeywordsToTable(newContentData);
                int generalId = GetGeneralId(newContentData);
                if (modelInfoById.EnbaleVote)
                {
                    this.Vote.Add(generalId);
                }
                SiteCache.Remove("CK_Page_Category_" + this.m_NodeId.ToString());
                BasePage.ResponseRedirect(AdminPage.AppendSecurityCode("ContentShowSuccess.aspx?Action=Add&GeneralID=" + generalId.ToString() + "&NodeID=" + this.m_NodeId.ToString() + "&ModelID=" + this.m_ModelId.ToString() + "&ContentFieldName=" + this.m_ContentFieldName));
            }
        }
Ejemplo n.º 15
0
 private void SaveKeywordToTable(string txtKeyWord, int generalId)
 {
     foreach (string str in txtKeyWord.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries))
     {
         if (EasyOne.Accessories.Keywords.Exists(str))
         {
             KeywordInfo keywordByKeywordName = EasyOne.Accessories.Keywords.GetKeywordByKeywordName(str);
             string      str2        = ContentManage.RebuildArr(keywordByKeywordName.ArrayGeneralId + "," + generalId.ToString());
             int         length      = str2.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Length;
             DateTime    lastUseTime = keywordByKeywordName.LastUseTime;
             keywordByKeywordName.ArrayGeneralId = str2;
             keywordByKeywordName.QuoteTimes     = length;
             EasyOne.Accessories.Keywords.Update(keywordByKeywordName);
         }
         else
         {
             KeywordInfo keywordInfo = new KeywordInfo();
             keywordInfo.KeywordText    = str;
             keywordInfo.KeywordType    = 1;
             keywordInfo.LastUseTime    = DateTime.Now;
             keywordInfo.Priority       = 0;
             keywordInfo.ArrayGeneralId = generalId.ToString();
             keywordInfo.QuoteTimes     = 1;
             EasyOne.Accessories.Keywords.Add(keywordInfo);
         }
     }
 }
Ejemplo n.º 16
0
 private static void UpdateStatus(string itemIDList, int status, bool IsSendMessage, GridView gv, bool Administrator)
 {
     if (ContentManage.UpdateStatus(itemIDList, status))
     {
         if (IsSendMessage && Administrator)
         {
             itemIDList = CompareState(itemIDList, gv, status).ToString();
             if (!string.IsNullOrEmpty(itemIDList))
             {
                 AdminPage.WriteSuccessMsg("<li>审核通过!</li>", string.Concat(new object[] { "ContentMessage.aspx?NodeID=", BasePage.RequestInt32("NodeID"), "&ItemIDList=", itemIDList, "&State=", status }));
             }
             else
             {
                 AdminPage.WriteSuccessMsg("<li>审核通过!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
             }
         }
         else
         {
             AdminPage.WriteSuccessMsg("<li>审核通过!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
         }
     }
     else
     {
         AdminPage.WriteErrMsg("<li>审核通过失败!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
     }
 }
Ejemplo n.º 17
0
        private void Update()
        {
            DataTable dataTableFromRepeater = this.GetDataTableFromRepeater();

            DataRow[] rowArray = dataTableFromRepeater.Select("FieldName = 'status'");
            if ((DataConverter.CLng(rowArray[0]["FieldValue"]) == 0x63) && !this.m_UserPurviewInfo.ManageSelfPublicInfo)
            {
                DynamicPage.WriteUserErrMsg("已经被审核通过,您不能再进行修改!");
            }
            DataRow[] rowArray2 = dataTableFromRepeater.Select("FieldName = 'updatetime'");
            if (rowArray2.Length > 0)
            {
                rowArray2[0]["FieldValue"] = DateTime.Now;
            }
            if (this.m_UserPurviewInfo.SetToNotCheck && !this.m_UserPurviewInfo.PublicInfoNoNeedCheck)
            {
                rowArray[0]["FieldValue"] = "0";
            }
            int generalId = BasePage.RequestInt32("GeneralID");

            if (ContentManage.UpdateByUser(generalId, ContentManage.GetNewContentData(dataTableFromRepeater)))
            {
                this.SavePresentExp(dataTableFromRepeater, this.m_UserPurviewInfo, this.m_User);
                this.UpdateKeywordsToTable(generalId, dataTableFromRepeater);
                DynamicPage.WriteUserSuccessMsg("修改成功!", "ContentManage.aspx");
            }
            else
            {
                DynamicPage.WriteUserErrMsg("修改失败!");
            }
        }
Ejemplo n.º 18
0
        protected void EBtnCancelPass_Click(object sender, EventArgs e)
        {
            this.PermissionDetection(this.m_isCheck);
            StringBuilder selectList = this.EgvContent.SelectList;

            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要取消审核的项目!</li>");
            }
            else if (ContentManage.UpdateStatus(selectList.ToString(), 0))
            {
                if (!SiteConfig.SmsConfig.IsAutoSendStateMessage || !this.m_Administrator)
                {
                    AdminPage.WriteSuccessMsg("<li>取消审核成功!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
                }
                else
                {
                    selectList = CompareState(selectList.ToString(), this.EgvContent, 0);
                    if (selectList.Length > 0)
                    {
                        AdminPage.WriteSuccessMsg("<li>取消审核成功!</li>", string.Concat(new object[] { "ContentMessage.aspx?NodeID=", BasePage.RequestInt32("NodeID"), "&ItemIDList=", selectList.ToString(), "&State=0" }));
                    }
                }
            }
            else
            {
                AdminPage.WriteErrMsg("<li>取消审核失败!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
        }
 protected override void Render(HtmlTextWriter writer)
 {
     if (!this.Page.IsPostBack)
     {
         int generalId = BasePage.RequestInt32("id", 0);
         base.Response.Write("document.write(" + ContentManage.UpdateBrowseTimes(generalId) + ")");
     }
 }
Ejemplo n.º 20
0
 protected void RepContentForm_OnItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
     {
         FieldControl control     = (FieldControl)e.Item.FindControl("Field");
         FieldInfo    dataItem    = (FieldInfo)e.Item.DataItem;
         FieldType    controlType = control.ControlType;
         if (controlType == FieldType.NodeType)
         {
             control.Value = this.m_NodeId.ToString();
         }
         if ((((control.FieldLevel == 0) && (dataItem.Id != "title")) && ((controlType != FieldType.NodeType) && (controlType != FieldType.SpecialType))) && ((controlType != FieldType.StatusType) && (controlType != FieldType.PictureType)))
         {
             control.FindControl("EasyOne2007").Visible = false;
         }
         if ((controlType == FieldType.ContentType) && !this.m_UserPurviewInfo.SetEditor)
         {
             ContentType type2 = (ContentType)control.FindControl("EasyOne2007");
             type2.Editor.ToolbarSet = "Simple";
         }
         if (controlType == FieldType.ContentType)
         {
             ((ContentType)control.FindControl("EasyOne2007")).IsUpload = true;
         }
         if (this.m_Action == "modify")
         {
             if (controlType == FieldType.ContentType)
             {
                 ContentType type3 = (ContentType)control.FindControl("EasyOne2007");
                 type3.Content       = ContentManage.ToFieldType(this.m_ContentData.Rows[0][dataItem.FieldName].ToString(), dataItem.FieldType);
                 type3.DefaultPicurl = ContentManage.ToFieldType(this.m_ContentData.Rows[0]["DefaultPicurl"].ToString(), FieldType.TextType);
                 type3.IsUpload      = true;
             }
             else
             {
                 control.Value = ContentManage.ToFieldType(this.m_ContentData.Rows[0][dataItem.FieldName].ToString(), dataItem.FieldType);
             }
             if (controlType == FieldType.KeywordType)
             {
                 control.Value = StringHelper.ReplaceChar(control.Value, '|', ' ');
             }
             if ((controlType == FieldType.PictureType) && (dataItem.FieldLevel == 0))
             {
                 PictureType type4 = (PictureType)control.FindControl("EasyOne2007");
                 type4.UploadFiles = ContentManage.ToFieldType(this.m_ContentData.Rows[0]["UploadFiles"].ToString(), FieldType.TextType);
             }
             if (controlType == FieldType.FileType)
             {
                 FileType type5 = (FileType)control.FindControl("EasyOne2007");
                 if (DataConverter.CBoolean(dataItem.Settings[3]))
                 {
                     type5.FileSize = ContentManage.ToFieldType(this.m_ContentData.Rows[0][dataItem.Settings[4]].ToString(), dataItem.FieldType);
                 }
             }
         }
     }
 }
Ejemplo n.º 21
0
 public void GetProductAllDataById(int generalId)
 {
     EasyOne.Model.Contents.CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId);
     if (!commonModelInfoById.IsNull)
     {
         this.m_CommonModelInfo = commonModelInfoById;
         this.m_ProductInfoData = GetProductById(generalId, commonModelInfoById.ItemId, commonModelInfoById.TableName);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(base.Title))
     {
         base.Title = "我的待签收内容";
     }
     this.EgvContent.DataSource = ContentManage.GetCommonModelInfoListBySignInStatus(0, this.PageSize, PEContext.Current.Admin.UserName, 2);
     this.EgvContent.DataBind();
     base.Subtitle = "共" + ContentManage.GetTotalOfCommonModelInfo(0, ContentSortType.None, 0).ToString() + "条";
 }
Ejemplo n.º 23
0
 protected void EBtnDelete_Click(object sender, EventArgs e)
 {
     if (ContentManage.Delete(this.EgvContentRecycle.SelectList.ToString()))
     {
         AdminPage.WriteSuccessMsg("<li>彻底删除成功</li>", "ContentRecycle.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
     }
     else
     {
         AdminPage.WriteErrMsg("<li>彻底删除失败</li>");
     }
 }
Ejemplo n.º 24
0
 private static void UpdateStatus(string itemIDList, int status)
 {
     if (ContentManage.UpdateStatus(itemIDList, status))
     {
         AdminPage.WriteSuccessMsg("<li>审核通过!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
     }
     else
     {
         AdminPage.WriteErrMsg("<li>审核通过失败!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            int    specialId  = BasePage.RequestInt32("SpecialID");
            int    categoryId = BasePage.RequestInt32("SpecialCategoryID");
            string str        = BasePage.RequestString("SpecialName");

            if (PEContext.Current.Admin.IsSuperAdmin)
            {
                this.m_Administrator = true;
            }
            if (!base.IsPostBack)
            {
                this.DropRescentQuery.SelectedValue = BasePage.RequestStringToLower("ListType");
                this.HdnListType.Value = BasePage.RequestStringToLower("ListType");
                this.HdnStatus.Value   = BasePage.RequestStringToLower("status", "100");
                if (!string.IsNullOrEmpty(str))
                {
                    this.SmpNavigator.AdditionalNode = this.InitSiteMapCategory(categoryId) + " >> " + str;
                }
                else
                {
                    this.SmpNavigator.AdditionalNode = this.InitSiteMapCategory(categoryId);
                }
            }
            if (!this.m_Administrator)
            {
                if (specialId > 0)
                {
                    this.m_IsManage = RolePermissions.AccessCheckSpecialPermission(OperateCode.SepcialContentManage, specialId);
                }
                else if (categoryId > 0)
                {
                    foreach (SpecialCommonModelInfo info in ContentManage.GetCommonModelInfoListBySpecialIdOrSpecialCategoryId(0, 0, 0, categoryId, ContentSortType.None, 100))
                    {
                        if (RolePermissions.AccessCheckSpecialPermission(OperateCode.SepcialContentManage, info.SpecialId))
                        {
                            this.m_IsManage = true;
                            break;
                        }
                    }
                }
                else
                {
                    this.m_IsManage = RolePermissions.AccessCheckSpecialPermission(OperateCode.SepcialContentManage, -1);
                }
                if (!this.m_IsManage)
                {
                    this.EBtnDelete.Enabled             = false;
                    this.EBtnAddToSpecial.Enabled       = false;
                    this.EBtnMoveToOtherSpecial.Enabled = false;
                }
            }
        }
Ejemplo n.º 26
0
 protected void BtnEmpty_Click(object sender, EventArgs e)
 {
     ContentManage.EmptyContentArchiving();
     if (SiteConfig.SmsConfig.IsAutoSendStateMessage)
     {
         AdminPage.WriteSuccessMsg("<li>清空归档成功!</li><br /> " + this.ChangeStateSendMessageToUser(-3), string.Concat(new object[] { "ContentArchivingManage.aspx?NodeID=", BasePage.RequestInt32("NodeID"), "&Status=102&ListType=", this.HdnListType.Value }));
     }
     else
     {
         AdminPage.WriteSuccessMsg("<li>清空归档成功!</li>", string.Concat(new object[] { "ContentArchivingManage.aspx?NodeID=", BasePage.RequestInt32("NodeID"), "&Status=102&ListType=", this.HdnListType.Value }));
     }
 }
Ejemplo n.º 27
0
        private IList <CommonModelInfo> GetCommonList(int startIndex, int pageSize)
        {
            IList <CommonModelInfo> commonModelInfoList = new List <CommonModelInfo>();

            switch (base.CreateMethod)
            {
            case CreateContentType.CreateLatest:
                commonModelInfoList = ContentManage.GetCommonModelInfoList(this.m_NodeIdArray, pageSize);
                break;

            case CreateContentType.CreateByUpdateTime:
                commonModelInfoList = ContentManage.GetCommonModelInfoList(this.m_NodeIdArray, this.m_ContentBeginTime, this.m_ContentEndTime, startIndex, pageSize);
                break;

            case CreateContentType.CreateBetweenId:
                commonModelInfoList = ContentManage.GetCommonModelInfoList(this.m_NodeIdArray, this.m_ContentMinId, this.m_ContentMaxId, startIndex, pageSize);
                break;

            case CreateContentType.CreateByGeneralId:
                commonModelInfoList = ContentManage.GetCommonModelInfoList(this.m_NodeIdArray, this.m_ContentGeneralIdArray);
                break;

            case CreateContentType.CreateByNotCreate:
                commonModelInfoList = ContentManage.CreateByNotCreate(this.m_NodeIdArray, startIndex, pageSize);
                break;

            case CreateContentType.CreateAll:
                commonModelInfoList = ContentManage.CreateAll(this.m_NodeIdArray, startIndex, pageSize);
                break;

            case CreateContentType.CreateAuto:
                commonModelInfoList = ContentManage.CreateAll(this.m_NodeIdArray, 0, 20);
                break;
            }
            if (base.CreateMethod == CreateContentType.CreateByGeneralId)
            {
                this.CreateCount = commonModelInfoList.Count;
                return(commonModelInfoList);
            }
            if (base.CreateMethod == CreateContentType.CreateLatest)
            {
                if (this.CreateCount == 0)
                {
                    this.CreateCount = this.m_LatestNumber;
                }
                return(commonModelInfoList);
            }
            if (this.CreateCount == 0)
            {
                this.CreateCount = ContentManage.GetTotalOfCommonModelInfo(0, ContentSortType.DayHitsAsc, 0x63);
            }
            return(commonModelInfoList);
        }
 protected void EBtnDelete_Click(object sender, EventArgs e)
 {
     RolePermissions.BusinessAccessCheck(OperateCode.NodeContentManage, DataConverter.CLng(this.contentDataTable.Rows[0]["NodeId"]));
     if (ContentManage.UpdateStatus(this.m_GeneralId, -3))
     {
         AdminPage.WriteSuccessMsg("<li>删除成功!</li>", "ContentManage.aspx?NodeID=" + this.contentDataTable.Rows[0]["NodeId"].ToString());
     }
     else
     {
         AdminPage.WriteErrMsg("<li>删除失败!</li>");
     }
 }
Ejemplo n.º 29
0
        private void AddFieldRows()
        {
            Dictionary <int, IList <EasyOne.Model.CommonModel.FieldInfo> > dictionary = new Dictionary <int, IList <EasyOne.Model.CommonModel.FieldInfo> >();
            List <ProductDetailInfo> productInfoList = this.ProductInfoList;
            bool flag = false;

            foreach (ProductDetailInfo info in productInfoList)
            {
                if ((info.ModelId != 0) && !dictionary.ContainsKey(info.ModelId))
                {
                    dictionary.Add(info.ModelId, Field.GetFieldList(info.ModelId));
                    if (!flag)
                    {
                        this.NewCategoryRow("详细参数");
                        flag = true;
                    }
                }
            }
            List <DataTable> list2 = new List <DataTable>();

            for (int i = 0; i < productInfoList.Count; i++)
            {
                list2.Add(ContentManage.GetContentDataById(productInfoList[i].ProductId));
            }
            foreach (KeyValuePair <int, IList <EasyOne.Model.CommonModel.FieldInfo> > pair in dictionary)
            {
                foreach (EasyOne.Model.CommonModel.FieldInfo info2 in pair.Value)
                {
                    if (info2.FieldType != FieldType.Property)
                    {
                        TableRow row = this.NewRow();
                        row.CssClass = "tdbg";
                        row.Cells.Add(NewTitleCell(info2.FieldAlias + ":"));
                        for (int j = 0; j < productInfoList.Count; j++)
                        {
                            if (productInfoList[j].ModelId == pair.Key)
                            {
                                TableCell cell = NewCell(list2[j].Rows[0][info2.FieldName].ToString());
                                cell.HorizontalAlign = HorizontalAlign.Center;
                                row.Cells.Add(cell);
                            }
                            else
                            {
                                row.Cells.Add(NewCell(string.Empty));
                            }
                        }
                        this.TbProduct.Rows.Add(row);
                    }
                }
            }
        }
Ejemplo n.º 30
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);
            }
        }