Example #1
0
        private Nodo CreaNodo(int idNodo, string idmagazz, int profondita, int idpadre, decimal quantitaConsumo, decimal quantitaOccorrenza, string IDTABFAS,
                              string noteTecniche, string noteStandard, string fornitoDaCommittente, string metodo, string versione, string attiva, string controllata, string unitaMisura, string repartoDiBa)
        {
            EstraiProdottiFinitiDS.MAGAZZRow magazz = _ds.MAGAZZ.Where(x => x.IDMAGAZZ == idmagazz).FirstOrDefault();
            EstraiProdottiFinitiDS.TABFASRow fase   = _ds.TABFAS.Where(x => x.IDTABFAS == IDTABFAS).FirstOrDefault();

            EstraiProdottiFinitiDS.BC_ANAGRAFICARow anagrafica = _ds.BC_ANAGRAFICA.Where(x => x.RowState != DataRowState.Deleted && x.IDMAGAZZ == idmagazz && x.CL == 0).FirstOrDefault();


            string reparto = fase.IsCODICECLIFOPREDFASENull() ? string.Empty : fase.CODICECLIFOPREDFASE;
            Nodo   n       = new Nodo();

            n.Anagrafica = (anagrafica != null) ? anagrafica.BC : string.Empty;;
            n.ID         = idNodo;
            n.Profondita = profondita;
            n.IDPADRE    = idpadre;
            n.IDMAGAZZ   = idmagazz;

            decimal quantita = 0;

            if (quantitaOccorrenza == 0)
            {
                quantita = quantitaConsumo;
            }
            else
            {
                quantita = 1.0M / quantitaOccorrenza;
            }

            n.QuantitaConsumo    = quantitaConsumo;
            n.QuantitaOccorrenza = quantitaOccorrenza;
            n.Quantita           = quantita;

            n.Reparto              = string.IsNullOrEmpty(repartoDiBa) ? reparto : repartoDiBa;
            n.Fase                 = fase.CODICEFASE;
            n.Peso                 = magazz.PESO;
            n.Superficie           = magazz.SUPERFICIE;
            n.FornitoDaCommittente = fornitoDaCommittente;
            n.OrePeriodo           = 1;

            noteStandard = noteStandard.Replace("\n", String.Empty);
            noteStandard = noteStandard.Replace("\r", String.Empty);
            noteStandard = noteStandard.Replace("\t", String.Empty);

            noteTecniche = noteTecniche.Replace("\n", String.Empty);
            noteTecniche = noteTecniche.Replace("\r", String.Empty);
            noteTecniche = noteTecniche.Replace("\t", String.Empty);

            n.NoteStandard        = noteStandard;
            n.NoteTecniche        = noteTecniche;
            n.Modello             = (magazz == null) ? string.Empty : magazz.MODELLO;
            n.DescrizioneArticolo = (magazz == null) ? string.Empty : magazz.DESMAGAZZ;
            n.Metodo      = metodo;
            n.Versione    = versione;
            n.Attiva      = attiva;
            n.Controllata = controllata;
            n.UM          = unitaMisura;
            n.ContoLavoro = false;
            return(n);
        }
Example #2
0
 public EstraiProdottiFinitiDS.BC_ANAGRAFICARow CreaRigaTabella(EstraiProdottiFinitiDS ds)
 {
     EstraiProdottiFinitiDS.BC_ANAGRAFICARow rigaTabella = ds.BC_ANAGRAFICA.NewBC_ANAGRAFICARow();
     rigaTabella.BC       = Anagrafica;
     rigaTabella.IDMAGAZZ = IDMAGAZZ;
     return(rigaTabella);
 }