public static Payrate GetObject(Payrate o, FormCollection fc) { string staff_id = fc.Get("staff_id"); string paramMonth = fc.Get("month"); int month = CommonHelper.GetValue<int>(paramMonth); string paramYear = fc.Get("year"); int year = CommonHelper.GetValue<int>(paramYear); string paramPayRate = fc.Get("pay_rate"); double hourlyPayRate = CommonHelper.GetValue<double>(paramPayRate); if (o == null) o = new Payrate(); o.Staffid = staff_id; o.Month = month; o.Year = year; o.Hourlypayrate = hourlyPayRate; return o; }
private static async Task CreatePayRate(ISession se, string staffId) { Random r = new Random(); await Task.Run(() => { for (int y = 2000; y <= DateTime.Now.Year; y++) { for (int m = 1; m <= 12; m++) { int x = r.Next(12, 18); Payrate p = new Payrate { Staffid = staffId, Month = m, Year = y, Hourlypayrate = x }; se.SaveOrUpdate(p); } } }); }