private PaymentPeriod GetPeriod(DataClassesDataContext context) { var result = context.PaymentPeriods.FirstOrDefault(x => x.Year == ShowYear && x.Month == ShowMonth); if (result == null) { result = new PaymentPeriod { Year = ShowYear, Month = ShowMonth }; context.PaymentPeriods.InsertOnSubmit(result); context.SubmitChanges(); } return(result); }
private PaymentPeriod GetPeriod(DataClassesDataContext context) { var result = context.PaymentPeriods.FirstOrDefault(x => x.Year == ShowYear && x.Month == ShowMonth); if (result == null) { result = new PaymentPeriod { Year = ShowYear, Month = ShowMonth }; context.PaymentPeriods.InsertOnSubmit(result); context.SubmitChanges(); } return result; }
partial void DeletePaymentPeriod(PaymentPeriod instance);
partial void UpdatePaymentPeriod(PaymentPeriod instance);
partial void InsertPaymentPeriod(PaymentPeriod instance);