Esempio n. 1
0
        protected void fillEnzymeAndDemographic()
        {
            try
            {
                objclsDemographicBAL = new clsDemographicBAL();
                DataSet objDS = new DataSet();
                int demogrId = Convert.ToInt32(demographicid);

                objclsDemographicBAL.getEnzymeDetails_BAL(demogrId, ref objDS);

                if (objDS.Tables.Count > 0)
                {
                    if (string.IsNullOrEmpty(objDS.Tables[0].Rows[0]["CampaignID"].ToString()))
                    {
                        grdEnzymes.Visible = false;
                    }
                    else
                    {
                        grdEnzymes.DataSource = objDS.Tables[0];
                        grdEnzymes.DataBind();
                        grdEnzymes.Visible = true;
                    }

                    lblCategory.Text = objDS.Tables[0].Rows[0]["Category"] == null ? string.Empty : objDS.Tables[0].Rows[0]["Category"].ToString();
                    hdnCategory.Value = objDS.Tables[0].Rows[0]["Category_ID"] == null ? string.Empty : objDS.Tables[0].Rows[0]["Category_ID"].ToString();

                    lblBusinessUnit.Text = objDS.Tables[0].Rows[0]["BusinessUnit"] == null ? string.Empty : objDS.Tables[0].Rows[0]["BusinessUnit"].ToString();
                    hdnBusinessUnit.Value = objDS.Tables[0].Rows[0]["BusinessUnit_ID"] == null ? string.Empty : objDS.Tables[0].Rows[0]["BusinessUnit_ID"].ToString();

                    lblSector.Text = objDS.Tables[0].Rows[0]["Sector"] == null ? string.Empty : objDS.Tables[0].Rows[0]["Sector"].ToString();
                    hdnSector.Value = objDS.Tables[0].Rows[0]["Sector_ID"] == null ? string.Empty : objDS.Tables[0].Rows[0]["Sector_ID"].ToString();

                    string pltform = objDS.Tables[0].Rows[0]["Platform"] == null ? string.Empty : objDS.Tables[0].Rows[0]["Platform"].ToString();

                    if (pltform == "Liquid")
                    {
                        rdPlatform.Items[0].Selected = true;
                    }
                    else if (pltform == "Granules")
                    {
                        rdPlatform.Items[1].Selected = true;
                    }
                    else if (pltform == "Soluble Unit Dose [Pods]")
                    {
                        rdPlatform.Items[2].Selected = true;
                    }
                    else
                    {
                        rdPlatform.Items[3].Selected = true;
                        txtOther.Visible = true;
                        txtOther.Text = pltform;
                        IsOther = true;
                    }

                    string empStatus = objDS.Tables[0].Rows[0]["EmploymentStatus"] == null ? string.Empty : objDS.Tables[0].Rows[0]["EmploymentStatus"].ToString();
                    if (empStatus == "Contractors")
                    {
                        rdEmpStatus.Items[1].Selected = true;
                    }
                    else
                    {
                        rdEmpStatus.Items[0].Selected = true;
                    }

                    string fiscalYear = objDS.Tables[0].Rows[0]["FiscalYear"] == null ? "0" : objDS.Tables[0].Rows[0]["FiscalYear_ID"].ToString();

                    //ListEditItem li = drpFiscalYear.Items.FindByValue(fiscalYear);
                    //if (li != null)
                    //{
                    //    li.Selected = true;
                    //}
                    clsUtils.SetDropdown(drpFiscalYear, fiscalYear);
                    //drpFiscalYear.Items.FindByValue(fiscalYear).Selected = true;

                    string campaign = objDS.Tables[0].Rows[0]["Campaign"] == null ? string.Empty : objDS.Tables[0].Rows[0]["Campaign"].ToString();

                    if (campaign == "Spring")
                    {
                        rdCompaign.Items[0].Selected = true;
                    }
                    else if (campaign == "Fall")
                    {
                        rdCompaign.Items[1].Selected = true;
                    }
                    else if (campaign == "Annual")
                    {
                        rdCompaign.Items[2].Selected = true;
                    }
                    else
                    {
                        rdCompaign.Items[3].Selected = true;
                    }

                    string totalSitePopulation = objDS.Tables[0].Rows[0]["TotalSitePopulation"] == null ? string.Empty : objDS.Tables[0].Rows[0]["TotalSitePopulation"].ToString();
                    txtTotalSitePop.Text = totalSitePopulation;

                    string medicalMonitoringPro = objDS.Tables[0].Rows[0]["NumberofIndividualsGrade1"] == null ? string.Empty : objDS.Tables[0].Rows[0]["NumberofIndividualsGrade1"].ToString();
                    txtMedicalMonitor.Text = medicalMonitoringPro;

                    string principalreporter = objDS.Tables[0].Rows[0]["PrincipalReporter"] == null ? string.Empty : objDS.Tables[0].Rows[0]["PrincipalReporter"].ToString();
                    txtReporter.Text = principalreporter;

                    string PrincipalReporterId = objDS.Tables[0].Rows[0]["PrincipalReporter_ID"] == null ? "0" : objDS.Tables[0].Rows[0]["PrincipalReporter_ID"].ToString();
                    // hdnReporter.Value = PrincipalReporterId;
                    Session["PrincipalReporterID"] = Convert.ToInt32(PrincipalReporterId);

                    //Fill Region Dropdown
                    string region = objDS.Tables[0].Rows[0]["Region_ID"] == null ? "0" : objDS.Tables[0].Rows[0]["Region_ID"].ToString();

                    string country = objDS.Tables[0].Rows[0]["Country_ID"] == null ? "0" : objDS.Tables[0].Rows[0]["Country_ID"].ToString();

                    string site = objDS.Tables[0].Rows[0]["SiteName_ID"] == null ? string.Empty : objDS.Tables[0].Rows[0]["SiteName_ID"].ToString();

                    drpRegion.Items.FindByValue(region).Selected = true;
                    objDS = null;

                    //Fill Country dropdown

                    int regID = Convert.ToInt32(drpRegion.SelectedItem.Value);

                    objclsDemographicBAL.getCountryDetails_BAL(regID, ref objDS);

                    if (objDS.Tables.Count > 0)
                    {
                        drpCountry.DataSource = objDS.Tables[0];
                        drpCountry.DataBind();
                    }

                    drpCountry.Items.FindByValue(country).Selected = true;

                    //Fill Site dropdown
                    int reg2ID = Convert.ToInt32(drpRegion.SelectedItem.Value);
                    int cntryID = Convert.ToInt32(drpCountry.SelectedItem.Value);
                    objDS = null;

                    objclsDemographicBAL.getSiteNameDetails_BAL(reg2ID, cntryID, ref objDS);

                    if (objDS.Tables.Count > 0)
                    {
                        drpSiteName.DataSource = objDS.Tables[0];
                        drpSiteName.DataBind();
                    }

                    drpSiteName.Items.FindByValue(site).Selected = true;
                }

                btnSaveExit.Text = UPDATEEXIT;
                btnSaveNew.Text = UPDATE;
                // IsUpdate = true;
                Session["Mode"] = DEMOGRAPHICUPDATE;
                IsonlyCampaign = false;
            }

            finally
            {
                objclsDemographicBAL = null;
            }
        }
Esempio n. 2
0
        protected void drpCountry_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (drpCountry.SelectedIndex != 0)
                {
                    objclsDemographicBAL = new clsDemographicBAL();
                    DataSet objDS = new DataSet();

                    int regID = Convert.ToInt32(drpRegion.SelectedItem.Value);
                    int cntryID = Convert.ToInt32(drpCountry.SelectedItem.Value);

                    objclsDemographicBAL.getSiteNameDetails_BAL(regID, cntryID, ref objDS);

                    //if (objDS.Tables.Count > 0)
                    //{
                    //    drpSiteName.DataSource = objDS.Tables[0];
                    //    drpSiteName.DataBind();
                    //}

                    clsUtils.BindDropDown(drpSiteName, objDS.Tables[0], "Site_ID", "SiteName");

                }
                lblBusinessUnit.Text = string.Empty;
                lblCategory.Text = string.Empty;
                lblSector.Text = string.Empty;
            }
            finally
            {
                objclsDemographicBAL = null;
            }
        }