Example #1
0
        public void FillFasi(AnagraficaDS ds, bool soloNonCancellati)
        {
            ds.FASI.Clear();
            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            a.FillFasi(ds, soloNonCancellati);
        }
        public void FillCLIFO(AnagraficaDS ds)
        {
            string select = @"SELECT * FROM gruppo.CLIFO ";

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.CLIFO);
            }
        }
        public void FillUSR_TAB_VOCICOSTO(AnagraficaDS ds)
        {
            string select = @"SELECT * FROM GRUPPO.USR_TAB_VOCICOSTO ";

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.USR_TAB_VOCICOSTO);
            }
        }
        public void FillUSR_PRD_CDDIBA(AnagraficaDS ds)
        {
            string select = @"SELECT * FROM ditta1.USR_PRD_CDDIBA ";

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.USR_PRD_CDDIBA);
            }
        }
        public void FillUSR_PREV_GRUPPI(AnagraficaDS ds)
        {
            string select = @"SELECT * FROM GRUPPO.USR_PREV_GRUPPI ";

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.USR_PREV_GRUPPI);
            }
        }
        public void FillMAGAZZ(AnagraficaDS ds)
        {
            string select = @"SELECT * FROM gruppo.MAGAZZ ";

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.MAGAZZ);
            }
        }
        public void FillTABFAS(AnagraficaDS ds)
        {
            string select = @"SELECT * FROM gruppo.tabfas ";

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.TABFAS);
            }
        }
        public void FillTipiDocumento(AnagraficaDS ds, bool soloNonCancellati)
        {
            string select = @"SELECT * FROM TIPIDOCUMENTO ";

            if (soloNonCancellati)
            {
                select += "WHERE CANCELLATO = 'N'";
            }
            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.TIPIDOCUMENTO);
            }
        }
        public void FillCostiFissi(AnagraficaDS ds, bool soloNonCancellati)
        {
            string select = @"SELECT * FROM COSTIFISSI ";

            if (soloNonCancellati)
            {
                select += "WHERE CANCELLATO = 'N'";
            }
            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.COSTIFISSI);
            }
        }
        public void FillMAGAZZ(AnagraficaDS ds, List <string> IDMAGAZZ)
        {
            string inCOndition = ConvertToStringForInCondition(IDMAGAZZ);

            string select = @"SELECT DISTINCT * FROM GRUPPO.MAGAZZ WHERE IDMAGAZZ in ( {0} )";

            select = string.Format(select, inCOndition);

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.MAGAZZ);
            }
        }
        public void FillMateriali(AnagraficaDS ds, bool soloNonCancellati)
        {
            string select = @"SELECT * FROM MATERIALI ";

            if (soloNonCancellati)
            {
                select += "WHERE CANCELLATO = 'N'";
            }
            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.MATERIALI);
            }
        }
        public void FillColori(AnagraficaDS ds, bool soloNonCancellati)
        {
            string select = @"SELECT * FROM COLORI ";

            if (soloNonCancellati)
            {
                select += "WHERE CANCELLATO = 'N' ";
            }

            select += "ORDER BY IDCOLORE";
            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.COLORI);
            }
        }
        public void FillTipiProdotto(AnagraficaDS ds, bool soloNonCancellati)
        {
            string select = @"SELECT * FROM TIPIPRODOTTO ";

            if (soloNonCancellati)
            {
                select += "WHERE CANCELLATO = 'N'";
            }

            select += "ORDER BY CODICE";
            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.TIPIPRODOTTO);
            }
        }
        public void FillMateriePrime(AnagraficaDS ds, bool soloNonCancellati)
        {
            string select = @"SELECT * FROM MATERIEPRIME ";

            if (soloNonCancellati)
            {
                select += "WHERE CANCELLATO = 'N'";
            }

            select += "ORDER BY CODICE";
            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.MATERIEPRIME);
            }
        }
        public void UpdateTable(string tablename, AnagraficaDS ds)
        {
            string query = string.Format(CultureInfo.InvariantCulture, "SELECT * FROM {0}", tablename);

            using (DbDataAdapter a = BuildDataAdapter(query))
            {
                a.ContinueUpdateOnError = false;
                DataTable        dt  = ds.Tables[tablename];
                DbCommandBuilder cmd = BuildCommandBuilder(a);
                a.UpdateCommand = cmd.GetUpdateCommand();
                a.DeleteCommand = cmd.GetDeleteCommand();
                a.InsertCommand = cmd.GetInsertCommand();
                a.Update(dt);
            }
        }
        public void FillUSR_PDM_FILES(AnagraficaDS ds, List <string> IDMAGAZZ)
        {
            string inCOndition = ConvertToStringForInCondition(IDMAGAZZ);

            string select = @"  select FI.*, IM.IDMAGAZZ,PA.PDMPATH  from gruppo.USR_PDM_FILES FI
            INNER JOIN GRUPPO.USR_PDM_IMG_MAGAZZ IM ON IM.IDPDMFILE = FI.IDPDMFILE
            INNER JOIN GRUPPO.USR_PDM_PATHS PA ON PA.IDPDMPATH = FI.IDPDMPATH
            where IM.idmagazz in ( {0} )";

            select = string.Format(select, inCOndition);

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.USR_PDM_FILES);
            }
        }
        public void FillFasi(AnagraficaDS ds, bool soloNonCancellati)
        {
            string select = @"SELECT * FROM FASI ";

            if (soloNonCancellati)
            {
                select += "WHERE CANCELLATO = 'N'";
            }

            select += "ORDER BY codice ";

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.FASI);
            }
        }
        public void FillPrezziMateriali(AnagraficaDS ds, bool soloNonCancellati)
        {
            string select = @"SELECT * FROM PREZZIMATERIALE ";

            if (soloNonCancellati)
            {
                select += "WHERE CANCELLATO = 'N'";
            }

            select += "ORDER BY DATAINIZIOVALIDITA DESC";

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.PREZZIMATERIALE);
            }
        }
        public void FillBrand(AnagraficaDS ds, bool soloNonCancellati)
        {
            string select = @"SELECT * FROM BRAND ";

            if (soloNonCancellati)
            {
                select += "WHERE CANCELLATO = 'N'";
            }

            select += "ORDER BY BRAND ";

            using (DbDataAdapter da = BuildDataAdapter(select))
            {
                da.Fill(ds.BRAND);
            }
        }
Example #20
0
        public DocumentoModelContainer CreaDocumentoModelContainer(decimal IdEsterna, string TabellaEstera)
        {
            AnagraficaDS            ds = new AnagraficaDS();
            DocumentoModelContainer dc = new DocumentoModelContainer();

            dc.IdEsterna      = IdEsterna;
            dc.TabellaEsterna = TabellaEstera;
            dc.Documenti      = new List <DocumentoModel>();
            using (DocumentiBusiness bDocumenti = new DocumentiBusiness())
            {
                bDocumenti.FillDocumentiNoData(_ds, true);
                foreach (DocumentiDS.DOCUMENTIRow documento in _ds.DOCUMENTI.Where(x => x.IDESTERNA == IdEsterna && x.TABELLAESTERNA == TabellaEstera))
                {
                    dc.Documenti.Add(CreaDocumentoModel(documento, ds));
                }
            }
            return(dc);
        }
        public void FillMAGAZZ(AnagraficaDS ds, List <string> IDMAGAZZ)
        {
            List <string> articoliPresenti = ds.MAGAZZ.Select(x => x.IDMAGAZZ).Distinct().ToList();
            List <string> articoliMancanti = IDMAGAZZ.Except(articoliPresenti).ToList();

            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            while (articoliMancanti.Count > 0)
            {
                List <string> articoliDaCaricare;
                if (articoliMancanti.Count > 999)
                {
                    articoliDaCaricare = articoliMancanti.GetRange(0, 999);
                    articoliMancanti.RemoveRange(0, 999);
                }
                else
                {
                    articoliDaCaricare = articoliMancanti.GetRange(0, articoliMancanti.Count);
                    articoliMancanti.RemoveRange(0, articoliMancanti.Count);
                }
                a.FillMAGAZZ(ds, articoliDaCaricare);
                a.FillUSR_PDM_FILES(ds, articoliDaCaricare);
            }
        }
Example #22
0
        public void FillTipiProdotto(AnagraficaDS ds, bool soloNonCancellati)
        {
            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            a.FillTipiProdotto(ds, soloNonCancellati);
        }
Example #23
0
        private DocumentoModel CreaDocumentoModel(DocumentiDS.DOCUMENTIRow documento, AnagraficaDS ds)
        {
            Anagrafica     a  = new Anagrafica();
            DocumentoModel rm = new DocumentoModel();

            rm.Filename      = documento.FILENAME;
            rm.IdDocumento   = documento.IDDOCUMENTO;
            rm.TipoDocumento = a.EstraiTipoDocumentoModel(documento.IDTIPODOCUMENTO);

            return(rm);
        }
Example #24
0
        public void UpdateTable(AnagraficaDS ds, string tabella)
        {
            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            a.UpdateTable(tabella, ds);
        }
        public void FillUSR_PREV_GRUPPI(AnagraficaDS ds)
        {
            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            a.FillUSR_PREV_GRUPPI(ds);
        }
        public void FillUSR_PRD_CDDIBA(AnagraficaDS ds)
        {
            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            a.FillUSR_PRD_CDDIBA(ds);
        }
        public void FillUSR_TAB_VOCICOSTO(AnagraficaDS ds)
        {
            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            a.FillUSR_TAB_VOCICOSTO(ds);
        }
        public void FillMAGAZZ(AnagraficaDS ds)
        {
            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            a.FillMAGAZZ(ds);
        }
Example #29
0
        public void FillCostiFissi(AnagraficaDS ds, bool soloNonCancellati)
        {
            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            a.FillCostiFissi(ds, soloNonCancellati);
        }
Example #30
0
        public void FillMateriePrime(AnagraficaDS ds, bool soloNonCancellati)
        {
            AnagraficaAdapter a = new AnagraficaAdapter(DbConnection, DbTransaction);

            a.FillMateriePrime(ds, soloNonCancellati);
        }