Пример #1
0
        public virtual void RemoveNReportedSite(int nrid)
        {
            ForecastNRSite nr = GetNReportedSite(nrid);

            if (nr != null)
            {
                NoneReportedSites.Remove(nr);
            }
        }
Пример #2
0
        public bool AddNoneReportedSite()
        {
            // FrmSelectSite frm = new FrmSelectSite(_activeFSite.GetSelectedNRSiteId(), _sites);
            FrmSelectSite frm = new FrmSelectSite(_forecastInfo.GetSelectedSiteId(), _sites);//b it Filters N.R site and Reported Site
            if (frm.ShowDialog() == DialogResult.OK)
            {
                foreach (int siteid in frm.SelectedSiteIds)
                {
                    ForecastNRSite fc = new ForecastNRSite();
                    fc.NReportedSite = DataRepository.GetSiteById(siteid);
                    fc.ForecastSite = _activeFSite;

                    _activeFSite.NoneReportedSites.Add(fc);

                    ForecastSite fs = new ForecastSite();
                    fs.Site = fc.NReportedSite;
                    fs.ForecastInfo = _forecastInfo;
                    fs.ReportedSiteId = _activeFSite.Id;

                    CopySiteProduct(_activeFSite, fs);

                    _forecastInfo.ForecastSites.Add(fs);
                }

                OnForecastInfoDataChanged();
                return true;
            }
            return false;
        }