Exemplo n.º 1
0
        public void CancellaPosizioneCampioni(string Id, string Seriale, string Cliente)
        {
            MagazzinoDS ds = new MagazzinoDS();

            using (MagazzinoBusiness bMagazzino = new MagazzinoBusiness())
            {
                bMagazzino.FillRW_POSIZIONE_CAMPIONI(ds);
                MagazzinoDS.RW_POSIZIONE_CAMPIONIRow elemento = null;
                if (!string.IsNullOrEmpty(Id))
                {
                    decimal id = decimal.Parse(Id);
                    elemento = ds.RW_POSIZIONE_CAMPIONI.Where(x => x.IDPOSIZCAMP == id).FirstOrDefault();
                    if (elemento == null)
                    {
                        throw new ArgumentException(string.Format("IDPOSIZCAMP non trovato il valore {0} impossibile salvare", Id));
                    }
                    elemento.Delete();
                }
                bMagazzino.UpdateRW_POSIZIONE_CAMPIONI(ds);
            }
        }
Exemplo n.º 2
0
        public void SalvaPosizioneCampioni(string Id, string Campione, string Posizione, decimal Progressivo, string Seriale, string Cliente, string User)
        {
            MagazzinoDS ds = new MagazzinoDS();

            using (MagazzinoBusiness bMagazzino = new MagazzinoBusiness())
            {
                bMagazzino.FillRW_POSIZIONE_CAMPIONI(ds);
                MagazzinoDS.RW_POSIZIONE_CAMPIONIRow elemento = null;
                if (string.IsNullOrEmpty(Id))
                {
                    elemento                 = ds.RW_POSIZIONE_CAMPIONI.NewRW_POSIZIONE_CAMPIONIRow();
                    elemento.CAMPIONE        = Campione;
                    elemento.POSIZIONE       = Posizione;
                    elemento.PROGRESSIVO     = Progressivo;
                    elemento.SERIALE         = Seriale;
                    elemento.CLIENTE         = Cliente;
                    elemento.UTENTE          = User;
                    elemento.DATAINSERIMENTO = DateTime.Now;
                    ds.RW_POSIZIONE_CAMPIONI.AddRW_POSIZIONE_CAMPIONIRow(elemento);
                }
                else
                {
                    decimal id = decimal.Parse(Id);
                    elemento = ds.RW_POSIZIONE_CAMPIONI.Where(x => x.IDPOSIZCAMP == id).FirstOrDefault();
                    if (elemento == null)
                    {
                        throw new ArgumentException(string.Format("IDPOSIZCAMP non trovato il valore {0} impossibile salvare", Id));
                    }
                    elemento.CAMPIONE        = Campione;
                    elemento.POSIZIONE       = Posizione;
                    elemento.PROGRESSIVO     = Progressivo;
                    elemento.SERIALE         = Seriale;
                    elemento.CLIENTE         = Cliente;
                    elemento.UTENTE          = User;
                    elemento.DATAINSERIMENTO = DateTime.Now;
                }
                bMagazzino.UpdateRW_POSIZIONE_CAMPIONI(ds);
            }
        }