Example #1
0
 public Executive(string firstname, string lastname, DateTime DOB, float currPay, string ssn, int numbOfOpts = 10000, ExecTitle title = ExecTitle.VP)
     : base(firstname, lastname, DOB, currPay, ssn, numbOfOpts)
 {
     // Title defined by the Executive class.
     Title       = title;
     empBenefits = new GoldBenefitPackage();
 }
Example #2
0
        new public static object SpareAddPropConvert(object obj, int id)
        {
            if (id == 1)
            {
                if (obj is int)
                {
                    return(obj);
                }
                else if (obj is string)
                {
                    string s = (string)obj;
                    int    value;

                    if (int.TryParse(s, out value))
                    {
                        return(value);
                    }
                }
            }
            if (id == 2)
            {
                if (obj is int)
                {
                    return((ExecTitle)obj);
                }
                else if (obj is string)
                {
                    string    s = (string)obj;
                    ExecTitle value;

                    if (ExecTitle.TryParse(s, out value))
                    {
                        return(value);
                    }
                }
            }

            // Not a valid value
            return(null);
        }