Example #1
0
 public void Add(SsqNumbers item)
 {
     if (string.IsNullOrEmpty(item.Id))
     {
         item.Id = Common.GetId();
     }
     SsqNumbersDAL.GetInstance().Insert(item);
 }
Example #2
0
        //通过期号获取
        public SsqNumbers GetByQh(string qh)
        {
            if (string.IsNullOrEmpty(qh))
            {
                return(null);
            }

            List <SsqNumbers> list = SsqNumbersDAL.GetInstance().Select(null, new SsqNumbers.Field[] { SsqNumbers.Field.Qh }, new object[] { qh });

            if (list.Count > 0)
            {
                return(list[0]);
            }
            return(null);
        }
Example #3
0
        public SsqNumbers GetById(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(null);
            }

            List <SsqNumbers> list = SsqNumbersDAL.GetInstance().Select(null, new SsqNumbers.Field[] { SsqNumbers.Field.Id }, new object[] { id });

            if (list.Count > 0)
            {
                return(list[0]);
            }
            return(null);
        }
Example #4
0
        public List <SsqNumbers> GetList(string start, string end)
        {
            List <QueryCondition> qcList = new List <QueryCondition>();
            QueryCondition        qc;

            if (!string.IsNullOrEmpty(start) || !string.IsNullOrEmpty(end))
            {
                qc            = new QueryCondition();
                qc.Type       = QueryCondition.ConditionType.Range;
                qc.FieldIndex = (int)SsqNumbers.Field.SsqDate;
                if (!string.IsNullOrEmpty(start))
                {
                    qc.LowerEqual = true;
                    qc.LowerBound = Common.ToDateTime(start);
                }
                if (!string.IsNullOrEmpty(end))
                {
                    qc.UpperEqual = true;
                    qc.UpperBound = Common.ToDateTime(end);
                }
                qcList.Add(qc);
            }
            return(SsqNumbersDAL.GetInstance().Select(null, qcList, new SsqNumbers.Field[] { SsqNumbers.Field.SsqDate }, false));
        }
Example #5
0
 public void Update(SsqNumbers item)
 {
     SsqNumbersDAL.GetInstance().Update(item, new SsqNumbers.Field[] { SsqNumbers.Field.NumBlue7, SsqNumbers.Field.NumRed1,
                                                                       SsqNumbers.Field.NumRed2, SsqNumbers.Field.NumRed3, SsqNumbers.Field.NumRed4, SsqNumbers.Field.NumRed5, SsqNumbers.Field.NumRed6,
                                                                       SsqNumbers.Field.Qh, SsqNumbers.Field.SsqDate }, new SsqNumbers.Field[] { SsqNumbers.Field.Id });
 }