protected void FillDropDowns()
    {
        LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration");
        DataSet       theDS       = LabManager.GetDropDowns();
        BindFunctions BindManager = new BindFunctions();

        BindManager.BindCombo(ddDepartment, theDS.Tables[0], "LabDepartmentName", "LabDepartmentID");
    }
예제 #2
0
        /// <summary>
        /// Fills the values drop downs.
        /// </summary>
        protected void FillValuesDropDowns()
        {
            LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration");
            DataSet       theDDDS     = LabManager.GetDropDowns();
            BindFunctions BindManager = new BindFunctions();

            BindManager.BindCombo(ddDepartment, theDDDS.Tables[0], "LabDepartmentName", "LabDepartmentID");

            if (Request.QueryString["name"] == "Edit")
            {
                int     LabId = Convert.ToInt32(Request.QueryString["LabId"]);
                DataSet theDS = LabManager.GetLabByID(LabId);
                txtLabName.Text = theDS.Tables[0].Rows[0]["LabName"].ToString();
                this.ddDepartment.SelectedValue = theDS.Tables[0].Rows[0]["LabDepartmentID"].ToString();
                this.ddStatus.SelectedValue     = theDS.Tables[0].Rows[0]["DeleteFlag"].ToString();
                //ddlDataType.Items.FindByText(theDS.Tables[0].Rows[0]["dataType"].ToString()).Selected = true;
                if (theDS.Tables[0].Rows[0]["dataType"] != DBNull.Value)
                {
                    //ddlDataType.Items.FindByText(theDS.Tables[0].Rows[0]["dataType"].ToString()).Selected = true;
                    ddlDataType.ClearSelection();
                    ListItem item = ddlDataType.Items.FindByText(theDS.Tables[0].Rows[0]["dataType"].ToString());
                    if (item != null)
                    {
                        item.Selected = true;
                    }
                }

                if (ddlDataType.SelectedItem.Text == "Select List")
                {
                    getselectlist(theDS.Tables[2]);
                }
                else if (ddlDataType.SelectedItem.Text == "Numeric")
                {
                    DataSet ds = LabManager.GetSubTestDetails(Convert.ToInt32(Request.QueryString["LabId"]));
                    ViewState["MstDS"] = ds;
                    DataTable  theDT  = ds.Tables[1];
                    DataColumn newCol = new DataColumn("Visible", typeof(bool));
                    newCol.DefaultValue = true;
                    theDT.Columns.Add(newCol);
                    this.BindGrid(ref theDT);
                }
            }
            else
            {
                ViewState["MstDS"] = LabManager.GetSubTestDetails(Convert.ToInt32(Request.QueryString["LabId"]));

                theLabNumerics = ((DataSet)ViewState["MstDS"]).Tables[1];
                DataRow theDR = theLabNumerics.NewRow();
                theDR.SetField(0, 0);
                theLabNumerics.Rows.Add(theDR);

                grdLabUnits.DataSource = theLabNumerics;
                grdLabUnits.DataBind();
                grdLabUnits.Rows[0].Visible = false;
            }
        }