コード例 #1
0
        public DataTable getDetails(string filePath, string ObjAttr)
        {
            string jsonString = File.ReadAllText(fileName);
            //JArray jsonArr = JArray.Parse(jsonString);
            List <CharModel> obj = JsonConvert.DeserializeObject <List <CharModel> >(jsonString);
            //dynamic modelJson;
            ListToDataTable converter = new ListToDataTable();

            //CharModel modelObj = new CharModel();
            foreach (CharModel o in obj.Where(item => item.charName == modelName))
            {
                switch (ObjAttr)
                {
                case "model":
                    //CharModel modelJson = o;
                    collection = converter.ClassToDataTable <CharModel>(o);
                    break;

                case "action":
                    //List<Models.Action> modelJson = o.actions;
                    collection = converter.ToDataTable(o.actions);
                    break;

                case "sa":
                    //modelJson = o.specialAbilities;
                    collection = converter.ToDataTable(o.specialAbilities);
                    break;
                }
            }
            return(collection);
        }
コード例 #2
0
ファイル: DB_Admin.cs プロジェクト: edkeran/compramatic
        //METODO PARA TRAER EL PQR DE LAS EMPRESAS
        public DataTable pqr_empresa()
        {
            using (var db = new Mapeo("public"))
            {
                var data = (from qj in db.inf_quejas
                            join emp in db.empre on qj.IdEmpre equals emp.Id
                            join usr in db.user on qj.Id_user equals usr.IdUsr
                            join Mq in db.quejas on qj.Id_Moti_Quej equals Mq.Id_queja
                            where qj.IdEmpre != null
                            where qj.ReceptorQ == 2
                            select new vistaPQRempresa
                {
                    desQueja = qj.DesQuej,
                    fechaQueja = qj.FechaQuj,
                    nomQueja = Mq.Nom_queja,
                    Emisor = usr.NomUsr,
                    foto = emp.RutaArchivo + emp.NomArchivo
                }).Distinct();

                List <vistaPQRempresa> datos = data.ToList <vistaPQRempresa>();
                ListToDataTable        conv  = new ListToDataTable();
                DataTable respuesta          = conv.ToDataTable <vistaPQRempresa>(datos);
                return(respuesta);
            }
        }
コード例 #3
0
ファイル: DB_Admin.cs プロジェクト: edkeran/compramatic
        public DataTable MostrarVentasPorEmpresa()
        {
            using (var db = new Mapeo("public"))
            {
                var data = (from empresa in db.empre
                            join producto in db.productos on empresa.Id equals producto.IdEmpresa
                            join venta in db.ventas on producto.Id equals venta.IdProducto
                            where venta.EstadoVenta == 4
                            select new vistaMostraVentByEmp
                {
                    nitEmpresa = empresa.Nit,
                    nomEmpresa = empresa.Nombre,
                    calificacionEmpresa = empresa.Calificacion,
                    valorAux = (from venta in db.ventas
                                where venta.EstadoVenta == 4 && venta.IdProducto == producto.Id &&
                                producto.IdEmpresa == empresa.Id && venta.EstadoVenta == 4 select venta.Valor).Sum(),
                    ventas = (from venta in db.ventas
                              where venta.IdProducto == producto.Id && producto.IdEmpresa == empresa.Id &&
                              venta.EstadoVenta == 4
                              select venta.IdVenta).Count(),
                    rutaArchivo = empresa.RutaArchivo + empresa.NomArchivo
                }).Distinct();
                List <vistaMostraVentByEmp> infList = data.ToList <vistaMostraVentByEmp>();
                foreach (vistaMostraVentByEmp aux in infList)
                {
                    aux.valor = aux.valorAux.ToString("C");
                }

                ListToDataTable conv = new ListToDataTable();
                DataTable       res  = conv.ToDataTable <vistaMostraVentByEmp>(infList);
                return(res);
            }
        }
コード例 #4
0
ファイル: DB_Admin.cs プロジェクト: edkeran/compramatic
 public DataTable ProductosBajoI(int id_empresa)
 {
     using (var db = new Mapeo("public"))
     {
         var inf = from producto in db.productos
                   join catego in db.categ on producto.Categoria equals catego.Id_cate
                   join empresa in db.empre on producto.IdEmpresa equals empresa.Id
                   where empresa.Id == id_empresa && producto.Estado_producto == 1 && producto.Cantidad <= producto.BajoInventario
                   select new vistaProductoSingle
         {
             nomProducto    = producto.Nombre,
             idProducto     = producto.Id,
             canProducto    = producto.Cantidad,
             precioProducto = producto.Precio,
             desProducto    = producto.Descripcion,
             estadoProducto = producto.Estado_producto,
             bajoInventario = producto.BajoInventario,
             idEmpresa      = producto.IdEmpresa,
             nomCategoria   = catego.nomCategoria,
             nomEmpresa     = empresa.Nombre,
             idCategoria    = producto.Categoria,
             nomArchivo     = empresa.Nombre
         };
         ListToDataTable conv      = new ListToDataTable();
         DataTable       respuesta = conv.ToDataTable <vistaProductoSingle>(inf.ToList <vistaProductoSingle>());
         return(respuesta);
     }
 }
コード例 #5
0
ファイル: DB_Admin.cs プロジェクト: edkeran/compramatic
 //SHOW COMPANY
 public DataTable MostrarEmpresaId(int id)
 {
     using (var db = new Mapeo("public"))
     {
         var data = (from v in db.ventas
                     from e in db.empre
                     from p in db.productos
                     where v.IdProducto == p.Id && p.IdEmpresa == e.Id
                     select new vistaHistorialCompra
         {
             idVenta = v.IdVenta,
             fechaVenta = v.FechaVent,
             idUsuario = v.IdUsr,
             fechaEntrega = v.FechaEntr,
             cantVenta = v.Cantidad,
             estadoVenta = v.EstadoVenta,
             valorVenta = v.Valor,
             nomProducto = p.Nombre,
             nomEmpresa = e.Nombre,
             idEmpresa = e.Id,
             calificacionEmpresa = e.Calificacion
         }).Distinct();
         ListToDataTable conv = new ListToDataTable();
         DataTable       res  = conv.ToDataTable <vistaHistorialCompra>(data.ToList <vistaHistorialCompra>());
         return(res);
     }
 }
コード例 #6
0
ファイル: DB_Admin.cs プロジェクト: edkeran/compramatic
 //METODO PARA TRAER LOS REPORTES
 public DataTable Reportes()
 {
     using (var db = new Mapeo("public"))
     {
         var data = (from Empresa in db.empre
                     join Producto in db.productos on Empresa.Id equals Producto.IdEmpresa
                     join Reporte in db.reporte_T on Producto.Id equals Reporte.idProducto
                     join Usuario in db.user on Reporte.idUsuario equals Usuario.IdUsr
                     join MotivoR in db.report on Reporte.idMotivoR equals MotivoR.IdMoti
                     select new vista_reportesAdministrador
         {
             rutaArchivo = Empresa.RutaArchivo + Empresa.NomArchivo,
             nomEmpresa = Empresa.Nombre,
             nomUsuario = Usuario.NomUsr,
             nomProducto = Producto.Nombre,
             desMotivo = MotivoR.DesMotiv,
             fechaReporte = Reporte.fechaReporte,
             correoEmpresa = Empresa.Correo,
             idProducto = Reporte.idProducto
         });
         List <vista_reportesAdministrador> res = data.ToList <vista_reportesAdministrador>();
         ListToDataTable conv    = new ListToDataTable();
         DataTable       retorno = conv.ToDataTable <vista_reportesAdministrador>(res);
         return(retorno);
     }
 }
コード例 #7
0
 //METODO PARA OBTENER UN PRODUCTO
 public DataTable obtener_producto(int id_produ)
 {
     using (var db = new Mapeo("public"))
     {
         var datos = (from p in db.productos join c in db.categ on p.Categoria equals c.Id_cate
                      join e in db.empre on p.IdEmpresa equals e.Id
                      select new vistaProductoSingle  {
             nomProducto = p.Nombre,
             idProducto = p.Id,
             canProducto = p.Cantidad,
             precioProducto = (double)p.Precio,
             desProducto = p.Descripcion,
             estadoProducto = p.Estado_producto,
             bajoInventario = p.BajoInventario,
             idEmpresa = p.IdEmpresa,
             nomCategoria = c.nomCategoria,
             nomEmpresa = e.Nombre,
             idCategoria = p.Categoria,
             nomArchivo = e.NomArchivo
         });
         datos = (from d in datos where d.idProducto == id_produ select d);
         ListToDataTable conv = new ListToDataTable();
         DataTable       data = conv.ToDataTable <vistaProductoSingle>(datos.ToList <vistaProductoSingle>());
         data.Rows[0]["nomProducto"].ToString();
         return(data);
     }
 }
コード例 #8
0
 //METODO QUE ME TRAE TODAS LAS SOLICITUDES PENDIENTES
 public DataTable traer_pendiente()
 {
     using (var db = new Mapeo("public"))
     {
         var data = (from emp in db.empre
                     join solicit in db.sol_reg on emp.Id equals solicit.Id_empresa
                     where solicit.Estado_solici == 1
                     select new UEUVista_Soil_Acep
         {
             nomEmpresa = emp.Nombre,
             telEmpresa = emp.Numero,
             correoEmpresa = emp.Correo,
             dirEmpresa = emp.Direccion,
             nitEmpresa = emp.Nit,
             rutaArchivo = emp.RutaArchivo + emp.NomArchivo,
             estadoEmpresa = emp.EstadoEmpre,
             calificacionEmpresa = emp.Calificacion,
             fechaCreacion_empresa = emp.Fecha_Crea,
             idSolicitud_registro = solicit.Id_solici,
             estadoSolicitud = solicit.Estado_solici
         });
         ListToDataTable conv    = new ListToDataTable();
         DataTable       retorno = conv.ToDataTable <UEUVista_Soil_Acep>(data.ToList <UEUVista_Soil_Acep>());
         return(retorno);
     }
 }
コード例 #9
0
        public DataTable ToDatatable()
        {
            List <TreeData> lt = GetDepartment();
            DataTable       dt = new DataTable();

            return(ListToDataTable.ToDataTable <TreeData>(lt, null));
        }
コード例 #10
0
 //METODO PARA TRAER LOS PRODUCTOS ESCRITOS EN LA BUSQUEDA
 public DataTable find_products(string busqueda)
 {
     using (var db = new Mapeo("public"))
     {
         var data = (from x in db.empre
                     join h in db.productos on x.Id equals h.IdEmpresa
                     join l in db.categ on h.Categoria equals l.Id_cate
                     where h.Estado_producto == 1 && h.Nombre.Contains(busqueda)
                     select new UEUVista_Tot_Prod
         {
             _nomcategoria = l.nomCategoria,
             _idproducto = h.Id,
             _nomproducto = h.Nombre,
             _desproducto = h.Descripcion,
             _precioproducto = h.Precio,
             _canproducto = h.Cantidad,
             _nomempresa = x.Nombre,
             _idempresa = x.Id,
             _foto = (from k in db.fotosPro where h.Id == k.Id_Product && h.Estado_producto == 1 select k).Take(1).FirstOrDefault().NomArchi.ToString()
         });
         List <UEUVista_Tot_Prod> res = data.ToList <UEUVista_Tot_Prod>();
         foreach (UEUVista_Tot_Prod aux in res)
         {
             if (aux._foto.Equals(""))
             {
                 aux._foto = "default.png";
             }
             aux._foto.ToString();
         }
         ListToDataTable convert = new ListToDataTable();
         DataTable       retorno = convert.ToDataTable <UEUVista_Tot_Prod>(res);
         return(retorno);
     }
 }
コード例 #11
0
ファイル: PaymentsList.cs プロジェクト: zep2zep/Compas
        private void Fill()
        {
            DocumentPaymentsLogic payments = new DocumentPaymentsLogic(manager);

            DataGV.AutoGenerateColumns = false;
            ListToDataTable    listToDataTable = new ListToDataTable();
            List <ViewPayment> paymentsList    = new List <ViewPayment>();

            if (documentId == null)
            {
                paymentsList = payments.GetAllViewByPeriod(StartDateDTP.Value, EndDateDTP.Value);
            }
            else
            {
                paymentsList         = payments.GetAllViewByDocumentID(Convert.ToInt32(documentId));
                StartDateDTP.Enabled = false;
                EndDateDTP.Enabled   = false;
            }
            DataGV.DataSource = listToDataTable.ToDataTable <ViewPayment>(paymentsList);
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);

            DataGV.Update();

            SummaryDataGV.AutoGenerateColumns = true;
            var groupResult = from p in paymentsList
                              group p by new { p.FullEmployeeName, p.PaymentTypeName }
            into myGroup
            where myGroup.Count() > 0
            select new { myGroup.Key.FullEmployeeName, myGroup.Key.PaymentTypeName, Count = myGroup.Count(), Suma = myGroup.Sum(a => a.Suma) };

            SummaryDataGV.DataSource = groupResult.ToList();
            SummaryDataGV.Update();
        }
コード例 #12
0
ファイル: DBEmpresa.cs プロジェクト: edkeran/compramatic
 public DataTable PeticionesHechas(int idEmpresa)
 {
     using (var db = new Mapeo("public"))
     {
         var data = (from prod in db.productos
                     join vent in db.ventas on prod.Id equals vent.IdProducto
                     join usuario in db.user on vent.IdUsr equals usuario.IdUsr
                     join empresa in db.empre on prod.IdEmpresa equals empresa.Id
                     where vent.EstadoVenta == 5 && empresa.Id == idEmpresa
                     select new vistaMostrarVenta
         {
             idVenta = vent.IdVenta,
             fechaVenta = vent.FechaVent,
             estadoVenta = vent.EstadoVenta,
             valorVenta = vent.Valor,
             nomUsuario = usuario.NomUsr,
             apeUsuario = usuario.ApelUsr,
             telUsuario = usuario.TelUsr,
             correoUsuario = usuario.CorreoUsr,
             dirUsuario = usuario.DirUsr,
             idEmpresa = empresa.Id,
             calificacionUsuario = usuario.Calificacion2,
             canProducto = prod.Cantidad,
             cantVenta = vent.Cantidad,
             nomProducto = prod.Nombre
         });
         ListToDataTable conv   = new ListToDataTable();
         DataTable       retorn = conv.ToDataTable <vistaMostrarVenta>(data.ToList <vistaMostrarVenta>());
         return(retorn);
     }
 }
コード例 #13
0
 public DataTable historial_compras(UEUsuario user, int estado)
 {
     using (var db = new Mapeo("public"))
     {
         var data = (from v in db.ventas
                     from e in db.empre
                     from p in db.productos where v.IdProducto == p.Id &&
                     p.IdEmpresa == e.Id && v.IdUsr == user.IdUsr &&
                     v.EstadoVenta == estado select new vista_Historial_vent {
             idVenta = v.IdVenta,
             fechaVenta = v.FechaVent,
             idUsuario = v.IdUsr,
             fechaEntrega = v.FechaEntr,
             cantVenta = v.Cantidad,
             estadoVenta = v.EstadoVenta,
             valorVenta = v.Valor,
             nomProducto = p.Nombre,
             nomEmpresa = e.Nombre,
             idEmpresa = e.Id,
             calificacionEmpresa = e.Calificacion
         }).Distinct();
         ListToDataTable conv    = new ListToDataTable();
         DataTable       retorno = conv.ToDataTable <vista_Historial_vent>(data.ToList <vista_Historial_vent>());
         return(retorno);
     }
 }
コード例 #14
0
        public UEUProducto Prueba1_ItemCommand(String comandName, DataTable Empresa, List <UEUProducto> products, int itemIndex)
        {
            ListToDataTable conv      = new ListToDataTable();
            DataTable       Productos = conv.ToDataTable <UEUProducto>(products);
            UEUProducto     response  = new UEUProducto();

            if (comandName == "Delete")
            {
                this.BorrarProducto(int.Parse(Productos.Rows[itemIndex]["Id"].ToString()), Empresa.Rows[0]["nomEmpresa"].ToString());
                response.Id          = 0;
                response.Redireccion = "0";
                throw new System.ArgumentException("Valido");
            }

            if (comandName == "Select")
            {
                //CAMBIAR CUANDO SE CAMBIE EL TRAER PRODUCTOS
                response.Id             = int.Parse(Productos.Rows[itemIndex]["Id"].ToString());
                response.Nombre         = Productos.Rows[itemIndex]["Nombre"].ToString();
                response.Cantidad       = int.Parse(Productos.Rows[itemIndex]["Cantidad"].ToString());
                response.Precio         = int.Parse(Productos.Rows[itemIndex]["Precio"].ToString());
                response.Descripcion    = Productos.Rows[itemIndex]["Descripcion"].ToString();
                response.Categoria      = int.Parse(Productos.Rows[itemIndex]["Categoria"].ToString());
                response.BajoInventario = int.Parse(Productos.Rows[itemIndex]["BajoInventario"].ToString());
                //Session["IdProducto"] = Productos.Rows[itemIndex]["idProducto"].ToString();
                response.Redireccion = "98";
                return(response);
            }
            response.Redireccion = "98";
            return(response);
        }
コード例 #15
0
        public void CrawlerAll()
        {
            try
            {
                if (string.IsNullOrWhiteSpace(category.Url))
                {
                    Console.WriteLine($"分类的链接为空{category.Name}{category.CategoryLevel}");
                }
                else
                {
                    string html = HttpHelper.DownLoad(category.Url, Encoding.UTF8);

                    //解析网页
                    HtmlDocument document = new HtmlDocument();
                    document.LoadHtml(html);
                    //通过xpath解析

                    string             pageXPath = "/html/body/section[1]/div/div[6]/a[@class='page-btn']";
                    HtmlNodeCollection pageNodes = document.DocumentNode.SelectNodes(pageXPath);
                    int pageCount = pageNodes.Select(a => Convert.ToInt32(a.InnerText)).OrderByDescending(a => a).FirstOrDefault();

                    List <CourseEntity> courses = new List <CourseEntity>();
                    for (int i = 1; i <= pageCount; i++)
                    {
                        string pageUrl = $"{category.Url}&page={i}";
                        html = HttpHelper.DownLoad(pageUrl, Encoding.UTF8);
                        //解析网页
                        HtmlDocument pageDocument = new HtmlDocument();
                        pageDocument.LoadHtml(html);
                        string             liXPath        = "/html/body/section[1]/div/div[4]/ul/li";
                        HtmlNodeCollection pageLiNodeList = pageDocument.DocumentNode.SelectNodes(liXPath);
                        foreach (var liNode in pageLiNodeList)
                        {
                            var course = GetOneCourse(liNode);
                            courses.Add(course);
                        }
                        if (i == 3)
                        {
                            break;
                        }
                    }
                    string direct    = $"{System.AppDomain.CurrentDomain.BaseDirectory}CrawlerFile\\";;
                    string sheetName = "course";
                    string Name      = $"{sheetName}{DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";// sheetName  + DateTime.Now.ToString("yyyyMMddHHmmss") + ").xls";

                    if (!Directory.Exists(direct))
                    {
                        Directory.CreateDirectory(direct);
                    }
                    ExcelHelper eh        = new ExcelHelper(direct + Name);
                    DataTable   dtCourses = ListToDataTable.ToDataTable <CourseEntity>(courses);
                    eh.DataTableToExcel(dtCourses, sheetName, true);
                }
            }
            catch (Exception)
            {
                Console.WriteLine("Crawler抓取异常");
            }
        }
コード例 #16
0
 public DataTable get_picture_product(int id_produ)
 {
     using (var db = new Mapeo("public"))
     {
         var             pictures = db.fotosPro.Where(x => x.Id_Product == id_produ).ToList <UEUFotoProd>();
         ListToDataTable conv     = new ListToDataTable();
         return(conv.ToDataTable <UEUFotoProd>(pictures));
     }
 }
コード例 #17
0
ファイル: CarsList.cs プロジェクト: rymarrv/Compas
        private void Fill()
        {
            CWCarsLogic cars = new CWCarsLogic(manager);
            DataGV.AutoGenerateColumns = false;

            ListToDataTable listToDataTable = new ListToDataTable();
            DataGV.DataSource = listToDataTable.ToDataTable<CWCarView>(cars.GetAllView().ToList());
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);
        }
コード例 #18
0
 //CONTEMPLA EL ESTADO DE LA DICHOSA MEMBRESIA
 public DataTable MostrarActual2(int idEmpresa)
 {
     using (var db = new Mapeo("public"))
     {
         var             data = (from mem in db.membresia where mem.Id_empresa == idEmpresa && mem.Estado_mem == 1  select mem);
         ListToDataTable conv = new ListToDataTable();
         return(conv.ToDataTable <UEUMembresia>(data.ToList <UEUMembresia>()));
     }
 }
コード例 #19
0
 public DataTable formularios()
 {
     using (var db = new Mapeo("idioma"))
     {
         ListToDataTable         conv = new ListToDataTable();
         List <UEUFormula_Idiom> data = db.form_idioma.ToList <UEUFormula_Idiom>();
         return(conv.ToDataTable <UEUFormula_Idiom>(data));
     }
 }
コード例 #20
0
 //METODO PARA VERFICAR LA QUEJA
 public DataTable verficarQueja(string nomQueja)
 {
     using (var db = new Mapeo("public"))
     {
         nomQueja = nomQueja.ToUpper();
         var             consulta = (from motiQ in db.quejas where motiQ.Nom_queja.ToUpper().Contains(nomQueja) select motiQ);
         ListToDataTable conv     = new ListToDataTable();
         return(conv.ToDataTable <UEUQueja>(consulta.ToList <UEUQueja>()));
     }
 }
コード例 #21
0
ファイル: DBCategoria.cs プロジェクト: edkeran/compramatic
 public DataTable verificar_categoria(string consulta)
 {
     using (var db = new Mapeo("public"))
     {
         consulta = consulta.ToUpper();
         var             data = from cat in db.categ where cat.nomCategoria.ToUpper().Contains(consulta) select cat;
         ListToDataTable conv = new ListToDataTable();
         return(conv.ToDataTable <UEUCategoria>(data.ToList <UEUCategoria>()));
     }
 }
コード例 #22
0
 public DataTable MostrarCategoria()
 {
     using (var db = new Mapeo("public"))
     {
         var             data = db.categ.OrderBy(x => x.Id_cate);
         ListToDataTable conv = new ListToDataTable();
         DataTable       res  = conv.ToDataTable <UEUCategoria>(data.ToList <UEUCategoria>());
         return(res);
     }
 }
コード例 #23
0
        /*change the object to a DataTable for displaying purpose*/
        public DataTable getNames(string fileName)
        {
            var jsonString = File.ReadAllText(fileName);

            modelCollectionList = JsonConvert.DeserializeObject <List <CharModel> >(jsonString);
            ListToDataTable converter  = new ListToDataTable();
            DataTable       collection = converter.ToDataTable(modelCollectionList);

            return(collection);
        }
コード例 #24
0
        private void ReportBinding()
        {
            string date = dtpDate.Value.ToString("yyyy-MM-dd");

            dryList = service.GetDryingHistory(date);

            List <string> workno = new List <string>();

            foreach (var item in dryList)
            {
                workno.Add(item.Workorderno);
            }

            Inspect_Measure_HistoryService inservice = new Inspect_Measure_HistoryService();

            imhList = inservice.GetDrying(workno);

            var figurationList = (from req in dryList
                                  join val in imhList on req.Workorderno equals val.Workorderno
                                  where req.Workorderno == val.Workorderno
                                  select new
            {
                Num = req.Num,
                GV_Code = req.GV_Code,
                Item_Name = req.Item_Name,
                Prd_Endtime = req.Prd_Endtime,
                Workorderno = val.Workorderno,
                ADate = val.Adate,
                AVal = val.Aval,
                BDate = val.Bdate,
                BVal = val.Bval,
                CDate = val.Cdate,
                CVal = val.Cval
            }).ToList();

            try
            {
                ds.Relations.Clear();
                ds.Tables.Clear();

                dt = ListToDataTable.ToDataTable(figurationList);
                ds.Tables.Add(dt);
                ds.Tables[0].TableName = "dtDrying";

                rpt.DataSource = ds.Tables["dtDrying"];
            }
            catch
            {
            }
            rpt.Parameters["Ins_Date"].Value   = dtpDate.Value.ToString("yyyy-MM-dd");
            rpt.Parameters["Ins_Date"].Visible = false; //파라미터 바로 넘기기
            documentViewer1.DocumentSource     = rpt;
            rpt.CreateDocument();
        }
コード例 #25
0
        private void FillDataGV()
        {
            Compas.Logic.Config.ConfigurationParametersLogic configurationsLogic = new ConfigurationParametersLogic(manager);
            ListToDataTable listToDataTable = new ListToDataTable();

            DataGV.AutoGenerateColumns = false;
            DataGV.DataSource          = listToDataTable.ToDataTable <ViewConfigurationParameter>(configurationsLogic.GetAllView());
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);

            DataGV.Update();
        }
コード例 #26
0
        private void Fill()
        {
            CWCarsLogic cars = new CWCarsLogic(manager);

            DataGV.AutoGenerateColumns = false;

            ListToDataTable listToDataTable = new ListToDataTable();

            DataGV.DataSource = listToDataTable.ToDataTable <CWCarView>(cars.GetAllView().ToList());
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);
        }
コード例 #27
0
 public DataTable mostrarTipos(int id)
 {
     using (var db = new Mapeo("public"))
     {
         DataTable       res      = new DataTable();
         var             consulta = (from TM in db.type_membership where TM.Id_tipo_mem == id select TM);
         ListToDataTable conv     = new ListToDataTable();
         res = conv.ToDataTable <UEUTipoMembresia>(consulta.ToList <UEUTipoMembresia>());
         return(res);
     }
 }
コード例 #28
0
 public DataTable verificarMembresia(string nomMembresia)
 {
     nomMembresia = nomMembresia.ToUpper();
     using (var db = new Mapeo("public"))
     {
         var             verMem = (from tip in db.type_membership where tip.Nom_mem.ToUpper().Contains(nomMembresia) select tip);
         ListToDataTable conv   = new ListToDataTable();
         DataTable       res    = conv.ToDataTable <UEUTipoMembresia>(verMem.ToList <UEUTipoMembresia>());
         return(res);
     }
 }
コード例 #29
0
 //METODO PARA VERFICAR EL REPORTE
 public DataTable verficarReporte(string nomReporte)
 {
     nomReporte = nomReporte.ToUpper();
     using (var db = new Mapeo("public"))
     {
         var             datos = (from motiR in db.report where motiR.DesMotiv.ToUpper().Contains(nomReporte) select motiR);
         ListToDataTable conv  = new ListToDataTable();
         DataTable       res   = conv.ToDataTable <UEUMotiRepo>(datos.ToList <UEUMotiRepo>());
         return(res);
     }
 }
コード例 #30
0
ファイル: DBEmpresa.cs プロジェクト: edkeran/compramatic
 public DataTable PeticionCompra(int idVenta)
 {
     using (var db = new Mapeo("public"))
     {
         var data = (from venta in db.ventas
                     where venta.IdVenta == idVenta
                     select venta);
         ListToDataTable conv = new ListToDataTable();
         DataTable       res  = conv.ToDataTable <UEUVenta>(data.ToList <UEUVenta>());
         return(res);
     }
 }
コード例 #31
0
ファイル: DB_Tag.cs プロジェクト: edkeran/compramatic
 public DataTable MostrarTags(UEUTag tag)
 {
     using (var db = new Mapeo("public"))
     {
         var data = (from palabraClave in db.tag
                     where palabraClave.IdProducto == tag.IdProducto
                     select palabraClave);
         ListToDataTable conv = new ListToDataTable();
         DataTable       res  = conv.ToDataTable <UEUTag>(data.ToList <UEUTag>());
         return(res);
     }
 }
コード例 #32
0
ファイル: WaresList.cs プロジェクト: rymarrv/Compas
        public void FillResultsFilter()
        {
            List<ViewWare> viewList = new List<ViewWare>();
            List<WareCode> codeList = new List<WareCode>();

            viewList = view.Where(a => (
                ((a.Name.ToUpper().Contains(NameTB.Text.ToUpper()) == true) ||
                a.WareCategoryName.ToUpper().Contains(NameTB.Text.ToUpper())) &
                a.WareCode.ToUpper().Contains(CodeTB.Text.ToUpper())

                )).ToList();

            SortableBindingList<ViewWare> filteredView = new SortableBindingList<ViewWare>(viewList);

            //DataGV.DataSource = filteredView;

            ListToDataTable listToDataTable = new ListToDataTable();
            DataGV.DataSource = listToDataTable.ToDataTable<ViewWare>(viewList);

            DataGV.Update();
        }
コード例 #33
0
ファイル: PaymentsList.cs プロジェクト: rymarrv/Compas
        private void Fill()
        {
            DocumentPaymentsLogic payments = new DocumentPaymentsLogic(manager);
            DataGV.AutoGenerateColumns = false;
            ListToDataTable listToDataTable = new ListToDataTable();
            List<ViewPayment> paymentsList = new List<ViewPayment>();
            if (documentId == null)
                paymentsList = payments.GetAllViewByPeriod(StartDateDTP.Value, EndDateDTP.Value);
            else
            {
                paymentsList = payments.GetAllViewByDocumentID(Convert.ToInt32(documentId));
                StartDateDTP.Enabled = false;
                EndDateDTP.Enabled = false;
            }
            DataGV.DataSource = listToDataTable.ToDataTable<ViewPayment>(paymentsList);
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);
            DataGV.Update();

            SummaryDataGV.AutoGenerateColumns = true;
            var groupResult = from p in paymentsList
                              group p by new { p.FullEmployeeName, p.PaymentTypeName }
                                  into myGroup
                                  where myGroup.Count() > 0
                                  select new { myGroup.Key.FullEmployeeName, myGroup.Key.PaymentTypeName, Count = myGroup.Count(), Suma = myGroup.Sum(a => a.Suma) };
            SummaryDataGV.DataSource = groupResult.ToList();
            SummaryDataGV.Update();
        }
コード例 #34
0
ファイル: WaresList.cs プロジェクト: rymarrv/Compas
        private void Fill(string columnName)
        {
            DateTime start = DateTime.Now;
            WaresLogic wares = new WaresLogic(manager);
            DataGV.AutoGenerateColumns = false;
            int? categoryId = null;
            int? manufacturerId = null;
            int? unitId = null;
            //string name = wareFilterUC1.WareName;
            if(categoriesFilterUC1.SelectedCategoryID >= 0)
                categoryId = categoriesFilterUC1.SelectedCategoryID;
            //manufacturerId = wareFilterUC1.ManufacturerID;
            //unitId = wareFilterUC1.UnitID;
            BindingSource bs = new BindingSource();

            var waresList = wares.GetAllView("", categoryId, manufacturerId, unitId);
            //    .Select(a => new
            //{
            //    a.ID,
            //    Name = a.Name,
            //    UnitName = a.WareUnit != null ? a.WareUnit.Name : "",
            //    ManufacturerName = a.WareManufacturer != null ? a.WareManufacturer.Name : "",
            //    CategoryName = a.WareCategory != null ? a.WareCategory.Name : "",
            //    CategoryID = a.CategoryID,
            //    SecondaryUnitID = a.SecondaryUnitID != null ? a.SecondaryUnitID : null,

            //   SecondaryUnitName = a.WareUnit1 != null ? a.WareUnit1.Name : "",
            //   SecondaryUnitQuantity = a.SecondaryUnitQuantity != null ? a.SecondaryUnitQuantity : null,
            //   a.WareCodes,
            //   a.WareTimeLimits
            //});//.OrderBy(a => a.CategoryName).ThenBy(a=> a.Name).ToList();
            //List<WareView> viewList = new List<WareView>();

            DateTime start0 = DateTime.Now;

            //foreach (var a in waresList)
            //{
            //    WareView wv = new WareView();
            //    wv.ID = a.ID;
            //    wv.CategoryID = a.CategoryID;
            //    wv.Name = a.Name;
            //    wv.CategoryName = a.CategoryName;
            //    wv.ManufacturerName = a.ManufacturerName;
            //    wv.UnitName = a.UnitName;
            //    wv.SecondaryUnitID = a.SecondaryUnitID;
            //    wv.SecondaryUnitName = a.SecondaryUnitName;
            //    wv.SecondaryUnitQuantity = a.SecondaryUnitQuantity;
            //    //wv.WareCodes = a.WareCodes.ToList();

            //    //var lastTimeLimit = (from aa in a.WareTimeLimits
            //    //                     where aa.Active == true
            //    //                     select aa).FirstOrDefault();
            //    //if (lastTimeLimit != null)
            //    //    wv.TimeLimit = lastTimeLimit.TimeLimit;
            //    //else
            //    //    wv.TimeLimit = 0;

            //    viewList.Add(wv);
            //}
            DateTime start1 = DateTime.Now;
            //BindingListView<WareView> view = new BindingListView<WareView>(viewList);
            //bs.DataSource = view;
            //bs.Sort = columnName;

            view = new SortableBindingList<ViewWare>(waresList);

            ListToDataTable listToDataTable = new ListToDataTable();
            DataGV.DataSource = listToDataTable.ToDataTable<ViewWare>(waresList);

            //DataGV.DataSource = view;
            DataGV.Update();
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);
            DateTime start2 = DateTime.Now;
            //MessageBox.Show(start.ToString() + " " + start0.ToString() + " " + start1.ToString() + " " + start2.ToString());
        }
コード例 #35
0
ファイル: ConfigurationsList.cs プロジェクト: rymarrv/Compas
        private void FillDataGV()
        {
            Compas.Logic.Config.ConfigurationParametersLogic configurationsLogic = new ConfigurationParametersLogic(manager);
            ListToDataTable listToDataTable = new ListToDataTable();

            DataGV.AutoGenerateColumns = false;
            DataGV.DataSource = listToDataTable.ToDataTable<ViewConfigurationParameter>(configurationsLogic.GetAllView());
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);
            DataGV.Update();
        }