Ejemplo n.º 1
0
        private void cboVehicle_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboVehicle.Items.Clear();

            Orchestrator.Facade.IVehicle facResource = new Orchestrator.Facade.Resource();
            DataSet    ds = facResource.GetAllVehicles();
            List <int> excludedVehicles = null;

            using (var uow = DIContainer.CreateUnitOfWork())
            {
                var repo = DIContainer.CreateRepository <Repositories.IVehicleExcludedFromRevenueReportRepository>(uow);
                excludedVehicles = repo.GetExcludedVehicleIds().ToList();
                if (excludedVehicles == null)
                {
                    excludedVehicles = new List <int>();
                }
            }

            List <Telerik.Web.UI.RadComboBoxItem> comboItems =
                (from row in ds.Tables[0].Rows.Cast <DataRow>()
                 where !excludedVehicles.Contains(Convert.ToInt32(row["ResourceId"]))
                 select new Telerik.Web.UI.RadComboBoxItem
            {
                Value = row["ResourceId"].ToString(),
                Text = row["RegNo"].ToString()
            }).GroupBy(item => item.Value).Select(grp => grp.First()).ToList();

            comboItems.Sort((item1, item2) => item1.Text.CompareTo(item2.Text));
            cboVehicle.Items.AddRange(comboItems);
        }
Ejemplo n.º 2
0
    protected void RadComboBoxCihaz_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        RadComboBoxCihaz.Items.Clear();
        string sqlSelectCommand = "";

        sqlSelectCommand = "SELECT [ID],[CIHAZADI], [LAB] from [cihaz] WHERE [CIHAZADI] LIKE '%'+ @text + '%' ORDER BY [CIHAZADI]";
        SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings["KalData"].ConnectionString);

        adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
        DataTable dataTable = new DataTable();

        adapter.Fill(dataTable);

        RadComboBoxCihaz.Items.Clear();
        foreach (DataRow dataRow in dataTable.Rows)
        {
            string          Lab  = "";
            RadComboBoxItem item = new RadComboBoxItem();
            item.Text  = (string)dataRow["CIHAZADI"].ToString();
            item.Value = dataRow["ID"].ToString();
            Lab        = (string)dataRow["LAB"];
            item.Attributes.Add("LAB", Lab);
            RadComboBoxCihaz.Items.Add(item);
            item.DataBind();
        }
    }
 protected void cboFindItem_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
 {
     cboFindItem.DataSource     = ItemService.GetItems(e.Text);
     cboFindItem.DataTextField  = "Name";
     cboFindItem.DataValueField = "ID";
     cboFindItem.DataBind();
 }
Ejemplo n.º 4
0
        void cboSubContractor_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboSubContractor.Items.Clear();

            Orchestrator.Facade.IReferenceData facRefData = new Orchestrator.Facade.ReferenceData();
            DataSet ds = facRefData.GetAllSubContractorsFiltered(e.Text, false);

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

            if (endOffset > ds.Tables[0].Rows.Count)
            {
                endOffset = ds.Tables[0].Rows.Count;
            }

            DataTable dt = ds.Tables[0];

            Telerik.Web.UI.RadComboBoxItem rcItem = null;
            for (int i = itemOffset; i < endOffset; i++)
            {
                rcItem       = new Telerik.Web.UI.RadComboBoxItem();
                rcItem.Text  = dt.Rows[i]["OrganisationName"].ToString();
                rcItem.Value = dt.Rows[i]["IdentityId"].ToString();
                cboSubContractor.Items.Add(rcItem);
            }

            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());
            }
        }
Ejemplo n.º 5
0
    protected void RadComboBoxFirma_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        if (e.Text.Length > 3)
        {
            using (Service1Client client = new Service1Client())
            {
                intBolgeKodu = client.BolgeKoduDon(Context.User.Identity.Name);
            }
            string BolgeKodu        = intBolgeKodu.ToString();
            string sqlSelectCommand = "";
            sqlSelectCommand = "SELECT [FIRMAID],[MUSTNO], [FIRMAADI], [IL_ILCE] from [firma] WHERE [FIRMAADI] LIKE '%'+ @text + '%' and SILINDI=0 and BOLGEKODU=" + BolgeKodu + " ORDER BY [FIRMAADI]";
            SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings["KalData"].ConnectionString);
            adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
            DataTable dataTable = new DataTable();
            adapter.Fill(dataTable);

            RadComboBoxFirma.Items.Clear();
            foreach (DataRow dataRow in dataTable.Rows)
            {
                string          IlIlce = "";
                RadComboBoxItem item   = new RadComboBoxItem();
                item.Text  = (string)dataRow["MUSTNO"].ToString();
                item.Value = dataRow["FIRMAID"].ToString();
                string FirmaAdi = (string)dataRow["FIRMAADI"];
                if (dataRow["IL_ILCE"] != System.DBNull.Value)
                {
                    IlIlce = (string)dataRow["IL_ILCE"];
                }
                item.Attributes.Add("FIRMAADI", FirmaAdi);
                item.Attributes.Add("IL_ILCE", IlIlce);
                RadComboBoxFirma.Items.Add(item);
                item.DataBind();
            }
        }
    }
Ejemplo n.º 6
0
        void cboClient_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboClient.Items.Clear();
            Orchestrator.Facade.IReferenceData facRefData = new Orchestrator.Facade.ReferenceData();
            DataSet   ds           = facRefData.GetAllClientsFiltered("%" + e.Text, true);
            DataTable dt           = ds.Tables[0];
            DataTable boundResults = dt.Clone();

            int itemsPerRequest = 15;
            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());
            }
        }
Ejemplo n.º 7
0
    protected void RadComboBoxFirma_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        EFDal ed = new EFDal();

        if (e.Text.Length > 2)
        {
            string BolgeKodu        = ed.kal_BolgeKoduDon(Context.User.Identity.Name).ToString();
            string sqlSelectCommand = "";
            sqlSelectCommand = "SELECT [FIRMAID],[MUSTNO], [FIRMAADI], [IL_ILCE] from [firma] WHERE [FIRMAADI] LIKE '%'+ @text + '%' and SILINDI=0 and BOLGEKODU=" + BolgeKodu + " ORDER BY [FIRMAADI]";
            SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings["KalData"].ConnectionString);
            adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
            DataTable dataTable = new DataTable();
            adapter.Fill(dataTable);
            RadComboBoxFirma.Items.Clear();
            foreach (DataRow dataRow in dataTable.Rows)
            {
                string          IlIlce = "";
                RadComboBoxItem item   = new RadComboBoxItem();
                item.Text  = (string)dataRow["MUSTNO"].ToString();
                item.Value = dataRow["FIRMAID"].ToString();
                string FirmaAdi = (string)dataRow["FIRMAADI"];
                if (dataRow["IL_ILCE"] != System.DBNull.Value)
                {
                    IlIlce = (string)dataRow["IL_ILCE"];
                }
                item.Attributes.Add("FIRMAADI", FirmaAdi);
                item.Attributes.Add("IL_ILCE", IlIlce);
                RadComboBoxFirma.Items.Add(item);
                item.DataBind();
            }
            Label lbl = (Label)RadComboBoxFirma.Footer.FindControl("lblBulunanKayitSayisi");
            lbl.Text = "Bulunan kayıt sayısı:" + "  " + dataTable.Rows.Count.ToString();
        }
    }
Ejemplo n.º 8
0
        protected void ddlEquipamento_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            Dictionary <int, string> dicEquipamento = null;
            string sTexto     = e.Text.Trim();
            int    itemOffset = 0;
            int    endOffset  = 0;

            try
            {
                ddlEquipamento.Items.Clear();

                using (UnitOfWork oUnitOfWork = new UnitOfWork())
                {
                    dicEquipamento = oUnitOfWork.EquipamentoREP.FiltrarTodosKeyValue(sTexto);
                }

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

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

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

                e.Message = Utils.GetStatusMessage(endOffset, dicEquipamento.Count);
            }
            catch (Exception ex)
            {
                Log.Trace(ex, true);
                Utils.Notificar(ntfGeral, "Falha ao tentar carregar dados de equipamentos. Contate o administrador", Enums.TipoNotificacao.Erro);
            }
        }
Ejemplo n.º 9
0
        void cboResource_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboResource.Items.Clear();

            Facade.IResource facResource = new Facade.Resource();
            DataSet          ds          = facResource.GetAllResourcesFiltered(e.Text, false, false);

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

            if (endOffset > ds.Tables[0].Rows.Count)
            {
                endOffset = ds.Tables[0].Rows.Count;
            }

            DataTable dt = ds.Tables[0];

            Telerik.Web.UI.RadComboBoxItem rcItem = null;
            for (int i = itemOffset; i < endOffset; i++)
            {
                rcItem       = new Telerik.Web.UI.RadComboBoxItem();
                rcItem.Text  = dt.Rows[i]["Description"].ToString();
                rcItem.Value = dt.Rows[i]["ResourceId"].ToString();
                cboResource.Items.Add(rcItem);
            }

            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());
            }
        }
Ejemplo n.º 10
0
 protected void RadComboBoxFirma_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
 {
     if (e.Text.Length > 3)
     {
         string sqlSelectCommand = "";
         sqlSelectCommand = "SELECT [UserID],[UserName] from [telerik_Users] ORDER BY [UserName]";
         SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings["KalData"].ConnectionString);
         adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
         DataTable dataTable = new DataTable();
         adapter.Fill(dataTable);
         RadComboBoxFirma.Items.Clear();
         foreach (DataRow dataRow in dataTable.Rows)
         {
             string          UserName = "";
             RadComboBoxItem item     = new RadComboBoxItem();
             item.Text  = (string)dataRow["UserName"].ToString();
             item.Value = dataRow["UserId"].ToString();
             UserName   = (string)dataRow["UserName"];
             if (dataRow["UserName"] != System.DBNull.Value)
             {
                 UserName = (string)dataRow["UserName"];
             }
             //item.Attributes.Add("FIRMAADI", FirmaAdi);
             //item.Attributes.Add("IL_ILCE", IlIlce);
             RadComboBoxFirma.Items.Add(item);
             item.DataBind();
         }
         Label lbl = (Label)RadComboBoxFirma.Footer.FindControl("lblBulunanKayitSayisi");
         lbl.Text = "Bulunan kayıt sayısı:" + "  " + dataTable.Rows.Count.ToString();
     }
 }
Ejemplo n.º 11
0
 protected void cmbInstalacion_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
 {
     if (cmbcentro.SelectedValue.Length > 0)
     {
         int _idCentro = convertir.toInt32(cmbcentro.SelectedValue);
         CargarInstalacionesbyCentro(_idCentro);
     }
 }
        protected void rcbPendingReason_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox      rcStatus        = (RadComboBox)o;
            GridEditableItem editedItem      = rcStatus.NamingContainer as GridEditableItem;
            RadComboBox      rcPendingReason = editedItem.FindControl("rcbPendingReason") as RadComboBox;
            string           statusOrderCode = rcStatus.SelectedValue;

            BindRadComboBoxPendingReason(rcPendingReason, statusOrderCode);
        }
Ejemplo n.º 13
0
        void cboPoint_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);

            cboPoint.Items.Clear();
            int    identityId = 0;
            string searchText = "";

            if (e.Context["FilterString"] != null && e.Context["FilterString"].ToString() != "")
            {
                string[] values = e.Context["FilterString"].ToString().Split(';');
                try { identityId = int.Parse(values[0]); }
                catch { }
                if (values.Length > 1 && values[1] != "false" && !string.IsNullOrEmpty(values[1]))
                {
                    searchText = values[1];
                }
                else if (!string.IsNullOrEmpty(e.Text))
                {
                    searchText = e.Text;
                }
            }
            else
            {
                searchText = e.Context["FilterString"].ToString();
            }

            Orchestrator.Facade.IPoint facPoint = new Orchestrator.Facade.Point();
            DataSet ds = facPoint.GetAllForOrganisation(identityId, ePointType.Any, 0, searchText);

            System.Diagnostics.Debug.Write(e.Value + " " + e.Text);

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

            if (endOffset > ds.Tables[0].Rows.Count)
            {
                endOffset = ds.Tables[0].Rows.Count;
            }

            DataTable dt = ds.Tables[0];

            Telerik.Web.UI.RadComboBoxItem rcItem = null;
            for (int i = itemOffset; i < endOffset; i++)
            {
                rcItem       = new Telerik.Web.UI.RadComboBoxItem();
                rcItem.Text  = dt.Rows[i]["Description"].ToString();
                rcItem.Value = dt.Rows[i]["PointId"].ToString();
                cboPoint.Items.Add(rcItem);
            }

            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());
            }
        }
Ejemplo n.º 14
0
 protected void RadComboBoxGroups_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
 {
     using (SSITrainingEntities context = new SSITrainingEntities())
     {
         //var allGroups = context.CompetencyGroups.OrderBy(i => i.GroupName);
         //RadComboBoxGroups.DataSource = allGroups.ToList();
         //RadComboBoxGroups.DataBind();
     }
 }
Ejemplo n.º 15
0
        /// <summary>
        /// Handles the ItemsRequested event of the cboSearch control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs"/> instance containing the event data.</param>
        protected void cboSearch_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            string keyword = e.Text.Trim().ToLower();

            if (keyword == string.Empty)
            {
                return;
            }

            try
            {
                List <BookingInfo> bookings = new List <BookingInfo>();
                switch (DisplayMode)
                {
                case ViewMode.InventoryManager:
                    bookings = this.GetBL <InventoryBL>().GetBookingInfo(this.CompanyId, null, keyword, this.BookingStatus, this.ShowArchived, true).ToList();
                    break;

                case ViewMode.MyBookings:
                    bookings = this.GetBL <InventoryBL>().GetBookingInfo(null, this.CreatedByUserId, keyword, this.BookingStatus, this.ShowArchived, true).ToList();
                    break;
                }

                int resultCount = bookings.Count;
                for (int i = 0; i < resultCount; i++)
                {
                    //Search beginning of words.
                    string        matchPattern      = string.Format(@"\b{0}", Regex.Escape(keyword));
                    Match         keywordMatch      = Regex.Match(bookings[i].BookingName, matchPattern, RegexOptions.IgnoreCase);
                    StringBuilder formattedItemText = new StringBuilder(bookings[i].BookingName);

                    // Highlight matching word portion
                    if (keywordMatch != null && keywordMatch.Length > 0)
                    {
                        formattedItemText.Insert(keywordMatch.Index, "<b>");
                        formattedItemText.Insert(3 + keywordMatch.Index + keyword.Length, "</b>");
                    }

                    // Add the matched items to the suggestion list
                    using (RadComboBoxItem item = new RadComboBoxItem())
                    {
                        Literal ltrl = new Literal();
                        item.Controls.Add(ltrl);
                        ltrl.Text = Support.TruncateString(formattedItemText.ToString(), 35);

                        item.Text = bookings[i].BookingName;

                        cboSearch.Items.Add(item);
                    }
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 16
0
        private void LoadDrivers(Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboDriver.Items.Clear();

            Facade.IReferenceData facDriver = new Facade.ReferenceData();

            DataSet ds = facDriver.GetAllDriversFiltered(e.Text, false);

            cboDriver.DataSource = ds;
            cboDriver.DataBind();
        }
Ejemplo n.º 17
0
        protected void RadComboBoxType_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox RadComboBoxType = (RadComboBox)sender;

            using (SSITrainingEntities context = new SSITrainingEntities())
            {
                var allTypes = context.CompetencyTypes.OrderBy(i => i.CompetencyTypeName);
                RadComboBoxType.DataSource = allTypes.ToList();
                RadComboBoxType.DataBind();
            }
        }
Ejemplo n.º 18
0
        protected void rdcAccesorio_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            if (e.Text == "")
            {
                return;
            }
            RadComboBox combo = (RadComboBox)sender;

            combo.Items.Clear();
            foreach (Accesorio accesorio in CntDosimetria.getAccesorio(e.Text, ctx))
            {
                combo.Items.Add(new RadComboBoxItem(accesorio.Descripcion, accesorio.AccesorioId.ToString()));
            }
        }
Ejemplo n.º 19
0
        void cboClient_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();
            DataSet         ds;
            DataTable       dt;
            RadComboBoxItem rcItem;
            int             itemsPerRequest = 20;
            int             itemOffset;
            int             endOffset;

            this.cboClient.Items.Clear();

            if (this.IsCalledFromHotKey)
            {
                ds = facReferenceData.GetClientAndSubcontractorLookup(e.Text);
            }
            else if (this.IsClient)
            {
                ds = facReferenceData.GetAllClientsFiltered(e.Text);
            }
            else
            {
                ds = facReferenceData.GetAllSubContractorsFiltered(e.Text);
            }

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

            dt = ds.Tables[0];
            dt.DefaultView.Sort             = "OrganisationName";
            dt.DefaultView.ApplyDefaultSort = true;

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

            for (int i = itemOffset; i < endOffset; i++)
            {
                rcItem       = new RadComboBoxItem();
                rcItem.Text  = dt.Rows[i]["OrganisationName"].ToString();
                rcItem.Value = dt.Rows[i]["IdentityID"].ToString();
                cboClient.Items.Add(rcItem);
            }

            if (dt.Rows.Count > 0)
            {
                e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, dt.Rows.Count);
            }
        }
Ejemplo n.º 20
0
        protected void rdcDispositivo_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            if (e.Text == "")
            {
                return;
            }
            RadComboBox combo = (RadComboBox)sender;

            combo.Items.Clear();
            foreach (Dispositivo dispositivo in CntDosimetria.GetDispositivo(e.Text, ctx))
            {
                combo.Items.Add(new RadComboBoxItem(dispositivo.Nombre, dispositivo.DispositivoId.ToString()));
            }
        }
Ejemplo n.º 21
0
    protected void RadComboBoxFirma_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        //string BolgeKodu = Session["BolgeKodu"].ToString();
        //string bak = e.Text;
        if (e.Text.Length > 2)
        {
            string BolgeKodu        = intBolgeKodu.ToString();
            string sqlSelectCommand = "";

            /*
             * if (rdbtnlstAramaTipi.SelectedIndex == 0)//isnodan arama
             *  sqlSelectCommand = "SELECT [ObjectID], [isno], [adi], [birim] from [tblIsEmri] WHERE [isno] LIKE '%'+ @text + '%' ORDER BY [isno]";
             * if (rdbtnlstAramaTipi.SelectedIndex == 1)//is adından arama
             *  sqlSelectCommand = "SELECT [ObjectID], [isno], [adi], [birim] from [tblIsEmri] WHERE [adi] LIKE '%'+ @text + '%' ORDER BY [adi]";
             * if (rdbtnlstAramaTipi.SelectedIndex == 2)//Birimden arama
             *  sqlSelectCommand = "SELECT [ObjectID], [isno], [adi], [birim] from [tblIsEmri] WHERE [birim] LIKE '%'+ @text + '%' ORDER BY [birim]";
             */
            sqlSelectCommand = "SELECT [FIRMAID],[MUSTNO], [FIRMAADI], [IL_ILCE] from [firma] WHERE [FIRMAADI] LIKE '%'+ @text + '%' and SILINDI=0 and BOLGEKODU=" + BolgeKodu + " ORDER BY [FIRMAADI]";
            SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings["KalData"].ConnectionString);
            adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
            DataTable dataTable = new DataTable();
            adapter.Fill(dataTable);
            //lblBulunanIsSayisi.Text = dataTable.Rows.Count.ToString();



            RadComboBoxFirma.Items.Clear();
            foreach (DataRow dataRow in dataTable.Rows)
            {
                string          IlIlce = "";
                RadComboBoxItem item   = new RadComboBoxItem();
                item.Text  = (string)dataRow["MUSTNO"].ToString();
                item.Value = dataRow["FIRMAID"].ToString();
                string FirmaAdi = (string)dataRow["FIRMAADI"];
                if (dataRow["IL_ILCE"] != System.DBNull.Value)
                {
                    IlIlce = (string)dataRow["IL_ILCE"];
                }
                item.Attributes.Add("FIRMAADI", FirmaAdi);
                item.Attributes.Add("IL_ILCE", IlIlce);
                RadComboBoxFirma.Items.Add(item);
                item.DataBind();
            }
            Label lbl = (Label)RadComboBoxFirma.Footer.FindControl("lblBulunanKayitSayisi");
            lbl.Text = "Bulunan kayıt sayısı:" + "  " + dataTable.Rows.Count.ToString();
        }
    }
Ejemplo n.º 22
0
        protected void RadComboBoxProject_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            IQueryable <Project> projects = (IQueryable <Project>)_db.Projects;
            RadComboBox          comboBox = (RadComboBox)sender;

            comboBox.Items.Clear();

            foreach (Project p in projects)
            {
                RadComboBoxItem item = new RadComboBoxItem();

                item.Text  = p.name;
                item.Value = p.projectId.ToString();
                comboBox.Items.Add(item);
                item.DataBind();
            }
        }
Ejemplo n.º 23
0
        void cboTown_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboTown.Items.Clear();

            int countryId = 1; //UK

            if (e.Context["FilterString"] != null && e.Context["FilterString"].ToString().ToLower().IndexOf("countryid=") > -1)
            {
                string countryIdString = e.Context["FilterString"].ToString().ToLower().Replace("countryid=", "");
                countryIdString = countryIdString.Substring(0, countryIdString.IndexOf(';'));
                countryId       = Convert.ToInt32(countryIdString);
            }

            Orchestrator.Facade.IReferenceData facRefData = new Orchestrator.Facade.ReferenceData();
            DataSet ds = facRefData.GetTownForTownNameAndCountry(e.Text, countryId);

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

            if (endOffset > ds.Tables[0].Rows.Count)
            {
                endOffset = ds.Tables[0].Rows.Count;
            }

            DataTable dt = ds.Tables[0];

            Telerik.Web.UI.RadComboBoxItem rcItem = null;
            for (int i = itemOffset; i < endOffset; i++)
            {
                rcItem       = new Telerik.Web.UI.RadComboBoxItem();
                rcItem.Text  = dt.Rows[i]["Description"].ToString();
                rcItem.Value = dt.Rows[i]["TownId"].ToString();
                cboTown.Items.Add(rcItem);
            }

            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());
            }
            else
            {
                this.cboTown.Text = String.Empty;
            }
        }
Ejemplo n.º 24
0
        protected void cbRole_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            string text = e.Text.Trim();

            if (!String.IsNullOrEmpty(text))
            {
                RadComboBox combo = (sender as RadComboBox);
                combo.Items.Clear();
                var query = from r in DataContext.SSO_Roles
                            where r.name.Contains(text)
                            orderby r.name
                            select new { value = r.id.ToString(), r.name };
                foreach (var r in query)
                {
                    combo.Items.Add(new RadComboBoxItem(r.name, r.value));
                }
            }
        }
Ejemplo n.º 25
0
        protected void cbUser_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            string text = e.Text.Trim();

            if (!String.IsNullOrEmpty(text))
            {
                RadComboBox combo = (sender as RadComboBox);
                combo.Items.Clear();
                var query = from r in DataContext.SSO_Users
                            where r.username.StartsWith(text) ||
                            r.name.StartsWith(text) || r.surname.StartsWith(text)
                            orderby r.surname
                            orderby r.name
                            select new { value = r.id.ToString(), name = r.surname + ", " + r.name + " (" + r.username + ")" };
                foreach (var r in query)
                {
                    combo.Items.Add(new RadComboBoxItem(r.name, r.value));
                }
            }
        }
Ejemplo n.º 26
0
        protected void cboDriver_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            ((Telerik.Web.UI.RadComboBox)sender).Items.Clear();

            Facade.IResource facResource = new Facade.Resource();
            DataSet          ds          = null;

            #region Get ControlArea and Traffic Area
            // As thgis is only set when there is no call back or post back we need to get the correct values

            #endregion

            ds = facResource.GetAllResourcesFiltered("%" + e.Text, eResourceType.Driver, false);

            int itemsPerRequest = 30;
            int itemOffset      = e.NumberOfItems;
            int endOffset       = itemOffset + itemsPerRequest;
            if (endOffset > ds.Tables[0].Rows.Count)
            {
                endOffset = ds.Tables[0].Rows.Count;
            }

            DataTable dt = ds.Tables[0];
            Telerik.Web.UI.RadComboBoxItem rcItem = null;
            for (int i = itemOffset; i < endOffset; i++)
            {
                rcItem       = new Telerik.Web.UI.RadComboBoxItem();
                rcItem.Text  = dt.Rows[i]["Description"].ToString();
                rcItem.Value = dt.Rows[i]["ResourceId"].ToString();
                ((Telerik.Web.UI.RadComboBox)sender).Items.Add(rcItem);
            }

            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());
            }
        }
        protected void radCmboUserName_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            try
            {
                DataTable dataTable = BLUserAccess.GetAllUsers();

                foreach (DataRow dataRow in dataTable.Rows)
                {
                    RadComboBoxItem item = new RadComboBoxItem();

                    item.Text = (string)dataRow["name"];


                    String ContactNumber = dataRow["ContactNumber"].ToString();
                    item.Attributes.Add("ContactNumber", ContactNumber.ToString());

                    String email = dataRow["email"].ToString();
                    item.Attributes.Add("email", email.ToString());


                    item.Value = dataRow["pin_number"].ToString();
                    String pin_number = dataRow["pin_number"].ToString();
                    item.Attributes.Add("pin_number", pin_number.ToString());



                    radCmboUserName.Items.Add(item);

                    item.DataBind();
                }
            }

            catch (Exception ex)
            {
                Alert.Show(ex.Message);
            }
        }
Ejemplo n.º 28
0
 void cboDriver_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
 {
     LoadDrivers(e);
 }