Esempio n. 1
0
        public override bool ApproveMaterial(Material material, ref string reason)
        {
            bool isValid = true;

            if (string.IsNullOrWhiteSpace(material.DrawingNumber))
            {
                isValid = false;
                reason  = "There is no drawing for this material";
            }

            if (string.IsNullOrWhiteSpace(material.PartNumber))
            {
                isValid = false;
                reason  = "There is no part number for this material";
            }

            if (isValid)
            {
                if (NextApprover != null)
                {
                    return(NextApprover.ApproveMaterial(material, ref reason));
                }
            }

            return(isValid);
        }
Esempio n. 2
0
 public override bool ApproveMaterial(Material material, ref string reason)
 {
     if (material.Budget < 100000)
     {
         if (NextApprover != null)
         {
             NextApprover.ApproveMaterial(material, ref reason);
         }
         return(true);
     }
     else
     {
         reason = "No bugdet!";
         return(false);
     }
 }
Esempio n. 3
0
 public override bool ApproveMaterial(Material material, ref string reason)
 {
     if (material.Budget < 100000)
     {
         if (NextApprover != null)
         {
             // finance may be the end of the chain, but this allows changes later
             NextApprover.ApproveMaterial(material, ref reason);
         }
         return(true);
     }
     else
     {
         reason = "This is way too much - find another way!";
         return(false);
     }
 }
Esempio n. 4
0
 public override bool ApproveMaterial(Material material, ref string reason)
 {
     if (material.Budget < 10000)
     {
         return(true);
     }
     else if (material.Budget < 100000)
     {
         if (NextApprover != null)
         {
             return(NextApprover.ApproveMaterial(material, ref reason));
         }
         return(true);
     }
     else
     {
         reason = "This is way too much - find another way!";
         return(false);
     }
 }
 public override bool ApproveMaterial(Material material, ref string reason)
 {
     if (material.Budget < 10000)
     {
         // purchasing can approve anything under $10k
         return(true);
     }
     else if (material.Budget < 100000)
     {
         // for up to $100k, finance needs to approve
         if (NextApprover != null)
         {
             return(NextApprover.ApproveMaterial(material, ref reason));
         }
         return(true);
     }
     else
     {
         reason = "This is way too much - find another way!";
         return(false);
     }
 }