Esempio n. 1
0
        public static int InsDObject(DObject _param)
        {
            int result = -1;

            _param.CreateUs = 1;
            if (_param.BPolicyOID == null)
            {
                _param.BPolicyOID = BPolicyRepository.SelBPolicy(new BPolicy {
                    Type = _param.Type
                }).First().OID;
            }

            if (_param.Revision == null)
            {
                BPolicy tmpBPolicy = BPolicyRepository.SelBPolicy(new BPolicy {
                    OID = _param.BPolicyOID
                }).First();
                if (tmpBPolicy.IsRevision != null && tmpBPolicy.IsRevision.Equals("Y"))
                {
                    _param.TdmxOID = DObjectRepository.SelTdmxOID(new DObject {
                        Type = _param.Type
                    });
                    _param.Revision = CommonConstant.REVISION_PREFIX + CommonConstant.INIT_REVISION;
                }
            }

            _param.IsLatest         = 1;
            _param.IsReleasedLatest = 0;
            result = DaoFactory.SetInsert("Comm.InsDObject", _param);
            return(result);
        }
Esempio n. 2
0
        public static List <Dictionary <string, string> > SelActionProgram(BPolicy _param)
        {
            BPolicy policy = DaoFactory.GetData <BPolicy>("Comm.SelBPolicy", _param);

            if (policy.ActionProgram == null || policy.ActionProgram.Length < 1)
            {
                return(null);
            }

            List <Dictionary <string, string> > lDActionProgram = new List <Dictionary <string, string> >();

            policy.ActionProgram.Split(',').ToList().ForEach(prog =>
            {
                Dictionary <string, string> tmp = new Dictionary <string, string>();
                string[] splitProg = prog.Split(':');
                tmp.Add(CommonConstant.POLICY_TRIGGER_CLASS, splitProg[0]);
                tmp.Add(CommonConstant.POLICY_TRIGGER_FUNCTION, splitProg[1]);
                lDActionProgram.Add(tmp);
            });
            return(lDActionProgram);
        }
Esempio n. 3
0
 public static List <BPolicy> SelBPolicy(BPolicy _param)
 {
     return(DaoFactory.GetList <BPolicy>("Comm.SelBPolicy", _param).OrderBy(d => d.StatusOID).ToList());
 }