构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(49)-工作流设计-我的申请

系列目录

提交一个表单后

我们需要一个管理的列表。我的申请,我的申请包含了提交内容的列表状态

状态分:过期,未审核,审核通过,驳回,废弃

列表对应代码

@using App.Admin;
@using App.Common;
@using App.Models.Sys;
@{
    ViewBag.Title = "主页";
    Layout = "~/Views/Shared/_Index_Layout.cshtml";
    List<permModel> perm = (List<permModel>)ViewBag.Perm;
    if (perm == null)
    {
    perm = new List<permModel>();
    }
}
<div class="mvctool" style="line-height:30px;">
    我的申请:52,过期:10,未审核:14,审核通过:10,审核不通过:13,审核中:10
</div>
<table id="List"></table>

<div id="modalwindow" class="easyui-window" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div>
@Html.Partial("~/Views/Shared/_Partial_AutoGrid.cshtml")
<script type="text/javascript">
    $(function () {
        $(‘#List‘).datagrid({
            url: ‘@Url.Action("GetListByUserId")‘,
            width:SetGridWidthSub(10),
            methord: ‘post‘,
            height: SetGridHeightSub(39),
            fitColumns: true,
            sortName: ‘CreateTime‘,
            sortOrder: ‘desc‘,
            idField: ‘Id‘,
            pageSize: 15,
            pageList: [15, 20, 30, 40, 50],
            pagination: true,
            striped: true, //奇偶行是否区分
            singleSelect: true,//单选模式
            rownumbers: true,//行号
            columns: [[
                { field: ‘Id‘, title: ‘ID‘, width: 80,hidden:true },
                { field: ‘Title‘, title: ‘标题‘, width: 280,sortable:true },
                { field: ‘UserId‘, title: ‘发起用户‘, width: 80, sortable: true, hidden: true },
                { field: ‘FormId‘, title: ‘对应表单‘, width: 80, sortable: true, hidden: true },
                { field: ‘FormLevel‘, title: ‘公文级别‘, width: 80,sortable:true, hidden: true  },
                { field: ‘CreateTime‘, title: ‘创建时间‘, width: 110,sortable:true },
                { field: ‘TimeOut‘, title: ‘截至时间‘, width: 80, sortable: true, formatter: function (value) { return SubStrYMD(value) } },
                { field: ‘CurrentStep‘, title: ‘当前环节‘, width: 80, sortable: true, align: ‘center‘ },
                { field: ‘CurrentState‘, title: ‘当前状态‘, width: 80, sortable: true, align: ‘center‘ },
                { field: ‘Action‘, title: ‘管理‘, width: 80, sortable: true, align: ‘center‘ }
            ]]
        });
    });
    //ifram 返回
    function frameReturnByClose() {
        $("#modalwindow").window(‘close‘);
    }
    function frameReturnByReload(flag) {
        if (flag)
            $("#List").datagrid(‘load‘);
        else
            $("#List").datagrid(‘reload‘);
    }
    function frameReturnByMes(mes) {
        $.messageBox5s(‘提示‘, mes);
    }
    function LookFlow(formId)
    {
            $("#modalwindow").html("<iframe width=‘100%‘ height=‘98%‘ scrolling=‘auto‘ frameborder=‘0‘ src=‘@Url.Action("Details")?id=" + formId + "&Ieguid=" + GetGuid() + "‘></iframe>");
                $("#modalwindow").window({ title: ‘图例‘, width: 500, height: 380, iconCls: ‘icon-details‘ }).window(‘open‘);
    }
    function ManageFlow(formId,id)
    {
        $("#modalwindow").html("<iframe width=‘100%‘ height=‘98%‘ scrolling=‘auto‘ frameborder=‘0‘ src=‘@Url.Action("Edit")?formId=" + formId + "&id=" + id + "&Ieguid=" + GetGuid() + "‘></iframe>");
            $("#modalwindow").window({ title: ‘详细‘, width: 500, height: 380, iconCls: ‘icon-details‘ }).window(‘open‘);
    }
</script>

Index.cshtml

@model App.Models.Flow.Flow_FormModel
@using App.Common;
@using App.Models.Flow;
@using App.Admin;
@using App.Models.Sys;
@{
    ViewBag.Title = "创建";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = (List<permModel>)ViewBag.Perm;
    if (perm == null)
    {
        perm = new List<permModel>();
    }
}
<style>

    .tbdetail { width: 98%; border-collapse: collapse; }
.tbdetail .alignRight { width: 150px; text-align: right; }
.tbdetail td { border-bottom: 1px solid #F4F4F4; height: 30px; word-wrap:break-word; word-break:break-all; }
.tbcalendar, .tbcalendar td, .tbcalendar th { border: 1px solid #cccccc; border-collapse: collapse; padding: 5px; text-align: center; }
.tbcalendar th{ background: #f4f4f4; }
</style>
       <div class="tc" style="padding:10px;"> @Model.Name</div>

 <table class="tbdetail">

@{
    int i = 0;
    foreach (var item in Model.stepList)
    {
        i++;
            <tr>
                <td align="center">
         <table class="tbdetail">
                        <tr>
                            <td class="alignRight">
                                第
                                @i
                                步:
                            </td>
                            <td>
                                @item.Name
                            </td>
                        </tr>
                        <tr>
                            <td class="alignRight">
                                流转规则:
                            </td>
                            <td>
                               按@(item.FlowRule)
                            </td>
                        </tr>
                        @{
                            int j = 0;
                            foreach (var judge in item.stepRuleList)
                            {
                                j++;
                                            <tr>
                                                <td class="alignRight">
                                                    分支
                                                    @j:
                                                </td>
                                                <td>
                                                    @String.Format("如果 [{0} {1} {2}] → [{3}]", judge.AttrName, judge.Operator, judge.Result, judge.NextStep == "0" ? "流程结束" : judge.NextStepName)
                                                </td>
                                            </tr>
                            }
                         }
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center">
                    ↓
                </td>
            </tr>
    }
}
        <tr>
            <td align="center">
                流程结束
            </td>
        </tr>
        </table>

Details.cshtml

@model App.Models.Flow.Flow_FormContentModel
@using App.Common;
@using App.Models.Flow;
@using App.Admin;
@using App.Models.Sys;
@{
    ViewBag.Title = "创建";
    Layout = "~/Views/Shared/_Index_Layout.cshtml";
    List<permModel> perm = (List<permModel>)ViewBag.Perm;
    if (perm == null)
    {
        perm = new List<permModel>();
    }
}

<script>
    $(function () {
        $("*[name=‘AttrA‘]").val("@Model.AttrA");
        $("*[name=‘AttrB‘]").val("@Model.AttrB");
        $("*[name=‘AttrC‘]").val("@Model.AttrC");
        $("*[name=‘AttrD‘]").val("@Model.AttrD");
        $("*[name=‘AttrE‘]").val("@Model.AttrE");
        $("*[name=‘AttrF‘]").val("@Model.AttrF");
        $("*[name=‘AttrG‘]").val("@Model.AttrG");
        $("*[name=‘AttrH‘]").val("@Model.AttrH");
        $("*[name=‘AttrI‘]").val("@Model.AttrI");
        $("*[name=‘AttrJ‘]").val("@Model.AttrJ");
        $("*[name=‘AttrK‘]").val("@Model.AttrK");
        $("*[name=‘AttrL‘]").val("@Model.AttrL");
        $("*[name=‘AttrM‘]").val("@Model.AttrM");
        $("*[name=‘AttrN‘]").val("@Model.AttrN");
        $("*[name=‘AttrO‘]").val("@Model.AttrO");
        $("*[name=‘AttrP‘]").val("@Model.AttrP");
        $("*[name=‘AttrQ‘]").val("@Model.AttrQ");
        $("*[name=‘AttrR‘]").val("@Model.AttrR");
        $("*[name=‘AttrS‘]").val("@Model.AttrS");
        $("*[name=‘AttrT‘]").val("@Model.AttrT");
        $("*[name=‘AttrU‘]").val("@Model.AttrU");
        $("*[name=‘AttrV‘]").val("@Model.AttrV");
        $("*[name=‘AttrW‘]").val("@Model.AttrW");
        $("*[name=‘AttrX‘]").val("@Model.AttrX");
        $("*[name=‘AttrY‘]").val("@Model.AttrY");
        $("*[name=‘AttrZ‘]").val("@Model.AttrZ");

    });
</script>
<div class="mvctool ">
@Html.ToolButton("btnReturn", "icon-return", "返回",false)
</div>
     <table class="fromEditTable setTextWidth300">
    <tbody>
             @Html.HiddenFor(model => model.Id)
             @Html.HiddenFor(model => model.FormId)
             @Html.HiddenFor(model => model.UserId)
             <input id="CreateTime" type="hidden" name="CreateTime" value="2000-1-1" />
            <tr>
            <td style="width:100px; text-align:right;">
                @Html.LabelFor(model => model.Title):
            </td>
            <td style="width:310px">
                @Html.EditorFor(model => model.Title)
            </td>

            </tr>
             @Html.Raw(ViewBag.Html)
             <tr>
                <td style="width:100px; text-align:right;">
                    @Html.LabelFor(model => model.TimeOut):
                </td>
                <td style="width:310px">
                    @Html.EditorFor(model => model.TimeOut)
                </td>
            </tr>
            <tr><td style=‘width:100px; text-align:right;‘>紧急程度 :</td><td><select name="FormLevel" id="FormLevel"><option value="普通">普通</option><option value="重要">重要</option><option value="紧急">紧急</option></select></td></tr>
            </tbody>
</table>
<hr />
@Html.Raw(ViewBag.StepCheckMes)

Edit.cshtml

using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using App.Common;
using App.IBLL;
using App.Models.Sys;
using Microsoft.Practices.Unity;
using App.Flow.IBLL;
using App.Models.Flow;
using System.Text;
using App.Flow.BLL;
using System;

namespace App.Admin.Areas.Flow.Controllers
{
    public class ApplyController : BaseController
    {
        [Dependency]
        public ISysUserBLL userBLL { get; set; }
        [Dependency]
        public IFlow_TypeBLL m_BLL { get; set; }
        [Dependency]
        public IFlow_FormBLL formBLL { get; set; }
        [Dependency]
        public IFlow_FormAttrBLL formAttrBLL { get; set; }
        [Dependency]
        public IFlow_FormContentBLL formContentBLL { get; set; }
        [Dependency]
        public IFlow_StepBLL stepBLL { get; set; }
        [Dependency]
        public IFlow_StepRuleBLL stepRuleBLL { get; set; }
        [Dependency]
        public IFlow_FormContentStepCheckBLL stepCheckBLL { get; set; }
        [Dependency]
        public IFlow_FormContentStepCheckStateBLL stepCheckStateBLL { get; set; }

        ValidationErrors errors = new ValidationErrors();

        [SupportFilter]
        public ActionResult Index()
        {
            ViewBag.Perm = GetPermission();
            return View();
        }
        [HttpPost]
        public JsonResult GetListByUserId(GridPager pager, string queryStr)
        {
            List<Flow_FormContentModel> list = formContentBLL.GetListByUserId(ref pager, queryStr, GetUserId());
            var json = new
            {
                total = pager.totalRows,
                rows = (from r in list
                        select new Flow_FormContentModel()
                        {

                            Id = r.Id,
                            Title = r.Title,
                            UserId = r.UserId,
                            FormId = r.FormId,
                            FormLevel = r.FormLevel,
                            CreateTime = r.CreateTime,
                            TimeOut = r.TimeOut,
                            CurrentStep = GetCurrentStep(r),
                            CurrentState = GetCurrentState(r),
                            Action = "<a href=‘#‘ title=‘管理‘  onclick=‘ManageFlow(\"" + r.FormId + "\",\""+r.Id+"\")‘>管理</a> | <a href=‘#‘ title=‘图例‘  onclick=‘LookFlow(\"" + r.FormId + "\")‘>图例</a>"

                        }).ToArray()

            };
            return Json(json);
        }
        public string GetCurrentStep(Flow_FormContentModel model)
        {
            string str = "结束";
            List<Flow_FormContentStepCheckModel> stepCheckModelList = stepCheckBLL.GetListByFormId(model.FormId,model.Id);
            for (int i = stepCheckModelList.Count()-1;i>=0;i--)
            {
                if (stepCheckModelList[i].State == 2)
                {
                    str = stepBLL.GetById(stepCheckModelList[i].StepId).Name;
                }
            }
            return str;
        }
        public string GetCurrentState(Flow_FormContentModel model)
        {
            if (model.TimeOut < ResultHelper.NowTime)
            {
                return "<span style=‘color:#0094ff‘>过期</span>";
            }
            List<Flow_FormContentStepCheckModel> stepCheckModelList = stepCheckBLL.GetListByFormId(model.FormId,model.Id);

            var v = from r in stepCheckModelList where r.State == 1 select r;
            if (v.Count() == stepCheckModelList.Count())
            {
                return "<span style=‘color:#6fce2f‘>通过</span>";
            }
            var vv = from r in stepCheckModelList where r.State == 0 select r;
            if (vv.Count() > 0)
            {
                return "<span style=‘color:#ff6a00‘>驳回</span>";
            }
            return "<span style=‘color:#ff6600‘>待审核</span>";
        }

        #region 详细
        [SupportFilter(ActionName = "Details")]
        public ActionResult Details(string id)
        {
            ViewBag.Perm = GetPermission();
            Flow_FormModel flowFormModel = formBLL.GetById(id);
            //获取现有的步骤
            GridPager pager = new GridPager()
            {
                rows = 1000,
                page = 1,
                sort = "Id",
                order = "asc"
            };
            flowFormModel.stepList = new List<Flow_StepModel>();
            flowFormModel.stepList = stepBLL.GetList(ref pager, flowFormModel.Id);
            for (int i = 0; i < flowFormModel.stepList.Count; i++)//获取步骤下面的步骤规则
            {
                flowFormModel.stepList[i].stepRuleList = new List<Flow_StepRuleModel>();
                flowFormModel.stepList[i].stepRuleList = GetStepRuleListByStepId(flowFormModel.stepList[i].Id);
            }

            return View(flowFormModel);
        }
        //获取步骤下面的规则
        private List<Flow_StepRuleModel> GetStepRuleListByStepId(string stepId)
        {
            List<Flow_StepRuleModel> list = stepRuleBLL.GetList(stepId);
            return list;
        }
        #endregion

        [SupportFilter(ActionName = "Details")]
        public ActionResult Edit(string formId,string id)
        {

            ViewBag.Perm = GetPermission();
            ViewBag.Html = ExceHtmlJs(formId);
            ViewBag.StepCheckMes = GetCurrentStepCheckMes(formId, id);
            Flow_FormContentModel model = formContentBLL.GetById(id);
            return View(model);
        }

             //根据设定公文,生成表单及控制条件
        private string ExceHtmlJs(string id)
        {
            //定义一个sb为生成HTML表单
            StringBuilder sbHtml = new StringBuilder();
            StringBuilder sbJS = new StringBuilder();
            sbJS.Append("<script type=‘text/javascript‘>function CheckForm(){");
            Flow_FormModel model = formBLL.GetById(id);
            #region 判断流程是否有字段,有就生成HTML表单
            Type formType = model.GetType();
            //查找名称为"A-Z"的属性
            string[] arrStr = { "AttrA", "AttrB", "AttrC", "AttrD", "AttrE", "AttrF", "AttrG", "AttrH", "AttrI", "AttrJ", "AttrK"
                                  , "AttrL", "AttrM", "AttrN", "AttrO", "AttrP", "AttrQ", "AttrR", "AttrS", "AttrT", "AttrU"
                                  , "AttrV", "AttrW", "AttrX", "AttrY", "AttrZ"};
            foreach (string str in arrStr)
            {
                object o = formType.GetProperty(str).GetValue(model, null);
                if (o != null)
                {
                    //查找model类的Class对象的"str"属性的值
                    sbHtml.Append(GetHtml(o.ToString(), str.Replace("Attr", ""), ref sbJS));
                }
            }

            #endregion
            sbJS.Append("return true}</script>");
            ViewBag.HtmlJS = sbJS.ToString();
            return sbHtml.ToString();
        }

        //对比
        private bool JudgeVal(string attrId, string rVal, string cVal, string lVal)
        {
            string attrType = formAttrBLL.GetById(attrId).AttrType;
            return new FlowHelper().Judge(attrType, rVal, cVal, lVal);
        }

        //获取指定名称的HTML表单
        private string GetHtml(string id, string no, ref StringBuilder sbJS)
        {
            StringBuilder sb = new StringBuilder();
            Flow_FormAttrModel attrModel = formAttrBLL.GetById(id);
            sb.AppendFormat("<tr><td style=‘width:100px; text-align:right;‘>{0} :</td>", attrModel.Title);
            //获取指定类型的HTML表单
            sb.AppendFormat("<td>{0}</td></tr>", new FlowHelper().GetInput(attrModel.AttrType, attrModel.Name, no));
            sbJS.Append(attrModel.CheckJS);
            return sb.ToString();
        }

        //获取环节所有信息
        public string GetCurrentStepCheckMes(string fromId, string contentId)
        {
            string stepCheckMes = "";
            string stepCheckId = GetCurrentStepCheckId(fromId, contentId);

                List<Flow_FormContentStepCheckModel> stepCheckModelList = stepCheckBLL.GetListByFormId(fromId, contentId);
                for (int i = 0; i < stepCheckModelList.Count; i++)
                {
                    Flow_FormContentStepCheckStateModel stepCheckStateModel = stepCheckStateBLL.GetByStepCheckId(stepCheckModelList[i].Id);
                    stepCheckMes = stepCheckMes + "第" + (i + 1) + "步:审核人:" + stepCheckStateModel.UserId + " 审核意见:" + stepCheckStateModel.Reamrk + " 审核意见:" + (stepCheckStateModel.CheckFlag == 1 ? "通过" : stepCheckStateModel.CheckFlag == 0 ? "不通过" : "审核中") + "</br>";
                }
                return stepCheckMes;
        }
        //获取当前环节的审核条
        public string GetCurrentStepCheckId(string fromId, string contentId)
        {
                List<Flow_FormContentStepCheckModel> stepCheckModelList = stepCheckBLL.GetListByFormId(fromId, contentId);
                return new FlowHelper().GetCurrentStepCheckIdByStepCheckModelList(stepCheckModelList);

        }
    }
}

ApplyController

 List<Flow_FormContentModel> GetListByUserId(ref GridPager pager, string queryStr,string userId);

IFlow_FormContentBLL

 [Dependency]
        public IFlow_FormContentRepository m_Rep { get; set; }
 public List<Flow_FormContentModel> GetListByUserId(ref GridPager pager, string queryStr, string userId)
        {
            IQueryable<Flow_FormContent> queryData = null;
            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(db).Where(a => a.Title.Contains(queryStr) && a.UserId==userId);
            }
            else
            {
                queryData = m_Rep.GetList(db).Where(a=>a.UserId == userId);
            }
            pager.totalRows = queryData.Count();
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return CreateModelList(ref queryData);
        }
private List<Flow_FormContentModel> CreateModelList(ref IQueryable<Flow_FormContent> queryData)
        {

            List<Flow_FormContentModel> modelList = (from r in queryData
                                                     select new Flow_FormContentModel
                                                     {
                                                         Id = r.Id,
                                                         Title = r.Title,
                                                         UserId = r.UserId,
                                                         FormId = r.FormId,
                                                         FormLevel = r.FormLevel,
                                                         CreateTime = r.CreateTime,
                                                         AttrA = r.AttrA,
                                                         AttrB = r.AttrB,
                                                         AttrC = r.AttrC,
                                                         AttrD = r.AttrD,
                                                         AttrE = r.AttrE,
                                                         AttrF = r.AttrF,
                                                         AttrG = r.AttrG,
                                                         AttrH = r.AttrH,
                                                         AttrI = r.AttrI,
                                                         AttrJ = r.AttrJ,
                                                         AttrK = r.AttrK,
                                                         AttrL = r.AttrL,
                                                         AttrM = r.AttrM,
                                                         AttrN = r.AttrN,
                                                         AttrO = r.AttrO,
                                                         AttrP = r.AttrP,
                                                         AttrQ = r.AttrQ,
                                                         AttrR = r.AttrR,
                                                         AttrS = r.AttrS,
                                                         AttrT = r.AttrT,
                                                         AttrU = r.AttrU,
                                                         AttrV = r.AttrV,
                                                         AttrW = r.AttrW,
                                                         AttrX = r.AttrX,
                                                         AttrY = r.AttrY,
                                                         AttrZ = r.AttrZ,
                                                         CustomMember = r.CustomMember,
                                                         TimeOut = r.TimeOut
                                                     }).ToList();
            return modelList;
        }

Flow_FormContentBLL

 IQueryable<Flow_FormContent> GetList(DBContainer db);

IFlow_FormContentRepository

 public IQueryable<Flow_FormContent> GetList(DBContainer db)
        {
            IQueryable<Flow_FormContent> list = db.Flow_FormContent.AsQueryable();
            return list;
        }

Flow_FormContentRepository

运行效果。

图例效果

虽然显示效果不是很好,但是体现了流程的分支情况。

驳回废弃做完审批再回头来处理这个页面。这样来看代码比较清楚

直接看代码分析流程。目前没有特别模糊的逻辑

时间: 2024-10-12 04:14:13

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(49)-工作流设计-我的申请的相关文章

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(35)-文章发布系统②-构建项目

注:阅读本文,需要阅读本系列的之前文章 代码生成器下载地址(文章开头处) 接下来我们建立数据库的表和各层的代码 我们只需要两张表,文章列表(MIS_Article)和类别表(MIS_Article_Category) USE [AppDB] GO /****** Object: Table [dbo].[MIS_Article] Script Date: 05/15/2014 17:33:15 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(36)-文章发布系统③-kindeditor使用

我相信目前国内富文本编辑器中KindEditor 属于前列,详细的中文帮助文档,简单的加载方式,可以定制的轻量级.都是系统的首选 很多文章教程有kindeditor的使用,但本文比较特别可能带有,上传文件的缩略图和水印的源码!这块也是比较复杂和备受关注的功能 一.下载编辑器 KindEditor 4.1.10 (2013-11-23) [1143KB] 官方最新版 或者: http://www.kindsoft.net/down.php 二.添加到项目 解压 kindeditor-x.x.x.z

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(38)-Easyui-accordion+tree漂亮的菜单导航

本节主要知识点是easyui 的手风琴加树结构做菜单导航 有园友抱怨原来菜单非常难看,但是基于原有树形无限级别的设计,没有办法只能已树形展示 先来看原来的效果 改变后的效果,当然我已经做好了,最后只放出代码供大家参考,其实网上也有这方面的资料,但是不是很好用,我还是自己写了 改变后的效果 手风琴一直都是比较漂亮和受欢迎的,但是基于树多级别来说,做起来就比较麻烦,所以我这里也用了手风琴加树的模式来做 注:上面的图标都是乱添加的,并不代表意思 进入正文: 首先必须下载一些图标.可以自行百度网页小图标

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(37)-文章发布系统④-百万级数据和千万级数据简单测试

我想测试EF在一百万条数据下的显示时间!这分数据应该有很多同学想要,看看EF的性能! 服务器 现在来向SQL2008R2插入1000000条数据吧 declare @i int; set @i=0; while @i<1000000 begin INSERT INTO [AppDB].[dbo].[MIS_Article] ([Id] ,[ChannelId] ,[CategoryId] ,[Title] ,[ImgUrl] ,[BodyContent] ,[Sort] ,[Click] ,[C

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(47)-工作流设计-补充

原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(47)-工作流设计-补充 系列目录 补充一下,有人要表单的代码,这个用代码生成器生成表Flow_Form表的Index代码就可以 加上几个按钮就可以了 <div class="mvctool"> <input id="txtQuery" type="text" class="searchText" /> @Ht

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(48)-工作流设计-起草新申请

原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(48)-工作流设计-起草新申请 系列目录 创建新表单之后,我们就可以起草申请了,申请按照严格的表单步骤和分支执行. 起草的同时,我们分解流转的规则中的审批人并保存,具体流程如下 接下来创建DrafContoller控制器,此控制器只有2个页面,一个Create(起草页面)Index(表单列表) 表单列表显示个人想法,我是根据分类直接获取其下表单,即Flow_Type下的Flow_Form public

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(41)-组织架构

原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(41)-组织架构 本节开始我们要实现工作流,此工作流可以和之前的所有章节脱离关系,也可以紧密合并. 我们当初设计的项目解决方案就是可伸缩可以拆离,可共享的项目解决方案.所以我们同时要添加App.Flow文件夹 工作流的开始之前,我们必须有一个组织架构,我们做成无限动态级别树,因为之前的模块管理也是无限级别的 知识点:Easyui TreeGrid用法,根据组织架构读取架构下所有用户(with...as.

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(39)-在线人数统计探讨

原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(39)-在线人数统计探讨 系列目录 基于web的网站在线统计一直处于不是很精准的状态!基本上没有一种方法可以确实的统计在线用户! Discuz!NT 在线用户功能算是做得比较好的!参考资料 他的原理大致是根据用户的操作间隔来确定用户是否在线,也可以理解为操作日志,当系统扫描的日志间隔太长将被理解为用户离线,所以要不断的更新操作表和操作表日益增长的烦恼,所以必须定时的清除操作表,当系统启动时要重置表数据!

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(42)-工作流设计01

原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(42)-工作流设计01 工作流在实际应用中还是比较广泛,网络中存在很多工作流的图形化插件,可以做到拉拽的工作流设计,非常简便,再配合第三方编辑器,可以直接生成表单,我没有刻意的浏览很多工作流的实际设计,我认为工作流只要有动态可修改的流转,有时可按角色,部门,上级或者职位流转即是比较好的正常工作流!这里只带给一个思路的简单工作流... 工作流其实有几种,也可以设计得很简单: 1.固定的工作流,很小的公司,

构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(40)-精准在线人数统计实现-【过滤器+Cache】

原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(40)-精准在线人数统计实现-[过滤器+Cache] 系列目录 上次的探讨没有任何结果,我浏览了大量的文章和个别系统的参考!决定用Cache来做,这可能有点难以接受但是配合mvc过滤器来做效果非常好! 由于之前的过滤器我们用过了OnActionExecuting这个方法来判断权限 现在在方法被执行后我们用OnActionExecuted来监听用户的操作和刷新用户在线列表 首先下载http://files