public string GetWorkItemCompletePageUrl(SysWorkItem wi, SysProcessInstance pi, SysActivityInstance ai, bool isRelative = true)
        {
            string str3;

            try
            {
                SysActivity activity = ai.Activity;
                if (activity == null)
                {
                    throw new ApplicationException(string.Format("活动实例:{0}找不到对应活动", ai.ActivityInstanceId));
                }
                if (pi.Process.ProcessCategory == 2)
                {
                    return(string.Format("../FormWorkflow/FormInstanceApprove.aspx?id={0}", wi.WorkItemId));
                }
                long?   pageid = activity.PageId;
                SysPage page   = pi.Process.ProcessEntity.Pages.FirstOrDefault <SysPage>(p => p.ControlId == pageid);
                if (page == null)
                {
                    throw new ApplicationException(string.Format("活动:{0}找不到对应页面", activity.ActivityId));
                }
                if (!isRelative)
                {
                    return(string.Format("{0}_{1}/{2}.aspx?id={3}", new object[] { page.OwnerEntity.OwnerModule.EntityCategory.CategoryName, page.OwnerEntity.OwnerModule.ModuleName, page.PageName, wi.WorkItemId }));
                }
                str3 = string.Format("../{0}_{1}/{2}.aspx?id={3}", new object[] { page.OwnerEntity.OwnerModule.EntityCategory.CategoryName, page.OwnerEntity.OwnerModule.ModuleName, page.PageName, wi.WorkItemId });
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(str3);
        }
예제 #2
0
        public string GetPageUrl(BizDataContext db, SysEntity entity, SysPage page)
        {
            string str = string.Empty;

            if ((page != null) && page.ModuleId.HasValue)
            {
                page.OwnerModule = db.FindById <SysModule>(new object[] { page.ModuleId });
                if (page.OwnerModule != null)
                {
                    page.OwnerModule.EntityCategory = db.FindById <SysEntityCategory>(new object[] { page.OwnerModule.CategoryId });
                    if (page.OwnerModule.EntityCategory != null)
                    {
                        str = string.Format("~/{0}_{1}/{2}", page.OwnerModule.EntityCategory.CategoryName, page.OwnerModule.ModuleName, page.PageName);
                    }
                }
                return(str);
            }
            if (entity != null)
            {
                entity.OwnerModule = db.FindById <SysModule>(new object[] { entity.ModuleId });
                if (entity.OwnerModule == null)
                {
                    return(str);
                }
                entity.OwnerModule.EntityCategory = db.FindById <SysEntityCategory>(new object[] { entity.OwnerModule.CategoryId });
                if (entity.OwnerModule.EntityCategory != null)
                {
                    str = string.Format("~/{0}_{1}/{2}", entity.OwnerModule.EntityCategory.CategoryName, entity.OwnerModule.ModuleName, page.PageName);
                }
            }
            return(str);
        }
        public HttpResponseMessage SaveSysPage(SysPage sysPage)
        {
            try
            {
                var SysPageData = from d in db.SysPages where d.Id == Convert.ToInt32(sysPage.Id) select d;
                if (SysPageData.Any())
                {
                    var UpdateSysPageData = SysPageData.FirstOrDefault();

                    UpdateSysPageData.Page = sysPage.Page;
                    UpdateSysPageData.Url  = sysPage.Url;

                    db.SubmitChanges();

                    return(Request.CreateResponse(HttpStatusCode.OK));
                }
                else
                {
                    return(Request.CreateResponse(HttpStatusCode.OK));
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }
예제 #4
0
        public string GetPageUrl(SysEntity entity, SysPage page)
        {
            string result = string.Empty;

            //if (page != null && page.ModuleId != null)
            //{
            //    page.OwnerModule = db.FindById<SysModule>(page.ModuleId);
            if (page.OwnerModule != null)
            {
                //page.OwnerModule.EntityCategory = db.FindById<SysEntityCategory>(page.OwnerModule.CategoryId);
                if (page.OwnerModule.EntityCategory != null)
                {
                    result = string.Format("~/{0}_{1}/{2}.aspx", page.OwnerModule.EntityCategory.CategoryName, page.OwnerModule.ModuleName, page.PageName);
                }
            }
            //}
            else
            {
                if (entity != null)
                {
                    //entity.OwnerModule = db.FindById<SysModule>(entity.ModuleId);
                    if (entity.OwnerModule != null)
                    {
                        //entity.OwnerModule.EntityCategory = db.FindById<SysEntityCategory>(entity.OwnerModule.CategoryId);
                        if (entity.OwnerModule.EntityCategory != null)
                        {
                            result = string.Format("~/{0}_{1}/{2}.aspx", entity.OwnerModule.EntityCategory.CategoryName, entity.OwnerModule.ModuleName, page.PageName);
                        }
                    }
                }
            }

            return(result);
        }
예제 #5
0
        public async Task <IActionResult> Save(SysPage model, string columns = "")
        {
            var errMsg = GetModelErrMsg();

            if (!string.IsNullOrEmpty(errMsg))
            {
                return(ErrRes(errMsg));
            }
            model.Status = model.Status ?? 2;
            if (string.IsNullOrEmpty(model.SysPageId))
            {
                model.SysPageId  = GuidKey;
                model.CreateTime = DateTime.Now;
                model.CreateUser = Id;

                result = await _unitOfWork.SysPageRepository.InsertAsync(model);

                if (result)
                {
                    _logger.LogInformation($"添加{_entityName}{model.SysPageName}");
                }
            }
            else
            {
                //定义可以修改的列
                var lstColumn = new List <string>()
                {
                    nameof(SysPage.Remark), nameof(SysPage.Sort), nameof(SysPage.Status), nameof(SysPage.SysPageImg), nameof(SysPage.SysPageName), nameof(SysPage.SysPageNum), nameof(SysPage.SysPageParent), nameof(SysPage.SysPageUrl)
                };
                if (!string.IsNullOrEmpty(columns))//固定过滤只修改某字段
                {
                    if (lstColumn.Count == 0)
                    {
                        lstColumn = columns.Split(',').ToList();
                    }
                    else
                    {
                        lstColumn = lstColumn.Where(o => columns.Split(',').Contains(o)).ToList();
                    }
                }
                result = await _unitOfWork.SysPageRepository.UpdateAsync(model, true, lstColumn);

                if (result)
                {
                    _logger.LogInformation($"修改{_entityName}{model.SysPageName}");
                }
            }
            return(result ? SuccessRes() : ErrRes());
        }
예제 #6
0
        private string GetPageName(object pageId)
        {
            string res = string.Empty;

            //using (BizDataContext contex = new BizDataContext())
            {
                //SysPage page = this.DataHelper.FindById<SysPage>(pageId);
                SysPage page = this.EntityCache.FindById <SysPage>(pageId);
                if (page != null)
                {
                    res = page.PageName;
                }
            }
            return(res);
        }
예제 #7
0
 /// <summary>
 /// 绑定所有页面
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void dataListOperation_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         var     datalist = e.Item.FindControl("dataList") as DataList;
         SysPage pr       = e.Item.DataItem as SysPage;
         //获取页面下所有的操作,不包括行操作
         var operation = this.OperationPrivilegeHelper.GetOperation(pr.PageName);
         datalist.DataSource = operation;
         datalist.DataBind();
         //判断页面下是否有受控制的操作,包括行操作,没有则此页面不显示
         if (!this.OperationPrivilegeHelper.HasOperation(pr.PageName))
         {
             e.Item.Visible = false;
         }
         //获取页面下所有的视图
         var datalistview = e.Item.FindControl("dataListView") as Repeater;
         datalistview.DataSource = this.OperationPrivilegeHelper.GetView(pr.ControlId);
         datalistview.DataBind();
     }
 }
        public Int32 PostSysPage(SysPage addSysPage)
        {
            try
            {
                Data.SysPage newSysPage = new Data.SysPage()
                {
                    Page = addSysPage.Page,
                    Url  = addSysPage.Page
                };

                db.SysPages.InsertOnSubmit(newSysPage);
                db.SubmitChanges();

                return(newSysPage.Id);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
                return(0);
            }
        }