Пример #1
0
        public MorphBLL FindMorphByID(int MorphID)
        {
            MorphBLL rv  = null;
            MorphDAL dal = ctx.FindMorphByID(MorphID);

            if (dal != null)
            {
                rv = new MorphBLL(dal);
            }
            return(rv);
        }
 {                                                     //Iequatable allows the creation of a custom "Equality" becaue i am comparing morphnames to see if they are equal based on their name
     public MorphPlusBLL(MorphBLL one, MorphBLL two)   //all the percentages are calculated in this constructor
     {
         // one will never be null(normal), it can only be truebreed or het
         // two can be null(normal) or truebreed or het
         MorphName = one.MorphName;
         Het       = one.Het;
         MorphOne  = one;
         MorphTwo  = two;
         // two is null = normal
         if (two == null)
         {
             // het to normal
             if (one.Het)
             {
                 PercentNormal = 50;
                 PercentHet    = 50;
                 PercentTrue   = 0;
             }
             // truebreed to normal
             else
             {
                 PercentNormal = 0;
                 PercentHet    = 100;
                 PercentTrue   = 0;
             }
         }
         else if (one.Het == two.Het)
         {
             // het to het
             if (one.Het)
             {
                 PercentNormal = 25;
                 PercentHet    = 50;
                 PercentTrue   = 25;
             }
             // truebreed to truebreed
             else
             {
                 PercentNormal = 0;
                 PercentHet    = 0;
                 PercentTrue   = 100;
             }
         }
         else
         // het to truebreed (or truebreed to het)
         {
             PercentNormal = 0;
             PercentHet    = 50;
             PercentTrue   = 50;
         }
     }