private void Form1_Load(object sender, EventArgs e) { using (AccountsDataContext obj = new AccountsDataContext()) { obj.UpdateFiscalYearOnlogin(DateTime.Now.AddDays(1)); } }
public static void UpdateFiscalYearForLogin() { using (AccountsDataContext obj = new AccountsDataContext()) { try { obj.UpdateFiscalYearOnlogin(DateTime.Now.AddDays(1)); } catch (Exception) { throw; } } }