Esempio n. 1
0
        public ContentResult SaveApplyType(string jsonString)
        {
            AjaxResult res = new AjaxResult();

            try
            {
                WF_ApplyType role   = jsonString.ToObject <WF_ApplyType>();
                WF_ApplyType entity = applytypebll.getByID(role.ID);
                if (entity != null)
                {
                    role.UpdateTime     = DateTime.Now;
                    role.UpdateUserCode = getCurrent().UserCode;
                    role.CreateTime     = entity.CreateTime;
                    role.CreateUserCode = entity.CreateUserCode;
                    applytypebll.update(role);
                }
                else
                {
                    role.UpdateTime     = DateTime.Now;
                    role.UpdateUserCode = getCurrent().UserCode;
                    role.CreateTime     = DateTime.Now;
                    role.CreateUserCode = getCurrent().UserCode;
                    applytypebll.save(role);
                }
                res.code = ResultCode.OK;
            }
            catch (Exception ex)
            {
                res.code    = ResultCode.ERROR;
                res.message = "保存失败";
            }
            return(Content(res.ToJson()));
        }
Esempio n. 2
0
        private static FlowNode GetNodeByNodeType(string tmpkey, string nodeKey)
        {
            WF_TemplateNode node = nodebll.getByNodeKey(tmpkey, nodeKey);
            FlowNode        flo  = null;

            if (node.NodeType == (int)WFNodeType.BeginNode)
            {
                flo = new BeginNode();
            }
            if (node.NodeType == (int)WFNodeType.EndNode)
            {
                flo = new EndNode();
            }
            if (node.NodeType == (int)WFNodeType.Normal)
            {
                if (node.ProcessType == (int)WFProcessType.User)
                {
                    flo = new UserNode();
                }
                if (node.ProcessType == (int)WFProcessType.Role)
                {
                    flo = new RoleNode();
                }
                if (node.ProcessType == (int)WFProcessType.Custom)
                {
                    WF_ApplyType apply    = applytypebll.getByCode(node.ProcessTypeValue);
                    Assembly     assembly = Assembly.GetExecutingAssembly();
                    dynamic      obj      = assembly.CreateInstance(apply.ClassName);
                    flo = (FlowNode)obj;
                }
            }
            return(flo);
        }
Esempio n. 3
0
 public bool update(WF_ApplyType entity)
 {
     using (IDbConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["wfdb"].ToString()))
     {
         conn.Open();
         return(conn.Update <WF_ApplyType>(entity));
     }
 }
Esempio n. 4
0
 public bool save(WF_ApplyType entity)
 {
     using (IDbConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["wfdb"].ToString()))
     {
         conn.Open();
         conn.Insert <WF_ApplyType>(entity);
         return(true);
     }
 }
Esempio n. 5
0
 public bool del(int id)
 {
     using (IDbConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["wfdb"].ToString()))
     {
         conn.Open();
         WF_ApplyType Role = conn.Get <WF_ApplyType>(id);
         Role.IsDelete = 1;
         return(conn.Update <WF_ApplyType>(Role));
     }
 }
Esempio n. 6
0
        public ContentResult UpdateApplyTypeState(int id, int state)
        {
            AjaxResult res = new AjaxResult();

            try
            {
                WF_ApplyType entity = applytypebll.getByID(id);
                if (entity != null)
                {
                    entity.State = state;
                    applytypebll.update(entity);
                }
                res.code    = ResultCode.OK;
                res.message = "更新状态成功";
            }
            catch (Exception ex)
            {
                res.code    = ResultCode.ERROR;
                res.message = "更新状态失败";
            }
            return(Content(res.ToJson()));
        }
Esempio n. 7
0
        public ContentResult getApplyTypeByID(int id)
        {
            AjaxResult res = new AjaxResult();

            try
            {
                WF_ApplyType role = applytypebll.getByID(id);
                if (role == null)
                {
                    role       = new WF_ApplyType();
                    role.ID    = id;
                    role.State = 1;
                }
                res.code = ResultCode.OK;
                res.data = role;
            }
            catch (Exception ex)
            {
                res.code    = ResultCode.ERROR;
                res.message = "获取流程模板信息失败";
            }
            return(Content(res.ToJson()));
        }
Esempio n. 8
0
 public bool update(WF_ApplyType entity)
 {
     return(dao.update(entity));
 }
Esempio n. 9
0
 public bool save(WF_ApplyType entity)
 {
     return(dao.save(entity));
 }