private static Consent.CustomsProcess GetCustomsProcess(CustomsProcess process) { Consent.CustomsProcess _ret = default(Consent.CustomsProcess); switch (process) { case CustomsProcess.ipr: _ret = Consent.CustomsProcess.ipr; break; case CustomsProcess.cw: _ret = Consent.CustomsProcess.cw; break; } return(_ret); }
internal static Consent DefaultConsent(Entities edc, CustomsProcess process, string number) { int _defPeriod = 360; DateTime _defDate = DateTime.Today.Date; Consent _ret = new Consent() { ConsentDate = _defDate, ConsentPeriod = _defPeriod / 30, IsIPR = process == CustomsProcess.ipr, Title = String.Format("{0}", number.NotAvailable()), ValidFromDate = _defDate, ValidToDate = _defDate + TimeSpan.FromDays(_defPeriod) }; edc.Consent.InsertOnSubmit(_ret); edc.SubmitChanges(); return(_ret); }