コード例 #1
0
        public static Salaryadjustment GetObject(Salaryadjustment o, FormCollection fc)
        {
            string staff_id = fc.Get("staff_id");

            string paramInc = fc.Get("inc");
            double inc = CommonHelper.GetValue<double>(paramInc);

            string paramMonth = fc.Get("month");
            int month = CommonHelper.GetValue<int>(paramMonth);

            string paramYear = fc.Get("year");
            int year = CommonHelper.GetValue<int>(paramYear);

            if (o == null)
                o = new Salaryadjustment();

            o.Staffid = staff_id;
            o.Inc = inc;
            o.Month = month;
            o.Year = year;

            return o;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: kenny007/Payroll_MVC4
        private static async Task CreateSalaryAdj(ISession se, string staffId)
        {
            Random r = new Random();

            await Task.Run(() =>
                {
                    for (int y = 2001; y <= DateTime.Now.Year; y++)
                    {
                        int x = r.Next(50, 90);
                        Salaryadjustment o = new Salaryadjustment { Staffid = staffId, Inc = x, Month = 1, Year = y };
                        se.SaveOrUpdate(o);
                    }
                });
        }