public void Add(SsqNumbers item) { if (string.IsNullOrEmpty(item.Id)) { item.Id = Common.GetId(); } SsqNumbersDAL.GetInstance().Insert(item); }
//通过期号获取 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); }
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); }
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)); }
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 }); }