Пример #1
0
        public void AddDoTaskRule(T_WF_DOTASKRULE rule)
        {
            try
            {              
                string insSql = "INSERT INTO T_WF_DOTASKRULE (DOTASKRULEID,COMPANYID,SYSTEMCODE,SYSTEMNAME,MODELCODE,MODELNAME,TRIGGERORDERSTATUS,CREATEDATETIME) VALUES (:DOTASKRULEID,:COMPANYID,:SYSTEMCODE,:SYSTEMNAME,:MODELCODE,:MODELNAME,:TRIGGERORDERSTATUS,:CREATEDATETIME)";
                OracleParameter[] pageparm =
                {               
                    new OracleParameter(":DOTASKRULEID",OracleType.NVarChar,200), 
                    new OracleParameter(":COMPANYID",OracleType.NVarChar,100), 
                    new OracleParameter(":SYSTEMCODE",OracleType.NVarChar,100), 
                    new OracleParameter(":SYSTEMNAME",OracleType.NVarChar,100), 
                    new OracleParameter(":MODELCODE",OracleType.NVarChar,100), 
                    new OracleParameter(":MODELNAME",OracleType.NVarChar,100), 
                    new OracleParameter(":TRIGGERORDERSTATUS",OracleType.Number,22), 
                    new OracleParameter(":CREATEDATETIME",OracleType.DateTime) 

                };
                pageparm[0].Value = GetValue(rule.DOTASKRULEID);//待办规则主表ID
                pageparm[1].Value = GetValue(rule.COMPANYID);//公司ID
                pageparm[2].Value = GetValue(rule.SYSTEMCODE);//系统代码
                pageparm[3].Value = GetValue(rule.SYSTEMNAME);//系统名称
                pageparm[4].Value = GetValue(rule.MODELCODE);//模块代码
                pageparm[5].Value = GetValue(rule.MODELNAME);//模块名称
                pageparm[6].Value = GetValue(rule.TRIGGERORDERSTATUS);//触发条件的单据状态
                pageparm[7].Value = GetValue(DateTime.Now);//创建日期时间

                dal.ExecuteSql(insSql, pageparm);
              
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Пример #2
0
 public string EditDoTaskRule(T_WF_DOTASKRULE entity)
 {
     try
     {
         if (doTaskbll.GetBool(entity))
         {
             doTaskbll.EditDoTaskRule(entity);
         }
         else
         {
             return "2";
         }
         return "1";
     }
     catch (Exception ex)
     {
         return ex.Message;
     }
 }
Пример #3
0
        public void EditDoTaskRule(T_WF_DOTASKRULE rule)
        {
            try
            {

                //string sql = " update  T_WF_DOTASKRULE set COMPANYID='" + rule.COMPANYID + "',SYSTEMCODE='" + rule.SYSTEMCODE + "',SYSTEMNAME='" + rule.SYSTEMNAME + "',";
                //sql += "MODELCODE='" + rule.MODELCODE + "',MODELNAME='" + rule.MODELNAME + "',TRIGGERORDERSTATUS=" + rule.TRIGGERORDERSTATUS + "";
                //sql += " where DOTASKRULEID='" + rule.DOTASKRULEID + "'";
                //dal.ExecuteSql(sql);

                string updSql = "UPDATE T_WF_DOTASKRULE SET COMPANYID=:COMPANYID,SYSTEMCODE=:SYSTEMCODE,SYSTEMNAME=:SYSTEMNAME,MODELCODE=:MODELCODE,MODELNAME=:MODELNAME,TRIGGERORDERSTATUS=:TRIGGERORDERSTATUS WHERE   DOTASKRULEID=:DOTASKRULEID";
                OracleParameter[] pageparm =
                {               
                    new OracleParameter(":DOTASKRULEID",OracleType.NVarChar,200), 
                    new OracleParameter(":COMPANYID",OracleType.NVarChar,100), 
                    new OracleParameter(":SYSTEMCODE",OracleType.NVarChar,100), 
                    new OracleParameter(":SYSTEMNAME",OracleType.NVarChar,100), 
                    new OracleParameter(":MODELCODE",OracleType.NVarChar,100), 
                    new OracleParameter(":MODELNAME",OracleType.NVarChar,100), 
                    new OracleParameter(":TRIGGERORDERSTATUS",OracleType.Number,22) 

                };
                pageparm[0].Value = GetValue(rule.DOTASKRULEID);//待办规则主表ID
                pageparm[1].Value = GetValue(rule.COMPANYID);//公司ID
                pageparm[2].Value = GetValue(rule.SYSTEMCODE);//系统代码
                pageparm[3].Value = GetValue(rule.SYSTEMNAME);//系统名称
                pageparm[4].Value = GetValue(rule.MODELCODE);//模块代码
                pageparm[5].Value = GetValue(rule.MODELNAME);//模块名称
                pageparm[6].Value = GetValue(rule.TRIGGERORDERSTATUS);//触发条件的单据状态
                dal.ExecuteSql(updSql, pageparm);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Пример #4
0
 public bool GetBool(T_WF_DOTASKRULE rule)
 {
     string sql = "select * from T_WF_DOTASKRULE where COMPANYID='" + rule.COMPANYID + "' and SYSTEMCODE='" + rule.SYSTEMCODE + "' and MODELCODE='" + rule.MODELCODE + "' and TRIGGERORDERSTATUS='" + rule.TRIGGERORDERSTATUS + "'";
     sql += " and  DOTASKRULEID!='" + rule.DOTASKRULEID + "'";
     if (dal.GetDataTable(sql).Rows.Count > 0)
     {
         return false;
     }
     return true;
 }
Пример #5
0
        //自动触发规则定义
        public IQueryable<V_DotaskRule> GetListFlowTrigger(string filterString, int pageIndex, int pageSize, ref int pageCount)
        {
            try
            {
                string sql = string.Empty;
                if (filterString != null && filterString != "")
                {
                    sql = "SELECT * FROM T_WF_DOTASKRULEDETAIL where " + filterString;
                }
                else
                {
                    sql = "SELECT * FROM T_WF_DOTASKRULEDETAIL";
                }

                DataTable dtTriggerDefine = dao.GetDataTable(sql);

                var items = ToList<T_WF_DOTASKRULEDETAIL>(dtTriggerDefine).AsQueryable();

                if (filterString != null && filterString != "")
                {
                    sql = "SELECT * FROM T_WF_DOTASKRULE where " + filterString;
                }
                else
                {
                    sql = "SELECT * FROM T_WF_DOTASKRULE";
                }

                DataTable dtTriggerDefines = dao.GetDataTable(sql);

                var itemes = ToList<T_WF_DOTASKRULE>(dtTriggerDefines).OrderBy(s=>s.MODELNAME);
                List<V_DotaskRule> Dotaskrule = new List<V_DotaskRule>();
                foreach (var item in items)
                {
                    T_WF_DOTASKRULE rule = new T_WF_DOTASKRULE();
                    rule = itemes.Where(p => p.DOTASKRULEID == item.DOTASKRULEID).FirstOrDefault();
                    rule.DOTASKRULEDETAIL = null;
                    if (rule != null)
                    {
                        Dotaskrule.Add(new V_DotaskRule {
                        DOTASKRULE = rule,
                        DOTASKRULEDETAIL = item
                        });
                    }
                }
                Dotaskrule = Pager<V_DotaskRule>(Dotaskrule.AsQueryable(), pageIndex, pageSize, ref pageCount).ToList();
                return Dotaskrule.AsQueryable();
            }
            catch
            {
                return null;
            }
        }
Пример #6
0
        //自动触发规则定义
        public IQueryable<V_DotaskRule> GetFlowTrigger(string filterString)
        {
            try
            {
                string sql = string.Empty;
                string detailID = string.Empty;
                if (filterString != null && filterString != "")
                {
                    sql = "SELECT * FROM T_WF_DOTASKRULE where " + filterString;
                }
                else
                {
                    sql = "SELECT * FROM T_WF_DOTASKRULE";
                }

                DataTable dtTriggerDefine = dao.GetDataTable(sql);
                var items = ToList<T_WF_DOTASKRULE>(dtTriggerDefine).AsQueryable();
                if (items.Count() > 0)
                {
                    foreach (var item in items)
                    {
                        if (detailID == "")
                        {
                            detailID = "('" + item.DOTASKRULEID + "'";
                        }
                        else
                        {
                            detailID += ",'" + item.DOTASKRULEID + "'";
                        }
                    }
                    detailID += ")";
                }
                List<V_DotaskRule> Dotaskrule = new List<V_DotaskRule>();
                if (detailID != "")
                {
                    string strSqls = "SELECT * FROM T_WF_DOTASKRULEDETAIL where DOTASKRULEID in" + detailID;
                    DataTable dtTriggerDefines = dao.GetDataTable(strSqls);

                    var itemes = ToList<T_WF_DOTASKRULEDETAIL>(dtTriggerDefines).AsQueryable();

                    foreach (var item in itemes)
                    {
                        T_WF_DOTASKRULE rule = new T_WF_DOTASKRULE();
                        rule = items.Where(p => p.DOTASKRULEID == item.DOTASKRULEID).FirstOrDefault();
                        rule.DOTASKRULEDETAIL = null;
                        if (rule != null)
                        {
                            Dotaskrule.Add(new V_DotaskRule {
                            DOTASKRULE = rule,
                            DOTASKRULEDETAIL = item
                            });
                        }
                    }
                }
                return Dotaskrule.AsQueryable();
            }
            catch
            {
                return null;
            }
        }