示例#1
0
        public ActionResult getCommentList(string lotID, int pageIndex = 0, int pageSize = 5)
        {
            int             recordCount = 0;
            IList <Comment> list        = null;

            if ((BaseController.CurrentUserInfo.Role == UserRoles.OSAT) || (BaseController.CurrentUserInfo.Role == UserRoles.OSATAdmin))
            {
                list = LotService.GetCommentsByLotID(lotID, "", true, pageIndex, pageSize, out recordCount);
            }
            else
            {
                list = LotService.GetCommentsByLotID(lotID, "", false, pageIndex, pageSize, out recordCount);
            }
            bool   flag = ConfigurationManager.AppSettings["LocalDownload"] == "1";
            string str  = ConfigurationManager.AppSettings["RemoteDownloadUrlPrefix"];

            for (int i = 0; i <= (list.Count - 1); i++)
            {
                for (int j = 0; j <= (list[i].Attachments.Count - 1); j++)
                {
                    if (!flag)
                    {
                        list[i].Attachments[j].StoreRelativePath = str + list[i].Attachments[j].StoreRelativePath;
                    }
                }
            }
            var data = new {
                currentPage = pageIndex,
                totalPages  = PagerUtility.GetPageCount(recordCount, pageSize),
                rows        = list
            };

            NotificationService.ClearCommentNotificationByUserIDAndLotID(BaseController.CurrentUserInfo.UserID, lotID);
            return(base.Json(data));
        }
示例#2
0
        public ActionResult mDetailsIndex()
        {
            string lotID = base.Request.QueryString["LotID"];

            if (o__0.p__0 == null)
            {
                CSharpArgumentInfo[] argumentInfo = new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant | CSharpArgumentInfoFlags.UseCompileTimeType, null) };
                o__0.p__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Title", typeof(DetailsController), argumentInfo));
            }
            o__0.p__0.Target(o__0.p__0, base.ViewBag, "Details");
            LotView lotViewByLotID = LotService.GetLotViewByLotID(lotID);

            NotificationService.ClearCommentNotificationByUserIDAndLotID(BaseController.CurrentUserInfo.UserID, lotID);
            int             recordCount = 0;
            IList <Comment> list        = LotService.GetCommentsByLotID(lotID, "OtherBinDispose", false, 0, 0x270f, out recordCount);

            if ((list != null) && (list.Count > 0))
            {
                if (o__0.p__1 == null)
                {
                    CSharpArgumentInfo[] infoArray2 = new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant | CSharpArgumentInfoFlags.UseCompileTimeType, null) };
                    o__0.p__1 = CallSite <Func <CallSite, object, bool, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OtherBinDisposeCommentExist", typeof(DetailsController), infoArray2));
                }
                o__0.p__1.Target(o__0.p__1, base.ViewBag, true);
            }
            else
            {
                if (o__0.p__2 == null)
                {
                    CSharpArgumentInfo[] infoArray3 = new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant | CSharpArgumentInfoFlags.UseCompileTimeType, null) };
                    o__0.p__2 = CallSite <Func <CallSite, object, bool, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OtherBinDisposeCommentExist", typeof(DetailsController), infoArray3));
                }
                o__0.p__2.Target(o__0.p__2, base.ViewBag, false);
            }
            return(base.View(lotViewByLotID));
        }