public CodeRule queryRuleByCond(string cusNo, string delMatno, string boundType)
        {
            CodeRule codeRule = null;
            CusRule  cusRule  = cusRuleDao.queryCusRuleByConds(cusNo, delMatno, boundType);

            if (cusRule != null)
            {
                codeRule = codeRuleDao.queryRuleById(cusRule.Ruleno);
            }

            return(codeRule);
        }
        public string saveRuleInfo(CodeRule codeRule)
        {
            bool   mark   = false;
            string ruleNo = null;

            codeRule.Uuid       = Auxiliary.Get_UUID();
            codeRule.Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            codeRule.Opuser     = Auxiliary.loginName;
            if (codeRuleDao.saveCodeRule(codeRule))
            {
                ruleNo = codeRuleDao.queryRuleByID(codeRule.Uuid);
                foreach (RuleItem item in codeRule.RuleItem)
                {
                    item.Uuid       = Auxiliary.Get_UUID();
                    item.Ruleno     = ruleNo;
                    item.Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    item.Opuser     = Auxiliary.loginName;
                    mark            = codeRuleDao.saveSaveRuleItem(item);
                }
            }
            return(ruleNo);
        }