Exemplo n.º 1
0
 public FrmReferalSite(ForlabSite callingsite,IList<ForlabSite> referingsites,string platform)
 {
     _callingSite = callingsite;
        _referingSites = referingsites;
        _platform = platform;
        InitializeComponent();
        PopRegion();
 }
Exemplo n.º 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            _selectedSite = DataRepository.GetSiteById((int)comSite.SelectedValue);
            this.Tag = _selectedSite.SiteName;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
              // LQT.GUI.UserCtr.SitePane sp= (LQT.GUI.UserCtr.SitePane)this.Parent;

            Close();
        }
Exemplo n.º 3
0
 public void SetCallingSite(ForlabSite callingSite,string platform)
 {
     _callingSite = callingSite;
     _referingSites = DataRepository.GetReferingSiteByPlatform(platform);
     //if(platform=="CD4")
     //    _platform = "FlowCytometry";
     //else
     _platform = platform;
 }
Exemplo n.º 4
0
        public SiteForm(ForlabSite site, Form mdiparent)
        {
            this._site = site;
            this._mdiparent = mdiparent;

            InitializeComponent();
            lqtToolStrip1.SaveAndCloseClick += new EventHandler(lqtToolStrip1_SaveAndCloseClick);
            lqtToolStrip1.SaveAndNewClick += new EventHandler(lqtToolStrip1_SaveAndNewClick);

            LoadSiteCtr();
            SetRefSites();
        }
Exemplo n.º 5
0
        public SitePane(ForlabSite site, bool enableCtr)
        {
            this._site = site;
            this._enableCtr = enableCtr;
            InitializeComponent();

            lsvInstrument.AddNoneEditableColumn(0);
            lsvInstrument.AddNoneEditableColumn(1);

            //lsvInstrument.OnSubitemTextChanged += new EventHandler(lsvInstrument_OnSubitemTextChanged);
            lsvInstrument.SubitemTextChanged += new EventHandler<SubitemTextEventArgs>(lsvInstrument_OnSubitemTextChanged);
            SetControlState();
            PopRegion();
            PopSiteCategory();
            BindSite();
        }
Exemplo n.º 6
0
 private void InitializeSiteForm(ForlabSite site)
 {
     SiteForm frm = new SiteForm(site, _mdiparent);
     frm.ShowDialog();
     //_rPane.RebindRegion(_region);//b
     RebindRegion(_region);//added b
 }
Exemplo n.º 7
0
        private void butNewsite_Click(object sender, EventArgs e)
        {
            if (CreateOrEditSite != null)
            {
                ForlabSite site = new ForlabSite();
                site.Region = _region;
                CreateOrUpdateEventArgs eArgs = new CreateOrUpdateEventArgs(site);
                CreateOrEditSite(this, eArgs);
                _region = DataRepository.GetRegionById(site.Region.Id);//b

            }

            DisplaySites();
        }
Exemplo n.º 8
0
 public void RebindSite(ForlabSite site)
 {
     this._site = site;
     BindSite();
 }
Exemplo n.º 9
0
        void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e)
        {
            try
            {
                LQTUserMessage msg = SaveOrUpdateObject();
                ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, _reloadCtr);
                DataRepository.CloseSession();

                ForlabRegion r = _site.Region;
                SiteCategory sc = _site.SiteCategory;

                _site = new ForlabSite();
                _site.Region = r;
                _site.SiteCategory = sc;

                LoadSiteCtr();
                _isedited = false;
                if (_site.SiteCategory != null)//b
                {
                    comCategory.SelectedValue = _site.SiteCategory.Id;
                }
            }
            catch (Exception ex)
            {
                new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog();
            }
        }
Exemplo n.º 10
0
 public SiteForm(ForlabSite site, Form mdiparent, bool reloadctr)
     : this(site, mdiparent)
 {
     this._reloadCtr = reloadctr;
 }
Exemplo n.º 11
0
        private void butSave_Click(object sender, EventArgs e)
        {
            int count = 0;
            int error = 0;
            try
            {
                foreach (SiteImportData rd in _rdata)
                {
                    if (!rd.IsExist && !rd.HasError)
                    {
                        ForlabSite site = new ForlabSite();

                        site.Region = rd.Region;
                        site.SiteName = rd.SiteName;
                        site.SiteLevel = rd.SiteLevel;
                        site.SiteCategory = rd.Category;
                        site.WorkingDays = rd.WorkingDays;
                        site.CD4TestingDaysPerMonth = rd.Cd4Td;
                        site.ChemistryTestingDaysPerMonth = rd.ChemTd;
                        site.HematologyTestingDaysPerMonth = rd.HemaTd;
                        site.ViralLoadTestingDaysPerMonth = rd.ViralTd;
                        site.OtherTestingDaysPerMonth = rd.OtherTd;
                        SiteStatus ss = new SiteStatus();
                        ss.OpenedFrom = rd.OpeningDate != null ? rd.OpeningDate.Value : DateTime.Now;
                        site.SiteStatuses.Add(ss);
                        count++;
                        DataRepository.SaveOrUpdateSite(site);

                    }
                    else { error++; }

                }
                MessageBox.Show(count + " Sites are imported and saved successfully." + Environment.NewLine + error + " Sites Failed.", "Importing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();

            }
            catch
            {
                MessageBox.Show("Error: Unable to import Site data.", "Importing", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                DataRepository.CloseSession();

            }
        }
Exemplo n.º 12
0
        private void butNewsite_Click(object sender, EventArgs e)
        {
            if (CreateOrEditSite != null)
            {
                ForlabSite site = new ForlabSite();
                site.Region = _region;
                CreateOrUpdateEventArgs eArgs = new CreateOrUpdateEventArgs(site);
                CreateOrEditSite(this, eArgs);
            }

            DisplaySites();
        }
Exemplo n.º 13
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     this.DialogResult = DialogResult.OK;
        _selectedSite=LqtUtil.GetComboBoxValue<ForlabSite>(cobsite);
     Close();
 }
Exemplo n.º 14
0
 private int InstrumentUsage(ForlabSite s, ClassOfMorbidityTestEnum platform)
 {
     decimal sum = 0;
     // bool error = false;
     int removedInst = 0;
     IList<SiteInstrument> sinst = new List<SiteInstrument>();
     if (s.GetInstrumentByPlatform(platform).Count > 0)//instrument percentage
     {
         sinst = s.GetInstrumentByPlatform(platform);
         foreach (SiteInstrument si in sinst)
         {
             sum = sum + si.TestRunPercentage;
         }
         if (sum != 100)
         {
             // error = true;
             foreach (SiteInstrument si in sinst)
             {
                 foreach (SiteInstrumentImportData rd in _siteinstrumentdata)
                 {
                     if (rd.InstrumentName == si.Instrument.InstrumentName && rd.SiteName == s.SiteName && !rd.IsExist && !rd.HasError)
                     {
                         s.SiteInstruments.Remove(si);
                         sum = sum + si.TestRunPercentage;
                         removedInst++;
                     }
                 }
             }
         }
     }
     return removedInst;
 }
Exemplo n.º 15
0
 public SitePane(ForlabSite site)
     : this(site, false)
 {
 }
Exemplo n.º 16
0
 public static void SaveOrUpdateSite(ForlabSite site)
 {
     DaoFactory.GetDaoFactory().CreateSiteDao().SaveOrUpdate(site);
 }
Exemplo n.º 17
0
 public static void DeleteSite(ForlabSite t)
 {
     DaoFactory.GetDaoFactory().CreateSiteDao().Delete(t);
 }
Exemplo n.º 18
0
        private bool ISValidReferralSite(string Referralsite, string siten, string platform, out ForlabSite refSite)
        {
            IList<ForlabSite> _referingSites = new List<ForlabSite>();

            IList<ForlabSite> _validsites = new List<ForlabSite>();

            refSite = null;
            bool isvalid = false;
            if (!String.IsNullOrEmpty(Referralsite))
            {
                refSite = DataRepository.GetSiteByName(Referralsite);
                if (refSite != null)
                {

                    if (refSite.SiteName != siten)
                    {
                        _validsites = DataRepository.GetAllSiteByRegionandPlatform(-1, LqtUtil.RemoveWhitespace(platform));
                        _referingSites = DataRepository.GetReferingSiteByPlatform(LqtUtil.RemoveWhitespace(platform));
                        if (_validsites.Contains(refSite) && !_referingSites.Contains(refSite))
                            isvalid = true;
                        else
                            isvalid = false;
                    }
                    else
                        isvalid = false;
                }
                else
                {
                    isvalid = false;
                }
            }
            else
            {
                isvalid = false;
            }

            return isvalid;
        }