public static decimal GetWeightByType(string type) { var obj = new AutoAmountTypes(); foreach (var t in obj.Types) { if (t.Equals("Specified Amount")) { return(0); } else if (t.Equals("Per Day Salary")) { return(1); } else if (t.Equals("Half Day Salary")) { return(Convert.ToDecimal(0.5)); } else if (t.Equals("Quarter Day Salary")) { return(Convert.ToDecimal(0.25)); } else if (t.Equals("Two Days Salary")) { return(2); } } return(0); }
private static decimal GetOvertimeAmountByType(string type, decimal dailySalary, decimal specialAmount) { var weight = AutoAmountTypes.GetWeightByType(type); if (type.Equals("Specified Amount")) { return(specialAmount); } else { return(dailySalary * weight); } }