public static async IAsyncEnumerable <SpectrumLLI> GetLLISpectraForSampleSetAsync(string SetKey, IrradiationType type, CancellationToken ct) { var sks = SetKey.Split('-'); using (var ssc = new RegataContext()) { var lliSpectras = ssc.LLISpectra.FromSqlRaw("exec FormLLIFilesList @countryCode, @clientid, @year, @setnum, @setind, @type", new SqlParameter("countrycode", sks[0]), new SqlParameter("clientid", sks[1]), new SqlParameter("year", sks[2]), new SqlParameter("setnum", sks[3]), new SqlParameter("setind", sks[4]), new SqlParameter("type", IrradiationTypeMap[type])).AsAsyncEnumerable().WithCancellation(ct); await foreach (var spectraInfo in lliSpectras) { yield return(spectraInfo); } } }
public static async Task <List <SpectrumLLI> > GetLLISpectraForSampleSetAsync(string SetKey, IrradiationType type, CancellationToken ct) { var sks = SetKey.Split('-'); using (var ssc = new RegataContext()) { return(await ssc.LLISpectra.FromSqlRaw("exec FormLLIFilesList @countryCode, @clientid, @year, @setnum, @setind, @type", new SqlParameter("countrycode", sks[0]), new SqlParameter("clientid", sks[1]), new SqlParameter("year", sks[2]), new SqlParameter("setnum", sks[3]), new SqlParameter("setind", sks[4]), new SqlParameter("type", IrradiationTypeMap[type])).ToListAsync(ct)); } }
public IrradiationRegister(DateTime dateTime, IrradiationType irrType, int?loadNumber = null) { //Settings<IrradiationSettings>.AssemblyName = "IrradiationRegister"; _loadNumber = loadNumber; _irrType = irrType; _irrDateTime = dateTime; mainForm = new RegisterForm <Irradiation>(tabsNum: 3) { Name = "IrradiationRegister", Text = "IrradiationRegister" }; // mainForm.Icon = Properties.Resources.MeasurementsLogoCircle2; IrradiationTypeItems = new EnumItem <IrradiationType>(); IrradiationTypeItems.CheckItem(irrType); VerbosityItems = new EnumItem <Status>(); _chosenSamples = new List <Sample>(); _chosenStandards = new List <Standard>(); _chosenMonitors = new List <Monitor>(); Settings <IrradiationSettings> .CurrentSettings.PropertyChanged += (s, e) => { Labels.SetControlsLabels(mainForm); }; var u = User.GetUserByLogin(RegataContext.UserLogin); if (u == null) { _uid = 0; _userLabel = new ToolStripStatusLabel() { Name = "UnregisteredUser" }; } else { _uid = u.Id; _userLabel = new ToolStripStatusLabel() { Name = u.ToString() }; } mainForm.MainRDGV.RDGV_Set = Settings <IrradiationSettings> .CurrentSettings.MainTableSettings; Report.NotificationEvent += Report_NotificationEvent; InitMenuStrip(); InitStatusStrip(); InitCurrentRegister(); InitSamplesRegisters(); InitStandardsRegisters(); InitMonitorsRegisters(); InitializeRegFormingControls(); InitializeIrradiationsParamsControls(); mainForm.Load += MainForm_Load; mainForm.MainRDGV.CurrentDbSet.Local.CollectionChanged += Local_CollectionChanged; Settings <IrradiationSettings> .Save(); }