Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            int pageIndex = 1, pageSize = 500;
            string orderStr = string.Empty, whereStr = string.Empty;

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            string baseName = context.Request["b"];
            if (string.IsNullOrEmpty(baseName))
            {
                context.Response.Write("数据库名称参数不能为空");
                context.Response.End();
            }

            string tableCode = context.Request["t"];
            if (string.IsNullOrEmpty(baseName))
            {
                context.Response.Write("表名参数不能为空");
                context.Response.End();
            }

            int rowId = 0;
            if (string.IsNullOrEmpty(context.Request["id"]) || !int.TryParse(context.Request["id"], out rowId) || rowId <= 0)
            {
                context.Response.Write("序号错误");
                context.Response.End();
            }

            if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"]))
                int.TryParse(context.Request.QueryString["pagenum"], out pageIndex);
            pageIndex++;
            if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"]))
                int.TryParse(context.Request.QueryString["pagesize"], out pageSize);

            if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"]))
                orderStr = string.Format("{0} {1}", context.Request.QueryString["sortdatafield"].Trim(), context.Request.QueryString["sortorder"].Trim());

            NFMT.WorkFlow.BLL.TaskBLL taskBLL = new NFMT.WorkFlow.BLL.TaskBLL();

            NFMT.Common.ResultModel result = taskBLL.GetAuditProgressSelectModel(user, baseName, tableCode, rowId);

            System.Collections.Generic.Dictionary<string, object> dic = new System.Collections.Generic.Dictionary<string, object>();
            System.Data.DataTable dt = new System.Data.DataTable();
            context.Response.ContentType = "application/json; charset=utf-8";
            if (result.ResultStatus == 0)
                dt = result.ReturnValue as System.Data.DataTable;

            dic.Add("count", result.AffectCount);
            dic.Add("data", dt);

            string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic);

            context.Response.Write(postData);
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            int status = -1, empId = -1;
            int pageIndex = 1, pageSize = 10;
            string orderStr = string.Empty, whereStr = string.Empty;

            string key = context.Request["k"];//任务名称模糊搜索

            if (!string.IsNullOrEmpty(context.Request["s"]))
                int.TryParse(context.Request["s"], out status);//任务状态查询条件

            if (!string.IsNullOrEmpty(context.Request["uid"]))
                int.TryParse(context.Request["uid"], out empId);

            if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"]))
                int.TryParse(context.Request.QueryString["pagenum"], out pageIndex);
            pageIndex++;
            if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"]))
                int.TryParse(context.Request.QueryString["pagesize"], out pageSize);

            if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"]))
                orderStr = string.Format("{0} {1}", context.Request.QueryString["sortdatafield"].Trim(), context.Request.QueryString["sortorder"].Trim());

            NFMT.WorkFlow.BLL.TaskBLL taskBLL = new NFMT.WorkFlow.BLL.TaskBLL();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            NFMT.Common.SelectModel select = taskBLL.GetSelectModel(pageIndex, pageSize, orderStr, status, key, user.EmpId);
            NFMT.Common.ResultModel result = taskBLL.Load(new NFMT.Common.UserModel(), select);

            context.Response.ContentType = "application/json; charset=utf-8";
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
            System.Collections.Generic.Dictionary<string, object> dic = new System.Collections.Generic.Dictionary<string, object>();

            dic.Add("count", result.AffectCount);
            dic.Add("data", dt);

            string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic);

            context.Response.Write(postData);
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Utility.VerificationUtility ver = new Utility.VerificationUtility();
                //ver.JudgeOperate(this.Page, 85, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.查询 });

                NFMT.Common.UserModel user = NFMTSite.Utility.UserUtility.CurrentUser;
                string directURL = string.Format("{0}WorkFlow/AuditedList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

                this.navigation1.Routes.Add("已审核任务列表", directURL);
                this.navigation1.Routes.Add("已审核任务明细", string.Empty);

                int taskId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]))
                    Response.Redirect(directURL);
                if (!int.TryParse(Request.QueryString["id"], out taskId))
                    Response.Redirect(directURL);

                this.hidtaskId.Value = taskId.ToString();

                NFMT.WorkFlow.BLL.TaskBLL taskBLL = new NFMT.WorkFlow.BLL.TaskBLL();
                NFMT.Common.ResultModel result = taskBLL.Get(user, taskId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                NFMT.WorkFlow.Model.Task task = result.ReturnValue as NFMT.WorkFlow.Model.Task;

                //获取任务附件
                NFMT.WorkFlow.BLL.TaskAttachBLL taskAttachBLL = new NFMT.WorkFlow.BLL.TaskAttachBLL();
                result = taskAttachBLL.GetTaskAttachByTaskId(user, task.TaskId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                List<NFMT.WorkFlow.Model.TaskAttach> taskAttachs = result.ReturnValue as List<NFMT.WorkFlow.Model.TaskAttach>;
                if (taskAttachs == null && !taskAttachs.Any())
                    Response.Redirect(directURL);

                string aids = string.Empty;
                foreach (NFMT.WorkFlow.Model.TaskAttach taskAttach in taskAttachs)
                {
                    aids += taskAttach.AttachId + ",";
                }
                if (!string.IsNullOrEmpty(aids))
                    aids = aids.Substring(0, aids.Length - 1);

                //获取任务附件
                NFMT.Operate.BLL.AttachBLL attachBLL = new NFMT.Operate.BLL.AttachBLL();
                result = attachBLL.GetAttachByAttachIds(user, aids);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                attachs = result.ReturnValue as List<NFMT.Operate.Model.Attach>;
                if (attachs != null && attachs.Any())
                    hasAttachs = true;

                NFMT.WorkFlow.BLL.DataSourceBLL dataSourceBLL = new NFMT.WorkFlow.BLL.DataSourceBLL();
                result = dataSourceBLL.Get(user,task.DataSourceId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                NFMT.WorkFlow.Model.DataSource dataSource = result.ReturnValue as NFMT.WorkFlow.Model.DataSource;

                if (task != null)
                {
                    this.spTaskName.InnerText = task.TaskName;
                    NFMT.User.Model.Employee emp = NFMT.User.UserProvider.Employees.SingleOrDefault(a => a.EmpId == dataSource.EmpId);
                    if (emp != null)
                        this.spTaskApplyPerson.InnerText = emp.Name;
                    this.spTaskApplyTime.InnerText = dataSource.ApplyTime.ToString();
                    this.spTaskStatus.InnerText = task.TaskStatusName;
                    this.spTaskMemo.InnerText = task.ApplyMemo;

                    this.viewUrl = string.IsNullOrEmpty(dataSource.ViewUrl.Trim()) ? "#" : string.Format("{0}{1}", NFMT.Common.DefaultValue.NfmtSiteName, string.Format(dataSource.ViewUrl, dataSource.RowId));
                }
            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Utility.VerificationUtility ver = new Utility.VerificationUtility();
                //ver.JudgeOperate(this.Page, 22, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.查询 });

                NFMT.Common.UserModel user = NFMTSite.Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
                string directURL = string.Format("{0}WorkFlow/TaskList.aspx", NFMT.Common.DefaultValue.NfmtSiteName);

                this.navigation1.Routes.Add("待审核任务列表", directURL);
                this.navigation1.Routes.Add("待审核任务明细", string.Empty);

                int nodeId = 0;//taskNodeId
                if (nodeId == 0 && (string.IsNullOrEmpty(Request.QueryString["NodeId"]) || !int.TryParse(Request.QueryString["NodeId"], out nodeId)))
                    Response.Redirect(directURL);

                this.hidId.Value = nodeId.ToString();

                //获取任务节点
                NFMT.WorkFlow.BLL.TaskNodeBLL taskNodeBLL = new NFMT.WorkFlow.BLL.TaskNodeBLL();
                result = taskNodeBLL.Get(user, nodeId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                NFMT.WorkFlow.Model.TaskNode taskNode = result.ReturnValue as NFMT.WorkFlow.Model.TaskNode;
                if (taskNode == null || taskNode.TaskNodeId <= 0)
                    Response.Redirect(directURL);

                if (taskNode.NodeStatus != NFMT.Common.StatusEnum.待审核 || taskNode.EmpId != user.EmpId)
                    Response.Redirect(directURL);

                //获取节点
                NFMT.WorkFlow.BLL.NodeBLL nodeBLL = new NFMT.WorkFlow.BLL.NodeBLL();
                result = nodeBLL.Get(user, taskNode.NodeId);
                if (result.ResultStatus == 0)
                {
                    NFMT.WorkFlow.Model.Node node = result.ReturnValue as NFMT.WorkFlow.Model.Node;
                    if (node == null || node.NodeId <= 0)
                        Response.Redirect(directURL);

                    nodeType = node.NodeType;
                }

                //获取任务
                NFMT.WorkFlow.BLL.TaskBLL taskBLL = new NFMT.WorkFlow.BLL.TaskBLL();
                result = taskBLL.Get(user, taskNode.TaskId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                NFMT.WorkFlow.Model.Task task = result.ReturnValue as NFMT.WorkFlow.Model.Task;
                if (task == null || task.TaskId <= 0 || task.TaskStatus != NFMT.Common.StatusEnum.已生效)
                    Response.Redirect(directURL);

                //获取任务附件
                NFMT.WorkFlow.BLL.TaskAttachBLL taskAttachBLL = new NFMT.WorkFlow.BLL.TaskAttachBLL();
                result = taskAttachBLL.GetTaskAttachByTaskId(user, task.TaskId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                List<NFMT.WorkFlow.Model.TaskAttach> taskAttachs = result.ReturnValue as List<NFMT.WorkFlow.Model.TaskAttach>;
                if (taskAttachs == null && !taskAttachs.Any())
                    Response.Redirect(directURL);

                string aids = string.Empty;
                foreach (NFMT.WorkFlow.Model.TaskAttach taskAttach in taskAttachs)
                {
                    aids += taskAttach.AttachId + ",";
                }
                if (!string.IsNullOrEmpty(aids))
                    aids = aids.Substring(0, aids.Length - 1);

                //获取任务附件
                NFMT.Operate.BLL.AttachBLL attachBLL = new NFMT.Operate.BLL.AttachBLL();
                result = attachBLL.GetAttachByAttachIds(user, aids);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                attachs = result.ReturnValue as List<NFMT.Operate.Model.Attach>;
                if (attachs != null && attachs.Any())
                    hasAttachs = true;

                this.hidtaskId.Value = task.TaskId.ToString();

                //if (task.TaskStatus != NFMT.Common.StatusEnum.已生效)
                //    Response.Redirect(directURL);

                //获取数据源
                NFMT.WorkFlow.BLL.DataSourceBLL dataSourceBLL = new NFMT.WorkFlow.BLL.DataSourceBLL();
                result = dataSourceBLL.Get(user, task.DataSourceId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                dataSource = result.ReturnValue as NFMT.WorkFlow.Model.DataSource;
                if (dataSource == null || dataSource.SourceId <= 0)
                    Response.Redirect(directURL);

                //判断该任务节点是否需要操作,如有,则跳转到相应界面
                NFMT.WorkFlow.BLL.TaskOperateBLL taskOperateBLL = new NFMT.WorkFlow.BLL.TaskOperateBLL();
                result = taskOperateBLL.GetByTaskNodeId(user, taskNode.TaskNodeId);
                if (result.ResultStatus == 0)
                {
                    NFMT.WorkFlow.Model.TaskOperate taskOperate = result.ReturnValue as NFMT.WorkFlow.Model.TaskOperate;
                    try
                    {
                        Response.Redirect(string.Format(taskOperate.OperateUrl, dataSource.RowId.ToString(), taskNode.TaskNodeId));
                    }
                    catch (Exception ex)
                    {
                        this.WarmAlert(ex.Message, "#");
                    }
                }

                this.spTaskName.InnerText = task.TaskName;
                NFMT.User.Model.Employee emp = NFMT.User.UserProvider.Employees.FirstOrDefault(temp => temp.EmpId == dataSource.EmpId);
                if (emp != null)
                    this.spTaskApplyPerson.InnerText = emp.Name;
                this.spTaskApplyTime.InnerText = dataSource.ApplyTime.ToString();
                this.spTaskMemo.InnerText = task.TaskConnext;
                //this.spTaskStatus.InnerText = task.TaskStatusName;
                //this.spTaskFlowDesc.InnerText = task.FlowDescribtion;

                this.viewUrl = string.IsNullOrEmpty(dataSource.ViewUrl.Trim()) ? "#" : string.Format("{0}{1}", NFMT.Common.DefaultValue.NfmtSiteName, string.Format(dataSource.ViewUrl, dataSource.RowId));

                NFMT.Operate.AttachType attachType = attachBLL.GetAttachTypeByModel(new NFMT.Common.AuditModel() { TableName = dataSource.TableCode });
                attachTypeId = (int)attachType;
            }
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Utility.VerificationUtility ver = new Utility.VerificationUtility();
                //ver.JudgeOperate(this.Page, 22, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.查询 });

                NFMT.Common.UserModel user = NFMTSite.Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
                string directURL = string.Format("{0}WorkFlow/TaskList.aspx", NFMT.Common.DefaultValue.NfmtSiteName);

                this.navigation1.Routes.Add("待审核任务列表", directURL);
                this.navigation1.Routes.Add("待审核任务明细", string.Empty);

                int nodeId = 0;
                if (nodeId == 0 && (string.IsNullOrEmpty(Request.QueryString["NodeId"]) || !int.TryParse(Request.QueryString["NodeId"], out nodeId)))
                    Response.Redirect(directURL);

                this.hidId.Value = nodeId.ToString();

                NFMT.WorkFlow.BLL.TaskNodeBLL taskNodeBLL = new NFMT.WorkFlow.BLL.TaskNodeBLL();
                result = taskNodeBLL.Get(user, nodeId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                NFMT.WorkFlow.Model.TaskNode taskNode = result.ReturnValue as NFMT.WorkFlow.Model.TaskNode;
                if (taskNode == null || taskNode.TaskNodeId <= 0)
                    Response.Redirect(directURL);

                NFMT.WorkFlow.BLL.TaskBLL taskBLL = new NFMT.WorkFlow.BLL.TaskBLL();

                result = taskBLL.Get(user, taskNode.TaskId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                NFMT.WorkFlow.Model.Task task = result.ReturnValue as NFMT.WorkFlow.Model.Task;
                if (task == null || task.TaskId <= 0)
                    Response.Redirect(directURL);

                this.hidtaskId.Value = task.TaskId.ToString();

                if (task.TaskStatus != NFMT.Common.StatusEnum.已生效)
                    Response.Redirect(directURL);//跳至消息过期提醒页面

                NFMT.WorkFlow.BLL.DataSourceBLL dataSourceBLL = new NFMT.WorkFlow.BLL.DataSourceBLL();
                result = dataSourceBLL.Get(user, task.DataSourceId);
                if (result.ResultStatus != 0)
                    Response.Redirect(directURL);

                NFMT.WorkFlow.Model.DataSource dataSource = result.ReturnValue as NFMT.WorkFlow.Model.DataSource;
                if (dataSource == null || dataSource.SourceId <= 0)
                    Response.Redirect(directURL);

                this.spTaskName.InnerText = task.TaskName;
                NFMT.User.Model.Employee emp = NFMT.User.UserProvider.Employees.FirstOrDefault(temp => temp.EmpId == dataSource.EmpId);
                if (emp != null)
                    this.spTaskApplyPerson.InnerText = emp.Name;
                this.spTaskApplyTime.InnerText = dataSource.ApplyTime.ToString();
                this.spTaskMemo.InnerText = task.TaskConnext;
                //this.spTaskStatus.InnerText = task.TaskStatusName;
                //this.spTaskFlowDesc.InnerText = task.FlowDescribtion;

                this.viewUrl = string.IsNullOrEmpty(dataSource.ViewUrl.Trim()) ? "#" : string.Format("{0}{1}", NFMT.Common.DefaultValue.NfmtSiteName, string.Format(dataSource.ViewUrl, dataSource.RowId));
            }
        }