Esempio n. 1
0
        private static bool ValidateEmployee(EmpBEntity employee)
        {
            PropertyInfo[] properties = employee.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
            foreach (PropertyInfo property in properties)
            {
                object[] customAtt = property.GetCustomAttributes(typeof(IAttributes), true);

                foreach (object att in customAtt)
                {
                    IAttributes valAtt = (IAttributes)att;
                    if (valAtt == null)
                    {
                        continue;
                    }

                    if (valAtt.IsValid(property.GetValue(employee, null)))
                    {
                        continue;
                    }
                    ErrorMessage error = new ErrorMessage(property.Name, valAtt.message);
                    employee.ErrorList.Add(error);
                }
            }

            return(employee.ErrorList.Count == 0);
        }
Esempio n. 2
0
 public decimal mCalcGross(EmpBEntity entobj)
 {
     _hra   = (entobj.BASIC) * (decimal)(0.30);
     _da    = (entobj.BASIC) * (decimal).40;
     _gross = entobj.BASIC + _hra + _da;
     return(_gross);
 }
Esempio n. 3
0
 public decimal mCalcNet(EmpBEntity entobj)
 {
     _net = _gross - _pf;
     return(_net);
 }
Esempio n. 4
0
 public decimal mCalcPF(EmpBEntity entobj)
 {
     _pf = (entobj.BASIC) * (decimal).12;
     return(_pf);
 }