コード例 #1
0
        public void BindDropDown()
        {
            try
            {
                objclsDemographicBAL = new clsDemographicBAL();
                DataSet objDS = new DataSet();
                DataTable dt = new DataTable();

                bool flagStatus = false;

                //Fill Regions
                dt = objclsDemographicBAL.GetDropDownValuesBAL(MyLookup.Dropdowns.Region, ref flagStatus);
                clsUtils.BindDropDown(drpRegion, dt, "Region_ID", "Region_Name");

                //Fill FiscalYear
                dt = objclsDemographicBAL.GetDropDownValuesBAL(MyLookup.Dropdowns.FiscalYear, ref flagStatus);
                clsUtils.BindDropDown(drpFiscalYear, dt, "FiscalYear_ID", "FiscalYear");

                //Fill Enzyme
                objclsDemographicBAL.getEnzymeDetails_BAL(ref objDS);

                if (objDS.Tables.Count > 0)
                {
                    drpEnzyme.DataSource = objDS.Tables[0];
                    drpEnzyme.DataBind();
                    drpEnzyme.Items.Insert(0, new DevExpress.Web.ASPxEditors.ListEditItem("Select a Enzyme Name and Antigen Number", "-1"));
                    drpEnzyme.SelectedIndex = 0;
                }

            }
            finally
            {
                objclsDemographicBAL = null;
            }
        }
コード例 #2
0
        protected void OnRowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            int id = Convert.ToInt32(e.Keys[0]);
            string ModifiedBy = "testuserdel";
            objclsDemographicBAL = new clsDemographicBAL();

            DataSet objDS = new DataSet();
            string strout = string.Empty;

            objclsDemographicBAL.DeteteCampaign_BAL(id, ModifiedBy, ref strout, ref objDS);

            objclsDemographicBAL = new clsDemographicBAL();

            //Fill Enzyme Campaign
            int demogrId = Convert.ToInt32(demographicid);
            objclsDemographicBAL.getEnzymeDetails_BAL(demogrId, ref objDS);
            if (objDS.Tables.Count > 0)
            {
                grdEnzymes.DataSource = objDS.Tables[0];
                grdEnzymes.DataBind();
            }
            //ApplyLayout(0);
            e.Cancel = true;
            //lblReturnStatus.Text = strout;
            ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('" + strout + "');", true);
        }
コード例 #3
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;
            }
        }