Exemplo n.º 1
0
        protected void dlCargo_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            String sql = "SELECT top(30) CargoId,CargoName FROM [tblCargo] WHERE CargoName LIKE '%" + e.Text.ToUpper() + "%'";

            cargoSource.SelectCommand = sql;
            dlCargo.DataBind();
        }
Exemplo n.º 2
0
        protected void ddlStakeHolder_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            try
            {
                var stockholderTypeId = ddlStakeHolderType.SelectedValue.Trim();
                if (stockholderTypeId == "1" || stockholderTypeId == "14")
                {
                    //string sqlSelectCommand = @"Select InstitutionID,InstitutionName from Institution_Master_Info";
                    //SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, connectionString);
                    ////adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
                    //DataTable dataTable = new DataTable();
                    //adapter.Fill(dataTable);

                    DataTable dataTable = pbUtility.GetDataByProc("sp_getInstitutionMaster");
                    foreach (DataRow dataRow in dataTable.Rows)
                    {
                        RadComboBoxItem item = new RadComboBoxItem();
                        item.Text  = (string)dataRow["InstitutionName"];
                        item.Value = dataRow["InstitutionID"].ToString();
                        item.Attributes.Add("InstitutionName", dataRow["InstitutionName"].ToString());
                        ddlStakeHolder.Items.Add(item);
                        item.DataBind();
                    }
                }
                else
                {
                    ClearStakeHolder();
                }
            }
            catch (Exception ex)
            {
                Alert.Show(ex.Message);
            }
        }
Exemplo n.º 3
0
        protected void ddlStakeHolderType_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            try
            {
                //string sqlSelectCommand = @"Select StakeholderTypeID,StakeholderTypeName from [dbo].[CmnStakeholderType]";
                //SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, connectionString);
                ////adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
                //DataTable dataTable = new DataTable();
                //adapter.Fill(dataTable);

                //Hashtable ht = new Hashtable();
                //ht.Add("EnterpriseCategoryId", 1);  // 1 for Yarn
                DataTable dataTable = pbUtility.GetDataByProc("sp_getStakeholderType");
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    RadComboBoxItem item = new RadComboBoxItem();
                    item.Text  = (string)dataRow["StakeholderTypeName"];
                    item.Value = dataRow["StakeholderTypeID"].ToString();
                    item.Attributes.Add("StakeholderTypeName", dataRow["StakeholderTypeName"].ToString());
                    ddlStakeHolderType.Items.Add(item);
                    item.DataBind();
                }
            }
            catch (Exception ex)
            {
                Alert.Show(ex.Message);
            }
        }
 private void list_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
 {
     ((RadComboBox)o).DataTextField = DataField;
     ((RadComboBox)o).DataValueField = DataField;
     ((RadComboBox)o).DataSource = GetDataTable("SELECT DISTINCT " + UniqueName + " FROM Customers WHERE " + UniqueName + " LIKE '" + e.Text + "%'");
     ((RadComboBox)o).DataBind();
 }
        protected void RcbAuditingItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            var combo = (RadComboBox)sender;

            combo.Items.Clear();
            if (!string.IsNullOrEmpty(e.Text))
            {
                string key = e.Text;
                IList <PersonnelInfo> personnelList = _personnelManager.GetList().Where(p => p.RealName.IndexOf(key, StringComparison.Ordinal) > -1).ToList();
                Int32 totalCount = personnelList.Count;
                if (e.NumberOfItems >= totalCount)
                {
                    e.EndOfItems = true;
                }
                else
                {
                    foreach (PersonnelInfo personnelInfo in personnelList)
                    {
                        var item = new RadComboBoxItem
                        {
                            Text  = personnelInfo.RealName,
                            Value = personnelInfo.PersonnelId.ToString()
                        };
                        combo.Items.Add(item);
                    }
                }
            }
        }
Exemplo n.º 6
0
        protected void atiRadComboBoxSearchMessageInbox_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            // TODO: we need to search "reply" text and add those messages to the results.
            RadComboBox atiRadComboBoxSearchMessageInbox = (RadComboBox)sender;
            atiRadComboBoxSearchMessageInbox.Items.Clear();
            const int TAKE = 5;
            aqufitEntities entities = new aqufitEntities();
            int itemOffset = e.NumberOfItems;
            IQueryable<Message> messagesQuery = entities.MessageRecipiants.Where( m => m.UserSettingsKey == this.UserSettings.Id ).Select( m => m.Message ).OrderBy(m => m.DateTime);
            int length = messagesQuery.Count();
            messagesQuery = string.IsNullOrEmpty(e.Text) ? messagesQuery.Where(m => m.UserSetting.Id != this.UserSettings.Id).Skip(itemOffset).Take(TAKE) : messagesQuery.Where(m => m.UserSetting.Id != this.UserSettings.Id && m.Subject.ToLower().Contains(e.Text) || m.Text.ToLower().Contains(e.Text)).Skip(itemOffset).Take(TAKE);

            Message[] messages = messagesQuery.ToArray();

            foreach (Message m in messages)
            {
                RadComboBoxItem item = new RadComboBoxItem(m.Subject);
                item.Value = "" + m.Id;
               // item.ImageUrl = ResolveUrl("~/DesktopModules/ATI_Base/services/images/profile.aspx") + "?u=" + g.UserKey + "&p=" + g.PortalKey;
                atiRadComboBoxSearchMessageInbox.Items.Add(item);
            }
            int endOffset = Math.Min(itemOffset + TAKE + 1, length);
            e.EndOfItems = endOffset == length;
            e.Message = (length <= 0) ? "No matches" : String.Format("Items <b>1</b>-<b>{0}</b> of {1}", endOffset, length);
        }
Exemplo n.º 7
0
 public virtual void OnRouteItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     if (this.RouteItemsRequested != null)
     {
         this.RouteItemsRequested(sender, e);
     }
 }
Exemplo n.º 8
0
    protected void ComboControl_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        People candidates = null;

        if (e.Text.Replace(" ", "").Length >= 4)
        {
            candidates = People.FromNamePattern(e.Text);
        }

        if (candidates == null)
        {
            candidates = new People();
        }

        candidates = candidates.GetVisiblePeopleByAuthority(this.authority);
        candidates.Sort();

        int itemOffset = e.NumberOfItems;
        int itemCount  = Math.Min(itemOffset + initialItemCount, candidates.Count);

        e.EndOfItems = (itemCount == candidates.Count ? true : false);

        for (int i = itemOffset; i < itemCount; i++)
        {
            string descriptionString = candidates[i].Canonical;

            RadComboBoxItem comboItem = new RadComboBoxItem(descriptionString, candidates[i].Identity.ToString());
            comboItem.ImageUrl = "/Images/Public/Fugue/icons-shadowless/" +
                                 PersonIcon.ForPerson(candidates[i], Organizations.FromSingle(Organization.PPSE)).Image;

            this.ComboControl.Items.Add(comboItem);
        }

        e.Message = GetStatusMessage(itemCount, candidates.Count);
    }
Exemplo n.º 9
0
        protected void dlGang_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            String sql = "SELECT top(30) GangId,GangName FROM [tblGangs] WHERE GangName LIKE '%" + e.Text.ToUpper() + "%'";

            gangSource.SelectCommand = sql;
            dlGang.DataBind();
        }
Exemplo n.º 10
0
    protected void cboSeguros_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        //long idEmpresa = long.Parse(e.Text);


        ///// Cargo los seguros dados de alta para la empresa seleccionada
        //var Seguros = (from s in Contexto.Seguros
        //               where s.EmpresaContratista == idEmpresa
        //               select new
        //               {
        //                   Descripcion = s.objCompañia.Descripcion + " " + s.NroPoliza + " " + s.objTipoSeguro.Descripcion,
        //                   s.IdSeguro
        //               }).Distinct();

        //cboSeguro.Items.Clear();
        //if (Seguros.Count() > 0)
        //{
        //    foreach (var item in Seguros)
        //    {
        //        cboSeguro.Items.Add(new RadComboBoxItem(item.Descripcion, item.IdSeguro.ToString()));
        //    }
        //}
        //else
        //{
        //    cboSeguro.Items.Add(new RadComboBoxItem("No se encontraron resultados", "-1"));
        //}
    }
Exemplo n.º 11
0
        protected void dlCompany_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            String sql = "SELECT top(30) DLEcodeCompanyID,DLEcodeCompanyName FROM [tblDLECompany] WHERE Active = 1 AND DLEcodeCompanyName LIKE '%" + e.Text.ToUpper() + "%'";

            dleSource.SelectCommand = sql;
            dlCompany.DataBind();
        }
Exemplo n.º 12
0
        protected void ddlEquipamentoTipo_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            Dictionary <int, string> dicEquipamentoTipo = null;
            string sTexto     = e.Text.Trim();
            int    itemOffset = 0;
            int    endOffset  = 0;

            try
            {
                ddlEquipamentoTipo.Items.Clear();

                using (UnitOfWork oUnitOfWork = new UnitOfWork())
                {
                    dicEquipamentoTipo = oUnitOfWork.EquipamentoTipoREP.BuscarTodosKeyValue(sTexto);
                }

                itemOffset   = e.NumberOfItems;
                endOffset    = Math.Min(itemOffset + 10, dicEquipamentoTipo.Count);
                e.EndOfItems = endOffset == dicEquipamentoTipo.Count;

                for (int i = itemOffset; i < endOffset; i++)
                {
                    var item = dicEquipamentoTipo.ElementAt(i);

                    ddlEquipamentoTipo.Items.Add(new RadComboBoxItem(item.Value, item.Key.ToString()));
                }

                e.Message = Utils.GetStatusMessage(endOffset, dicEquipamentoTipo.Count);
            }
            catch (Exception ex)
            {
                Log.Trace(ex, true);
                Utils.Notificar(ntfGeral, "Falha ao tentar carregar dados de equipamentos. Contate o administrador", Enums.TipoNotificacao.Erro);
            }
        }
Exemplo n.º 13
0
    protected void cboContratos_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        long idEmpresa = long.Parse(e.Text);

        DateTime fechaAlta = DateTime.Parse("10/10/2080");
        /// Cargo los contratos para la empresa seleccionada
        var Contratos = (from c in Contexto.ContratoEmpresas
                         where c.IdEmpresa == idEmpresa
                         select new
        {
            c.Contrato.Codigo,
            c.Contrato.IdContrato,
            FechaVencimiento = c.Contrato != null ? (c.Contrato.Prorroga != null && c.Contrato.Prorroga > c.Contrato.FechaVencimiento ? c.Contrato.Prorroga : c.Contrato.FechaVencimiento) : fechaAlta,
        }).Distinct();

        cboContrato.Items.Clear();
        if (Contratos.Count() > 0)
        {
            foreach (var item in Contratos)
            {
                RadComboBoxItem a = new RadComboBoxItem("", "");
                a.Value = item.IdContrato.ToString();
                a.Text  = item.Codigo + " - FV: " + item.FechaVencimiento.Value.ToShortDateString();
                a.Attributes.Add("FechaMinima", item.FechaVencimiento.Value.ToShortDateString());
                cboContrato.Items.Add(a);
            }
        }
        else
        {
            cboContrato.Items.Add(new RadComboBoxItem("No se encontraron resultados", "-1"));
        }
    }
Exemplo n.º 14
0
        protected void dlReportingPoint_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            String sql = "SELECT top(30) ReportingPointId,ReportingPoint FROM [tblReportingPoint] WHERE ReportingPoint LIKE '%" + e.Text.ToUpper() + "%'";

            repPointSource.SelectCommand = sql;
            dlReportingPoint.DataBind();
        }
        protected void atiRadComboBoxSearchAffiliate_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox atiRadComboSearchWorkouts = (RadComboBox)sender;

            atiRadComboSearchAffiliates.Items.Clear();
            const int      TAKE       = 10;
            aqufitEntities entities   = new aqufitEntities();
            int            itemOffset = e.NumberOfItems;
            IQueryable <CompetitionAffiliate> affiliates = null;

            affiliates = entities.CompetitionAffiliates.OrderBy(a => a.Name);
            int length = affiliates.Count();

            affiliates = string.IsNullOrEmpty(e.Text) ? affiliates.Skip(itemOffset).Take(TAKE) : affiliates.Where(w => w.Name.ToLower().StartsWith(e.Text)).Skip(itemOffset).Take(TAKE);

            CompetitionAffiliate[] afArray = affiliates.ToArray();

            foreach (CompetitionAffiliate a in afArray)
            {
                RadComboBoxItem item = new RadComboBoxItem(a.Name);
                item.Value = "" + a.Id;
                atiRadComboSearchWorkouts.Items.Add(item);
            }
            int endOffset = Math.Min(itemOffset + TAKE + 1, length);

            e.EndOfItems = endOffset == length;
            e.Message    = (length <= 0) ? "No matches" : String.Format("Items <b>1</b>-<b>{0}</b> of {1}", endOffset, length);
        }
Exemplo n.º 16
0
        void cboClient_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            cboClient.Items.Clear();
            Orchestrator.Facade.IReferenceData facRefData = new Orchestrator.Facade.ReferenceData();
            DataSet   ds           = facRefData.GetAllClientsFiltered("%" + e.Text);
            DataTable dt           = ds.Tables[0];
            DataTable boundResults = dt.Clone();

            int itemsPerRequest = 20;
            int itemOffset      = e.NumberOfItems;
            int endOffset       = itemOffset + itemsPerRequest;

            if (endOffset > dt.Rows.Count)
            {
                endOffset = dt.Rows.Count;
            }

            for (int i = itemOffset; i < endOffset; i++)
            {
                boundResults.ImportRow(dt.Rows[i]);
            }

            cboClient.DataSource = boundResults;
            cboClient.DataBind();

            if (dt.Rows.Count > 0)
            {
                e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), dt.Rows.Count.ToString());
            }
        }
Exemplo n.º 17
0
 private void list_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
 {
     ((RadComboBox)o).DataTextField = this.DataField;
     ((RadComboBox)o).DataValueField = this.DataField;
     ((RadComboBox)o).DataSource = BLL.Users.DataSource();
     ((RadComboBox)o).DataBind();
 }
 private void list_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
 {
     ((RadComboBox)o).DataTextField  = this.DataField;
     ((RadComboBox)o).DataValueField = this.DataField;
     ((RadComboBox)o).DataSource     = GetDataTable("SELECT DISTINCT " + this.UniqueName + " FROM tblmenutimetable WHERE " + this.UniqueName + " LIKE '" + e.Text + "%'");
     ((RadComboBox)o).DataBind();
 }
Exemplo n.º 19
0
        protected void dlVessel1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            String sql = "SELECT top(30) VesselId, VesselName FROM tblVessel WHERE VesselName LIKE '%" + e.Text.ToUpper() + "%'";

            vesselSource.SelectCommand = sql;
            dlVessel1.DataBind();
        }
Exemplo n.º 20
0
        protected void cmbCentro_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            try
            {
                capascccmex.biz.centro obj = new capascccmex.biz.centro();
                List <capascccmex.metadatos.centro> listaCampos = new List <capascccmex.metadatos.centro>();

                listaCampos = obj.GetBizCentro(null, 0, 0);

                RadComboBox rcmb = (RadComboBox)sender;

                foreach (var _row in listaCampos)
                {
                    RadComboBoxItem item = new RadComboBoxItem();
                    //{
                    //Text=_row.Nombre,Value=_row.IdPerito.ToString()
                    //};
                    item.Text  = _row.Centro;
                    item.Value = _row.IdCentro.ToString();
                    string _centro   = _row.Centro;
                    string _idcentro = _row.IdCentro.ToString();
                    //string _rf = _row.RegimenFiscal;

                    item.Attributes.Add("Codigo", _idcentro);
                    item.Attributes.Add("Nombre", _centro);
                    //item.Attributes.Add("RegimenFiscal", _rf);
                    rcmb.Items.Add(item);
                    item.DataBind();
                }
            }
            catch (Exception ex)
            {
                windowManager1.RadAlert("Error: " + ex.Message.ToString(), 400, 100, "Cargando Centros", null);
            }
        }
Exemplo n.º 21
0
        protected void dlLocation_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            String sql = "SELECT top(30) LocationId,Location FROM [tblLocation] WHERE Location LIKE '%" + e.Text.ToUpper() + "%'";

            locationSource.SelectCommand = sql;
            dlLocation.DataBind();
        }
Exemplo n.º 22
0
        protected void atiRadComboBoxSearchFollower_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            /*
            RadComboBox atiRadComboSearchFriends = (RadComboBox)sender;
            atiRadComboSearchFriends.Items.Clear();
            const int TAKE = 5;
            aqufitEntities entities = new aqufitEntities();
            long[] friendIds = entities.UserFriends.Where(f => (f.SrcUserSettingKey == this.ProfileSettings.Id) && f.Relationship == (int)Affine.Utils.ConstsUtil.Relationships.FOLLOW).Select(f => f.SrcUserSettingKey == this.ProfileSettings.Id ? f.DestUserSettingKey : f.SrcUserSettingKey).ToArray();
            int itemOffset = e.NumberOfItems;
            IQueryable<User> friends = entities.UserSettings.OfType<User>().Where(Affine.Utils.Linq.LinqUtils.BuildContainsExpression<User, long>(w => w.Id, friendIds)).OrderBy(w => w.UserName);
            int length = friends.Count();
            friends = string.IsNullOrEmpty(e.Text) ? friends.Skip(itemOffset).Take(TAKE) : friends.Where(w => w.UserName.ToLower().StartsWith(e.Text) || w.UserFirstName.ToLower().StartsWith(e.Text) || w.UserLastName.ToLower().StartsWith(e.Text)).Skip(itemOffset).Take(TAKE);

            User[] users = friends.ToArray();

            foreach (User u in users)
            {
                RadComboBoxItem item = new RadComboBoxItem(u.UserFirstName + " (" + u.UserFirstName + " " + u.UserLastName + ")");
                item.Value = "" + u.UserName;
                item.ImageUrl = ResolveUrl("~/DesktopModules/ATI_Base/services/images/profile.aspx") + "?u=" + u.UserKey + "&p=" + u.PortalKey;
                atiRadComboSearchFriends.Items.Add(item);
            }
            int endOffset = Math.Min(itemOffset + TAKE + 1, length);
            e.EndOfItems = endOffset == length;
            e.Message = (length <= 0) ? "No matches" : String.Format("Items <b>1</b>-<b>{0}</b> of {1}", endOffset, length);
             */
        }
 void box_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     if (itemRequested != null)
     {
         itemRequested(this, e);
     }
 }
        /// <summary>会员搜索
        /// </summary>
        protected void RCB_MemberItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            var combo = (RadComboBox)o;

            combo.Items.Clear();
            string userName = e.Text.Trim();

            if (!string.IsNullOrEmpty(userName) && userName.Length >= 2)
            {
                var salePlatformId = new Guid(RCB_SalePlatform.SelectedValue);
                var list           = MemberCenterSao.GetUserToDic(salePlatformId, userName);
                var totalCount     = list.Count;
                if (e.NumberOfItems >= totalCount)
                {
                    e.EndOfItems = true;
                }
                else
                {
                    foreach (var item in list)
                    {
                        var rcb = new RadComboBoxItem
                        {
                            Text  = item.Value,
                            Value = item.Key.ToString()
                        };
                        combo.Items.Add(rcb);
                    }
                }
            }
        }
Exemplo n.º 25
0
        protected void RCB_CompanyList_OnItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            var combo = (RadComboBox)sender;

            combo.Items.Clear();
            if (!string.IsNullOrEmpty(e.Text))
            {
                string key         = e.Text;
                var    companyList = (IList <CompanyCussentInfo>)CompanyCussentList().Where(p => p.CompanyName.IndexOf(key, StringComparison.Ordinal) > -1).ToList();
                if (e.NumberOfItems >= companyList.Count)
                {
                    e.EndOfItems = true;
                }
                else
                {
                    foreach (CompanyCussentInfo i in companyList)
                    {
                        var item = new RadComboBoxItem {
                            Text = i.CompanyName, Value = i.CompanyId.ToString()
                        };
                        combo.Items.Add(item);
                    }
                }
            }
        }
Exemplo n.º 26
0
        protected void ProductDDL2_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            ////get all customers whose name starts with e.Text
            //string sql = "SELECT * from Customers WHERE ContactName LIKE '" + e.Text + "%'";

            //SessionDataSource1.SelectCommand = sql;
            //RadComboBox1.DataBind();
        }
Exemplo n.º 27
0
        protected void cboCopyFromTable_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            int tariffVersionID = 0;

            int.TryParse(e.Text, out tariffVersionID);

            LoadCopyFromTables(tariffVersionID);
        }
Exemplo n.º 28
0
 protected void cbxNhanVien_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     //var dt = from q in _entities.GetAllCV()
     //         where q.TenNV.Contains(e.Text)
     //         select q;
     //cbxNhanVien.DataSource = dt;
     //cbxNhanVien.DataBind();
 }
Exemplo n.º 29
0
 protected void cmbEquipo_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     if (cmbInstalacion.SelectedValue.Length > 0)
     {
         int _idInstalacion = Convert.ToInt16(cmbInstalacion.SelectedValue);
         EquipoByInstalacion(_idInstalacion);
     }
 }
Exemplo n.º 30
0
 protected void RCB_Company_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Text))
     {
         RCB_Company.Items.Clear();
         BindCompany(CompanyList.Where(c => c.CompanyName.Contains(e.Text)).ToList());
     }
 }
Exemplo n.º 31
0
 protected void cmbInstalacion_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     if (cmbcentro.SelectedValue.Length > 0)
     {
         int _idCentro = Convert.ToInt16(cmbcentro.SelectedValue);
         InstalacionesbyCentro(_idCentro);
     }
 }
        protected void m_cboExceptionTypes_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox cboExceptionTypes = sender as RadComboBox;

            foreach (var entity in CoreLib.AttendanceExceptionType.All)
            {
                cboExceptionTypes.Items.Add(new RadComboBoxItem(entity.Name, entity.ID.ToString()));
            }
        }
Exemplo n.º 33
0
 protected void m_cboEntities_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     foreach (var entity in BusinessEntity.All)
     {
         var cboItem = new RadComboBoxItem(entity.Name, entity.ID.ToString());
         cboItem.ImageUrl = entity.Type == BusinessEntityType.Company ? "Images/headquater.png" : "Images/branch.png";
         m_cboEntities.Items.Add(cboItem);
     }
 }
Exemplo n.º 34
0
        protected void drpBoard_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            DataSet ds = objglcode.fetchComboData("FETCH_ALL_GL_CODE_FOR_REPORT", e.Text);

            DataTable dt = ds.Tables[0];
            onitemrequest(drpBoard, dt, e.NumberOfItems);


        }
Exemplo n.º 35
0
        protected void m_cboContactDetails_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox cboContactFields = sender as RadComboBox;

            foreach (var profileField in CoreLib.Profile.Contact.Fields)
            {
                cboContactFields.Items.Add(new RadComboBoxItem(profileField.Name, profileField.ID.ToString()));
            }
        }
Exemplo n.º 36
0
    protected void OnDropdownCompany_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        string companyName = e.Text;
        if (!string.IsNullOrEmpty(companyName))
        {
            List<Company> list = new CompanyRepository().FindByName(companyName);

            ddlCompany.DataSource = list;
            ddlCompany.DataBind();
        }
    }
Exemplo n.º 37
0
 protected void RadComboBox1_ItemsRequested1(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     if (e.Text == "") return;
     RadComboBox combo = (RadComboBox)sender;
     var rs = from p in ctx.Patients
              where p.FullName.StartsWith(e.Text)
              select p;
     foreach (Patient pat in rs)
     {
         combo.Items.Add(new RadComboBoxItem(pat.FullName, pat.PersonId.ToString()));
     }
 }
        //private const string CompetencyTrackingReport = "Competency Tracking Report";
        //private const string CompetencyTrackingReport_NoSpaces = "CompetencyTrackingReport";

        #region search criteria event

        protected void ddlSchoolType_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            this.ddlSchoolType.DataSource = null;
            this.ddlSchoolType.DataBind();

            if (this.SessionObject != null && this.SessionObject.LoggedInUser != null)
            {
                var loggedInUser = this.SessionObject.LoggedInUser;
                if (loggedInUser.Roles != null && loggedInUser.Roles.Any())
                {
                    this.ddlSchoolType.DataSource = this.ViewModel.GetAllSchoolType(loggedInUser).Select(c => new { Text = string.Format("{0}", c.Name), Value = c.Name });
                    this.ddlSchoolType.DataBind();
                }
            }
        }
Exemplo n.º 39
0
 protected void OnDropdownCandidate_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
 {
     string name = e.Text;
     if (!string.IsNullOrEmpty(name))
     {
         if(name.Length >= 3)
         {
             List<Candidate> list = new CandidateRepository().SearchCandidatesOnName(name);
             ddlCandidate.DataTextField = "FullName";
             ddlCandidate.DataValueField = "CandidateId";
             ddlCandidate.DataSource = list;
             ddlCandidate.DataBind();
         }
     }
 }
Exemplo n.º 40
0
        protected void cboTitular_OnItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            using (var servico = FabricaGenerica.GetInstancia().CrieObjeto<IServicoDeTitular>())
            {
                cboTitular.Items.Clear();

                foreach (var titular in servico.ObtenhaPorNomeComoFiltro(e.Text, 50))
                {
                    var item = new RadComboBoxItem(titular.Pessoa.Nome, titular.Pessoa.ID.ToString());
                    item.Attributes.Add("DataDoCadastro", titular.DataDoCadastro.Value.ToString("dd/MM/yyyy"));
                    item.Attributes.Add("InformacoesAdicionais", titular.InformacoesAdicionais);
                    cboTitular.Items.Add(item);
                    item.DataBind();
                }
            }
        }
Exemplo n.º 41
0
        protected void RadComboBox2_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            DataTable data = Peerfx_DB.SPs.ViewUsersAllAdminDeposits(e.Text).GetDataSet().Tables[0];

            int itemOffset = e.NumberOfItems;
            int endOffset = Math.Min(itemOffset + 10, data.Rows.Count);
            e.EndOfItems = endOffset == data.Rows.Count;

            RadComboBox rdc = (RadComboBox)sender;
            for (int i = itemOffset; i < endOffset; i++)
            {
                 rdc.Items.Add(new RadComboBoxItem(data.Rows[i]["user_info_full"].ToString(), data.Rows[i]["user_key"].ToString()));
            }

            //e.Message = GetStatusMessage(endOffset, data.Rows.Count);
        }
Exemplo n.º 42
0
        protected void cboNCL_OnItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            var ncls = NCL.ObtenhaPorCodigoComoFiltro(e.Text);

            if (ncls.Count > 0)
            {
                foreach (var ncl in ncls)
                {
                    var item = new RadComboBoxItem(ncl.Codigo, ncl.Codigo);

                    item.Attributes.Add("Descricao", ncl.Descricao);
                    item.Attributes.Add("Natureza", ncl.NaturezaDeMarca.Nome);

                    cboNCL.Items.Add(item);
                    item.DataBind();
                }
            }
        }
        protected void cboProcedimentosInternos_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            IList<ITipoDeProcedimentoInterno> listaProcedimentosInternos = new List<ITipoDeProcedimentoInterno>();

            using (var servico = FabricaGenerica.GetInstancia().CrieObjeto<IServicoDeTipoDeProcedimentoInterno>())
            {
                listaProcedimentosInternos = servico.obtenhaTipoProcedimentoInternoPelaDescricao(e.Text);
            }

            if (listaProcedimentosInternos.Count > 0)
            {
                foreach (var procedimentoInterno in listaProcedimentosInternos)
                {
                    var item = new RadComboBoxItem(procedimentoInterno.Descricao, procedimentoInterno.Id.Value.ToString());

                    item.Attributes.Add("ID", procedimentoInterno.Id.ToString());

                    cboTipoDeProcedimentosInternos.Items.Add(item);
                    item.DataBind();
                }
            }
        }
Exemplo n.º 44
0
        protected void atiRadComboBoxSearchRoutes_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox atiRadComboSearchWorkouts = (RadComboBox)sender;
            atiRadComboSearchWorkouts.Items.Clear();
            const int TAKE = 5;
            aqufitEntities entities = new aqufitEntities();
            int itemOffset = e.NumberOfItems;
            IQueryable<MapRoute> routes = entities.User2MapRouteFav.Where(r => r.UserSettingsKey == UserSettings.Id).Select(w => w.MapRoute);
            routes = routes.OrderBy(r => r.Name);
            int length = routes.Count();
            routes = string.IsNullOrEmpty(e.Text) ? routes.Skip(itemOffset).Take(TAKE) : routes.Where(r => r.Name.ToLower().StartsWith(e.Text)).Skip(itemOffset).Take(TAKE);

            MapRoute[] routeArray = routes.ToArray();

            foreach (MapRoute r in routeArray)
            {
                RadComboBoxItem item = new RadComboBoxItem(r.Name);
                item.Value = "" + r.Id;
                atiRadComboSearchWorkouts.Items.Add(item);
            }
            int endOffset = Math.Min(itemOffset + TAKE + 1, length);
            e.EndOfItems = endOffset == length;
            e.Message = (length <= 0) ? "No matches" : String.Format("Items <b>1</b>-<b>{0}</b> of {1}", endOffset, length);
        }
Exemplo n.º 45
0
 protected void rdcProfessional_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     if (e.Text == "")
         return;
     RadComboBox combo = (RadComboBox)sender;
     combo.Items.Clear();
     var rs = from p in ctx.Professionals
              where p.ComercialName.StartsWith(e.Text)
              select p;
     foreach (Professional professional in rs)
     {
         if (!professional.Inactive)
         combo.Items.Add(new RadComboBoxItem(professional.ComercialName, professional.PersonId.ToString()));
     }
 }
Exemplo n.º 46
0
        //protected void CboProcedimentos_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        //{
        //    //DataSet ls = m_oSumario.ListaProcedimentos();
        //    RadComboBox Combo = (RadComboBox)sender;
        //    Combo.Items.Clear();
        //    DataRow[] rows;
        //    RadComboBoxItem item;
        //    string m_sTexto = e.Text.Replace("*", "");
        //    m_sTexto = m_sTexto.Replace("%", "");
        //    m_sTexto = m_sTexto.Replace("[", "");
        //    m_sTexto = m_sTexto.Replace("]", "");
        //    rows = ls.Tables[0].Select("(DESCRICAO LIKE '" + m_sTexto + "*')");
        //    for (int i = 0; i < rows.Count(); i++)
        //    {
        //        item = new RadComboBoxItem();
        //        item.Text = rows[i]["DESCRICAO"].ToString();
        //        item.Value = rows[i]["IDDWD016"].ToString();
        //        Combo.Items.Add(item);
        //    }
        //}
        protected void CboProcedimentos_ItemsRequested1(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            DataSet ls = m_oSumario.ListaProcedimentos();

            RadComboBox Combo = (RadComboBox)o;

            Combo.Items.Clear();

            DataRow[] rows;

            RadComboBoxItem item;

            string m_sTexto = e.Text.Replace("*", "");
            m_sTexto = m_sTexto.Replace("%", "");
            m_sTexto = m_sTexto.Replace("[", "");
            m_sTexto = m_sTexto.Replace("]", "");

            rows = ls.Tables[0].Select("(DESCRICAO LIKE '*" + m_sTexto + "*')");

            for (int i = 0; i < rows.Count(); i++)
            {
                item = new RadComboBoxItem();
                item.Text = rows[i]["DESCRICAO"].ToString();
                item.Value = rows[i]["IDDWD016"].ToString();

                Combo.Items.Add(item);
            }
        }
Exemplo n.º 47
0
 protected virtual void OnItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
 {
     this.InitDDLInternal();
 }
        protected void atiRadComboBoxSearchAffiliate_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox atiRadComboSearchWorkouts = (RadComboBox)sender;
            atiRadComboSearchAffiliates.Items.Clear();
            const int TAKE = 10;
            aqufitEntities entities = new aqufitEntities();
            int itemOffset = e.NumberOfItems;
            IQueryable<CompetitionAffiliate> affiliates = null;
            affiliates = entities.CompetitionAffiliates.OrderBy( a => a.Name );
            int length = affiliates.Count();
            affiliates = string.IsNullOrEmpty(e.Text) ? affiliates.Skip(itemOffset).Take(TAKE) : affiliates.Where(w => w.Name.ToLower().StartsWith(e.Text)).Skip(itemOffset).Take(TAKE);

            CompetitionAffiliate[] afArray = affiliates.ToArray();

            foreach (CompetitionAffiliate a in afArray)
            {
                RadComboBoxItem item = new RadComboBoxItem(a.Name);
                item.Value = "" + a.Id;
                atiRadComboSearchWorkouts.Items.Add(item);
            }
            int endOffset = Math.Min(itemOffset + TAKE + 1, length);
            e.EndOfItems = endOffset == length;
            e.Message = (length <= 0) ? "No matches" : String.Format("Items <b>1</b>-<b>{0}</b> of {1}", endOffset, length);
        }
Exemplo n.º 49
0
 protected void GetAllInvoiceTypes_Selecting(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     DataClasses1DataContext dbContext = new DataClasses1DataContext();
     RadComboBox rcbInvoiceType = ((RadComboBox)sender);
     rcbInvoiceType.Items.Clear();
     var types = from tp in dbContext.InvoiceTypes
                 select new { Key = tp.ID, Value = tp.InvoiceTypeName };
     rcbInvoiceType.DataSource = types;
     rcbInvoiceType.DataBind();
 }
Exemplo n.º 50
0
 protected void rdcExamination_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     if (e.Text == "") return;
     RadComboBox combo = (RadComboBox)sender;
     combo.Items.Clear();
     var rs = from d in ctx.Examinations
              where d.Name.StartsWith(e.Text)
                    && d.ExaminationType.Code == "biometry"
              select d;
     foreach (Examination dia in rs)
     {
         combo.Items.Add(new RadComboBoxItem(dia.Name, dia.ExaminationId.ToString()));
     }
 }
Exemplo n.º 51
0
 protected void LoadCapabilityValues(object source, RadComboBoxItemsRequestedEventArgs e)
 {
     BindCapabilityValues(e.Text);
     SetCapabilityAndValue();
 }
Exemplo n.º 52
0
        protected void atiWorkout_WodItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox atiRadComboBoxCrossfitWorkouts = (RadComboBox)sender;
            const int TAKE = 10;
            aqufitEntities entities = new aqufitEntities();
            int itemOffset = e.NumberOfItems;
            if (itemOffset == 0)
            {
                RadComboBoxItem item = new RadComboBoxItem("Create a New Workout");
                item.Value = "{'Id':0, 'Type':'0'}";
                atiRadComboBoxCrossfitWorkouts.Items.Add(item);
            }
            IQueryable<WOD> wods = entities.User2WODFav.Where(w => w.UserSetting.Id == UserSettings.Id).Select(w => w.WOD);
            wods = wods.Union<WOD>(entities.WODs.Where(w => w.Standard > 0));
            wods.Select(w => w.WODType).ToArray();  // hydrate WODTypes

            long[] groupIds = null;
            groupIds = entities.UserFriends.Where(f => (f.SrcUserSettingKey == UserSettings.Id || f.DestUserSettingKey == UserSettings.Id) && f.Relationship >= (int)Affine.Utils.ConstsUtil.Relationships.GROUP_OWNER).Select(f => f.SrcUserSettingKey == UserSettings.Id ? f.DestUserSettingKey : f.SrcUserSettingKey).ToArray();
            // OK this is a bit of a trick... this query hydrates only the "WODSchedule" in the above WOD query.. so we will get the wods we are looking for..
            IEnumerable< WODSchedule >[] workoutSchedule = entities.UserSettings.OfType<Group>().Where(LinqUtils.BuildContainsExpression<UserSettings, long>(us => us.Id, groupIds)).Select(g => g.WODSchedules.Where(ws => ws.HideTillDate.HasValue && DateTime.Now.CompareTo(ws.HideTillDate.Value) < 0)).ToArray();

            string lowerTxt = e.Text.ToLower();
            if (!string.IsNullOrWhiteSpace(e.Text))
            {
                wods = wods.Where(w => w.Name.ToLower().StartsWith(lowerTxt) || w.WODSchedules.Where(ws => ws.HideTillDate.HasValue && DateTime.Now.CompareTo(ws.HideTillDate.Value) < 0).Any(ws => ws.HiddenName.ToLower().StartsWith(lowerTxt))).OrderBy(w => w.Name);
            }
            else
            {
                wods = wods.OrderByDescending(w => w.CreationDate);
            }
            int length = wods.Count();
            wods = wods.Skip(itemOffset).Take(TAKE);
            WOD[] wodList = wods.ToArray();
            int endOffset = Math.Min(itemOffset + TAKE,  length);
            e.EndOfItems = endOffset == length;
            for (int i = 0; i < wodList.Length; i++)
            {
                WOD w = wodList[i];
                if (w.WODSchedules != null && w.WODSchedules.Count > 0)
                {
                    WODSchedule ws = w.WODSchedules.OrderByDescending( s => s.HideTillDate ).First();
                    if (ws.HideTillDate.HasValue && DateTime.Now.CompareTo(ws.HideTillDate.Value) < 0)
                    {
                        if (string.IsNullOrWhiteSpace(e.Text))
                        {
                            atiRadComboBoxCrossfitWorkouts.Items.Add(new RadComboBoxItem(Affine.Utils.Web.WebUtils.FromWebSafeString(ws.HiddenName), "{ 'Id':" + w.Id + ", 'Type':" + w.WODType.Id + "}"));
                            if (w.Standard > 0 || w.WODSchedules.Count > 1)
                            {   // CA - here is what is going on here.  If the workout is suppost to be hidden until a date (common for crossfit gyms) then we just put a date name like up
                                // top.  But if it is a standard WOD (or a wod that they have done before (w.WODSchedules.Count > 1) then we still need to add the WOD
                                atiRadComboBoxCrossfitWorkouts.Items.Add(new RadComboBoxItem(Affine.Utils.Web.WebUtils.FromWebSafeString(w.Name), "{ 'Id':" + w.Id + ", 'Type':" + w.WODType.Id + "}"));
                            }
                        }
                        else if (ws.HiddenName.ToLower().StartsWith(lowerTxt))
                        {
                            atiRadComboBoxCrossfitWorkouts.Items.Add(new RadComboBoxItem(Affine.Utils.Web.WebUtils.FromWebSafeString(ws.HiddenName), "{ 'Id':" + w.Id + ", 'Type':" + w.WODType.Id + "}"));
                        }
                    }
                    else
                    {
                        atiRadComboBoxCrossfitWorkouts.Items.Add(new RadComboBoxItem(Affine.Utils.Web.WebUtils.FromWebSafeString(w.Name), "{ 'Id':" + w.Id + ", 'Type':" + w.WODType.Id + "}"));
                    }
                }
                else
                {
                    atiRadComboBoxCrossfitWorkouts.Items.Add(new RadComboBoxItem(Affine.Utils.Web.WebUtils.FromWebSafeString(w.Name), "{ 'Id':" + w.Id + ", 'Type':" + w.WODType.Id + "}"));
                }
            }
            e.Message = (length <= 0) ? "No matches" : String.Format("Items <b>1</b>-<b>{0}</b> of {1}", endOffset, length);
        }
Exemplo n.º 53
0
 protected void atiWorkout_RouteItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     RadComboBox atiRadComboBoxCrossfitWorkouts = (RadComboBox)sender;
     atiRadComboBoxCrossfitWorkouts.Items.Clear();
     const int TAKE = 9;
     aqufitEntities entities = new aqufitEntities();
     IQueryable<MapRoute> mapRoutesQuery = string.IsNullOrEmpty(e.Text) ?
                     entities.User2MapRouteFav.Include("MapRoutes").Where(r => r.UserSettingsKey == UserSettings.Id ).Select( r => r.MapRoute ).OrderBy(w => w.Name) :
                     entities.User2MapRouteFav.Include("MapRoutes").Where(r => r.UserSettingsKey == UserSettings.Id ).Select( r => r.MapRoute ).Where(r => r.Name.ToLower().StartsWith(e.Text)).OrderBy(r => r.Name);
     int itemOffset = e.NumberOfItems > 0 ? e.NumberOfItems-1 : 0;
     List<MapRoute> mapRoutes = mapRoutesQuery.Skip(itemOffset).Take(TAKE).ToList();
     string mapIcon = ResolveUrl("~/DesktopModules/ATI_Base/resources/images/iMap.png");
     if (itemOffset == 0)
     {
         RadComboBoxItem item = new RadComboBoxItem("Add New Map");
         item.Value = "{'Id':0, 'Dist':'0'}";
         item.ImageUrl = mapIcon;
         atiRadComboBoxCrossfitWorkouts.Items.Add(item);
     }
     Affine.Utils.UnitsUtil.MeasureUnit unit = base.UserSettings.DistanceUnits != null ? Affine.Utils.UnitsUtil.ToUnit(Convert.ToInt32(base.UserSettings.DistanceUnits)) : UnitsUtil.MeasureUnit.UNIT_MILES;
     string unitName = Affine.Utils.UnitsUtil.unitToStringName(unit);
     foreach (MapRoute mr in mapRoutes)
     {
         double dist = Affine.Utils.UnitsUtil.systemDefaultToUnits( mr.RouteDistance, unit);
         dist = Math.Round(dist, 2);
         RadComboBoxItem item = new RadComboBoxItem(Affine.Utils.Web.WebUtils.FromWebSafeString( mr.Name ) + " (" + dist + " " +unitName+  ")");
         item.Value = "{ 'Id':" + mr.Id + ", 'Dist':" + mr.RouteDistance + "}";
         item.ImageUrl = Affine.Utils.ImageUtil.GetGoogleMapsStaticImage(mr, 200, 150);
         atiRadComboBoxCrossfitWorkouts.Items.Add(item);
     }
     int length = mapRoutesQuery.Count();
     int endOffset = Math.Min(itemOffset + TAKE+1, length);
     e.EndOfItems = endOffset == length;
     e.Message = (length <= 0) ? "No matches" : String.Format("Items <b>1</b>-<b>{0}</b> of {1}", endOffset, length);
 }
Exemplo n.º 54
0
 protected void cmbErloeskonten_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     DataClasses1DataContext dbContext = new DataClasses1DataContext();
     RadComboBox cmbErloeskonten = ((RadComboBox)sender);
     Label lbl = cmbErloeskonten.Parent.FindControl("lblId") as Label;
     cmbErloeskonten.Items.Clear();
     cmbErloeskonten.Text = string.Empty;
     var myErloeskonten = from _accounts in dbContext.Accounts
                          where _accounts.CustomerId == Int32.Parse(lbl.Text)
                          group _accounts by _accounts.AccountNumber into count
                          select new { count.Key };
     foreach (var myItem in myErloeskonten)
     {
         cmbErloeskonten.Items.Add(new RadComboBoxItem(myItem.Key));
     }
 }
Exemplo n.º 55
0
 protected void ZipCodes_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     DataClasses1DataContext dbContext = new DataClasses1DataContext();
     RadComboBox cmbZipCode = ((RadComboBox)sender);
     cmbZipCode.Items.Clear();
     var myzipCodes = from zipCodes in dbContext.Adress
                      group zipCodes by zipCodes.Zipcode into z
                      select new { z.Key };
     foreach (var myItem in myzipCodes)
     {
         cmbZipCode.Items.Add(new RadComboBoxItem(myItem.Key));
     }
 }
Exemplo n.º 56
0
 protected void rdcVisitReason_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     if (e.Text == "")
         return;
     RadComboBox combo = (RadComboBox)sender;
     combo.Items.Clear();
     var rs = from d in ctx.VisitReasons
              where d.Name.StartsWith(e.Text)
              select d;
     foreach (VisitReason dia in rs)
     {
         combo.Items.Add(new RadComboBoxItem(dia.Name, dia.VisitReasonId.ToString()));
     }
 }
Exemplo n.º 57
0
 protected void rdcAppointmentType_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
 {
     if (e.Text == "")
         return;
     RadComboBox combo = (RadComboBox)sender;
     combo.Items.Clear();
     var rs = from apt in ctx.AppointmentTypes
              where apt.Name.StartsWith(e.Text)
              select apt;
     foreach (AppointmentType apt in rs)
     {
         combo.Items.Add(new RadComboBoxItem(apt.Name, apt.AppointmentTypeId.ToString()));
     }
 }
Exemplo n.º 58
0
        protected void atiRadComboBoxSearchGroups_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox atiRadComboBoxSearchGroups = (RadComboBox)sender;
            atiRadComboBoxSearchGroups.Items.Clear();
            const int TAKE = 15;
            aqufitEntities entities = new aqufitEntities();
            int itemOffset = e.NumberOfItems;
            IQueryable<Group> friends = entities.UserSettings.OfType<Group>().OrderBy(w => w.UserName);
            if( !string.IsNullOrEmpty(e.Text) ){
                friends = friends.Where(w => w.UserName.ToLower().Contains(e.Text) || w.UserFirstName.ToLower().Contains(e.Text));
            }
            int length = friends.Count();
            friends = friends.Skip(itemOffset).Take(TAKE);
            Group[] groups = friends.ToArray();

            foreach (Group g in groups)
            {
                RadComboBoxItem item = new RadComboBoxItem(g.UserFirstName);
                item.Value = " { 'Address': '', 'GroupKey':" + g.Id + ", 'Lat':" + g.DefaultMapLat + ", 'Lng':" + g.DefaultMapLng + " , 'Name':'" + g.UserFirstName + "', 'UserName':'******'","") + "', 'UserKey':" + g.UserKey + ", 'ImageId':0, 'Description':'' }";
             //   item.ImageUrl = ResolveUrl("~/DesktopModules/ATI_Base/services/images/profile.aspx") + "?u=" + g.UserKey + "&p=" + g.PortalKey;
                atiRadComboBoxSearchGroups.Items.Add(item);
            }
            int endOffset = Math.Min(itemOffset + TAKE + 1, length);
            e.EndOfItems = endOffset == length;
            e.Message = (length <= 0) ? "No matches" : String.Format("Items <b>1</b>-<b>{0}</b> of {1}", endOffset, length);
        }
Exemplo n.º 59
0
 protected void OnCompanyDropdownItemRequested(object o, RadComboBoxItemsRequestedEventArgs e)
 {
     string companyName = e.Text;
     if (!string.IsNullOrEmpty(companyName))
     {
         CompanyRepository companyRepo = new CompanyRepository();
         ddlCompany.DataTextField = "CompanyName";
         ddlCompany.DataValueField = "CompanyID";
         ddlCompany.DataSource = companyRepo.FindByName(companyName);// .GetAllCompanies();
         ddlCompany.DataBind();
     }
 }
Exemplo n.º 60
0
        protected void Country_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            DataClasses1DataContext dbContext = new DataClasses1DataContext();
            RadComboBox cmbCountry = ((RadComboBox)sender);
            cmbCountry.Items.Clear();
            var myCountrys = from countrys in dbContext.Adress
                             group countrys by countrys.Country into count
                             select new { count.Key };
            foreach (var myItem in myCountrys)
            {

                cmbCountry.Items.Add(new RadComboBoxItem(myItem.Key));
            }
        }