Esempio n. 1
0
    /// <summary>
    /// selected region was changed.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            return;
        }

        if (ddlRegion.SelectedIndex != -1)
        {
            ddlSite.Items.Clear();

            DataSet   dsSite    = null;
            long      lRegionID = CDataUtils.ToLong(ddlRegion.SelectedValue);
            CSiteData siteData  = new CSiteData(BaseMstr.BaseData);

            //get all sites for this region
            siteData.GetSiteDS(lRegionID, out dsSite);
            CDropDownList.RenderDataSet(dsSite,
                                        ddlSite,
                                        "SITE_NAME",
                                        "SITE_ID");
        }

        ShowMPE();
    }
Esempio n. 2
0
    /// <summary>
    /// event
    /// sets dialog title
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        Title = "Login";
        txtUID.Focus();

        if (ddlSite.Items.Count < 1)
        {
            DataSet dsRegion = null;
            DataSet dsSite   = null;

            CSiteData siteData = new CSiteData(BaseMstr.BaseData);

            //get the regions
            CStatus status = siteData.GetRegionDS(out dsRegion);
            CDropDownList.RenderDataSet(dsRegion,
                                        ddlRegion,
                                        "REGION_NAME",
                                        "REGION_ID");

            //select the default region if set
            long lRegionID = 0;
            if (System.Configuration.ConfigurationManager.AppSettings["MDWSEmrSvcRegionID"] != null)
            {
                string strRegion = System.Configuration.ConfigurationManager.AppSettings["MDWSEmrSvcRegionID"].ToString();
                lRegionID = CDataUtils.ToLong(strRegion);
                CDropDownList.SelectItemByValue(ddlRegion,
                                                lRegionID);
            }

            //get all sites for this region
            status = siteData.GetSiteDS(lRegionID, out dsSite);
            CDropDownList.RenderDataSet(dsSite,
                                        ddlSite,
                                        "SITE_NAME",
                                        "SITE_ID");

            long lSiteID = 0;
            if (System.Configuration.ConfigurationManager.AppSettings["MDWSEmrSvcSiteList"] != null)
            {
                string strSite = System.Configuration.ConfigurationManager.AppSettings["MDWSEmrSvcSiteList"].ToString();
                lSiteID = CDataUtils.ToLong(strSite);
                CDropDownList.SelectItemByValue(ddlSite,
                                                lSiteID);
            }
        }
    }