/// <summary>
        /// 获取第parityNum胎次的日产奶list
        /// </summary>
        /// <param name="earNum">耳号</param>
        /// <param name="parityNum">第胎次,从1开始计算</param>
        /// <returns></returns>
        public List <IndividualProdcutionTotal> GetIndividualDayProdcutionList(int earNum, int parityNum)
        {
            DateTime startDate, endDate;

            CowInfo cowInfo = new CowInfo(earNum);
            int     parity  = cowInfo.Parity;
            //ORDER BY D.Birthday DESC 降序的
            List <Calving> calvingList = CowInfo.GetCowCalvingRecords(earNum);

            if (parityNum > parity | parityNum < 1)
            {
                throw new ArgumentException("此牛仅有" + parity.ToString() + "个胎次,不能有此记录");
            }
            else
            {
                startDate = calvingList[parity - parityNum].Birthday.Date;
                if (parityNum < parity)
                {
                    endDate = calvingList[parity - parityNum + 1].Birthday.Date;
                }
                else
                {
                    //最后一胎
                    endDate = DateTime.Now.Date;
                }
            }
            return(GetIndividualDayProdcutionList(earNum, startDate, endDate));
        }
Esempio n. 2
0
 public CowInfo(Cow cow)
 {
     myCow            = cow;
     this.earNum      = cow.EarNum;
     this.calvingList = CowInfo.GetCowCalvingRecords(this.earNum);
     this.dryMilkList = CowInfo.GetDryMilkRecords(this.earNum);
     this.parity      = this.calvingList.Count;
 }
Esempio n. 3
0
        public CowInfo(int earNum)
        {
            CowBLL cb = new CowBLL();

            this.earNum      = earNum;
            myCow            = cb.GetCowInfo(earNum);
            this.calvingList = CowInfo.GetCowCalvingRecords(earNum);
            this.dryMilkList = CowInfo.GetDryMilkRecords(earNum);
            this.parity      = this.calvingList.Count;
        }