public void LlenaCombo(Int32 Id1, Int32 Id2, Int32 Id3, int?Id4, int?Id5, string conexion, string SP, ref Telerik.Web.UI.RadComboBox RadComboBox)
 {
     try
     {
         System.Collections.Generic.List <Comun> Lista = new System.Collections.Generic.List <Comun>();
         CapaDatos.CD__Comun claseCapaDatos            = new CapaDatos.CD__Comun();
         claseCapaDatos.LlenaCombo(Id1, Id2, Id3, Id4, Id5, SP, conexion, ref Lista);
         if (Lista.Count > 0)
         {
             RadComboBox.DataSource     = Lista;
             RadComboBox.DataValueField = "Id";
             if (Lista.ToArray()[0].Relacion != "sin_relacion")
             {
                 RadComboBox.DataTextField = "Relacion";
             }
             else
             {
                 RadComboBox.DataTextField = "Descripcion";
             }
             RadComboBox.DataBind();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #2
0
        protected void BindChildGridDdl(Telerik.Web.UI.RadComboBox rcbComobo, string flag, string dataTextName, string dataValueName)
        {
            DataTable dt = GetDataTable(flag, "", "");

            rcbComobo.DataTextField  = dataTextName;
            rcbComobo.DataValueField = dataValueName;
            rcbComobo.DataSource     = dt;
            rcbComobo.DataBind();
            rcbComobo.SelectedValue = "";
        }
        protected void BindEmpLoyee(Telerik.Web.UI.RadComboBox rfbEmployee)
        {
            DataTable dt = GetDataTable("EMPLOYEE", 0, "");

            rfbEmployee.DataTextField  = "FirstName";
            rfbEmployee.DataValueField = "EmployeeID";
            rfbEmployee.DataSource     = dt;
            rfbEmployee.DataBind();
            rfbEmployee.SelectedValue = "";
        }
Exemple #4
0
        protected void BindEmpLoyee(Telerik.Web.UI.RadComboBox rfbEmployee)
        {
            ILabFunctions theILabManager;

            theILabManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
            DataTable dt = theILabManager.GetEmployeeDetails();

            rfbEmployee.DataTextField  = "EmployeeName";
            rfbEmployee.DataValueField = "EmployeeID";
            rfbEmployee.DataSource     = dt;
            rfbEmployee.DataBind();
            rfbEmployee.SelectedValue = "";
        }
        public void LlenaCombo(Int32 Id1, Int32 Id2, string conexion, string SP, ref Telerik.Web.UI.RadComboBox RadComboBox, params bool[] claveString)
        {
            try
            {
                System.Collections.Generic.List <Comun> Lista = new System.Collections.Generic.List <Comun>();
                CapaDatos.CD__Comun claseCapaDatos            = new CapaDatos.CD__Comun();
                claseCapaDatos.LlenaCombo(Id1, Id2, SP, conexion, ref Lista, claveString);

                if (Lista.Count > 0)
                {
                    RadComboBox.DataSource = Lista;
                    if (claveString.Length > 0)
                    {
                        if (claveString[0])
                        {
                            RadComboBox.DataValueField = "IdStr";
                        }
                        else
                        {
                            RadComboBox.DataValueField = "Id";
                        }
                    }
                    else
                    {
                        RadComboBox.DataValueField = "Id";
                    }
                    if (Lista.ToArray()[0].Relacion != "sin_relacion")
                    {
                        RadComboBox.DataTextField = "Relacion";
                    }
                    else
                    {
                        RadComboBox.DataTextField = "Descripcion";
                    }

                    RadComboBox.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public void LlenaCombo(Int32 Id1, string conexion, string SP, ref Telerik.Web.UI.RadComboBox RadComboBox)
 {
     try
     {
         System.Collections.Generic.List <Comun> Lista = new System.Collections.Generic.List <Comun>();
         CapaDatos.CD__Comun claseCapaDatos            = new CapaDatos.CD__Comun();
         claseCapaDatos.LlenaCombo(Id1, SP, conexion, ref Lista);
         if (Lista.Count > 0)
         {
             RadComboBox.DataSource     = Lista;
             RadComboBox.DataValueField = "Id";
             RadComboBox.DataTextField  = "Descripcion";
             RadComboBox.DataBind();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #7
0
 public static void FillTelericCombo(ref Telerik.Web.UI.RadComboBox cmb_, DataTable dt_, string dText, string dValue)
 {
     try
     {
         if (dt_ != null)
         {
             cmb_.Items.Clear();
             if (dt_.Rows.Count > 0)
             {
                 cmb_.DataSource     = dt_;
                 cmb_.DataTextField  = dText;
                 cmb_.DataValueField = dValue;
                 cmb_.DataBind();
             }
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #8
0
        private void FillList()
        {
            FirstLoad         = false;
            ctrl.AutoPostBack = AutoPostBack;
            ctrl.DataSource   = GetData().Items;
            ctrl.DataBind();

            if (IncludeAdditionalListItem)
            {
                string AdditionalListItemText  = GetGlobalResourceString("AdditionalListItemText", Me.AdditionalListItemText);
                string AdditionalListitemValue = Me.AdditionalListItemValue;
                if (String.IsNullOrEmpty(AdditionalListitemValue))
                {
                    AdditionalListitemValue = String.Empty;
                }

                ctrl.Items.Insert(0, new RadComboBoxItem(AdditionalListItemText, AdditionalListitemValue));
            }

            //to support criteria list edit - add mode
            ctrl.DataSource = null;
        }
        public static bool SQL_ManageUser_Manager(Telerik.Web.UI.RadComboBox dDl, string tblName)
        {
            string ConnectionString = ConfigurationManager.ConnectionStrings["dBConnectionString"].ConnectionString;


            //Set the Data Value and Text fields to the db column
            dDl.DataValueField = "Manager";
            dDl.DataTextField  = "Manager";

            //SQL string to execute
            string strSQL = "GetManagerDetails  '" + tblName + "'";
            //Create a connection
            SqlConnection conn = new SqlConnection(ConnectionString);

            try
            {
                conn.Open();
                //Execute the SQL String
                SqlCommand    cmd    = new SqlCommand(strSQL, conn);
                SqlDataReader reader = cmd.ExecuteReader();
                dDl.DataSource = reader;
                dDl.DataBind();
                conn.Close();

                // Insert the first item.
                //dDl.Items.Insert(0, new RadComboBoxItem("- Select -"));
            }
            catch // (Exception e) // Exception Removed
            {
                return(false);
            }
            finally
            {
                conn.Close();
            }
            return(true);
        }
Exemple #10
0
 public static void FillTelericCombo(ref Telerik.Web.UI.RadComboBox cmb_, System.Data.DataTable dt_, String DTF, String DVF, bool AddBlankRow, String BlankRowText, String BlankrowValue)
 {
     try
     {
         if (dt_ != null)
         {
             cmb_.Items.Clear();
             if (dt_.Rows.Count > 0)
             {
                 cmb_.DataSource     = dt_;
                 cmb_.DataTextField  = DTF;
                 cmb_.DataValueField = DVF;
                 cmb_.DataBind();
             }
         }
     }
     catch (Exception ex)
     {
         throw;
     }
     if (AddBlankRow == true)
     {
         if (BlankRowText == "")
         {
             cmb_.Items.Insert(0, new RadComboBoxItem("--Please Select--", ""));
         }
         else
         {
             cmb_.Items.Insert(0, new RadComboBoxItem("--Please Select--", BlankrowValue));
         }
     }
     else
     {
         cmb_.Items.Insert(0, new RadComboBoxItem("--Please Select--", " "));
     }
 }