Example #1
0
        protected bool IsEdit = false;//是否可以编辑文档
        protected void Page_Load(object sender, EventArgs e)
        {
            string loginMsg;

            if (!WebForm.Common.Tools.CheckLogin(out loginMsg) && !RoadFlow.Platform.WeiXin.Organize.CheckLogin())
            {
                Response.End();
            }

            DocID = Request.QueryString["docid"];

            if (DocID.IsGuid())
            {
                doc = Doc.Get(DocID.ToGuid());
                if (doc != null)
                {
                    var readusers = DocReadUsers.Get(doc.ID, CurrentUserID);
                    if (readusers == null)
                    {
                        Response.Write("您无权查看该文档!");
                        Response.End();
                    }
                    IsEdit = new RoadFlow.Platform.DocumentDirectory().HasPublish(doc.DirectoryID, CurrentUserID) ||
                             new RoadFlow.Platform.DocumentDirectory().HasManage(doc.DirectoryID, CurrentUserID);
                    if (!IsPostBack)
                    {
                        this.Title1.Text        = doc.Title;
                        this.WriteTime.Text     = doc.WriteTime.ToDateTimeString();
                        this.WriteUserName.Text = doc.WriteUserName;
                        this.Contents.Text      = doc.Contents;
                        this.DirectoryID.Text   = new RoadFlow.Platform.DocumentDirectory().GetName(doc.DirectoryID);
                        this.Source.Text        = doc.Source;
                        if (!doc.Files.IsNullOrEmpty())
                        {
                            this.Files.Text = "附件:" + RoadFlow.Platform.Files.GetFilesShowString(doc.Files, "/Platform/Files/Show.ashx");
                        }
                        this.ReadCount.Text = (doc.ReadCount + 1).ToString();
                        if (doc.EditTime.HasValue)
                        {
                            this.EditTime.Text = "修改时间:" + doc.EditTime.Value.ToDateTimeString();
                        }
                        if (!doc.EditUserName.IsNullOrEmpty())
                        {
                            this.EditUserName.Text = "修改人:" + doc.EditUserName;
                        }

                        Doc.UpdateReadCount(doc.ID);
                        DocReadUsers.UpdateRead(doc.ID, CurrentUserID);
                    }
                }
            }
        }
        public ActionResult DocRead()
        {
            RoadFlow.Data.Model.Documents        documents1         = (RoadFlow.Data.Model.Documents)null;
            RoadFlow.Platform.Documents          documents2         = new RoadFlow.Platform.Documents();
            RoadFlow.Platform.DocumentsReadUsers documentsReadUsers = new RoadFlow.Platform.DocumentsReadUsers();
            bool   flag          = false;
            string str           = this.Request.QueryString["docid"];
            Guid   currentUserId = RoadFlow.Platform.Users.CurrentUserID;

            if (str.IsGuid())
            {
                documents1 = documents2.Get(str.ToGuid());
                if (documents1 != null)
                {
                    if (documentsReadUsers.Get(documents1.ID, currentUserId) == null)
                    {
                        this.Response.Write("您无权查看该文档!");
                        this.Response.End();
                        return((ActionResult)null);
                    }
                    flag = new RoadFlow.Platform.DocumentDirectory().HasPublish(documents1.DirectoryID, currentUserId) || new RoadFlow.Platform.DocumentDirectory().HasManage(documents1.DirectoryID, currentUserId);
                    documents2.UpdateReadCount(documents1.ID);
                    documentsReadUsers.UpdateRead(documents1.ID, currentUserId);
                }
            }
            // ISSUE: reference to a compiler-generated field
            if (DocumentsController.\u003C\u003Eo__9.\u003C\u003Ep__0 == null)
            {
                // ISSUE: reference to a compiler-generated field
                DocumentsController.\u003C\u003Eo__9.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, bool, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "IsEdit", typeof(DocumentsController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj = DocumentsController.\u003C\u003Eo__9.\u003C\u003Ep__0.Target((CallSite)DocumentsController.\u003C\u003Eo__9.\u003C\u003Ep__0, this.ViewBag, flag);

            if (documents1 == null)
            {
                documents1 = new RoadFlow.Data.Model.Documents();
            }
            return((ActionResult)this.View((object)documents1));
        }