Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            ActionResponseLabel.Text = String.Empty;

            InitializeContentGrid();

            InitializeState();

            InitializeSecurity();

            EntityAddressCounty.AllowCustomText = true;

            if (Entity.EntityType == Mercury.Server.Application.EntityType.Provider)
            {
                Telerik.Web.UI.RadComboBoxItem serviceLocation = EntityAddressType.Items.FindItemByValue("77");

                serviceLocation.Visible = true;
            }

            // DEFAULT EFFECTIVE DATE TO CURRENT DATE

            if (EntityAddressEffectiveDatePicker.SelectedDate == null)
            {
                EntityAddressEffectiveDatePicker.SelectedDate = System.DateTime.Today.Date;
            }

            return;
        }
        void cboDrivers_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboDrivers.Items.Clear();

            Facade.IResource facResource = new Facade.Resource();
            DataSet          ds          = facResource.GetAllResourcesFiltered(e.Text, eResourceType.Driver, 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();
                cboDrivers.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());
            }
        }
Example #3
0
        private void Perfil_Cargar(int idEmpresa, string descripcion)
        {
            string                     ValorCero;
            PerfilWCFClient            objPerfilWCF = new PerfilWCFClient();
            List <Perfil_ListarResult> listPerfil   = new List <Perfil_ListarResult>();

            ValorCero = "SELECCIONAR";

            cboPerfil.Items.Clear();
            cboPerfil.Items.Insert(0, ValorCero);
            cboPerfil.Items.FindItemByText(ValorCero).Value = "0";
            try
            {
                listPerfil = objPerfilWCF.Perfil_Listar(idEmpresa, "").ToList();
                if (listPerfil.Count > 0)
                {
                    foreach (Perfil_ListarResult objPerfil in listPerfil)
                    {
                        Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem(objPerfil.nombrePerfil.ToString().Trim(), objPerfil.idPerfil.ToString());
                        cboPerfil.Items.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #4
0
        //---------------------------------------------------------------------------------------

        protected void cboVehicle_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            cboVehicle.Items.Clear();

            Telerik.Web.UI.RadComboBoxItem rcItem = new Telerik.Web.UI.RadComboBoxItem();
            DataSet ds = null;

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

            if (ds != null)
            {
                int       endOffset    = 0;
                DataTable boundResults = BindComboBoxItems(ds.Tables[0], e.NumberOfItems, out endOffset);

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

                if (boundResults.Rows.Count > 0)
                {
                    e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), boundResults.Rows.Count.ToString());
                }
            }
        }
        private void cboDepot_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboDepot.Items.Clear();

            Facade.IOrganisationLocation facOrgLoc = new Facade.Organisation();
            DataSet ds = facOrgLoc.GetAllDepots(Orchestrator.Globals.Configuration.IdentityId);

            DataTable dt = ds.Tables[0];

            Telerik.Web.UI.RadComboBoxItem rcItem = null;
            rcItem       = new Telerik.Web.UI.RadComboBoxItem();
            rcItem.Text  = "All";
            rcItem.Value = "0";
            cboDepot.Items.Add(rcItem);

            List <Telerik.Web.UI.RadComboBoxItem> comboItems = new List <Telerik.Web.UI.RadComboBoxItem>();

            dt.Rows.Cast <DataRow>().ToList().ForEach(row => comboItems.Add(
                                                          new Telerik.Web.UI.RadComboBoxItem
            {
                Text  = row["OrganisationLocationName"].ToString(),
                Value = row["OrganisationLocationId"].ToString()
            }));
            comboItems.Sort((item1, item2) => item1.Text.CompareTo(item2.Text));
            cboDepot.Items.AddRange(comboItems);
        }
        //装入公司信息
        private void LoadCompany()
        {
            using (MECEntities objDB = new MECEntities())
            {
                List <tblCompany> CompList = objDB.tblCompany.ToList <tblCompany>();

                cboCompany.Items.Clear();

                //设置空值
                Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem();

                item.Text  = "N/A";
                item.Value = string.Empty;

                cboCompany.Items.Add(item);

                //装入公司数据
                foreach (tblCompany cp in CompList)
                {
                    item = new Telerik.Web.UI.RadComboBoxItem();

                    item.Value = cp.CompanyID;
                    item.Text  = cp.CompName;

                    cboCompany.Items.Add(item);
                }
            }
        }
Example #7
0
        protected void drpDanshkade_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (drpDanshkade.SelectedIndex != 0)
            {
                int            danId       = Convert.ToInt32(drpDanshkade.SelectedValue);
                RC_UserHandler userhandler = new RC_UserHandler();
                List <RC_User> ostadList   = userhandler.GetOstadListByDaneshID(danId);
                if (ostadList != null)
                {
                    ostadList.ToList().ForEach(i => i.Name = i.Name.Replace("ي", "ی"));

                    Telerik.Web.UI.RadComboBoxItem other1 = new Telerik.Web.UI.RadComboBoxItem(text: "سایر", value: "0");
                    drpProfessors.DataSource     = ostadList;
                    drpProfessors.DataTextField  = "Name";
                    drpProfessors.DataValueField = "ID";
                    drpProfessors.DataBind();
                    drpProfessors.Items.Add(other1);
                }
                else
                {
                    drpProfessors.Items.Clear();
                    grdLessons.DataSource = null;
                    grdLessons.DataBind();
                }
            }
        }
        //装入对应公司的Cycle信息
        private void LoadCycle(string CompID)
        {
            using (MECEntities objDB = new MECEntities())
            {
                List <tblCycle> CycleList = objDB.tblCycle.Where("it.CompanyID=='" + CompID + "'").OrderBy("it.Cycle").ToList <tblCycle>();

                cboCycle.Items.Clear();

                Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem();

                item.Value = string.Empty;
                item.Text  = "N/A";

                cboCycle.Items.Add(item);

                foreach (tblCycle cl in CycleList)
                {
                    item = new Telerik.Web.UI.RadComboBoxItem();

                    item.Value = cl.CycleID;
                    item.Text  = cl.Cycle.ToString();

                    cboCycle.Items.Add(item);
                }
            }
        }
Example #9
0
        //------------------------------------------------------------------------------------

        private void LoadFiles()
        {
            cboFile.Items.Clear();

            DateTime fromDate = this.dteImportFromDate.SelectedDate.Value;
            DateTime toDate   = this.dteImportToDate.SelectedDate.Value;

            toDate = toDate.AddHours(23);
            toDate = toDate.AddMinutes(59);
            toDate = toDate.AddSeconds(59);

            List <EF.ImportedInvoice> importedInvoices = (from ii in EF.DataContext.Current.ImportedInvoiceSet
                                                          where ii.CreateDateTime >= fromDate && ii.CreateDateTime <= toDate
                                                          select ii).ToList();

            if (importedInvoices.Count > 0)
            {
                foreach (EF.ImportedInvoice importedInvoice in importedInvoices)
                {
                    Telerik.Web.UI.RadComboBoxItem rcItem = null;
                    rcItem       = new Telerik.Web.UI.RadComboBoxItem();
                    rcItem.Text  = importedInvoice.Filename;
                    rcItem.Value = importedInvoice.ImportedInvoiceID.ToString();
                    cboFile.Items.Add(rcItem);
                }
            }

            this.cboFile.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("-- Please Select -- ", "-1"));

            this.txtBatchRef.Text   = String.Empty;
            this.lblFromSystem.Text = String.Empty;
        }
Example #10
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);

            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();
                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.ToString(), dt.Rows.Count.ToString());
            }
        }
Example #11
0
        void cboClientsCustomer_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboClientsCustomer.Items.Clear();

            int identityID = int.Parse(e.Context["IdentityID"].ToString());

            //The Client IdentityId is passed in the combo's ClientDataString
            //If it is empty it means that a the combo selection hasn't changed
            //so check whether it was set to a client already (i.e. the Client User scenario)
            int clientId = 0;

            if (identityID == 0)
            {
                if (!string.IsNullOrEmpty(cboClient.SelectedValue))
                {
                    int.TryParse(cboClient.SelectedValue, out clientId);
                }
            }
            else
            {
                clientId = identityID;
            }

            //A client must be specified before their Customer's can be listed
            if (clientId == 0)
            {
                return;
            }

            //Restrict the Client Customers returned to the Client selected
            Orchestrator.Facade.IOrganisation facOrganisation = new Orchestrator.Facade.Organisation();
            DataSet ds = facOrganisation.GetClientCustomersForClientFiltered(
                clientId, 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]["OrganisationName"].ToString();
                rcItem.Value = dt.Rows[i]["IdentityId"].ToString();
                cboClientsCustomer.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());
            }
        }
Example #12
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());
            }
        }
Example #13
0
 protected void ddlTimeZone_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)
 {
     Telerik.Web.UI.RadComboBoxItem rdCm = e.Item;
     if (rdCm.Text == "Separator")
     {
         rdCm.Text        = "----------------------------------------------";
         rdCm.IsSeparator = true;
     }
 }
Example #14
0
        private void InitializePrompt()
        {
            promptRequest = (Server.Application.WorkflowUserInteractionRequestPromptUser)WorkflowPage.UserInteractionRequest;


            PromptTitle.Text = ParseSmartTag(promptRequest.PromptTitle);

            PromptMessage.Text = ParseSmartTag(promptRequest.PromptMessage);

            if (promptRequest.PromptImage == Mercury.Server.Application.UserPromptImage.NoImage)
            {
                PromptImage.Visible = false;
            }

            else
            {
                PromptImage.Src = "/Images/Common32/" + promptRequest.PromptImage.ToString() + ".png";
            }

            switch (promptRequest.PromptType)
            {
            case Mercury.Server.Application.UserPromptType.ConfirmationYesNo:

                ButtonOk.Text = "Yes";

                ButtonCancel.Text = "No";

                break;

            case Mercury.Server.Application.UserPromptType.Selection:

                PromptSelectionItemsRow.Visible = true;

                ButtonCancel.Enabled = promptRequest.AllowCancel;

                if (promptRequest.SelectionItems != null)
                {
                    foreach (Mercury.Server.Application.WorkflowUserInteractionRequestPromptSelectionItem currentSelectionItem in promptRequest.SelectionItems)
                    {
                        Telerik.Web.UI.RadComboBoxItem selectionItem = new Telerik.Web.UI.RadComboBoxItem(currentSelectionItem.Text, currentSelectionItem.Value);

                        selectionItem.Enabled = currentSelectionItem.Enabled;

                        selectionItem.Selected = currentSelectionItem.Selected;

                        PromptSelectionItemsSelection.Items.Add(selectionItem);
                    }
                }

                break;
            }

            return;
        }
        public void CarregarComboGrupo()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("idfornecedor");
            dt.Columns.Add("nome");
            GrupoBusinessLayer bl = new GrupoBusinessLayer();
            GrupoEntity        eo = new GrupoEntity();

            eo.status = EOConst.CodStatus.Ativo;
            dt        = bl.ConsultarGruposAtivos(eo);

            ddlgrupo.Items.Clear();
            ListItem itemCliente = new ListItem();

            Telerik.Web.UI.RadComboBoxItem radComboBoxItem = new Telerik.Web.UI.RadComboBoxItem();
            radComboBoxItem.Value = "0";
            radComboBoxItem.Text  = "";
            ddlgrupo.Items.Add(radComboBoxItem);

            if (dt != null)
            {
                if (dt.Rows != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            radComboBoxItem       = new Telerik.Web.UI.RadComboBoxItem();
                            radComboBoxItem.Value = dr["idgrupo"].ToString();
                            radComboBoxItem.Text  = dr["nome"].ToString();
                            ddlgrupo.Items.Add(radComboBoxItem);
                        }
                    }
                }
            }

            ddlgrupo.AllowCustomText = true;
            ddlgrupo.MarkFirstMatch  = true;

            ddlgrupo.SelectedValue = "0";

            //ddlgrupo.DataSource = dt;
            //ddlgrupo.DataBind();
            //if (ddlgrupo.Items.Count > 0)
            //{
            //    ddlgrupo.Items.Insert(0, new ListItem("", ""));
            //}
            //else
            //{
            //    ddlgrupo.Items.Insert(0, new ListItem("", "Não existe registro cadastrado."));
            //}
        }
Example #16
0
    /// <summary>
    /// Event handler fort the SelectedIndexChanged event of cmbAssociates
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void cmbAssociates_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
    {
        CurrentUser currentUser = ((CurrentUser)SessionManager.GetSessionValueRedirect(this.ParentPage, SessionStrings.CURRENT_USER));

        try
        {
            //Refresh the inergy login label according to the selected assocaite
            if (cmbAssociates.SelectedValue == ApplicationConstants.INT_NULL_VALUE.ToString())
            {
                lblInergyLogin.Text    = "";
                cmbRoles.SelectedValue = ApplicationConstants.INT_NULL_VALUE.ToString();
                cmbRoles.Enabled       = false;
            }
            else
            {
                cmbRoles.Enabled = true;
                int       idAssociate = int.Parse(cmbAssociates.SelectedValue);
                DataTable roleTable   = profile.GetAssociateRole(idAssociate);
                if (roleTable.Rows.Count > 0)
                {
                    cmbRoles.SelectedValue = roleTable.Rows[0]["Id"].ToString();
                    if (int.Parse(roleTable.Rows[0]["Id"].ToString()) == ApplicationConstants.ROLE_BUSINESS_ADMINISTATOR &&
                        currentUser.UserRole.Id != ApplicationConstants.ROLE_TECHNICAL_ADMINISTATOR)
                    {
                        Telerik.Web.UI.RadComboBoxItem item = cmbRoles.FindItemByValue(ApplicationConstants.ROLE_TECHNICAL_ADMINISTATOR.ToString());
                        item.Enabled = false;
                    }
                }
                else
                {
                    cmbRoles.SelectedValue = ApplicationConstants.INT_NULL_VALUE.ToString();
                    cmbRoles.Text          = String.Empty;
                }
                //Get the datasource for the cmbProjects combo
                DataTable tbl = (DataTable)cmbAssociates.DataSource;
                DataRow   row = tbl.Rows[cmbAssociates.SelectedIndex];
                //Updates the label on the screen
                lblInergyLogin.Text = (row["InergyLogin"] == DBNull.Value) ? "" : row["InergyLogin"].ToString();
            }
        }
        catch (IndException indEx)
        {
            HasErrors = true;
            ReportControlError(indEx);
            return;
        }
        catch (Exception ex)
        {
            HasErrors = true;
            ReportControlError(new IndException(ex));
            return;
        }
    }
        private void cboVehicle_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboVehicle.Items.Clear();

            int depotId = 0;

            int.TryParse(cboDepot.SelectedValue, out depotId);
            Orchestrator.Facade.IVehicle facResource = new Orchestrator.Facade.Resource();

            DataSet ds = null;

            if (depotId == 0)
            {
                ds = facResource.GetAllVehicles();
            }
            else
            {
                ds = facResource.GetVehicleForDepotId(depotId);
            }

            DataTable dt = ds.Tables[0];

            Telerik.Web.UI.RadComboBoxItem rcItem = null;
            rcItem       = new Telerik.Web.UI.RadComboBoxItem();
            rcItem.Text  = "All";
            rcItem.Value = "0";
            cboVehicle.Items.Add(rcItem);

            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 dt.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);
        }
Example #18
0
        public void CarregarComboCertificacao()
        {
            ddlcertificacao.Items.Clear();
            CertificadoBusinessLayer blCertificado = new CertificadoBusinessLayer();
            CertificadoEntity        eoCertificado = new CertificadoEntity();

            eoCertificado.status = EOConst.CodStatus.Ativo;

            //ddlcertificacao.DataSource = blCertificado.Consultar(eoCertificado);
            DataTable dtCertificacao = blCertificado.Consultar(eoCertificado);

            ddlcertificacao.Items.Clear();
            ListItem itemCliente = new ListItem();

            Telerik.Web.UI.RadComboBoxItem radComboBoxItem = new Telerik.Web.UI.RadComboBoxItem();
            radComboBoxItem.Value = "0";
            radComboBoxItem.Text  = "";
            ddlcertificacao.Items.Add(radComboBoxItem);

            if (dtCertificacao != null)
            {
                if (dtCertificacao.Rows != null)
                {
                    if (dtCertificacao.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dtCertificacao.Rows)
                        {
                            radComboBoxItem       = new Telerik.Web.UI.RadComboBoxItem();
                            radComboBoxItem.Value = dr["idcertificado"].ToString();
                            radComboBoxItem.Text  = dr["dscombo"].ToString();
                            ddlcertificacao.Items.Add(radComboBoxItem);
                        }
                    }
                }
            }

            ddlcertificacao.AllowCustomText = true;
            ddlcertificacao.MarkFirstMatch  = true;
            ddlcertificacao.SelectedValue   = "0";

            //ddlcertificacao.DataTextField = "dscombo";
            //ddlcertificacao.DataValueField = "idcertificado";
            //ddlcertificacao.DataBind();
            //if (ddlcertificacao.Items.Count > 0)
            //{
            //    ddlcertificacao.Items.Insert(0, new ListItem("", ""));
            //}
            //else
            //{
            //    ddlcertificacao.Items.Insert(0, new ListItem("", "Não existe registro cadastrado."));
            //}
        }
Example #19
0
        public void CarregarComboColaborador()
        {
            ddlColaborador.Items.Clear();
            UsuarioBusinessLayer bl = new UsuarioBusinessLayer();
            UsuarioEntity        eo = new UsuarioEntity();

            eo.status = EOConst.CodStatusUsuario.Ativo;

            DataTable dtcolaborador = bl.Consultar(eo);

            ddlColaborador.Items.Clear();
            ListItem itemCliente = new ListItem();

            Telerik.Web.UI.RadComboBoxItem radComboBoxItem = new Telerik.Web.UI.RadComboBoxItem();
            radComboBoxItem.Value = "";
            radComboBoxItem.Text  = "";
            ddlColaborador.Items.Add(radComboBoxItem);

            if (dtcolaborador != null)
            {
                if (dtcolaborador.Rows != null)
                {
                    if (dtcolaborador.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dtcolaborador.Rows)
                        {
                            radComboBoxItem       = new Telerik.Web.UI.RadComboBoxItem();
                            radComboBoxItem.Value = dr["idusuario"].ToString();
                            radComboBoxItem.Text  = dr["dscombo"].ToString();
                            ddlColaborador.Items.Add(radComboBoxItem);
                        }
                    }
                }
            }

            ddlColaborador.AllowCustomText = true;
            ddlColaborador.MarkFirstMatch  = true;

            ddlColaborador.SelectedValue = "";

            //ddlColaborador.DataBind();
            //if (ddlColaborador.Items.Count > 0)
            //{
            //    ddlColaborador.Items.Insert(0, new ListItem("", ""));
            //}
            //else
            //{
            //    ddlColaborador.Items.Insert(0, new ListItem("Não existe registros cadastrados.", ""));
            //}
        }
Example #20
0
        private Telerik.Web.UI.RadComboBoxItem CreateRadComboBoxItem(String text, String value, Boolean isSelected)
        {
            Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem();

            item = new Telerik.Web.UI.RadComboBoxItem();

            item.Text = text;

            item.Value = value;

            item.Selected = isSelected;

            return(item);
        }
Example #21
0
        void Page_InitComplete(object sender, EventArgs e)
        {
            if (Page != null && WebPartManager.GetCurrentWebPartManager(Page) != null)
            {
                _manager = WebPartManager.GetCurrentWebPartManager(Page);

                String browseModeName = WebPartManager.BrowseDisplayMode.Name;
                Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem("View Page", "Browse");
                cboPageMenu.Items.Add(item);
                item = new Telerik.Web.UI.RadComboBoxItem("Change Settings", "Edit");
                cboPageMenu.Items.Add(item);
                item = new Telerik.Web.UI.RadComboBoxItem("Design Page", "Catalog");
                cboPageMenu.Items.Add(item);
            }
        }
    public Controls_GoToPage(string selected_page)
    {
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        XmlUtil x_util = new XmlUtil();
        string[] pages = x_util.GetAppPageNames(State, State["SelectedApp"].ToString());

        gotopage.Items.Clear();
        foreach (string name in pages)
        {
            Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem(name, name);
            gotopage.Items.Add(item);
            if (name == selected_page)
                item.Selected = true;
        }
    }
    public void cboDefaultAttemptedDeliveryReturnPoint_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        DataSet ds = null;

        Orchestrator.Facade.Point facPoint = new Orchestrator.Facade.Point();
        int noOfRowsToReturn = 20;

        // The search text entered by the user ("e.Text") can be split into two regions delimited by a backslash.
        // Any text to the left of the first backslash (or when there is no backslash) should be used to filter the organisation name.
        // Any text to the right of a backslash should be used to filter the point description.
        char filterChar = (char)92; // Backslash character "\"

        string[] filterString = e.Text.Split(filterChar.ToString().ToCharArray());

        if (string.IsNullOrEmpty(e.Text))
        {
            // Do not filter the point type for the time being - just display 'Any'.
            ds = facPoint.GetAllWithAddress(ePointType.Any, "", "", noOfRowsToReturn);
        }
        else if (filterString.Length == 1)
        {
            // Do not filter the point type for the time being - just display 'Any'.
            ds = facPoint.GetAllWithAddress(ePointType.Any, filterString[0], "", noOfRowsToReturn);
        }
        else if (filterString.Length > 1)
        {
            // Do not filter the point type for the time being - just display 'Any'.
            ds = facPoint.GetAllWithAddress(ePointType.Any, filterString[0], filterString[1], noOfRowsToReturn);
        }

        DataTable dt = ds.Tables[0];

        Telerik.Web.UI.RadComboBoxItem rcItem = null;

        foreach (DataRow row in dt.Rows)
        {
            rcItem = new Telerik.Web.UI.RadComboBoxItem();
            PointComboItem comboItem = new PointComboItem(row);

            rcItem.DataItem = comboItem;
            rcItem.Text     = comboItem.SingleLineText;
            rcItem.Value    = row["IdentityId"].ToString() + "," + row["PointId"];

            cboDefaultAttemptedDeliveryReturnPoint.Items.Add(rcItem);
        }
    }
Example #24
0
    void cboPointOwner_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        //cboDeliveryPointOwner.Items.Clear();


        // if this is being called by a client they can only access clients of their own for now.
        DataSet ds = null;

        if (this.ClientUserOrganisationIdentityID > 0)
        {
            Orchestrator.Facade.IOrganisation facOrganisation = new Orchestrator.Facade.Organisation();
            ds = facOrganisation.GetClientsForIdentityIdFiltered(this.ClientUserOrganisationIdentityID, e.Text);
        }
        else
        {
            Orchestrator.Facade.IReferenceData facReferenceData = new Orchestrator.Facade.ReferenceData();
            ds = facReferenceData.GetAllOrganisationsFiltered("%" + e.Text, false);
        }

        DataTable dt = ds.Tables[0];

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

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



        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();
            cboPointOwner.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 ItemTable_OnDataBinding(Object sender, EventArgs eventArgs)
        {
            System.Web.UI.WebControls.Table itemTable = (System.Web.UI.WebControls.Table)sender;

            Telerik.Web.UI.RadComboBoxItem currentItem = (Telerik.Web.UI.RadComboBoxItem)itemTable.BindingContainer;

            System.Data.DataRowView currentRow = (System.Data.DataRowView)currentItem.DataItem;

            itemTable.Rows[0].Cells[0].Text = ((String)currentRow["ProviderName"]);

            itemTable.Rows[0].Cells[1].Text = ((String)currentRow["FederalTaxId"]);

            itemTable.Rows[0].Cells[2].Text = ((String)currentRow["NationalProviderId"]);

            itemTable.Rows[0].Cells[3].Text = ((String)currentRow["PrimarySpecialtyName"]);

            return;
        }
Example #26
0
        private void PopulateStaticControls()
        {
            using (var uow = DIContainer.CreateUnitOfWork())
            {
                var organisationsRepo = DIContainer.CreateRepository <IOrganisationRepository>(uow);
                var depots            = organisationsRepo.GetOrganisationDepots();
                foreach (var depot in depots)
                {
                    var rcItem = new Telerik.Web.UI.RadComboBoxItem();
                    rcItem.Text  = depot.OrganisationLocationName;
                    rcItem.Value = depot.OrganisationLocationID.ToString();
                    cboDepot.Items.Add(rcItem);
                }
            }

            dteStartDate.SelectedDate = Utilities.StartOfWeek(DateTime.Now, DayOfWeek.Monday);
            dteEndDate.SelectedDate   = dteStartDate.SelectedDate.Value.AddDays(7);
        }
Example #27
0
        // select some saved filter
        protected void rcbSaved_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        { // move this to client side
            string FilterID = e.Value;

            rcbSaved.DataBind();
            Telerik.Web.UI.RadComboBoxItem item = rcbSaved.FindItemByValue(FilterID);
            if (item != null)
            {
                item.Selected = true;
            }
            else
            {
                rcbSaved.SelectedValue = Guid.Empty.ToString();
            }
            //---------
            Guid ID = Guid.Empty;

            try { ID = new Guid(e.Value); }
            catch { };
            if (ID != Guid.Empty)
            {
                Bll.MetricFilter.Extend mf = MetricTrac.Bll.MetricFilter.Get(ID);
                if (mf != null)
                {
                    SelectedOrgLocations          = mf.FilterOrgLocation;
                    SelectedGroupCategoryAspect   = mf.GroupCategoryAspectID;
                    SelectedPerformanceIndicators = mf.FilterPI;
                    SelectedMetrics       = mf.FilterMetric;
                    SelectedDataCollector = mf.DataCollectorID;
                }
                else
                {
                    ClearFilters();
                }
            }
            else
            {
                ClearFilters();
            }
            if (Use != null)
            {
                Use(this, new EventArgs());
            }
        }
Example #28
0
        protected void Page_Prerender(object sender, EventArgs e)
        {
            Guid   ScoreCardID       = new Guid(ddlScoreCard.SelectedValue);
            string ScoreCardMetricID = rcbMetricOrg.SelectedValue;

            if (!IsPostBack && mfScoreCardDashboard.DataItem != null)
            {
                MetricTrac.Bll.ScoreCardDashboard d = (MetricTrac.Bll.ScoreCardDashboard)mfScoreCardDashboard.DataItem;
                var scm = MetricTrac.Bll.ScoreCardMetric.Get(d.ScoreCardMetricID);
                ScoreCardMetricID = d.ScoreCardMetricID.ToString();
                ScoreCardID       = scm.ScoreCardID;
            }

            var mo = MetricTrac.Bll.ScoreCardMetric.ListUnusedDashboard(ScoreCardID, ScoreCardDashboardID == Guid.Empty ? null : (Guid?)ScoreCardDashboardID);

            rcbMetricOrg.DataSource = mo;
            rcbMetricOrg.DataBind();
            if (mo.Count < 1)
            {
                rcbMetricOrg.EmptyMessage = "This Score Card has not more Metric, Please select another Score Card";
            }

            for (int i = 0; i < mo.Count(); i++)
            {
                Telerik.Web.UI.RadComboBoxItem        it = rcbMetricOrg.Items[i];
                MetricTrac.Bll.ScoreCardMetric.Extend d  = mo[i];
                string t = d.MetricName + " / " + d.OrgLocationName;
                it.Text = t;
            }

            foreach (Telerik.Web.UI.RadComboBoxItem i in rcbMetricOrg.Items)
            {
                i.Selected = i.Value == ScoreCardMetricID;
            }

            foreach (ListItem i in ddlScoreCard.Items)
            {
                i.Selected = i.Value == ScoreCardID.ToString();
            }

            Telerik.Web.UI.RadAjaxManager ram = Telerik.Web.UI.RadAjaxManager.GetCurrent(this);
            ram.UpdatePanelsRenderMode = UpdatePanelRenderMode.Inline;
            ram.AjaxSettings.AddAjaxSetting(mfScoreCardDashboard.FindControl("ddlScoreCard"), mfScoreCardDashboard.FindControl("rapDashboard"), (Telerik.Web.UI.RadAjaxLoadingPanel)mfScoreCardDashboard.FindControl("ralpDashboard"));
        }
        void cboTrailer_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            ((Telerik.Web.UI.RadComboBox)sender).Items.Clear();

            #region Get ControlArea and Traffic Area
            string[] clientArgs    = e.Context["FilterString"].ToString().Split(':');
            int      controlAreaId = 0;
            controlAreaId = int.Parse(clientArgs[0]);

            string[] taids        = clientArgs[1].Split(',');
            int[]    trafficAreas = new int[taids.Length];
            for (int i = 0; i < taids.Length; i++)
            {
                trafficAreas[i] = int.Parse(taids[i]);
            }
            #endregion

            Facade.IResource facResource = new Facade.Resource();
            DataSet          ds          = facResource.GetAllResourcesFiltered(e.Text, eResourceType.Trailer, controlAreaId, trafficAreas, true);

            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();
                ((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());
            }
        }
Example #30
0
        private void CarregarUsuario()
        {
            UsuarioBusinessLayer bl = new UsuarioBusinessLayer();

            DataTable dtUsuario = bl.ConsultarUsuariosAtivos();

            ddlUsuario.Items.Clear();
            ListItem itemCliente = new ListItem();

            Telerik.Web.UI.RadComboBoxItem radComboBoxItem = new Telerik.Web.UI.RadComboBoxItem();
            radComboBoxItem.Value = "0";
            radComboBoxItem.Text  = "Todos";
            ddlUsuario.Items.Add(radComboBoxItem);

            if (dtUsuario != null)
            {
                if (dtUsuario.Rows != null)
                {
                    if (dtUsuario.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dtUsuario.Rows)
                        {
                            radComboBoxItem       = new Telerik.Web.UI.RadComboBoxItem();
                            radComboBoxItem.Value = dr["idusuario"].ToString();
                            radComboBoxItem.Text  = dr["dscombo"].ToString();
                            ddlUsuario.Items.Add(radComboBoxItem);
                        }
                    }
                }
            }

            ddlUsuario.AllowCustomText = true;
            ddlUsuario.MarkFirstMatch  = true;
            ddlUsuario.SelectedValue   = "0";

            // ddlUsuario.DataSource = bl.ConsultarUsuariosAtivos();
            //ddlUsuario.DataTextField = "nome";
            //ddlUsuario.DataValueField = "idusuario";
            //ddlUsuario.DataBind();
            //ddlUsuario.Items.Insert(0, "Todos");
            //ddlUsuario.Items[0].Value = "0";
        }
Example #31
0
        private void InitializeSelectedCarePlanSeverity()
        {
            // GET REFERENCE TO CURRENT CASE CARE LEVEL SEVERITY SELECTION RAD COMBO BOX

            Telerik.Web.UI.RadComboBox currentCaseCareLevelSeveritySelection = (Telerik.Web.UI.RadComboBox)CaseCareLevelSeveritySelection;

            // ADD NOT SPECIFIED SELECTED CARE PLAN SEVERITY RAD COMBO BOX ITEM

            Telerik.Web.UI.RadComboBoxItem notSpecifiedRadComboBoxItem = new Telerik.Web.UI.RadComboBoxItem("** Not Specified", "0");

            // ADD NEW RAD COMBO BOX ITEM TO ITEMS OF CURRENT CASE CARE LEVEL SEVERITY SELECTION RAD COMBO BOX

            currentCaseCareLevelSeveritySelection.Items.Add(notSpecifiedRadComboBoxItem);

            // LOOP THROUGH EACH CARE LEVEL IN CARE LEVELS AVAILABLE

            foreach (Client.Core.Individual.CareLevel currentCareLevel in MercuryApplication.CareLevelsAvailable(false))
            {
                // IF CURRENT CARE LEVEL IS ENABLED AND VISIBLE, THEN CREATE RAD COMBO BOX ITEM FOR CURRENT CARE LEVEL AND ADD TO ITEMS OF CURRENT CASE CARE LEVEL SEVERITY SELECTION RAD COMBO BOX

                if (currentCareLevel.Enabled && currentCareLevel.Visible)
                {
                    // CREATE REFERENCE TO NEW RAD COMBO BOX ITEM WITH VALUE AS ID OF CURRENT CARE LEVEL AND TEXT AS NAME OF CURRENT CARE LEVEL

                    Telerik.Web.UI.RadComboBoxItem newRadComboBoxItem = new Telerik.Web.UI.RadComboBoxItem(currentCareLevel.Name, currentCareLevel.Id.ToString());

                    // ADD NEW RAD COMBO BOX ITEM TO ITEMS OF CURRENT CASE CARE LEVEL SEVERITY SELECTION RAD COMBO BOX

                    currentCaseCareLevelSeveritySelection.Items.Add(newRadComboBoxItem);
                }
            } /* END FOREACH */

            // SET CURRENT CASE LEVEL SEVERITY OF SELECTED MEMBER CASE CARE PLAN

            //String severityValue = MemberCaseCarePlan.Severity.Value.ToString ();

            //String severityName = MemberCaseCarePlan.Severity.Text;



            return;
        }
        //装入公司信息
        private void LoadCompany()
        {
            using (MECEntities objDB = new MECEntities())
            {
                List<tblCompany> CompList = objDB.tblCompany.ToList<tblCompany>();

                cboCompany.Items.Clear();

                //设置空值
                Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem();

                item.Text = "N/A";
                item.Value = string.Empty;

                cboCompany.Items.Add(item);

                //装入公司数据
                foreach (tblCompany cp in CompList)
                {
                    item = new Telerik.Web.UI.RadComboBoxItem();

                    item.Value = cp.CompanyID;
                    item.Text = cp.CompName;

                    cboCompany.Items.Add(item);
                }
            }
        }
        //装入对应公司的Cycle信息
        private void LoadCycle(string CompID)
        {
            using (MECEntities objDB = new MECEntities())
            {
                List<tblCycle> CycleList = objDB.tblCycle.Where("it.CompanyID=='" + CompID+"'").OrderBy("it.Cycle").ToList<tblCycle>();

                cboCycle.Items.Clear();

                Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem();

                item.Value = string.Empty;
                item.Text = "N/A";

                cboCycle.Items.Add(item);

                foreach (tblCycle cl in CycleList)
                {
                    item = new Telerik.Web.UI.RadComboBoxItem();

                    item.Value = cl.CycleID;
                    item.Text = cl.Cycle.ToString();

                    cboCycle.Items.Add(item);
                }
            }
        }
Example #34
0
        protected void updatefriendslist()
        {
            DataTable dttemp = new DataTable();
            try
            {
                dttemp = sitetemp.getFriendslist(fbuser);
            }
            catch
            {
                lblerrorfriend.Visible = true;
            }

            ddlfbfriend.DataSource = dttemp;
            ddlfbfriend.DataTextField = "Name";
            ddlfbfriend.DataValueField = "fbid";
            ddlfbfriend.DataBind();

            Telerik.Web.UI.RadComboBoxItem comb = new Telerik.Web.UI.RadComboBoxItem();
            comb.Text="None";
            comb.Value = "0";
            ddlfbfriend.Items.Insert(0,comb);
        }
Example #35
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport();
            DotNetNuke.Framework.jQuery.RegisterDnnJQueryPlugins(this.Page);
            DotNetNuke.Web.Client.ClientResourceManagement.ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.searchBox.js");
            DotNetNuke.Web.Client.ClientResourceManagement.ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/stylesheets/dnn.searchBox.css");
            DotNetNuke.Web.Client.ClientResourceManagement.ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/admin/SearchResults/dnn.searchResult.js");

            CultureCode = System.Threading.Thread.CurrentThread.CurrentCulture.ToString();

            foreach (var o in SearchContentSources)
            {
                var item = new Telerik.Web.UI.RadComboBoxItem(o, o) { Checked = true};
                SearchScopeList.Items.Add(item);
            }

            SearchScopeList.Localization.AllItemsCheckedString = Localization.GetString("AllFeaturesSelected", Localization.GetResourceFile(this, MyFileName));
        }