예제 #1
0
        public static AutoCompleteBoxData Agenda_UsuarioBuscar(object context)
        {
            int idEmpresa;

            AutoCompleteBoxData res = new AutoCompleteBoxData();
            string searchString     = ((Dictionary <string, object>)context)["Text"].ToString();

            if (searchString.Length > 2)
            {
                idEmpresa = int.Parse(HttpContext.Current.Session["IdEmpresa"].ToString());


                UsuarioWCFClient objUsuario = new UsuarioWCFClient();

                gsUsuario_BuscarResult[] lst = objUsuario.Usuario_BuscarGenesys(idEmpresa,
                                                                                ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, 0, searchString);

                List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();

                foreach (gsUsuario_BuscarResult usuario in lst)
                {
                    AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                    childNode.Text  = usuario.CodUsuario.ToString() + "-" + usuario.NomUsuario;
                    childNode.Value = usuario.CodUsuario.ToString();
                    result.Add(childNode);
                }
                res.Items = result.ToArray();
            }
            return(res);
        }
        public static AutoCompleteBoxData Item_BuscarProducto(object context)
        {
            AutoCompleteBoxData res = new AutoCompleteBoxData();
            string searchString     = ((Dictionary <string, object>)context)["Text"].ToString();

            if (!string.IsNullOrEmpty(searchString) && searchString.Length >= 4)
            {
                ItemWCFClient objItemWCF          = new ItemWCFClient();
                gsItem_ListarProductoResult[] lst = objItemWCF.Item_ListarProducto(((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).idEmpresa,
                                                                                   ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, searchString);
                List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();

                foreach (gsItem_ListarProductoResult producto in lst)
                {
                    if (result.FindAll(x => x.Text == producto.ID_Item + "-" + producto.Nombre).Count == 0)
                    {
                        AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                        childNode.Text  = producto.ID_Item + "-" + producto.Nombre;
                        childNode.Value = producto.ID_Item;
                        result.Add(childNode);
                    }
                }
                res.Items = result.ToArray();
            }
            return(res);
        }
예제 #3
0
        public static AutoCompleteBoxData Item_BuscarUsuario(object context)
        {
            string idempresa;
            string idCargo;

            AutoCompleteBoxData res = new AutoCompleteBoxData();
            string searchString     = ((Dictionary <string, object>)context)["Text"].ToString();

            if (!string.IsNullOrEmpty(searchString) && searchString.Length >= 4)
            {
                ComisionWCFClient objUsuarioWCF = new ComisionWCFClient();
                idempresa = HttpContext.Current.Session["idempresa"].ToString();
                idCargo   = HttpContext.Current.Session["idCargo"].ToString();


                List <Personal_BuscarResult> lst = objUsuarioWCF.Personal_Buscar(int.Parse(idempresa),
                                                                                 ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, idempresa, idCargo, searchString).ToList();
                List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();

                foreach (Personal_BuscarResult usuario in lst)
                {
                    if (result.FindAll(x => x.Text == usuario.NroDocumento + "-" + usuario.Nombres).Count == 0)
                    {
                        AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                        childNode.Text  = usuario.NroDocumento + "-" + usuario.Nombres + " " + usuario.ApPaterno;
                        childNode.Value = usuario.NroDocumento;
                        result.Add(childNode);
                    }
                }
                res.Items = result.ToArray();
            }
            return(res);
        }
예제 #4
0
        public AutoCompleteBoxData GetPeopleNames(RadAutoCompleteContext context)
        {
            //string clientData = context["ClientData"].ToString();

            var list   = new PersonServices().GetByLikeName(context.Text);
            var teams  = new TeamServices().GetByLikeName(context.Text);
            var result = new List <AutoCompleteBoxItemData>();

            foreach (var p in list)
            {
                var childNode = new AutoCompleteBoxItemData();
                childNode.Text = p.Name;
                childNode.Text = p.Email;
                result.Add(childNode);
            }
            foreach (var t in teams)
            {
                var childNode = new AutoCompleteBoxItemData();
                childNode.Text = t.Name;
                childNode.Text = "team:" + t.ID.ToString();
                result.Add(childNode);
            }
            var res = new AutoCompleteBoxData();

            res.Items = result.ToArray();
            return(res);
        }
        public static AutoCompleteBoxData GetStaffInfo(object context)
        {
            string searchString = ((Dictionary<string, object>)context)["Text"].ToString();

            string sqlStr = "select [StaffCode],[StaffName],[Designation],[Dept] from [dbo].[viewStaffInfo] where StaffName like '%" + searchString + "%'";
            DataTable data = new AppManager().DataAccess.RecordSet(sqlStr, new string[]{});

            //DataTable data = sLink.GetDataTable("select [StaffCode],[StaffName],[Designation],[Dept] from [dbo].[viewStaffInfo] where StaffName like '%" + searchString + "%'");
            List<AutoCompleteBoxItemData> result = new List<AutoCompleteBoxItemData>();

            foreach (DataRow row in data.Rows)
            {
                AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                childNode.Text = row["StaffName"].ToString();
                childNode.Value = row["StaffCode"].ToString();
                childNode.Attributes.Add("Designation", row["Designation"].ToString());
                childNode.Attributes.Add("Dept", row["Dept"].ToString());
                result.Add(childNode);
            }

            AutoCompleteBoxData res = new AutoCompleteBoxData();
            res.Items = result.ToArray();

            return res;
        }
        public static AutoCompleteBoxData Agenda_ChoferBuscar(object context)
        {
            string transporte;
            string chofer;

            AutoCompleteBoxData res = new AutoCompleteBoxData();
            string searchString     = ((Dictionary <string, object>)context)["Text"].ToString();

            if (searchString.Length > 2)
            {
                transporte = HttpContext.Current.Session["Id_Transporte"].ToString();
                chofer     = null;


                AgendaWCFClient         objAgendaWCFClient = new AgendaWCFClient();
                gsChofer_ListarResult[] lst = objAgendaWCFClient.Agenda_ListarChofer(((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).idEmpresa,
                                                                                     ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, transporte, chofer, searchString);
                List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();


                foreach (gsChofer_ListarResult agenda in lst)
                {
                    AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                    childNode.Text  = agenda.ID_Chofer + "-" + agenda.Nombre;
                    childNode.Value = agenda.ID_Chofer;
                    result.Add(childNode);
                }
                res.Items = result.ToArray();
            }
            return(res);
        }
        public static AutoCompleteBoxData Agenda_VehiculoBuscar(object context)
        {
            string transporte;
            string Vehiculo;

            AutoCompleteBoxData res = new AutoCompleteBoxData();
            string searchString     = ((Dictionary <string, object>)context)["Text"].ToString();

            if (searchString.Length > 2)
            {
                transporte = HttpContext.Current.Session["Id_Transporte"].ToString();
                Vehiculo   = null;

                AgendaWCFClient         objAgendaWCFClient = new AgendaWCFClient();
                gsPlaca_ListarResult [] lst = objAgendaWCFClient.Agenda_ListarPlaca(((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).idEmpresa,
                                                                                    ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, transporte, Vehiculo, searchString);
                List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();


                foreach (gsPlaca_ListarResult agenda in lst)
                {
                    AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                    childNode.Text  = agenda.ID_Vehiculo + "/" + agenda.Marca + "/" + agenda.Modelo + "/" + agenda.Linea;
                    childNode.Value = agenda.ID_Vehiculo;
                    result.Add(childNode);
                }
                res.Items = result.ToArray();
            }
            return(res);
        }
예제 #8
0
        public static AutoCompleteBoxData Item_BuscarProducto(object context)
        {
            AutoCompleteBoxData res = new AutoCompleteBoxData();
            string searchString     = ((Dictionary <string, object>)context)["Text"].ToString();

            if (!string.IsNullOrEmpty(searchString) && searchString.Length >= 4)
            {
                string idalmacen;

                //idalmacen = HttpContext.Current.Session["idAlmacen"].ToString();

                ItemWCFClient objItemWCF = new ItemWCFClient();
                List <gsItem_ListarProductoPresupuestoResult> lst = objItemWCF.Item_ListarProductoPresupuesto(((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).idEmpresa,
                                                                                                              ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, searchString)
                                                                    .ToList();


                List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();

                foreach (gsItem_ListarProductoPresupuestoResult producto in lst)
                {
                    AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                    childNode.Text  = producto.ItemCodigo + "-" + producto.Nombre;
                    childNode.Value = producto.Kardex.ToString();

                    result.Add(childNode);
                }
                res.Items = result.ToArray();
            }
            return(res);
        }
        public static AutoCompleteBoxData Agenda_UsuarioBuscar(object context)
        {
            string idempresa;
            string idCargo;

            AutoCompleteBoxData res = new AutoCompleteBoxData();
            string searchString     = ((Dictionary <string, object>)context)["Text"].ToString();

            if (!string.IsNullOrEmpty(searchString) && searchString.Length >= 4)
            {
                AgendaWCFClient objAgenda = new AgendaWCFClient();

                idempresa = HttpContext.Current.Session["idempresa"].ToString();



                List <gsAgenda_ListarClienteResult> lst = objAgenda.Agenda_ListarCliente(int.Parse(idempresa),
                                                                                         ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, searchString, 0).ToList();
                List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();

                foreach (gsAgenda_ListarClienteResult usuario in lst)
                {
                    if (result.FindAll(x => x.Text == usuario.ID_Agenda + "-" + usuario.Nombre).Count == 0)
                    {
                        AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                        childNode.Text  = usuario.ID_Agenda + "-" + usuario.Nombre;
                        childNode.Value = usuario.ID_Agenda.ToString();

                        result.Add(childNode);
                    }
                }
                res.Items = result.ToArray();
            }
            return(res);
        }
    public static AutoCompleteBoxData GetCompanyNames(object context)
    {
        string searchString = ((Dictionary <string, object>)context)["Text"].ToString();

        List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();

        DataTable data = SEARCHCOMPANYNAME(searchString);

        //string CLIENTS = RadAutoCompleteBox1.Text;

        foreach (DataRow row in data.Rows)
        {
            AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
            childNode.Text  = row["COMPANY_NAME"].ToString();
            childNode.Value = row["COMPANY_NAME"].ToString();
            result.Add(childNode);
        }

        AutoCompleteBoxData res = new AutoCompleteBoxData();

        res.Items = result.ToArray();

        return(res);

        //string searchString = ((Dictionary<string, object>)context)["Text"].ToString();
        //DataTable data = GetChildNodes(searchString);
        //List<AutoCompleteBoxItemData> result = new List<AutoCompleteBoxItemData>();

        //foreach (DataRow row in data.Rows)
        //{
        //    AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
        //    childNode.Text = row["ACCOUNT"].ToString();
        //    childNode.Value = row["ACCOUNT"].ToString();
        //    result.Add(childNode);
        //}

        //AutoCompleteBoxData res = new AutoCompleteBoxData();
        //res.Items = result.ToArray();

        //return res;
    }
        public static AutoCompleteBoxData GetData(object context)
        {
            var dataManager = new DataManager();
            var siteId      = CurrentUser.Instance.SiteID;

            var searchString = ((Dictionary <string, object>)context)["Text"].ToString();

            var roles    = dataManager.ContactRole.SelectAll(siteId).Where(a => a.Title.Contains(searchString));
            var contacts =
                dataManager.Contact.SelectAll(siteId).Where(
                    a =>
                    !string.IsNullOrEmpty(a.Email) &&
                    (a.UserFullName.Contains(searchString) || a.Email.Contains(searchString)));

            var result = new List <AutoCompleteBoxItemData>();

            foreach (var role in roles)
            {
                var node = new AutoCompleteBoxItemData {
                    Text = role.Title, Value = "Role|" + role.ID.ToString()
                };
                result.Add(node);
            }

            foreach (var contact in contacts)
            {
                var node = new AutoCompleteBoxItemData {
                    Value = "Contact|" + contact.ID.ToString()
                };
                node.Text = !string.IsNullOrEmpty(contact.UserFullName)
                            ? string.Format("{0} &lt;{1}&gt;", contact.UserFullName, contact.Email)
                            : string.Format("&lt;{0}&gt;", contact.Email);
                result.Add(node);
            }

            var res = new AutoCompleteBoxData();

            res.Items = result.ToArray();

            return(res);
        }
예제 #12
0
        public static AutoCompleteBoxData GetProductTags(object context)
        {
            string       searchString             = ((Dictionary <string, object>)context)["Text"].ToString();
            SiteSettings siteSettings             = CacheHelper.GetCurrentSiteSettings();
            List <Tag>   lstTags                  = Tag.GetPage(siteSettings.SiteGuid, Product.FeatureGuid, searchString, -1, 1, 10);
            List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();

            foreach (Tag tag in lstTags)
            {
                AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                childNode.Text  = tag.TagText;
                childNode.Value = tag.TagId.ToString();
                result.Add(childNode);
            }

            AutoCompleteBoxData res = new AutoCompleteBoxData();

            res.Items = result.ToArray();

            return(res);
        }
예제 #13
0
        public static AutoCompleteBoxData Agenda_BuscarCliente(object context)
        {
            AutoCompleteBoxData res = new AutoCompleteBoxData();
            string searchString     = ((Dictionary <string, object>)context)["Text"].ToString();

            if (searchString.Length > 2)
            {
                AgendaWCFClient objAgendaWCFClient = new AgendaWCFClient();
                gsAgenda_ListarClienteResult[] lst = objAgendaWCFClient.Agenda_ListarCliente(((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).idEmpresa,
                                                                                             ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, searchString, 1);
                List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();

                foreach (gsAgenda_ListarClienteResult agenda in lst)
                {
                    AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                    childNode.Text  = agenda.ID_Agenda + "-" + agenda.Nombre;
                    childNode.Value = agenda.ID_Agenda;
                    result.Add(childNode);
                }
                res.Items = result.ToArray();
            }
            return(res);
        }
        public static AutoCompleteBoxData Agenda_BuscarCCosto(object context)
        {
            AutoCompleteBoxData res = new AutoCompleteBoxData();
            string searchString     = ((Dictionary <string, object>)context)["Text"].ToString();

            if (searchString.Length > 2)
            {
                CentroCostoWCFClient objCCortosWCFClient = new CentroCostoWCFClient();
                VBG00786Result[]     lst = objCCortosWCFClient.CentroCosto_Listar(((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).idEmpresa,
                                                                                  ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, searchString);
                List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>();

                foreach (VBG00786Result ccosto in lst)
                {
                    AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                    childNode.Text  = ccosto.ID_CentroCostos + "-" + ccosto.CentroCostos;
                    childNode.Value = ccosto.ID_CentroCostos;
                    result.Add(childNode);
                }
                res.Items = result.ToArray();
            }
            return(res);
        }