Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int site_id = Convert.ToInt32(Request.QueryString["site_id"]);

            Data.Site site = db.Sites.Where(p => p.site_id == site_id).FirstOrDefault();

            rlbFieldTripsStart.DataSource = db.Trips
                                            .Where(p => p.Office.wsc_id == site.Office.wsc_id)
                                            .Select(p => new { TripName = p.trip_nm + " (" + p.user_id + ")", trip_id = p.trip_id })
                                            .OrderBy(p => p.TripName)
                                            .ToList();
            rlbFieldTripsStart.DataBind();

            List <TripItem> trips = new List <TripItem>();

            foreach (var trip in site.TripSites)
            {
                //Remove the trips that are already assigned to the site from the start list box
                RadListBoxItem itemToRemove = rlbFieldTripsStart.FindItemByValue(trip.trip_id.ToString());
                rlbFieldTripsStart.Items.Remove(itemToRemove);

                //Add the trips that are already assigned to the site to the trips list
                trips.Add(new TripItem {
                    trip_id = trip.trip_id, TripName = trip.Trip.trip_nm + " ( " + trip.Trip.user_id + ")"
                });
            }

            rlbFieldTripsEnd.DataSource = trips;
            rlbFieldTripsEnd.DataBind();
        }
        private void CargarDatos()
        {
            ProcesoSeleccionNegocio nProceso = new ProcesoSeleccionNegocio();

            var vEntrevista = nProceso.ObtieneEntrevistaProcesoSeleccion(pIdEntrevista: vIdEntrevista).FirstOrDefault();

            if (vEntrevista != null)
            {
                cmbTipoEntrevista.SelectedValue = vEntrevista.ID_ENTREVISTA_TIPO.ToString();
                vFeEntrevista = vEntrevista.FE_ENTREVISTA;
                RadListBoxItem vItem = new RadListBoxItem();
                vItem.Text            = vEntrevista.NB_ENTREVISTADOR;
                vItem.Value           = vEntrevista.ID_ENTREVISTADOR.ToString();
                txtEntrevistador.Text = vItem.Text;
                vIdEntrevistador      = vEntrevista.ID_ENTREVISTADOR;
                //lstEntrevistador.Items.Add(vItem);
                txtCorreoEntrevistador.Text = vEntrevista.CL_CORREO_ENTREVISTADOR;
                txtPuesto.Text     = vEntrevista.NB_PUESTO_ENTREVISTADOR;
                txtDsNotas.Content = vEntrevista.DS_OBSERVACIONES;

                vCltocken     = vEntrevista.CL_TOKEN;
                vFlEntrevista = vEntrevista.FL_ENTREVISTA.Value;
            }
            if (vIdEntrevistador == null)
            {
                txtEntrevistador.Enabled = true;
                txtPuesto.Enabled        = true;
            }
            else
            {
                txtEntrevistador.Enabled = false;
                txtPuesto.Enabled        = false;
            }
        }
Ejemplo n.º 3
0
        private void LaunchSearchResultsActivity(bool launchActivity)
        {
            try
            {
                RadListBoxItem selectedItem = lbxSearchResults.SelectedItem as RadListBoxItem;
                if (selectedItem != null && selectedItem.Tag != null)
                {
                    //is Activity
                    Activity activity = selectedItem.Tag as Activity;

                    if (activity != null)
                    {
                        if (launchActivity)
                        {
                            myClientForm.StartActivity(activity);
                        }
                    }

                    NTContact contact = selectedItem.Tag as NTContact;

                    if (contact != null)
                    {
                        DisplaySelectionOptions(contact);
                    }
                }
                ;
            }
            catch (Exception)
            {
                return;
            }
        }
Ejemplo n.º 4
0
        protected void RadTreeView1_NodeDrop(object sender, RadTreeNodeDragDropEventArgs e)
        {
            e.SourceDragNode.Remove();

            if (e.HtmlElementID == RadListBox1.ClientID)
            {
                RadListBoxItem item = new RadListBoxItem();
                item.Text = e.SourceDragNode.Text;

                if (RadListBox1.SelectedIndex > -1)
                {
                    RadListBox1.Items.Insert(RadListBox1.SelectedIndex + 1, item);
                }
                else
                {
                    RadListBox1.Items.Add(item);
                }
            }
            else
            {
                if (e.DestDragNode.Level == 0)
                {
                    e.DestDragNode.Nodes.Add(e.SourceDragNode);
                }
                else
                {
                    e.DestDragNode.InsertAfter(e.SourceDragNode);
                }
            }
        }
Ejemplo n.º 5
0
    private void Save_Log(string Log_Text)
    {
        RadListBoxItem listItem = new RadListBoxItem(Log_Text);

        listItem.ImageUrl = "~/images/icons/blue-bullet.png";
        Log_RadListBox.Items.Add(listItem);
    }
        private void LlenarFacturas()
        {
            Sesion sesion = (Sesion)Session["Sesion" + Session.SessionID];
            CN_ConfiguracionCobranza cn_GestorCobranza = new CN_ConfiguracionCobranza();
            List <Factura>           list = new List <Factura>();
            int Id_Cte = 0;

            if ((Request.QueryString["Id_Cte"] != ""))
            {
                Id_Cte = Convert.ToInt32(Request.QueryString["Id_Cte"].Replace("'", ""));
            }

            try
            {
                cn_GestorCobranza.ConsultarFacturasVencidasPorCliente(sesion.Id_Emp, sesion.Id_Cd_Ver, Id_Cte, ref list, Emp_CnxCob);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            listFacturas.Visible = true;
            listFacturas.Items.Clear();
            foreach (Factura f in list)
            {
                RadListBoxItem rlbi = new RadListBoxItem();
                rlbi.Value = f.Id_FacSerie;
                rlbi.Text  = f.Id_FacSerie;
                // rlbi.Checked = true;
                listFacturas.Items.Add(rlbi);
            }

            listFacturas.DataBind();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Binds the data.
        /// </summary>
        public int BindData()
        {
            var count = 0;

            if (CurrentUser.Instance.ContactID.HasValue)
            {
                rcbPosponePeriods.SelectedIndex = 0;
                var dataManager  = new DataManager();
                var reminderList = dataManager.Reminder.SelectAll((Guid)CurrentUser.Instance.ContactID, DateTime.Now).ToList();
                count = reminderList.Count;

                rlbRemindersList.Items.Clear();

                foreach (var reminder in reminderList)
                {
                    var item = new RadListBoxItem();
                    item.Text  = reminder.Title;
                    item.Value = reminder.ID.ToString();
                    item.Attributes.Add("ReminderDate", reminder.ReminderDate.ToString("yyyy-MM-dd HH:mm"));
                    item.Attributes.Add("ModuleTitle", reminder.ModuleTitle);

                    rlbRemindersList.Items.Add(item);
                }

                rlbRemindersList.DataBind();
            }

            return(count);
        }
Ejemplo n.º 8
0
        //protected void LCOApprovals_RadTabStrip_TabClick(object sender, RadTabStripEventArgs e)
        //{
        //    switch (((RadTabStrip)sender).SelectedTab.Text)
        //    {
        //        case "Approved":
        //            RadListBoxApprovalsApproved.Visible = true;
        //            RadListBoxApprovalsPending.Visible = false;
        //            break;
        //        case "Pending":
        //            RadListBoxApprovalsApproved.Visible = false;
        //            RadListBoxApprovalsPending.Visible = true;
        //            break;
        //        default:
        //            break;
        //    }
        //}

        private void BuildLists()
        {
            foreach (DataRow lea in Base.Classes.LCO.LoadLEAsByCourseID(_lco.CourseID).Rows)
            {
                RadListBoxItem ri = new RadListBoxItem();
                if (DataIntegrity.ConvertToBool(lea["IsApproved"]))
                {
                    RadListBoxApprovalsApproved.Items.Add(ri);
                  
                }
                else
                {
                    RadListBoxApprovalsPending.Items.Add(ri);
                }

                HyperLink lnk = (HyperLink)ri.FindControl("lnkLEA");
                lnk.Text = lea["LEAName"].ToString() + " - " + lea["IMCName"].ToString();

                var link = ResolveUrl("~/SessionBridge.aspx?ReturnURL=") +
                    System.Web.HttpUtility.UrlEncode("display.asp?fo=basic%20display&rm=page&key=7266&xID=" + DataIntegrity.ConvertToInt(lea["DocID"]) + "&??hideButtons=Save And Return,Delete,copydocument,cancel&??appName=E3");

                if (UserHasPermission(Permission.Hyperlink_LEA_Approvals))
                {
                    lnk.NavigateUrl = link;
                }
                else
                {
                    lnk.ForeColor = System.Drawing.Color.Black;
                }
            }
        }
Ejemplo n.º 9
0
        private void NotifyUser(string message)
        {
            RadListBoxItem commandListItem = new RadListBoxItem();

            commandListItem.Text = message;
            SavedChangesList.Items.Add(commandListItem);
        }
    protected void listBoxSelectedSites_Dropped(object sender, RadListBoxDroppedEventArgs e)
    {
        if (e.HtmlElementID == listBoxSites.ClientID)
        {
            if (listBoxSites.SelectedItem != null)
            {
                foreach (RadListBoxItem item in e.SourceDragItems)
                {
                    bool flag = true;

                    RadListBoxItem dItem = new RadListBoxItem(item.Text, item.Value);

                    foreach (RadListBoxItem selectedItem in listBoxSelectedSites.Items)
                    {
                        if (selectedItem.Value == dItem.Value)
                        {
                            flag = false;
                        }
                    }

                    if (flag)
                    {
                        listBoxSelectedSites.Items.Add(dItem);
                    }
                }
            }
        }
    }
Ejemplo n.º 11
0
        /// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            var publicationTypes = _dataManager.PublicationType.SelectByPublicationKindID(CurrentUser.Instance.SiteID, (int)PublicationKind.Discussion).OrderBy(pt => pt.Order);

            rlbPublicationTypes.Items.Add(new RadListBoxItem("Все обсуждения", Guid.Empty.ToString()));

            foreach (var publicationType in publicationTypes)
            {
                var item = new RadListBoxItem {
                    Text = publicationType.Title, Value = publicationType.ID.ToString()
                };
                item.Attributes["Logo"] = PublicationLogoRootPath + publicationType.Logo;
                rlbPublicationTypes.Items.Add(item);
            }


            rlbPublicationTypes.Items[0].Selected = true;

            if (SelectedIndexChanged != null)
            {
                SelectedIndexChanged(this, new SelectedIndexChangedEventArgs()
                {
                    SelectedValue = Guid.Parse(rlbPublicationTypes.SelectedValue)
                });
            }


            rlbPublicationTypes.DataBind();
        }
    protected void bindSearchOutputsToPage()
    {
        foreach (var f in targetSearchManifest.Fields)
        {
            if (f.Name == null)
            {
                continue;
            }

            //See if it's already in the destination
            var rliDestination = dlbOutputFields.Destination.FindItemByValue(f.Name);
            if (rliDestination != null)
            {
                continue;
            }

            // ok, is it in the source column?
            var rli = dlbOutputFields.Source.FindItemByValue(f.Name);

            if (rli == null)  // nope
            {
                rli = new RadListBoxItem(f.Label, f.Name);
                dlbOutputFields.Source.Items.Add(rli);
            }

            // ok, move it over
            dlbOutputFields.Source.Transfer(rli, dlbOutputFields.Source, dlbOutputFields.Destination);

            if (f.Label != null)
            {
                rli.Text = f.Label;
            }
        }
    }
Ejemplo n.º 13
0
        protected void AsignarEncuesta(object sender, RadListBoxTransferringEventArgs e)
        {
            if (hdfEncuestaActual.Value != "0")
            {
                RadListBoxItem itemAsignado = programas.SelectedItem;
                int            idPrograma   = Convert.ToInt32(itemAsignado.DataKey);
                try
                {
                    con.ConnectionString = ConfigurationManager.ConnectionStrings["IconoCRM"].ToString();
                    string stmt = "INSERT INTO sm_programacionEncuestas(idEncuesta, numeroIdentificacion, idTipoIdentificacion, estadoEncuesta, fechaEstado, programaAsignado) " +
                                  "select " + hdfEncuestaActual.Value + ", numeroIdentificacion, idTipoIdentificacion,'programada', GETDATE(), " + idPrograma + " from sm_pacientePrograma where idPrograma =" + idPrograma;
                    SqlCommand cmd = new SqlCommand(stmt, con);

                    con.Open();
                    cmd.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    string error = ex.Message;
                }
                finally
                {
                    con.Close();
                }
            }
            else
            {
            }
        }
Ejemplo n.º 14
0
        protected void CargarDatos()
        {
            CursoNegocio nCurso = new CursoNegocio();
            E_CURSO      oCurso = nCurso.ObtieneCurso(vCursoId);

            ContextoCurso.oCursos.Add(oCurso);

            vIdListaCurso  = oCurso.ID_ITEM;
            txtClave.Text  = vCurso.CL_CURSO;
            txtNombre.Text = vCurso.NB_CURSO;
            //txtDsNotas.Content = vCurso.DS_NOTAS;

            if (!String.IsNullOrEmpty(vCurso.DS_NOTAS))
            {
                if (vCurso.DS_NOTAS.Contains("DS_NOTA"))
                {
                    txtDsNotas.Content = Utileria.MostrarNotas(vCurso.DS_NOTAS);
                }
                else
                {
                    XElement vRequerimientos = XElement.Parse(vCurso.DS_NOTAS);
                    if (vRequerimientos != null)
                    {
                        vRequerimientos.Name = vNbFirstRadEditorTagName;
                        txtDsNotas.Content   = vRequerimientos.ToString();
                    }
                }
            }

            txtDuracion.Text = vCurso.NO_DURACION_CURSO.ToString();

            if (vCurso.LS_AREAS_TEMATICAS.CL_AREA_TEMATICA != null)
            {
                btnEliminarAreaTCurso.Visible = true;
                cmbAreaT.SelectedValue        = vCurso.LS_AREAS_TEMATICAS.CL_AREA_TEMATICA.ToString();
                lblClAreaT.Text = vCurso.LS_AREAS_TEMATICAS.CL_AREA_TEMATICA;
                lblAreaT.Text   = vCurso.LS_AREAS_TEMATICAS.NB_AREA_TEMATICA;
            }
            else
            {
                btnEliminarAreaTCurso.Visible = false;
            }
            SPE_OBTIENE_M_PUESTO_Result puesto = new SPE_OBTIENE_M_PUESTO_Result();

            PuestoNegocio neg = new PuestoNegocio();

            if (vCurso.ID_PUESTO_OBJETIVO != null)
            {
                puesto = neg.ObtienePuestos(vCurso.ID_PUESTO_OBJETIVO).FirstOrDefault();
                Telerik.Web.UI.RadListBoxItem vItmPuestoObjetivo = new RadListBoxItem(puesto.NB_PUESTO, puesto.ID_PUESTO.ToString());
                rlbPuesto.Items.Clear();
                rlbPuesto.Items.Add(vItmPuestoObjetivo);
            }

            vXmlDocumentos = vCurso.XML_DOCUMENTOS;
            AsignarValoresAdicionales(vCurso.XML_CAMPOS_ADICIONALES);

            ContextoCurso.oCursos.Add(vCurso);
        }
Ejemplo n.º 15
0
        private void agregarItemLista(RadListBox lista, RadTextBox cajaTexto)
        {
            RadListBoxItem item = new RadListBoxItem();

            item.Value = cajaTexto.Text;
            item.Text  = cajaTexto.Text;
            lista.Items.Add(item);
        }
Ejemplo n.º 16
0
 /// <summary>
 /// 设置选中的值
 /// </summary>
 /// <param name="box"></param>
 /// <param name="item">值</param>
 public static RadListBoxItem SetSelected(this RadListBox box, RadListBoxItem item)
 {
     if (item != null)
     {
         box.ClearSelection();
         item.Selected = true;
     }
     return(item);
 }
        private void radListBoxTabItems_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.radListBoxTabItems.SelectedItem != null)
            {
                RadListBoxItem selectedItem = this.radListBoxTabItems.SelectedItem as RadListBoxItem;

                this.propGridTabProperties.SelectedObject = selectedItem.Tag;
            }
        }
Ejemplo n.º 18
0
        public void PopulateHonarariumTexts()
        {
            for (var i = 1; i <= 10; i++)
            {
                RadListBoxItem item = new RadListBoxItem("HonarariumText " + i, i.ToString());

                RadListBox1.Items.Add(item);
            }
        }
Ejemplo n.º 19
0
 private void LoadData()
 {
     this.LstCategories.Items.Clear();
     foreach (String category in GooeyConfigManager.StorePackageCategories)
     {
         RadListBoxItem item = new RadListBoxItem(category,category);
         this.LstCategories.Items.Add(item);
     }
 }
Ejemplo n.º 20
0
    protected void Page_Init(object sender, EventArgs e)
    {
        // add large number of items to RadListBox

        for (int i = 0; i < 40; i++)
        {
            var item = new RadListBoxItem(i.ToString());
            RadListBox1.Items.Add(item);
        }
    }
Ejemplo n.º 21
0
        private RadListBoxItem RoleListItem(String role, String tooltip)
        {
            MembershipUserWrapper userwrapper = MembershipUtil.FindByUserGuid(Request.QueryString["g"]);
            String value = TextEncryption.Encode(role);
            RadListBoxItem item = new RadListBoxItem(role, value);
            item.ToolTip = tooltip;
            item.Checked = MembershipUtil.IsUserInRole(userwrapper.MembershipUser.UserName, role);

            return item;
        }
Ejemplo n.º 22
0
    protected void Page_Init(object sender, EventArgs e)
    {
        // add large number of items to RadListBox

        for (int i = 0; i < 40; i++)
        {
            var item = new RadListBoxItem(i.ToString());
            RadListBox1.Items.Add(item);
        }
        
    }
Ejemplo n.º 23
0
        public void PopulateHonarariumTexts()
        {
            eventList.Add("PopulateHonarariumTexts");
            NotifyEventCalls();
            for (var i = 1; i <= 10; i++)
            {
                RadListBoxItem item = new RadListBoxItem("HonarariumText " + i, i.ToString());

                RadListBox1.Items.Add(item);
            }
        }
Ejemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vClUsuario  = ContextoUsuario.oUsuario.CL_USUARIO;
            vNbPrograma = ContextoUsuario.nbPrograma;

            DepartamentoNegocio negocio = new DepartamentoNegocio();

            if (!IsPostBack)
            {
                ptipo = Request.QueryString["TIPO"];
                vArea = new E_DEPARTAMENTO();
                if (!ptipo.Equals("Agregar"))
                {
                    pID_DEPARTAMENTO = int.Parse((Request.QueryString["ID"]));

                    SPE_OBTIENE_M_DEPARTAMENTO_Result vObjetoArea = negocio.ObtieneDepartamentos(pIdDepartamento: pID_DEPARTAMENTO).FirstOrDefault();
                    vArea.CL_DEPARTAMENTO        = vObjetoArea.CL_DEPARTAMENTO;
                    vArea.FE_INACTIVO            = vObjetoArea.FE_INACTIVO;
                    vArea.FG_ACTIVO              = vObjetoArea.FG_ACTIVO;
                    vArea.ID_DEPARTAMENTO        = vObjetoArea.ID_DEPARTAMENTO;
                    vArea.NB_DEPARTAMENTO        = vObjetoArea.NB_DEPARTAMENTO;
                    vArea.XML_CAMPOS_ADICIONALES = vObjetoArea.XML_CAMPOS_ADICIONALES;
                    vArea.ID_DEPARTAMENTO_PADRE  = vObjetoArea.ID_DEPARTAMENTO_PADRE;
                    vArea.NB_DEPARTAMENTO_PADRE  = vObjetoArea.NB_DEPARTAMENTO_PADRE;
                    vArea.CL_TIPO_DEPARTAMENTO   = vObjetoArea.CL_TIPO_DEPARTAMENTO;

                    if (vArea != null)
                    {
                        txtNbCatalogo.Text                = vArea.NB_DEPARTAMENTO;
                        txtClCatalogo.Text                = vArea.CL_DEPARTAMENTO;
                        txtClCatalogo.ReadOnly            = true;
                        chkActivo.Checked                 = vArea.FG_ACTIVO;
                        cmbTipoDepartamento.SelectedValue = vArea.CL_TIPO_DEPARTAMENTO;

                        RadListBoxItem vItem;
                        if (vArea.ID_DEPARTAMENTO_PADRE != null)
                        {
                            vItem = new RadListBoxItem(vArea.NB_DEPARTAMENTO_PADRE, vArea.ID_DEPARTAMENTO_PADRE.ToString());
                        }
                        else
                        {
                            vItem = new RadListBoxItem("No seleccionado", "");
                        }

                        lstDepartamentoJefe.Items.Clear();
                        lstDepartamentoJefe.Items.Add(vItem);
                    }
                }
                else
                {
                    chkActivo.Checked = false;
                }
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Finds the index of the first item in the list box that matches the specified string.
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public int FindStringExact(string text)
        {
            int            index = -1;
            RadListBoxItem item  = this.FindItemExact(text);

            if (item != null)
            {
                index = this.Items.IndexOf(item);
            }
            return(index);
        }
Ejemplo n.º 26
0
        protected void OnTagItemDataBound(object sender, RadListBoxItemEventArgs e)
        {
            TagReferenceItem tag  = (TagReferenceItem)e.Item.DataItem;
            RadListBoxItem   item = (RadListBoxItem)e.Item;

            item.Value = tag.TagId.ToString();
            item.Text  = Helper.GetMappedTagWord(tag.Title);
            if (tagList.Contains(tag.TagId.ToString()))
            {
                item.Checked = true;
            }
        }
Ejemplo n.º 27
0
        protected void lnkeliminarselecion_Click(object sender, EventArgs e)
        {
            IList <RadListBoxItem> collection = rdtselecteds.SelectedItems;

            foreach (RadListBoxItem node in collection)
            {
                RadListBoxItem item = rdtselecteds.FindItemByValue(node.Value);
                item.Remove();
            }

            lblcountselecteds.Text = rdtselecteds.Items.Count.ToString();
        }
Ejemplo n.º 28
0
        protected void CargarDatos(string pIdUsuario)
        {
            UsuarioNegocio nUsuario = new UsuarioNegocio();
            E_USUARIO      vUsuario = nUsuario.ObtieneUsuario(pIdUsuario);

            string vChangePasswordStyle = "block";
            string vPasswordStyle       = "none";

            bool vEsInsercion = vClOperacion == E_TIPO_OPERACION_DB.I;

            if (vEsInsercion)
            {
                vChangePasswordStyle = "none";
                vPasswordStyle       = "block";
            }

            txtClUsuario.ReadOnly          = !vEsInsercion;
            chkPasswordChange.Checked      = vEsInsercion;
            ctrlPasswordChange.Style.Value = String.Format("display:{0};", vChangePasswordStyle);
            ctrlPassword.Style.Value       = String.Format("display:{0};", vPasswordStyle);

            txtClUsuario.Text           = vUsuario.CL_USUARIO;
            txtNbUsuario.Text           = vUsuario.NB_USUARIO;
            txtNbCorreoElectronico.Text = vUsuario.NB_CORREO_ELECTRONICO;
            chkActivo.Checked           = vUsuario.FG_ACTIVO;

            cmbRol.Items.AddRange(vUsuario.XML_CATALOGOS.Element("ROLES").Elements("ROL").Select(s => new RadComboBoxItem(s.Attribute("NB_ROL").Value, s.Attribute("ID_ROL").Value)
            {
                Selected = UtilXML.ValorAtributo <bool>(s.Attribute("FG_SELECCIONADO"))
            }));

            cmbTipoMultiempresa.Items.AddRange(vUsuario.XML_CATALOGOS.Element("MULTIEMPRESAS").Elements("MULTIEMPRESA").Select(s => new RadComboBoxItem(s.Attribute("NB_TIPO_MULTIEMPRESAS").Value, s.Attribute("CL_TIPO_MULTIEMPRESAS").Value)
            {
                Selected = UtilXML.ValorAtributo <bool>(s.Attribute("FG_SELECCIONADO"))
            }));



            RadListBoxItem vItmEmpleado = new RadListBoxItem("No seleccionado", String.Empty);
            XElement       vEmpleados   = vUsuario.XML_CATALOGOS.Element("EMPLEADOS");

            if (vEmpleados != null)
            {
                XElement vEmpleado = vEmpleados.Element("EMPLEADO");
                if (vEmpleado != null)
                {
                    vItmEmpleado = new RadListBoxItem(vEmpleado.Attribute("NB_EMPLEADO").Value, vEmpleado.Attribute("ID_EMPLEADO").Value);
                }
            }
            lstEmpleado.Items.Add(vItmEmpleado);
        }
Ejemplo n.º 29
0
 public void OrtografiaIIIRespuestas(string pAnswer)
 {
     if (pAnswer != null)
     {
         var vPalabrasContestadas = MensajesPruebaLaboralI(XElement.Parse(pAnswer));
         foreach (var item in vPalabrasContestadas)
         {
             RadListBoxItem it = new RadListBoxItem();
             it.Text  = item.NB_RESPUESTA;
             it.Value = item.NB_RESPUESTA;
             lstPalabras.Items.Add(it);
         }
     }
 }
Ejemplo n.º 30
0
        protected virtual void LoadItemsInternal()
        {
            SqlQuery query = new SqlQuery();
            StringBuilder text = query.Text;

            text.Append("SELECT ");
            text.Append(this.ParentValueField);
            text.Append(',');
            text.Append(this.ParentTextField);
            text.Append(" FROM ");
            text.Append(this.ParentTable);

            if (!String.IsNullOrEmpty(this.FilterExpression))
            {
                text.AppendLine();
                text.Append("WHERE ");
                text.Append(this.FilterExpression);
            }
            if (!String.IsNullOrEmpty(this.SortExpression))
            {
                text.AppendLine();
                text.Append("ORDER BY ");
                text.Append(this.SortExpression);
            }

            base.Items.Clear();
            using (IDataReader dr = this.Factory.DataAccess.CreateDataReader(query, CommandBehavior.Default))
            {
                StringBuilder sb = new StringBuilder();
                while (dr.Read())
                {
                    int j = 1;
                    for (; j < dr.FieldCount - 1; ++j)
                    {
                        if (dr[j].GetType() != CachedTypes.DBNull)
                        {
                            sb.Append(dr[j]);
                            sb.Append(" - ");
                        }
                    }
                    sb.Append(dr[j]);

                    RadListBoxItem item = new RadListBoxItem(sb.ToString(), dr[0].ToString());
                    base.Items.Add(item);

                    sb.Length = 0;
                }
            }
        }
Ejemplo n.º 31
0
 private void AgregarItemSleccionado(IList <RadTreeNode> collection)
 {
     try
     {
         lblcountselecteds.Text = collection.Count.ToString();
         foreach (RadTreeNode node in collection)
         {
             RadListBoxItem item = new RadListBoxItem(node.Text, node.Value);
             rdtselecteds.Items.Add(item);
         }
     }
     catch (Exception ex)
     {
         Toast.Error("Error al agregar seleccion de empleados: " + ex.Message, this);
     }
 }
Ejemplo n.º 32
0
        protected override void ListBoxDoubleClick(RadListBoxItem listBoxItem)
        {
            var boxItem = listBoxItem.Content as ListBoxDocumentItem;
            if (boxItem != null)
            {
                var viewModel = ServiceLocator.Current.GetInstance<ManageContractVm>();
                if (boxItem.IsLeaf)
                {

                    viewModel.OpenDocument(boxItem.DocumentGuid);
                }
                else
                {
                    viewModel.OpenFolderInSearchResults(boxItem.DocumentPathId);
                }
            }
        }
Ejemplo n.º 33
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vClUsuario  = ContextoUsuario.oUsuario.CL_USUARIO;
            vNbPrograma = ContextoUsuario.nbPrograma;

            if (!Page.IsPostBack)
            {
                traerAreasTematicas();
                int vCursoIdQS = -1;
                vClOperacion = E_TIPO_OPERACION_DB.I;

                CursoNegocio nCurso = new CursoNegocio();

                RadListBoxItem vItmPuesto = new RadListBoxItem("Ninguno", String.Empty);
                rlbPuesto.Items.Add(vItmPuesto);
                vClRutaArchivosTemporales = Server.MapPath(ContextoApp.ClRutaArchivosTemporales);
                vLstDocumentos            = new List <E_DOCUMENTO>();
                vXmlAdicionales           = nCurso.ObtieneCampoAdicionalXml("C_CURSO");

                if (ContextoCurso.oCursos == null)
                {
                    ContextoCurso.oCursos = new List <E_CURSO>();
                }

                if (int.TryParse(Request.QueryString["CursoId"], out vCursoIdQS))
                {
                    vCursoId     = vCursoIdQS;
                    vClOperacion = E_TIPO_OPERACION_DB.A;
                    CargarDatos();
                    CargarDocumentos();
                }
                else
                {
                    vCursoId      = 0;
                    vIdListaCurso = Guid.NewGuid();
                    ContextoCurso.oCursos.Add(new E_CURSO {
                        ID_ITEM = vIdListaCurso
                    });
                }

                SeguridadProcesos();
            }
            LlenaComboAreas();
            DespacharEventos(Request.Params.Get("__EVENTTARGET"), Request.Params.Get("__EVENTARGUMENT"));
        }
Ejemplo n.º 34
0
    public void Resume(string strRoleID)
    {
        if (strRoleID != string.Empty)
        {
            IList <RadTreeNode> nodeCollection = RadTreeView_Rigth.CheckedNodes;
            //循环所有节点把CheckBox设为 false
            foreach (RadTreeNode node in nodeCollection)
            {
                node.Checked = false;
            }
            using (MWDatabaseEntities MWDB = new MWDatabaseEntities())
            {
                //根据选中ListBox的值查询tblRole表
                System.Guid gu      = new Guid(strRoleID);
                tblRole     objRole = MWDB.tblRole.First(r => r.RoleID == gu);
                if (objRole != null)
                {
                    //必须调用 Load方法,把数据先加载上去
                    ObjectQuery <tblMenu_Permission_Role> tblMenu_Permission_Roles = MWDB.tblMenu_Permission_Role.Where(" it.RoleID=Guid '" + strRoleID + "'");
                    foreach (tblMenu_Permission_Role item in tblMenu_Permission_Roles)
                    {
                        RadListBoxItem objItem = new RadListBoxItem();
                        item.tblMenuRightReference.Load();
                        objItem.Text = item.RoleID.ToString();
                        tblMenuRight objMenut = MWDB.tblMenuRight.First(m => m.MenuID == item.MenuID);
                        if (objMenut != null)
                        {
                            RadTreeNode node = RadTreeView_Rigth.FindNodeByValue(item.MenuID.ToString());

                            if (node != null)
                            {
                                //判断是否有子节点如果有返回True ,否则返回False
                                //如果有子节点就不能选中当前的节点,如果选中的话他会自动选中所有子节点
                                if (!node.HasControls())
                                {
                                    node.Checked = true;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 35
0
    public void Resume(string strRoleID)
    {
        if (strRoleID != string.Empty)
        {
            IList<RadTreeNode> nodeCollection = RadTreeView_Rigth.CheckedNodes;
            //循环所有节点把CheckBox设为 false
            foreach (RadTreeNode node in nodeCollection)
            {
                node.Checked = false;
            }
            using (MWDatabaseEntities MWDB = new MWDatabaseEntities())
            {
                //根据选中ListBox的值查询tblRole表
                System.Guid gu = new Guid(strRoleID);
                tblRole objRole = MWDB.tblRole.First(r => r.RoleID == gu);
                if (objRole != null)
                {
                    //必须调用 Load方法,把数据先加载上去
                    ObjectQuery<tblMenu_Permission_Role> tblMenu_Permission_Roles = MWDB.tblMenu_Permission_Role.Where(" it.RoleID=Guid '" + strRoleID + "'");
                    foreach (tblMenu_Permission_Role item in tblMenu_Permission_Roles)
                    {
                        RadListBoxItem objItem = new RadListBoxItem();
                        item.tblMenuRightReference.Load();
                        objItem.Text = item.RoleID.ToString();
                        tblMenuRight objMenut = MWDB.tblMenuRight.First(m => m.MenuID == item.MenuID);
                        if (objMenut != null)
                        {
                            RadTreeNode node = RadTreeView_Rigth.FindNodeByValue(item.MenuID.ToString());

                            if (node != null)
                            {
                                //判断是否有子节点如果有返回True ,否则返回False
                                //如果有子节点就不能选中当前的节点,如果选中的话他会自动选中所有子节点
                                if (!node.HasControls())
                                {
                                    node.Checked = true;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 36
0
        /// <summary>RCB_GoodsGift下拉选择事件
        /// </summary>
        protected void RCB_GoodsGiftOnSelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            var rlbGoodsGift = new RadListBoxItem(e.Text, e.Value);

            if (!string.IsNullOrEmpty(e.Value) && RCB_GoodsGift.FindItemByValue(e.Value) == null)
            {
                var item = GoodsGiftList.Items.FirstOrDefault(ent => ent.Value == rlbGoodsGift.Value);
                if (item == null)
                {
                    var goodsId = new List <Guid> {
                        new Guid(e.Value)
                    };
                    var result   = WMSSao.BindGift(goodsId);
                    var quantity = result.ContainsKey(new Guid(rlbGoodsGift.Value)) ? result[new Guid(rlbGoodsGift.Value)] : 0;
                    GoodsGiftList.Items.Add(new RadListBoxItem(rlbGoodsGift.Text + "  [" + quantity + "]", rlbGoodsGift.Value));
                }
                RCB_GoodsGift.Text = string.Empty;
            }
        }
 protected void btn_Transfer_Click(object sender, ImageClickEventArgs e)
 {
     if (Dor.Util.UtDbNet.CampoLongo(CboExames.SelectedValue) != 0)
     {
         if (!VerificarExamesExistentes())
         {
             RadListBoxItem m_sItem = new RadListBoxItem(CboExames.Text, CboExames.SelectedValue);
             lstExamesAtribuido.Items.Add(m_sItem);
             if (lstExamesAtribuido.Items.Count > 0)
             {
                 lstExamesAtribuido.SelectedIndex = 0;
                 lstExamesAtribuido.SelectedItem.Selected = true;
                 btn_Remover.Enabled = true;
             }
             CboExames.Text = string.Empty;
             CboExames.Items.Clear();
         }
     }
 }
        private void radBtnAddNewTab_Click(object sender, EventArgs e)
        {
            RibbonTab newTab = (RibbonTab)this.host.CreateComponent(typeof(RibbonTab));

            newTab.Text = newTab.Site.Name;

            RadListBoxItem listBoxItem = new RadListBoxItem();

            listBoxItem.Text = newTab.Text;
            listBoxItem.Tag  = newTab;

            if (this.radListBoxTabItems.SelectedIndex >= 0 &&
                this.radListBoxTabItems.SelectedIndex < this.radListBoxTabItems.Items.Count - 1)
            {
                this.radListBoxTabItems.Items.Insert(this.radListBoxTabItems.SelectedIndex, listBoxItem);
            }
            else
            {
                this.radListBoxTabItems.Items.Insert(this.radListBoxTabItems.Items.Count, listBoxItem);
            }

            this.radListBoxTabItems.SelectedItem = listBoxItem;

            IComponentChangeService componentChangeService = this.host.GetService(typeof(IComponentChangeService)) as IComponentChangeService;

            if (componentChangeService != null)
            {
                componentChangeService.OnComponentChanging(this.host.RootComponent, TypeDescriptor.GetProperties(this.host.RootComponent)["CommandTabs"]);

                if (this.collection.Count > 0)
                {
                    this.collection.Insert(this.collection.Count - 1, newTab);
                }
                else
                {
                    this.collection.Insert(this.collection.Count, newTab);
                }

                componentChangeService.OnComponentChanged(this.host.RootComponent, TypeDescriptor.GetProperties(this.host.RootComponent)["CommandTabs"], null, null);
                this.newlyAddedItems.Add(newTab);
            }
        }
Ejemplo n.º 39
0
    protected void btnContacts_Click(object sender, EventArgs e)
    {
        //Provide Login Information
        ViewState["hello"] = txtPassword.Text;
        RequestSettings rsLoginInfo = new RequestSettings("", txtEmail.Text, txtPassword.Text);
        rsLoginInfo.AutoPaging = true;

        // Fetch contacts and dislay them in ListBox
        ContactsRequest cRequest = new ContactsRequest(rsLoginInfo);
        Feed<Contact> feedContacts = cRequest.GetContacts();
        foreach (Contact gmailAddresses in feedContacts.Entries)
        {

            foreach (EMail emailId in gmailAddresses.Emails)
            {
                RadListBoxItem item = new RadListBoxItem();
                item.Text = emailId.Address;
                RadListBoxSource.Items.Add(item);
            }
        }
    }
 protected void btnTransferForm_Click(object sender, EventArgs e)
 {
     bool dup = false;
     foreach (RadListBoxItem item in lbxTC.CheckedItems)
     {
         foreach (RadListBoxItem i in lbxSTC.Items)
         {
             if (i.Text == item.Text)
             {
                 dup = true;
                 break;
             }
             else
             {
                 dup = false;
             }
         }
         if (!dup)
         {
             RadListBoxItem item2 = new RadListBoxItem(item.Text, item.Value);
             lbxSTC.Items.Add(item2);
         }
     }
 }
        protected void btnUpdateTC_Click(object sender, EventArgs e)
        {
            try
            {
                if (lbxSTC.CheckedItems.Count > 0)
                {
                    lbxSTC.CheckedItems[0].Value = txtUpdateTC.Text;

                    lbxSTC.CheckedItems[0].Checked = false;
                    txtUpdateTC.Text = "";
                }
                else
                {
                    //new item
                    bool dup = false;
                    foreach (RadListBoxItem i in lbxSTC.Items)
                    {
                        if (i.Text == txtUpdateTC.Text.Trim())
                        {
                            dup = true;
                            break;
                        }
                        else
                        {
                            dup = false;
                        }
                    }
                    if (!dup)
                    {
                        RadListBoxItem item = new RadListBoxItem(txtUpdateTC.Text.Trim(), txtUpdateTC.Text.Trim());
                        lbxSTC.Items.Add(item);
                        txtUpdateTC.Text = "";
                    }
                }
            }
            catch (Exception ex)
            {

            }
        }
Ejemplo n.º 42
0
 /// <summary>
 /// When overridden in derived class returns the location which is used for render transforming the drop visual.
 /// </summary>
 /// <param name="container">
 /// The container.
 /// </param>
 /// <param name="panel">
 /// The panel.
 /// </param>
 /// <returns>
 /// The location.
 /// </returns>
 public Point GetLocation(RadListBoxItem container, Panel panel)
 {
     return new Point();
 }
        protected void BuildPendingLCO()
        {
            lbxList.Items.Clear();
            foreach (var course in _alllcos)
            {
                 if (course.Grade == cmbGrade.SelectedItem.Text || cmbGrade.SelectedItem.Value.ToLower() == "all")
                {
                    if (course.ProgramArea == cmbSubject.SelectedItem.Text || cmbSubject.SelectedItem.Value.ToLower() == "all")
                    {
                        if (course.LEAName == cmbLEA.SelectedItem.Text || cmbLEA.SelectedItem.Value.ToLower() == "all")
                        {
                            RadListBoxItem radItem = new RadListBoxItem();
                            lbxList.Items.Add(radItem);

                            HyperLink hlkList = (HyperLink)radItem.FindControl("lnkListCourseName");
                            hlkList.Text = (course.CourseNumber != "0" && course.CourseNumber != "") ? course.CourseNumber + " - " + course.Course : course.Course;
                            hlkList.NavigateUrl = "~/Record/CourseObject.aspx?xID=" + Encryption.EncryptInt(course.CourseID);
                        }

                    }
                }
            }

            divListNoResults.Visible = (lbxList.Items.Count < 1);
            lbxList.Visible = (lbxList.Items.Count > 0);
        }
Ejemplo n.º 44
0
 /// <summary>
 /// When overridden in derived class indicates that visualizing the drop cue operation is finished.
 /// </summary>
 /// <param name="container">
 /// The container.
 /// </param>
 /// <param name="panel">
 /// The panel.
 /// </param>
 /// <param name="dataItem">
 /// The data item.
 /// </param>
 /// <param name="dropVisual">
 /// The drop visual.
 /// </param>
 public void VisualizeDropPlaceholderEnded(RadListBoxItem container, Panel panel, object dataItem, FrameworkElement dropVisual)
 {
 }
        protected void CarregarListaExames(DataSet c_lst)
        {
            lstExamesAtribuido.Items.Clear();

            for (int i = 0; i < c_lst.Tables[0].Rows.Count; i++)
            {
                DataRow DrowS = c_lst.Tables[0].Rows[i];

                RadListBoxItem m_sItem = new RadListBoxItem(DrowS["Descricao"].ToString(), DrowS["IDDWD016"].ToString());
                lstExamesAtribuido.Items.Add(m_sItem);

            }
            //foreach (RadListBoxItem item in c_lst.Items)
            //{
            //    RadListBoxItem m_sItem = new RadListBoxItem(item.Text, item.Value);
            //    lstExamesAtribuido.Items.Add(m_sItem);
            //}
        }
Ejemplo n.º 46
0
 protected override bool CanDoubleClick(RadListBoxItem listBoxItem)
 {
     return true;
 }
Ejemplo n.º 47
0
        private void cargarCuentasDisponibles(Connection conexion)
        {
            try
            {
                string query = String.Format("select ckc.CLIENT_ID, ckc.CLIENT_NAME from CLIENTES_KC as ckc where ckc.COUNTRY = '{0}' and ckc.DIRECT_CUSTOMER = 0 and 0 = (select COUNT(ck.KAM_ID) from CUENTAS_KAM as ck where ck.CLIENT_ID = ckc.CLIENT_ID)",
                        conexion.getUserCountry(Session.Contents["userid"].ToString()));

                DataTable resultset = conexion.getGridDataSource(query);
                foreach (DataRow fila in resultset.Rows)
                {
                    RadListBoxItem item = new RadListBoxItem();

                    item.Text = fila["CLIENT_NAME"].ToString();
                    item.Value = fila["CLIENT_ID"].ToString();

                    item.DataBind();
                    lbxCuentasFuente.Items.Add(item);
                }
            }
            catch (Exception error)
            {
                RadAjaxManager1.ResponseScripts.Add(String.Format("errorEnvio('{0}');", error.Message));
            }
        }
Ejemplo n.º 48
0
        protected void cmbKAM_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            try
            {
                #region Desbloqueos y más

                if (cmbKAM.Text.Equals(String.Empty) || cmbKAM.SelectedValue.Equals(String.Empty))
                {
                    RadAjaxManager1.ResponseScripts.Add(String.Format("alert('Seleccion invalida, seleccione un KAM de la lista.');"));
                    btEditar.Enabled = false;
                    return;
                }

                btEditar.Enabled = true;
                lbxCuentasFuente.Items.Clear();
                lbxCuentasDestino.Items.Clear();

                #endregion

                valoresInicio = new List<string>();

                Connection conexion = new Connection();
                string query = String.Format("SELECT KAM_NAME, KAM_MAIL, KAM_ACTIVE, RECEIVE_MAIL FROM KAM WHERE KAM_ID = '{0}'", cmbKAM.SelectedValue);
                DataTable Kaminfo = conexion.getGridDataSource(query);

                //Carga los controles con la info del KAM devuleta por el query
                txtNombreKAM.Text = Kaminfo.Rows[0]["KAM_NAME"].ToString();
                txtCorreo.Text = Kaminfo.Rows[0]["KAM_MAIL"].ToString();
                chkHabilitarKam.Checked = Convert.ToBoolean(Kaminfo.Rows[0]["KAM_ACTIVE"].ToString());
                chkHabilitarCorreo.Checked = Convert.ToBoolean(Kaminfo.Rows[0]["RECEIVE_MAIL"].ToString());

                cargarCuentasDisponibles(conexion);

                query = String.Format("SELECT CK.CLIENT_ID, CK.CLIENT_NAME FROM CLIENTES_KC AS CK JOIN CUENTAS_KAM AS C ON CK.CLIENT_ID = C.CLIENT_ID WHERE C.KAM_ID = '{0}'",
                    cmbKAM.SelectedValue);
                Kaminfo = conexion.getGridDataSource(query);

                foreach (DataRow fila in Kaminfo.Rows)
                {
                    RadListBoxItem item = new RadListBoxItem();

                    valoresInicio.Add(fila["CLIENT_ID"].ToString());
                    item.Text = fila["CLIENT_NAME"].ToString();
                    item.Value = fila["CLIENT_ID"].ToString();

                    item.DataBind();
                    lbxCuentasDestino.Items.Add(item);
                }
            }
            catch (Exception error)
            {
                RadAjaxManager1.ResponseScripts.Add(String.Format("errorEnvio('{0}');", error.Message));
            }
        }
        protected void BuildPendingLCO()
        {
            lbxList.Items.Clear();
            foreach (var course in _lcos)
            {
                if (course.ProgramArea == cmbSubject.SelectedItem.Text || cmbSubject.SelectedItem.Value.ToLower() == "all")
                {
                    if (course.Status == cmbStatus.SelectedItem.Text || cmbStatus.SelectedItem.Value.ToLower() == "all")
                    {
                        if (course.LEAName == cmbLEA.SelectedItem.Text || cmbLEA.SelectedItem.Value.ToLower() == "all")
                        {
                            
                                RadListBoxItem radItem = new RadListBoxItem();
                                lbxList.Items.Add(radItem);

                                Image imgProofed = (Image)radItem.FindControl("testImg");
                                imgProofed.ImageUrl = "~/Images/under_review.png";

                                HyperLink hlkList = (HyperLink)radItem.FindControl("lnkListCourseName");
                                hlkList.Text = course.Course;
                                hlkList.NavigateUrl = "~/Record/CourseObject.aspx?xID=" + Encryption.EncryptInt(course.CourseID);

                                if (_level == EntityTypes.RegionalCoordinator || _level == EntityTypes.SectionChief)
                                {
                                    Label lblLEA = (Label)radItem.FindControl("lblLEA");
                                    lblLEA.Text = "LEA: " + course.LEAName;
                                }
                                else
                                {
                                    ((Label)radItem.FindControl("lblLEA")).Visible = false;
                                }

                                Label lblRequestDate = (Label)radItem.FindControl("lblRequestDate");
                                if (!course.IsApproved && !course.IsSectionRequested && course.IsRegionRequested)
                                {
                                    lblRequestDate.Text = "Region Approval Requested: " + course.DateRCRequested;
                                }
                                else if (!course.IsApproved && course.IsSectionRequested && course.IsRegionRequested)
                                {
                                    lblRequestDate.Text = "State Approval Requested: " + course.DateSCRequested;
                                }
                           
                        }              
                    }
                }
            }

            divListNoResults.Visible = (lbxList.Items.Count < 1);
            lbxList.Visible = (lbxList.Items.Count > 0);
        }
Ejemplo n.º 50
0
        protected void UpdatePaymentMethod(int sellcurrency, decimal sellamount)
        {
            ddlpaymentmethod.Items.Clear();
            //Check if have enough balance in account
            DataTable dtfundingsources = sitetemp.getpossiblefundingsources(currentuser.User_key, sellcurrency, sellamount);
            if (dtfundingsources.Rows.Count > 0)
            {
                //Has enough in balance
                ddlpaymentmethod.DataTextField = "user_balance_text";
                ddlpaymentmethod.DataValueField = "payment_object_key";
                ddlpaymentmethod.DataSource = dtfundingsources;
                ddlpaymentmethod.DataBind();
            }
            RadListBoxItem rdtemp = new RadListBoxItem();
            rdtemp.Value = "0";
            rdtemp.Text = "Bank Account";
            ddlpaymentmethod.Items.Add(rdtemp);

            ddlpaymentmethod.SelectedIndex = 0;
        }
Ejemplo n.º 51
0
        private void initForm()
        {
            dpStartDate.SelectedDate = DateTime.Now;
            _conn.Open();

            var cmd = new OleDbCommand(
                "SELECT ClassType.classTypeID, ClassType.classTypeDesc FROM ClassType;", _conn);
            var myReader = cmd.ExecuteReader();
            while (myReader.Read())
            {
                var i = new RadListBoxItem(myReader["classTypeDesc"].ToString(),
                                                      myReader["classTypeID"].ToString());
                lbClasses.Items.Add(i);
            }
            myReader.Close();

            cmd = new OleDbCommand("SELECT DaysOfWeek.DaysOfWeekID, DaysOfWeek.Description FROM DaysOfWeek;", _conn);
            myReader = cmd.ExecuteReader();
            while (myReader.Read())
            {
                lbDays.Items.Add(new RadListBoxItem(myReader["Description"].ToString(),
                                                    myReader["DaysOfWeekID"].ToString()));
            }
            myReader.Close();

            cmd = new OleDbCommand("SELECT Hotels.HotelID, Hotels.ClassLocation FROM Hotels;", _conn);
            myReader = cmd.ExecuteReader();
            while (myReader.Read())
            {
                var i = new RadListBoxItem(myReader["ClassLocation"].ToString(),
                                                      myReader["HotelID"].ToString());
                lbLocations.Items.Add(i);
            }
            myReader.Close();
            _conn.Close();
        }
Ejemplo n.º 52
0
 /// <summary>
 /// When overridden in derived class returns the location which is used for render transforming the drop visual depending on the <see cref="T:Telerik.Windows.Controls.ItemDropPosition"/>.
 /// </summary>
 /// <param name="container">
 /// The container.
 /// </param>
 /// <param name="panel">
 /// The panel.
 /// </param>
 /// <param name="dropPosition">
 /// The drop position.
 /// </param>
 /// <returns>
 /// The <see cref="Point"/>.
 /// </returns>
 public Point GetLocation(RadListBoxItem container, Panel panel, ItemDropPosition dropPosition)
 {
     return new Point();
 }
Ejemplo n.º 53
0
 /// <summary>
 /// When overridden in derived class returns the margin for the container when the dragged element moves above it.
 /// </summary>
 /// <param name="container">
 /// The container.
 /// </param>
 /// <param name="panel">
 /// The panel.
 /// </param>
 /// <param name="dropVisual">
 /// The drop visual.
 /// </param>
 /// <returns>
 /// The margin.
 /// </returns>
 public Thickness GetDropCueHighlightMargin(RadListBoxItem container, Panel panel, FrameworkElement dropVisual)
 {
     return new Thickness();
 }
        private RadListBoxItemState GetRadListBoxItemState(RadListBoxItem listBoxItem)
        {
            Debug.Assert(listBoxItem != null);

            var row = (DataRowView)(listBoxItem).DataItem;

            Debug.Assert(row != null);

            return new RadListBoxItemState
            {
                DataRowViewState = GetDataRowViewState(row),
            };
        }
        private HtmlGenericControl CreateHeaderDiv(Criterion criterion)
        {
            var containerDiv = new HtmlGenericControl("div");

            var headerDiv = new HtmlGenericControl("div");
            headerDiv.Attributes["class"] = "criteriaHeaderDiv";

            var headerDivLbl = new HtmlGenericControl("div");
            headerDivLbl.Attributes["class"] = "left";

            var headerDivExpand = new HtmlGenericControl("div");
            headerDivExpand.Attributes["class"] = "right";

            var adjustedID = StripString(criterion.Key);

            headerDivExpand.ID = "expand_" + adjustedID;
            headerDivExpand.Style.Add("overflow", "hidden");

            var requiredAsterik = "";

            // Add tooltip
            if (!criterion.Locked && (criterion.UIType != UIType.None))
            {
                var tooltip = new RadToolTip
                {
                    Height = 55,
                    Width = 205,
                    TargetControlID = headerDivExpand.ID,
                    Position = ToolTipPosition.MiddleRight,
                    RelativeTo = ToolTipRelativeDisplay.Element,
                    HideEvent = ToolTipHideEvent.Default,
                    AutoCloseDelay = 20000,
                    Skin = "Black",
                    ShowEvent = ToolTipShowEvent.OnClick,
                    EnableShadow = true
                };

                var contentChunk = new HtmlGenericControl("div");
                contentChunk.Style.Add("position", "relative");

                if (criterion.IsRequired) //BJC - 6/11/2012: If this criterion object is required
                {
                    requiredFields.Value += criterion.Key + ","; //Add Key to the requiredFields hidden input value.
                    requiredAsterik = "<span style=\"font-weight:bold;color:#F00;\">*</span>";
                }

                // Add appropriate control to tooltip
                switch (criterion.UIType)
                {
                    case UIType.DropDownList:
                        var cmb = CreateDropDownList(criterion, adjustedID);

                        if (criterion.Object != null && criterion.ReportStringVal != null)
                        {
                            var selectedItemIndex = cmb.FindItemIndexByValue(adjustedID + "_" + criterion.ReportStringVal, true);
                            if (selectedItemIndex > 0) cmb.SelectedIndex = selectedItemIndex;
                            if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                            {
                                requiredFieldsSelected.Value += criterion.Key + ",";
                            }
                        }

                        contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                        contentChunk.Controls.Add(cmb);

                        tooltip.Attributes["dropDownListID"] = cmb.ID;
                        tooltip.OnClientShow = "onClientShowToolTipDropDownList";

                        break;

                    //case UIType.RadioButton:
                    //    {
                    //        var radioButtons = new RadButton()
                    //        {
                    //            ID = "RadRadioButtonCriteriaRadioButtonList",
                    //            GroupName = criterion.Key,
                    //            ToggleType = ButtonToggleType.Radio,
                    //            //AutoPostBack = false,
                    //            //OnClientToggleStateChanged = "OnClientToggleStateChanged"

                    //        };

                    //        if (criterion.DataSource == null)
                    //        {
                    //            radioButtons.ToggleStates.Add(new RadButtonToggleState("No data supplied", string.Format(adjustedID + "_" + "0")));
                    //        }
                    //        else
                    //        {
                    //            radioButtons.ToggleStates.Add(new RadButtonToggleState("All", string.Format(adjustedID + "_" + "0")));


                    //            foreach (DataRow row in ((DataTable)criterion.DataSource).Rows)
                    //            {
                    //                var rbItem = new RadButtonToggleState(row[criterion.DataTextField].ToString(),
                    //                                                      adjustedID + "_" +
                    //                                                      row[criterion.DataValueField]);

                    //                radioButtons.ToggleStates.Add(rbItem);
                    //            }
                    //        }

                    //        contentChunk.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("div") { InnerText = criterion.Header });
                    //        contentChunk.Controls.Add(radioButtons);


                    //        break;
                    //    }

                    case UIType.CheckBoxList:
                        {
                            tooltip.Width = (criterion.ChildDataSource != null) ? 450 : 205;

                            var listBox = this.CreateCheckBoxList(criterion, adjustedID);
                            tooltip.Attributes.Add("lstBoxID", listBox.ClientID);

                            tooltip.OnClientShow = "setListBoxMaxHeight";

                            if (criterion.Object != null && criterion.ReportStringVal != null)
                            {
                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(listBox);

                            if (!string.IsNullOrEmpty(criterion.ChildHeader))
                            {
                                tooltip.OnClientShow = "TooltipOnClientShow_DisplayChildCheckboxItems";
                                tooltip.Attributes["ParentListID"] = "RadCombobBoxCriteriaCheckBoxList";
                                tooltip.Attributes["ChildListID"] = "RadCombobBoxCriteriaCheckBoxList2";

                                listBox.Attributes.Add("ChildCheckBoxList", "RadCombobBoxCriteriaCheckBoxList2");

                                var listBox2 = new RadListBox
                                {
                                    ID = "RadCombobBoxCriteriaCheckBoxList2",
                                    AutoPostBack = false,
                                    CheckBoxes = true,
                                    Skin = "Vista",
                                    OnClientItemChecked = "onItemChecked"
                                };

                                foreach (DataRow row in ((DataTable)criterion.ChildDataSource).Rows)
                                {
                                    var listBoxValue = string.Format("{0}_{1}", adjustedID, StripString(row[criterion.ChildDataValueField].ToString()));
                                    var listBoxItem = new RadListBoxItem(row[criterion.ChildDataTextField].ToString(), listBoxValue);
                                    listBoxItem.Attributes["parentValue"] = string.Format("{0}_{1}", adjustedID, StripString(row[criterion.ChildDataParentField].ToString()));
                                    listBoxItem.Attributes["checkBoxID"] = string.Format("{0}_RadCombobBoxCriteriaCheckBoxList2_CheckBox", listBoxValue);

                                    Criterion tempCriterion = null;
                                    foreach (Criterion c in Criteria.CriterionList)
                                    {
                                        if (c.Key == listBoxValue)
                                        {
                                            tempCriterion = c;
                                            break;
                                        }
                                    }

                                    if (tempCriterion != null)
                                    {
                                        listBoxItem.Checked = !tempCriterion.Empty;
                                    }

                                    listBox2.Items.Add(listBoxItem);
                                }

                                contentChunk.Controls.Add(new HtmlGenericControl("span") { InnerText = criterion.ChildHeader });
                                contentChunk.Controls.Add(listBox2);
                            }

                            break;
                        }

                    case UIType.TextBox:
                        {
                            var textBox = CreateTextBox(criterion, adjustedID);

                            if (criterion.Object != null && criterion.ReportStringVal != null)
                            {
                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(textBox);

                            tooltip.OnClientShow = "onClientShowToolTipTextBox";
                            tooltip.Attributes["textBoxID"] = textBox.ID;

                            break;
                        }

                    case UIType.DatePicker:
                        {
                            tooltip.Width = 330;

                            var startCriterion = Criteria.CriterionList.Find(c => c.Header == criterion.Header && c.IsHeader == false && c.Key.Contains("Start"));
                            var endCriterion = Criteria.CriterionList.Find(c => c.Header == criterion.Header && c.IsHeader == false && c.Key.Contains("End"));

                            var wrapperDiv = CreateDatePicker(adjustedID, startCriterion, endCriterion);

                            if (criterion.Object != null && criterion.ReportStringVal != null)
                            {
                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(wrapperDiv);

                            break;
                        }

                    case UIType.AssessmentTextSearch:
                        {
                            tooltip.Width = 400;

                            var wrapperDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            wrapperDiv.Style.Add("width", "350px");

                            var textBox = new RadTextBox
                            {
                                ID = "RadTextBoxAssessmentTextSearch",
                                AutoPostBack = false,
                                Skin = "Vista"
                            };

                            textBox.ClientEvents.OnBlur = "onInputBlur";
                            textBox.Attributes["updateMessageHeader"] = adjustedID;
                            textBox.Attributes["comboBoxDivID"] = "cmbBoxDiv";

                            //ADD DIV TO contentChunk
                            var textBoxDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div") { ID = "textBoxDiv" };
                            textBoxDiv.Controls.Add(textBox);


                            var textSearchCmb = new Telerik.Web.UI.RadComboBox
                            {
                                ID = "RadComboBoxAssessmentTextSearch",
                                AutoPostBack = false,
                                MarkFirstMatch = true,
                                AllowCustomText = false,
                                ZIndex = 8005,
                                OnClientSelectedIndexChanged = "onSelectedIndexChanged",
                                Skin = "Vista"
                            };
                            textSearchCmb.Attributes["textBoxDivID"] = "textBoxDiv";


                            if (criterion.Object != null)
                            {
                                var textSearchObjectArray = criterion.Object.ToString().Split(':');
                                textBox.Text = textSearchObjectArray[1].Trim();

                                var selectedItemIndex = textSearchCmb.FindItemIndexByText(textSearchObjectArray[0].Trim(), true);

                                textSearchCmb.SelectedIndex = selectedItemIndex;

                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            var textSearchCmbDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div") { ID = "cmbBoxDiv" };
                            textSearchCmbDiv.Controls.Add(textSearchCmb);

                            if (criterion.DataSource == null)
                            {
                                textSearchCmb.Items.Add(new RadComboBoxItem("No data supplied", adjustedID + "_" + "0"));
                            }
                            else
                            {
                                foreach (DataRow row in ((DataTable)criterion.DataSource).Rows)
                                {
                                    textSearchCmb.Items.Add(new RadComboBoxItem(row[criterion.DataTextField].ToString(), adjustedID + "_" + row[criterion.DataValueField]));
                                }
                            }

                            contentChunk.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("div") { InnerText = criterion.Header });

                            var wrapperDivLeft = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            wrapperDivLeft.Style.Add("float", "left");
                            wrapperDivLeft.Style.Add("width", "149px");
                            wrapperDivLeft.Controls.Add(textBoxDiv);

                            var wrapperDivRight = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            wrapperDivRight.Style.Add("float", "right");
                            wrapperDivRight.Style.Add("width", "149px");
                            wrapperDivRight.Controls.Add(textSearchCmbDiv);

                            wrapperDiv.Controls.Add(wrapperDivLeft);
                            wrapperDiv.Controls.Add(wrapperDivRight);

                            contentChunk.Controls.Add(wrapperDiv);

                            break;
                        }

                    case UIType.Demographics:
                        {
                            tooltip.Width = 390;

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(CreateDemographics(criterion, adjustedID));

                            break;
                        }

                    case UIType.RTI:
                        {
                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(CreateRTI(criterion, adjustedID));

                            break;
                        }
                }

                tooltip.Controls.Add(contentChunk);
                headerDiv.Controls.Add(tooltip);
            }

            if (criterion.Locked == false)
            {
                headerDivExpand.Controls.Add(new Image { ImageUrl = "~/Images/commands/expand_bubble.png", Width = 16, Height = 16 });
            }
            else if (FirstTimeLoaded)
            {
                criterion.ReportStringVal = criterion.DefaultValue;
            }

            headerDivLbl.InnerHtml = criterion.Header + ":" + requiredAsterik;

            headerDiv.Controls.Add(headerDivLbl);
            headerDiv.Controls.Add(headerDivExpand);

            var updateMessageDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
            updateMessageDiv.Attributes["class"] = "criteriaUpdateMessageDiv";
            updateMessageDiv.Attributes["id"] = adjustedID + "_updateMessage";

            containerDiv.Controls.Add(headerDiv);
            containerDiv.Controls.Add(updateMessageDiv);

            return containerDiv;
        }
        private void ApplyRadListBoxItemState(RadListBoxItem item, RadListBoxItemState state)
        {
            Debug.Assert(item != null);
            Debug.Assert(state != null);

            var descriptionLabel = (Label)item.FindControl(DescriptionLableName);
            Debug.Assert(descriptionLabel != null);
            ApplyLableState(descriptionLabel, state.DataRowViewState.DescriptionLabelState);

            var distractorLabel = (Label)item.FindControl(DistractorLabelName);
            Debug.Assert(distractorLabel != null);
            ApplyLableState(distractorLabel, state.DataRowViewState.DistractorLabelState);

            var valueLabel = (Label)item.FindControl(ValueLabelName);
            Debug.Assert(valueLabel != null);
            ApplyLableState(valueLabel, state.DataRowViewState.ValueLableState);
        }
Ejemplo n.º 57
0
 protected abstract bool CanDoubleClick(RadListBoxItem listBoxItem);
Ejemplo n.º 58
0
 protected abstract void ListBoxDoubleClick(RadListBoxItem listBoxItem);
        protected void BuildPendingLCO()
        {
            lbxList.Items.Clear();
            foreach(var course in _lcos)
            {
                if (course.ProgramArea == cmbSubject.SelectedItem.Text || cmbSubject.SelectedItem.Value.ToLower() == "all")
                {
                    if (course.LEAName == cmbLEA.SelectedItem.Text || cmbLEA.SelectedItem.Value.ToLower() == "all")
                    {
                        RadListBoxItem radItem = new RadListBoxItem();
                        lbxList.Items.Add(radItem);

                        Image imgProofed = (Image)radItem.FindControl("testImg");
                        imgProofed.ImageUrl = "~/Images/editable.png";

                        HyperLink hlkList = (HyperLink)radItem.FindControl("lnkListCourseName");
                        hlkList.Text = course.Course;
                        hlkList.NavigateUrl = "~/Record/CourseObject.aspx?xID=" + Encryption.EncryptInt(course.CourseID);
                        Label lblLEA = (Label)radItem.FindControl("lblLEA");
                        if (_level == EntityTypes.RegionalCoordinator || _level == EntityTypes.SectionChief)
                        {
                            //Label lblLEA = (Label)radItem.FindControl("lblLEA");
                            lblLEA.Text = "LEA:"+" "+ course.LEAName;
                        }
                        else
                        {
                            //Panel pnlLEA = (Panel)radItem.FindControl("listLine2List");
                            //pnlLEA.Visible = false;
                            lblLEA.Visible = false;
                        }
                        Label lblDateEdit = (Label)radItem.FindControl("lblDateEdited");
                        lblDateEdit.Text = "Last Edited: "+" "+course.DateEdited;
                    }                
                }
            }

            divListNoResults.Visible = (lbxList.Items.Count < 1);
            lbxList.Visible = (lbxList.Items.Count > 0);
        }
Ejemplo n.º 60
-1
        private RadListBox CreateCheckBoxList(Criterion criterion, string adjustedID)
        {
            var listBox = new RadListBox
            {
                ID = "RadCombobBoxCriteriaCheckBoxList" + adjustedID,
                AutoPostBack = false,
                CheckBoxes = true,
                Skin = "Vista",
                OnClientItemChecked = "onItemChecked",
                CssClass = "noWrapRadListBox"
            };

            if (criterion.Dependencies != null && criterion.Dependencies.Length > 0)
            {


                listBox.Attributes["dependencies"] = DependencyString(criterion);
            }

            if (!string.IsNullOrEmpty(criterion.ServiceUrl))
            {
                listBox.Attributes["serviceurl"] = criterion.ServiceUrl;
            }

            if (!string.IsNullOrEmpty(criterion.ServiceOnSuccess))
            {
                listBox.Attributes["successcallback"] = criterion.ServiceOnSuccess;
            }

            if (string.IsNullOrEmpty(listBox.Attributes["ListBoxIdentifier"]))
            {
                listBox.Attributes["ListBoxIdentifier"] = listBox.ClientID;
            }

            listBox.Style.Add(HtmlTextWriterStyle.Overflow, "auto !important");
            listBox.Style.Add(HtmlTextWriterStyle.Height, "100%");
            listBox.Style.Add(HtmlTextWriterStyle.Width, "100%");

            if (criterion.DataSource == null)
            {
                listBox.Items.Add(new RadListBoxItem("No data supplied", string.Format("{0}_0", adjustedID)));
                listBox.CheckBoxes = false;
            }
            else
            {
                foreach (DataRow row in ((DataTable)criterion.DataSource).Rows)
                {
                    var listBoxValue = string.Format(
                        "{0}_{1}", adjustedID, StripString(row[criterion.DataValueField].ToString()));
                    var listBoxItem = new RadListBoxItem(row[criterion.DataTextField].ToString(), listBoxValue);
                    listBoxItem.Attributes["checkBoxID"] =
                        string.Format("{0}_RadCombobBoxCriteriaCheckBoxList{1}_CheckBox", listBoxValue, adjustedID);

                    // This fails with an exception if no First item.
                    //var tempCriterion = Criteria.CriterionList.First(r => r.Key == listBoxValue);
                    // Do it so that no exceptions are generated.
                    Criterion tempCriterion = null;
                    foreach (Criterion c in this.Criteria.CriterionList)
                    {
                        if (c.Key == listBoxValue)
                        {
                            tempCriterion = c;
                            break;
                        }
                    }

                    if (tempCriterion != null)
                    {
                        if (FirstTimeLoaded)
                        {
                            if (!String.IsNullOrEmpty(tempCriterion.DefaultValue) &&
                                tempCriterion.DefaultValue.Contains(StripString(row[criterion.DataValueField].ToString())))
                            {
                                tempCriterion.Object = listBoxItem.Text;
                                tempCriterion.ReportStringVal = tempCriterion.DefaultValue;
                                listBoxItem.Checked = true;
                            }
                            else
                            {
                                listBoxItem.Checked = !tempCriterion.Empty;
                            }
                        }
                        else
                        {
                            if (adjustedID=="SchoolType")
                            {
                                listBoxItem.Checked = hiddenSchoolTypeListSelected.Text.Contains(listBoxItem.Value);
                            }
                            else
                            {
                                listBoxItem.Checked = hiddenGradeListSelected.Text.Contains(listBoxItem.Value);
                            }
                           
                        }
                    }

                    listBox.Items.Add(listBoxItem);
                }

                if (IsPostBack && !string.IsNullOrEmpty(criterion.ServiceUrl))
                {
                    var javascript = "function () { serviceControlsList['" + adjustedID + "'].loaded = true; serviceControlsList['" + adjustedID + "'].callback = function () { loadServiceData('" + adjustedID + "', 'CheckBoxList'); } }";
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "StartupService" + adjustedID, "addServiceControl('" + adjustedID + "');", true);
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "CheckServiceControls", "loadingInterval = window.setInterval('checkServiceControlsFullyLoaded()', 200);", true);

                    listBox.OnClientLoad = javascript;
                }
            }

            return listBox;
        }