Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="idx">idx: 1 -> n</param>
 /// <param name="shearInfo"></param>
 public void setShearingTag(int idx, TShearByTag shearInfo)
 {
     if (idx <= shearing.shear_by_tag.Length)
     {
         shearing.shear_by_tag[idx - 1].tagNo = shearInfo.tagNo;
         shearing.shear_by_tag[idx - 1].doy   = shearInfo.doy;
     }
 }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="idx">idx: 1 -> n</param>
        /// <param name="shearInfo"></param>
        /// <returns></returns>
        public bool getShearingTag(int idx, ref TShearByTag shearInfo)
        {
            bool result = false;

            if (idx <= shearing.shear_by_tag.Length)
            {
                TShearByTag tagItem = shearing.shear_by_tag[idx - 1];
                shearInfo.tagNo = tagItem.tagNo;
                shearInfo.doy   = tagItem.doy;
                result          = true;
            }
            return(result);
        }
Beispiel #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="idx">idx: 1 -> n</param>
 /// <param name="shearInfo"></param>
 public void setShearingTag(int idx, TShearByTag shearInfo)
 {
     if (idx <= shearing.shear_by_tag.Length)
     {
         shearing.shear_by_tag[idx - 1].tagNo = shearInfo.tagNo;
         shearing.shear_by_tag[idx - 1].doy = shearInfo.doy;
     }
 }
Beispiel #4
0
        /// <summary>
        /// Execute on any of the shearing dates
        /// Shears all on a single date OR each specified tagged group on it's day of year.
        /// </summary>
        /// <param name="currentDay"></param>
        /// <param name="curEnt"></param>
        protected void manageShearing(int currentDay, TEnterpriseInfo curEnt)
        {
            int idx, g;
            TShearByTag shearInfo = new TShearByTag();

            if (curEnt.ShearingTagCount == 0)
            {
                if (curEnt.ShearingDate == currentDay)          //if shear all
                {
                    //only shear the groups in this enterprise
                    g = 1;
                    while (g <= Count())                       //for each group
                    {
                        if (curEnt.ContainsTag(getTag(g)))       //if this group belongs to this ent
                        {
                            Shear(g, true, true);                  //shear this group
                        }
                        g++;
                    }
                }
            }
            else //shear each group on it's specified day
            {
                for (idx = 1; idx <= curEnt.ShearingTagCount; idx++)
                {
                    curEnt.getShearingTag(idx, ref shearInfo);
                    if (shearInfo.doy == currentDay)
                    {
                        if (curEnt.ContainsTag(shearInfo.tagNo))         //if this tag belongs to this ent
                        {
                            g = 1;
                            while (g <= Count())                       //for each group
                            {
                                if (getTag(g) == shearInfo.tagNo)         //if this group matches the tag
                                {
                                    Shear(g, true, true);                  //shear this group
                                }
                                g++;
                            }
                        }
                    }
                }
            }
        }
Beispiel #5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="idx">idx: 1 -> n</param>
 /// <param name="shearInfo"></param>
 /// <returns></returns>
 public bool getShearingTag(int idx, ref TShearByTag shearInfo)
 {
     bool result = false;
     if (idx <= shearing.shear_by_tag.Length)
     {
         TShearByTag tagItem = shearing.shear_by_tag[idx - 1];
         shearInfo.tagNo = tagItem.tagNo;
         shearInfo.doy = tagItem.doy;
         result = true;
     }
     return result;
 }