コード例 #1
0
        public ItemModel(ITEM item)
        {
            this._articulo    = item.ARTICULO;
            this._nombre      = item.ARTICULO.ARTICULO1;
            this._unidItem    = item.UNID_ITEM;
            this._sku         = item.SKU;
            this.SKU          = item.SKU;
            this.NUMERO_SERIE = item.NUMERO_SERIE;
            this._numeroSerie = item.NUMERO_SERIE;
            //this._itemStatuss.updateItemStatus = item.UNID_ITEM_STATUS;
            if (item.ITEM_STATUS != null)
            {
                this._itemStatus  = item.ITEM_STATUS;
                this._itemStatuss = new ItemStatusModel(null)
                {
                    ItemStatusName = item.ITEM_STATUS.ITEM_STATUS_NAME, UnidItemStatus = long.Parse(item.UNID_ITEM_STATUS.ToString())
                };
            }
            this.UNID_ITEM_STATUS = item.UNID_ITEM_STATUS;
            this.COSTO_UNITARIO   = item.COSTO_UNITARIO;
            this._pedimentoExpo   = item.PEDIMENTO_EXPO;
            this._pedimentoImpo   = item.PEDIMENTO_IMPO;
            //this._facturaDetalle = item.FACTURA_DETALLE;
            this.IS_ACTIVE  = item.IS_ACTIVE;
            this.IsChecked  = false;
            this._equipo    = item.ARTICULO.EQUIPO;
            this._categoria = item.ARTICULO.CATEGORIA;
            this._marca     = item.ARTICULO.MARCA;
            this._modelo    = item.ARTICULO.MODELO;

            this.Detalles = new ObservableCollection <DeleteFacturaDetalleModel>();

            this._dataMapper = new ItemDataMapper();
        }
コード例 #2
0
        public CatalogItemViewModel(SalidaRentaViewModel _salidaRentaViewModel)
        {
            IDataMapper dataMapper = new ItemDataMapper();

            this._catalogItemModel = new CatalogItemModel(dataMapper);

            this._salidaRentaViewModel = _salidaRentaViewModel;
        }
コード例 #3
0
        public CatalogItemViewModel(EntradaPrestamoViewModel _entradaPrestamoViewModel)
        {
            IDataMapper dataMapper = new ItemDataMapper();

            this._catalogItemModel = new CatalogItemModel(dataMapper);

            this._entradaPrestamoViewModel = _entradaPrestamoViewModel;
        }
コード例 #4
0
        public CatalogItemViewModel(TraspasoStockViewModel _traspasoStockViewModel)
        {
            IDataMapper dataMapper = new ItemDataMapper();

            this._catalogItemModel = new CatalogItemModel(dataMapper);

            this._traspasoStockViewModel = _traspasoStockViewModel;
        }
コード例 #5
0
        public CatalogItemViewModel(EntradaDesinstalacionViewModel _entradaDesinstalacionViewModel)
        {
            IDataMapper dataMapper = new ItemDataMapper();

            this._catalogItemModel = new CatalogItemModel(dataMapper);

            this._entradaDesinstalacionViewModel = _entradaDesinstalacionViewModel;
        }
コード例 #6
0
        public CatalogItemViewModel(SalidaConfiguracionViewModel _salidaConfiguracionViewModel)
        {
            IDataMapper dataMapper = new ItemDataMapper();

            this._catalogItemModel = new CatalogItemModel(dataMapper);

            this._salidaConfiguracionViewModel = _salidaConfiguracionViewModel;
        }
コード例 #7
0
        public void loadItemsTest()
        {
            IDataMapper      dataMapper = new ItemDataMapper();
            CatalogItemModel target     = new CatalogItemModel(dataMapper); // TODO: Inicializar en un valor adecuado

            target.loadItems();
            Assert.Inconclusive("Un método que no devuelve ningún valor no se puede comprobar.");
        }
コード例 #8
0
        public void CatalogItemModelConstructorTest()
        {
            IDataMapper      dataMapper = new ItemDataMapper(); // TODO: Inicializar en un valor adecuado
            CatalogItemModel target     = new CatalogItemModel(dataMapper);

            target.Serie = "123456";
            target.loadItems();
            Assert.Inconclusive("TODO: Implementar código para comprobar el destino");
        }
コード例 #9
0
        public void GetJsonItemTest()
        {
            ItemDataMapper target   = new ItemDataMapper(); // TODO: Inicializar en un valor adecuado
            string         expected = string.Empty;         // TODO: Inicializar en un valor adecuado
            string         actual;

            actual = target.GetJsonItem();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Compruebe la exactitud de este método de prueba.");
        }
コード例 #10
0
        private bool ExisteRegistro(string s)
        {
            ItemDataMapper iDM = new ItemDataMapper();

            if (IsSKU)
            {
                return(iDM.ExistSKU(s));
            }
            return(iDM.ExistNumSerie(s));
        }
コード例 #11
0
        private string GetNameArticulo(string s)
        {
            ItemDataMapper iDM = new ItemDataMapper();

            if (IsSKU)
            {
                return(iDM.GetSKU(s));
            }
            return(iDM.GetNumSerie(s));
        }
コード例 #12
0
        public void getElementTest()
        {
            ItemDataMapper target  = new ItemDataMapper(); // TODO: Inicializar en un valor adecuado
            ITEM           element = new ITEM();

            element.NUMERO_SERIE = "a"; // TODO: Inicializar en un valor adecuado
            object expected = null;     // TODO: Inicializar en un valor adecuado
            object actual;

            actual = target.getElement(element);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Compruebe la exactitud de este método de prueba.");
        }
コード例 #13
0
 /// <summary>
 /// Set the current item to display
 /// </summary>
 /// <param name="item"></param>
 public void setItem(Item item)
 {
     this.item = item;
     if (item != null && item.type != null)
     {
         itemModel = Instantiate(ItemDataMapper.GetModelFor(item), transform);
         // add a rigidbody for gravity and enable the colliders which are disabled by default.
         itemModel.AddComponent(typeof(Rigidbody));
         Collider[] itemColliders = itemModel.GetComponentsInChildren <Collider>(true);
         foreach (Collider itemCollider in itemColliders)
         {
             itemCollider.enabled = true;
         }
         itemHilight = Instantiate(ItemHilight, itemModel.transform);
     }
 }
コード例 #14
0
        public string downloadItem(long?lastModifiedDate)
        {
            string respuesta = null;

            if (lastModifiedDate != null)
            {
                ItemDataMapper dataMapper = new ItemDataMapper();

                respuesta = dataMapper.GetJsonItem(lastModifiedDate);

                if (String.IsNullOrEmpty(respuesta))
                {
                    respuesta = null;
                }
            }
            return(respuesta);
        }
コード例 #15
0
        public ItemModel(ITEM item, int lectura, ITEM_STATUS status)
        {
            this._dataMapper2        = new ItemStatusDataMapper();
            this._articulo           = item.ARTICULO;
            this._nombre             = item.ARTICULO.ARTICULO1;
            this._unidItem           = item.UNID_ITEM;
            this._sku                = item.SKU;
            this.SKU                 = item.SKU;
            this.NUMERO_SERIE        = item.NUMERO_SERIE;
            this._numeroSerie        = item.NUMERO_SERIE;
            this._cantidadMovimiento = lectura;

            object itemStatusLectura = this._dataMapper2.getElement(status);

            if (itemStatusLectura != null)
            {
                this._itemStatus  = itemStatusLectura as ITEM_STATUS;
                this._itemStatuss = new ItemStatusModel(null)
                {
                    ItemStatusName = this._itemStatus.ITEM_STATUS_NAME, UnidItemStatus = this._itemStatus.UNID_ITEM_STATUS
                };
            }
            this.UNID_ITEM_STATUS = item.UNID_ITEM_STATUS;
            this.COSTO_UNITARIO   = item.COSTO_UNITARIO;
            this._pedimentoExpo   = item.PEDIMENTO_EXPO;
            this._pedimentoImpo   = item.PEDIMENTO_IMPO;
            this.IS_ACTIVE        = item.IS_ACTIVE;
            this.IsChecked        = false;
            this._equipo          = item.ARTICULO.EQUIPO;
            this._categoria       = item.ARTICULO.CATEGORIA;
            this._marca           = item.ARTICULO.MARCA;
            this._modelo          = item.ARTICULO.MODELO;

            this.Detalles = new ObservableCollection <DeleteFacturaDetalleModel>();

            this._dataMapper = new ItemDataMapper();
        }
コード例 #16
0
        private void ImprimirFinalmente(List <ARTICULO> ArtExcel)
        {
            Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
            dlg.DefaultExt = ".xlsx";
            dlg.Filter     = "Documentos Excel (.xlsx)|*.xlsx";
            if (dlg.ShowDialog() == true)
            {
                string filename = dlg.FileName;
                Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
                excel.Visible = false;

                Workbook  excelPrint      = excel.Workbooks.Open(@"C:\Programs\ElaraInventario\Resources\ExcelInventarioFisico.xlsx", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                Worksheet excelSheetPrint = (Worksheet)excelPrint.Worksheets[1];

                //Folio
                excel.Cells[8, 6] = SelectedAlmacen.ALMACEN_NAME;
                //Fecha
                excel.Cells[8, 23] = DateTime.Now.ToShortDateString() + " - " + DateTime.Now.ToShortTimeString();

                int X = 11;
                Microsoft.Office.Interop.Excel.Borders borders;

                for (int i = 0; i < ArtExcel.Count; i++)
                {
                    //No.
                    excel.Range[excel.Cells[X, 2], excel.Cells[X, 3]].Merge();
                    excel.Range[excel.Cells[X, 2], excel.Cells[X, 3]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                    excel.Cells[X, 2] = (i + 1).ToString() + ".-";
                    borders           = excel.Range[excel.Cells[X, 2], excel.Cells[X, 3]].Borders;
                    borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    //ARTÍCULO
                    excel.Range[excel.Cells[X, 4], excel.Cells[X, 22]].Merge();
                    excel.Range[excel.Cells[X, 4], excel.Cells[X, 22]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                    excel.Cells[X, 4] = ArtExcel[i].ARTICULO1;
                    borders           = excel.Range[excel.Cells[X, 4], excel.Cells[X, 22]].Borders;
                    borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    //SKU
                    excel.Range[excel.Cells[X, 23], excel.Cells[X, 28]].Merge();
                    excel.Range[excel.Cells[X, 23], excel.Cells[X, 28]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                    if (ArtExcel[i].CATEGORIA != null && ArtExcel[i].CATEGORIA.CATEGORIA_NAME != null)
                    {
                        excel.Cells[X, 23] = ArtExcel[i].CATEGORIA.CATEGORIA_NAME;
                    }
                    borders           = excel.Range[excel.Cells[X, 23], excel.Cells[X, 28]].Borders;
                    borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    //No. de Serie
                    excel.Range[excel.Cells[X, 29], excel.Cells[X, 35]].Merge();
                    excel.Range[excel.Cells[X, 29], excel.Cells[X, 35]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                    if (ArtExcel[i].MODELO != null && ArtExcel[i].MODELO.MODELO_NAME != null)
                    {
                        excel.Cells[X, 29] = ArtExcel[i].MODELO.MODELO_NAME;
                    }
                    borders           = excel.Range[excel.Cells[X, 29], excel.Cells[X, 35]].Borders;
                    borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    //cantidad
                    excel.Range[excel.Cells[X, 36], excel.Cells[X, 41]].Merge();
                    excel.Range[excel.Cells[X, 36], excel.Cells[X, 41]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                    excel.Cells[X, 36] = ArtExcel[i].EQUIPO.EQUIPO_NAME;
                    borders            = excel.Range[excel.Cells[X, 36], excel.Cells[X, 41]].Borders;
                    borders.LineStyle  = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

                    ItemDataMapper iaux = new ItemDataMapper();

                    if (IsSKU)
                    {
                        //Moneda
                        excel.Range[excel.Cells[X, 42], excel.Cells[X, 47]].Merge();
                        excel.Range[excel.Cells[X, 42], excel.Cells[X, 47]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                        if (ArtExcel[i].CATEGORIA != null && ArtExcel[i].CATEGORIA.CATEGORIA_NAME != null)
                        {
                            excel.Cells[X, 42] = iaux.ExcelGetMonedaSKU(ArtExcel[i].CATEGORIA.CATEGORIA_NAME);
                        }
                        borders           = excel.Range[excel.Cells[X, 42], excel.Cells[X, 47]].Borders;
                        borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

                        //Tipo de Cambio
                        excel.Range[excel.Cells[X, 48], excel.Cells[X, 53]].Merge();
                        excel.Range[excel.Cells[X, 48], excel.Cells[X, 53]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                        if (ArtExcel[i].CATEGORIA != null && ArtExcel[i].CATEGORIA.CATEGORIA_NAME != null)
                        {
                            excel.Cells[X, 48] = iaux.ExcelGetTcSKU(ArtExcel[i].CATEGORIA.CATEGORIA_NAME);
                        }
                        borders           = excel.Range[excel.Cells[X, 48], excel.Cells[X, 53]].Borders;
                        borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

                        //Costo Unitario
                        excel.Range[excel.Cells[X, 54], excel.Cells[X, 59]].Merge();
                        excel.Range[excel.Cells[X, 54], excel.Cells[X, 59]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                        if (ArtExcel[i].CATEGORIA != null && ArtExcel[i].CATEGORIA.CATEGORIA_NAME != null)
                        {
                            excel.Cells[X, 54] = iaux.ExcelGetCostoUnitarioSKU(ArtExcel[i].CATEGORIA.CATEGORIA_NAME).ToString();
                        }
                        borders           = excel.Range[excel.Cells[X, 54], excel.Cells[X, 59]].Borders;
                        borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    }
                    else
                    {
                        //Moneda
                        excel.Range[excel.Cells[X, 42], excel.Cells[X, 47]].Merge();
                        excel.Range[excel.Cells[X, 42], excel.Cells[X, 47]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                        if (ArtExcel[i].MODELO != null && ArtExcel[i].MODELO.MODELO_NAME != null)
                        {
                            excel.Cells[X, 42] = iaux.ExcelGetMonedaNUMEROSERIE(ArtExcel[i].MODELO.MODELO_NAME);
                        }
                        borders           = excel.Range[excel.Cells[X, 42], excel.Cells[X, 47]].Borders;
                        borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

                        //Tipo de Cambio
                        excel.Range[excel.Cells[X, 48], excel.Cells[X, 53]].Merge();
                        excel.Range[excel.Cells[X, 48], excel.Cells[X, 53]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                        if (ArtExcel[i].MODELO != null && ArtExcel[i].MODELO.MODELO_NAME != null)
                        {
                            excel.Cells[X, 48] = iaux.ExcelGetTcNUMEROSERIE(ArtExcel[i].MODELO.MODELO_NAME);
                        }
                        borders           = excel.Range[excel.Cells[X, 48], excel.Cells[X, 53]].Borders;
                        borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

                        //Costo Unitario
                        excel.Range[excel.Cells[X, 54], excel.Cells[X, 59]].Merge();
                        excel.Range[excel.Cells[X, 54], excel.Cells[X, 59]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                        if (ArtExcel[i].MODELO != null && ArtExcel[i].MODELO.MODELO_NAME != null)
                        {
                            excel.Cells[X, 54] = iaux.ExcelGetCostoUnitarioNUMEROSERIE(ArtExcel[i].MODELO.MODELO_NAME).ToString();
                        }
                        borders           = excel.Range[excel.Cells[X, 54], excel.Cells[X, 59]].Borders;
                        borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    }

                    //ESTATUS
                    excel.Range[excel.Cells[X, 60], excel.Cells[X, 66]].Merge();
                    excel.Range[excel.Cells[X, 60], excel.Cells[X, 66]].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;

                    if (Int32.Parse(ArtExcel[i].EQUIPO.EQUIPO_NAME) > 0)
                    {
                        excel.Cells[X, 60] = "Artículo en existencia";
                    }
                    else
                    {
                        excel.Cells[X, 60] = "Artículo extraviado";
                    }

                    borders           = excel.Range[excel.Cells[X, 60], excel.Cells[X, 66]].Borders;
                    borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    X++;
                }

                excelSheetPrint.SaveAs(filename, Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
                excel.Visible = true;
            }
        }
コード例 #17
0
        public void AttempImprimir()
        {
            List <ARTICULO> ArticulosFaltantes    = new List <ARTICULO>();
            List <string>   AuxArticulosFaltantes = new List <string>();
            //
            ItemDataMapper iDT = new ItemDataMapper();

            List <ITEM> Existentes = iDT.getElementsByAlmacen(this.SelectedAlmacen);
            List <ITEM> Capturados = new List <ITEM>();

            foreach (Descriptor ii in DescriptorCollection)
            {
                if (!String.IsNullOrEmpty(ii.DescriptorName))
                {
                    if (IsSKU)
                    {
                        Capturados.Add(new ITEM()
                        {
                            SKU = ii.DescriptorName, CANTIDAD = ii.Cantidad
                        });
                    }
                    else
                    {
                        Capturados.Add(new ITEM()
                        {
                            NUMERO_SERIE = ii.DescriptorName, CANTIDAD = ii.Cantidad
                        });
                    }
                }
            }


            if (IsSKU)
            {
                for (int i = 0; i < Existentes.Count; i++)
                {
                    for (int j = 0; j < Capturados.Count; j++)
                    {
                        if (Existentes[i].SKU.Equals(Capturados[j].SKU))
                        {
                            if (Existentes[i].CANTIDAD > 0 && Capturados[j].CANTIDAD > 0)
                            {
                                Existentes[i].CANTIDAD--;
                                Capturados[j].CANTIDAD--;

                                if (Existentes[i].CANTIDAD <= 0)
                                {
                                    Existentes.RemoveAt(i);
                                }
                                if (Capturados[j].CANTIDAD <= 0)
                                {
                                    Capturados.RemoveAt(j);
                                    j--;
                                }
                            }
                            else
                            {
                                AuxArticulosFaltantes.Add(Existentes[i].ARTICULO.ARTICULO1);
                                ArticulosFaltantes.Add(new ARTICULO()
                                {
                                    ARTICULO1 = Existentes[i].ARTICULO.ARTICULO1, EQUIPO = new EQUIPO()
                                    {
                                        EQUIPO_NAME = "1"
                                    }, CATEGORIA = new CATEGORIA()
                                    {
                                        CATEGORIA_NAME = Existentes[i].SKU
                                    }, MODELO = new MODELO()
                                    {
                                        MODELO_NAME = Existentes[i].NUMERO_SERIE
                                    }
                                });
                            }
                        }
                    }
                }
            }
            else
            {
                for (int i = 0; i < Existentes.Count; i++)
                {
                    for (int j = 0; j < Capturados.Count; j++)
                    {
                        if (Existentes[i].NUMERO_SERIE.Equals(Capturados[j].NUMERO_SERIE))
                        {
                            if (Existentes[i].CANTIDAD > 0 && Capturados[j].CANTIDAD > 0)
                            {
                                Existentes[i].CANTIDAD--;
                                Capturados[j].CANTIDAD--;

                                if (Existentes[i].CANTIDAD <= 0)
                                {
                                    Existentes.RemoveAt(i);
                                }
                                if (Capturados[j].CANTIDAD <= 0)
                                {
                                    Capturados.RemoveAt(j);
                                    j--;
                                }
                            }
                            else
                            {
                                AuxArticulosFaltantes.Add(Existentes[i].ARTICULO.ARTICULO1);
                                ArticulosFaltantes.Add(new ARTICULO()
                                {
                                    ARTICULO1 = Existentes[i].ARTICULO.ARTICULO1, EQUIPO = new EQUIPO()
                                    {
                                        EQUIPO_NAME = "1"
                                    }, CATEGORIA = new CATEGORIA()
                                    {
                                        CATEGORIA_NAME = Existentes[i].SKU
                                    }, MODELO = new MODELO()
                                    {
                                        MODELO_NAME = Existentes[i].NUMERO_SERIE
                                    }
                                });
                            }
                        }
                    }
                }
            }

            foreach (ITEM ii in Existentes)
            {
                while (ii.CANTIDAD > 0)
                {
                    AuxArticulosFaltantes.Add(ii.ARTICULO.ARTICULO1);
                    ArticulosFaltantes.Add(new ARTICULO()
                    {
                        ARTICULO1 = ii.ARTICULO.ARTICULO1, EQUIPO = new EQUIPO()
                        {
                            EQUIPO_NAME = "-1"
                        }, CATEGORIA = new CATEGORIA()
                        {
                            CATEGORIA_NAME = ii.SKU
                        }, MODELO = new MODELO()
                        {
                            MODELO_NAME = ii.NUMERO_SERIE
                        }
                    });

                    ii.CANTIDAD--;
                }
            }

            if (IsSKU)
            {
                foreach (ITEM ii in Capturados)
                {
                    while (ii.CANTIDAD > 0)
                    {
                        if (ExisteRegistro(ii.SKU))
                        {
                            string aux = GetNameArticulo(ii.SKU);
                            AuxArticulosFaltantes.Add(aux);
                            ArticulosFaltantes.Add(new ARTICULO()
                            {
                                ARTICULO1 = aux, EQUIPO = new EQUIPO()
                                {
                                    EQUIPO_NAME = "1"
                                }, CATEGORIA = new CATEGORIA()
                                {
                                    CATEGORIA_NAME = ii.SKU
                                }, MODELO = new MODELO()
                                {
                                    MODELO_NAME = ii.NUMERO_SERIE
                                }
                            });

                            ii.CANTIDAD--;
                        }
                        else
                        {
                            AuxArticulosFaltantes.Add("El SKU '" + ii.SKU + "' no existe en el sistema.");
                            ArticulosFaltantes.Add(new ARTICULO()
                            {
                                ARTICULO1 = "El SKU '" + ii.SKU + "' no existe en el sistema.", EQUIPO = new EQUIPO()
                                {
                                    EQUIPO_NAME = "1"
                                }
                            });

                            ii.CANTIDAD--;
                        }
                    }
                }
            }
            else
            {
                foreach (ITEM ii in Capturados)
                {
                    while (ii.CANTIDAD > 0)
                    {
                        if (ExisteRegistro(ii.NUMERO_SERIE))
                        {
                            string aux = GetNameArticulo(ii.NUMERO_SERIE);
                            AuxArticulosFaltantes.Add(aux);
                            ArticulosFaltantes.Add(new ARTICULO()
                            {
                                ARTICULO1 = aux, EQUIPO = new EQUIPO()
                                {
                                    EQUIPO_NAME = "1"
                                }, CATEGORIA = new CATEGORIA()
                                {
                                    CATEGORIA_NAME = ii.SKU
                                }, MODELO = new MODELO()
                                {
                                    MODELO_NAME = ii.NUMERO_SERIE
                                },
                            });

                            ii.CANTIDAD--;
                        }
                        else
                        {
                            AuxArticulosFaltantes.Add("El número dde serie '" + ii.NUMERO_SERIE + "' no existe en el sistema.");
                            ArticulosFaltantes.Add(new ARTICULO()
                            {
                                ARTICULO1 = "El número dde serie '" + ii.NUMERO_SERIE + "' no existe en el sistema.", EQUIPO = new EQUIPO()
                                {
                                    EQUIPO_NAME = "1"
                                }, CATEGORIA = new CATEGORIA()
                                {
                                    CATEGORIA_NAME = ii.SKU
                                }, MODELO = new MODELO()
                                {
                                    MODELO_NAME = ii.NUMERO_SERIE
                                }
                            });

                            ii.CANTIDAD--;
                        }
                    }
                }
            }

            ImprimirFinalmente(ArticulosFaltantes);
        }
コード例 #18
0
        private void SaveRecibo2()
        {
            ReciboDataMapper rdm = new ReciboDataMapper();

            rdm.udpateElement(new RECIBO()
            {
                UNID_SOLICITANTE = this.SelectedSolicitante.UnidSolicitante,
                PO          = this.PO,
                UNID_RECIBO = this.UnidRecibo
            }, this.ActualUser);

            rdm.LimpiarRecibo(this._DelMovs, this.UnidRecibo);

            foreach (InventoryApp.Model.Recibo.MovimientoModel mov in this.Movimientos)
            {
                //Agregar movimiento
                DAL.POCOS.MOVIMENTO movimiento = new MOVIMENTO()
                {
                    UNID_MOVIMIENTO = mov.UnidMovimiento
                    ,
                    FECHA_MOVIMIENTO = mov.FechaCaptura
                    ,
                    UNID_ALMACEN_DESTINO = (mov.DestinoAlmacen != null) ? mov.DestinoAlmacen.UnidAlmacen : (long?)null
                    ,
                    UNID_ALMACEN_PROCEDENCIA = (mov.OrigenAlmacen != null) ? mov.OrigenAlmacen.UnidAlmacen : (long?)null
                    ,
                    UNID_CLIENTE_PROCEDENCIA = (mov.OrigenCliente != null) ? mov.OrigenCliente.UnidCliente : (long?)null
                    ,
                    UNID_PROVEEDOR_PROCEDENCIA = (mov.OrigenProveedor != null) ? mov.OrigenProveedor.UnidProveedor : (long?)null
                    ,
                    TT = this.TroubleTicket
                    ,
                    UNID_TIPO_MOVIMIENTO = MovimientoRecibo
                    ,
                    IS_ACTIVE = true
                    ,
                    FINISHED = true
                };
                MovimientoDataMapper movDataMapper = new MovimientoDataMapper();
                movDataMapper.udpateElementRecibo(movimiento);

                foreach (InventoryApp.Model.Recibo.ReciboItemModel item in mov.Items)
                {
                    long?aux = null;
                    if (item.ItemStatus != null)
                    {
                        aux = item.ItemStatus.UnidItemStatus;
                    }

                    //Agregar el item
                    DAL.POCOS.ITEM pItem = new DAL.POCOS.ITEM()
                    {
                        UNID_ITEM = item.UnidItem
                        ,
                        SKU = item.Sku
                        ,
                        NUMERO_SERIE = item.NumeroSerie
                        ,
                        UNID_ITEM_STATUS = aux
                        ,
                        COSTO_UNITARIO = item.CostoUnitario
                        ,
                        UNID_FACTURA_DETALE = item.FacturaDetalle.UnidFacturaCompraDetalle
                        ,
                        UNID_ARTICULO = item.Articulo.UnidArticulo
                        ,
                        PEDIMENTO_EXPO = item.PedimentoExpo
                        ,
                        PEDIMENTO_IMPO = item.PedimentoImpo
                        ,
                        CANTIDAD = item.Cantidad
                        ,
                        IS_ACTIVE = true
                    };
                    ItemDataMapper itemDataMapper = new ItemDataMapper();
                    itemDataMapper.updateElementRecibo(pItem);

                    //Agregar detalle del movimiento
                    DAL.POCOS.MOVIMIENTO_DETALLE movDetalle = new DAL.POCOS.MOVIMIENTO_DETALLE()
                    {
                        UNID_MOVIMIENTO = mov.UnidMovimiento
                        ,
                        UNID_ITEM = item.UnidItem
                        ,
                        UNID_MOVIMIENTO_DETALLE = item.UnidMovimientoDetalle
                        ,
                        CANTIDAD = item.Cantidad
                        ,
                        UNID_ITEM_STATUS = item.ItemStatus.UnidItemStatus
                        ,
                        IS_ACTIVE = true
                    };
                    MovimientoDetalleDataMapper mdDataMapper = new MovimientoDetalleDataMapper();
                    mdDataMapper.udpateElementRecibo(movDetalle);

                    //Actualizar el último movimiento
                    DAL.POCOS.ULTIMO_MOVIMIENTO ulitmoMovto = new DAL.POCOS.ULTIMO_MOVIMIENTO()
                    {
                        UNID_ITEM               = item.UnidItem,
                        UNID_ALMACEN            = mov.DestinoAlmacen.UnidAlmacen,
                        UNID_MOVIMIENTO_DETALLE = item.UnidMovimientoDetalle,
                        CANTIDAD         = item.Cantidad,
                        UNID_ITEM_STATUS = item.ItemStatus.UnidItemStatus,
                        IS_ACTIVE        = true
                    };
                    UltimoMovimientoDataMapper umDataMapper = new UltimoMovimientoDataMapper();
                    umDataMapper.udpateElement(ulitmoMovto);
                }

                //Agregar recibodetalle
                DAL.POCOS.RECIBO_MOVIMIENTO rm = new DAL.POCOS.RECIBO_MOVIMIENTO()
                {
                    UNID_RECIBO            = this._UnidRecibo,
                    UNID_RECIBO_MOVIMIENTO = mov.UnidMovimiento,
                    UNID_MOVIMIENTO        = mov.UnidMovimiento,
                    UNID_FACTURA           = mov.Items.First().FacturaDetalle.Factura.UnidFactura,
                    IS_ACTIVE = true
                };
                ReciboMovimientoDataMapper rmDataMaper = new ReciboMovimientoDataMapper();
                rmDataMaper.udpateElementRecibo(rm);
            }
        }
コード例 #19
0
        private void AttemptAddMovimientoCmd()
        {
            LoteModel lot = new LoteModel(new LoteDataMapper());

            lot.UnidLote = UNID.getNewUNID();
            lot.UnidPOM  = UNID.getNewUNID();
            lot.saveLote();
            //factura
            foreach (FacturaCompraModel item in this.Facturas)
            {
                item.UnidLote    = lot.UnidLote;
                item.UnidFactura = UNID.getNewUNID();
                item.saveFactura();
                //factura detalle
                foreach (FacturaCompraDetalleModel fac in item.FacturaDetalle)
                {
                    fac.Factura = item;
                    fac.saveFacturaDetalle();
                }
            }

            //Agregar recibo
            DAL.POCOS.RECIBO recibo = new DAL.POCOS.RECIBO()
            {
                UNID_RECIBO      = this.UnidRecibo,
                FECHA_CREACION   = this.FechaCreacion,
                TT               = this.TroubleTicket,
                PO               = this.PO,
                UNID_SOLICITANTE = (this.SelectedSolicitante.UnidSolicitante == 0) ? (long?)null : this.SelectedSolicitante.UnidSolicitante
            };
            ReciboDataMapper reciboDataMapper = new ReciboDataMapper();

            reciboDataMapper.insertElement(recibo, this.ActualUser);


            foreach (InventoryApp.Model.Recibo.MovimientoModel mov in this.Movimientos)
            {
                //Agregar movimiento
                DAL.POCOS.MOVIMENTO movimiento = new MOVIMENTO()
                {
                    UNID_MOVIMIENTO = mov.UnidMovimiento
                    ,
                    FECHA_MOVIMIENTO = mov.FechaCaptura
                    ,
                    UNID_ALMACEN_DESTINO = (mov.DestinoAlmacen != null) ? mov.DestinoAlmacen.UnidAlmacen : (long?)null
                    ,
                    UNID_ALMACEN_PROCEDENCIA = (mov.OrigenAlmacen != null) ? mov.OrigenAlmacen.UnidAlmacen : (long?)null
                    ,
                    UNID_CLIENTE_PROCEDENCIA = (mov.OrigenCliente != null) ? mov.OrigenCliente.UnidCliente : (long?)null
                    ,
                    UNID_PROVEEDOR_PROCEDENCIA = (mov.OrigenProveedor != null) ? mov.OrigenProveedor.UnidProveedor : (long?)null
                    ,
                    TT = this.TroubleTicket
                    ,
                    UNID_TIPO_MOVIMIENTO = MovimientoRecibo
                };
                MovimientoDataMapper movDataMapper = new MovimientoDataMapper();
                movDataMapper.insertElement(movimiento);

                foreach (InventoryApp.Model.Recibo.ReciboItemModel item in mov.Items)
                {
                    long?aux = null;
                    if (item.ItemStatus != null)
                    {
                        aux = item.ItemStatus.UnidItemStatus;
                    }

                    //Agregar el item
                    DAL.POCOS.ITEM pItem = new DAL.POCOS.ITEM()
                    {
                        UNID_ITEM = item.UnidItem
                        ,
                        SKU = item.Sku
                        ,
                        NUMERO_SERIE = item.NumeroSerie
                        ,
                        UNID_ITEM_STATUS = aux
                        ,
                        COSTO_UNITARIO = item.CostoUnitario
                        ,
                        UNID_FACTURA_DETALE = item.FacturaDetalle.UnidFacturaCompraDetalle
                        ,
                        UNID_ARTICULO = item.Articulo.UnidArticulo
                        ,
                        PEDIMENTO_EXPO = item.PedimentoExpo
                        ,
                        PEDIMENTO_IMPO = item.PedimentoImpo
                        ,
                        CANTIDAD = item.Cantidad
                        ,
                        IS_ACTIVE = true
                    };
                    ItemDataMapper itemDataMapper = new ItemDataMapper();
                    itemDataMapper.insertElement(pItem);

                    //Agregar detalle del movimiento
                    DAL.POCOS.MOVIMIENTO_DETALLE movDetalle = new DAL.POCOS.MOVIMIENTO_DETALLE()
                    {
                        UNID_MOVIMIENTO = mov.UnidMovimiento
                        ,
                        UNID_ITEM = item.UnidItem
                        ,
                        UNID_MOVIMIENTO_DETALLE = item.UnidMovimientoDetalle
                        ,
                        CANTIDAD = item.Cantidad
                        ,
                        UNID_ITEM_STATUS = item.ItemStatus.UnidItemStatus
                        ,
                        IS_ACTIVE = true
                    };
                    MovimientoDetalleDataMapper mdDataMapper = new MovimientoDetalleDataMapper();
                    mdDataMapper.insertElement(movDetalle);

                    //Actualizar el último movimiento
                    DAL.POCOS.ULTIMO_MOVIMIENTO ulitmoMovto = new DAL.POCOS.ULTIMO_MOVIMIENTO()
                    {
                        UNID_ITEM               = item.UnidItem,
                        UNID_ALMACEN            = mov.DestinoAlmacen.UnidAlmacen,
                        UNID_MOVIMIENTO_DETALLE = item.UnidMovimientoDetalle,
                        CANTIDAD         = item.Cantidad,
                        UNID_ITEM_STATUS = item.ItemStatus.UnidItemStatus,
                        IS_ACTIVE        = false
                    };
                    UltimoMovimientoDataMapper umDataMapper = new UltimoMovimientoDataMapper();
                    umDataMapper.udpateElement(ulitmoMovto);
                }

                //Agregar recibodetalle
                DAL.POCOS.RECIBO_MOVIMIENTO rm = new DAL.POCOS.RECIBO_MOVIMIENTO()
                {
                    UNID_RECIBO            = this._UnidRecibo,
                    UNID_RECIBO_MOVIMIENTO = mov.UnidMovimiento,
                    UNID_MOVIMIENTO        = mov.UnidMovimiento,
                    UNID_FACTURA           = mov.Items.First().FacturaDetalle.Factura.UnidFactura
                };
                ReciboMovimientoDataMapper rmDataMaper = new ReciboMovimientoDataMapper();
                rmDataMaper.insertElement(rm);
            }

            if (this._CatalogReciboViewModel != null)
            {
                this._CatalogReciboViewModel.updateCollection();
            }
        }
コード例 #20
0
        public void CargaMovimiento(MOVIMENTO m)
        {
            this._dataMapperArticulos   = new MovimientoDetalleDataMapper();
            this._dataMaperItemsLectura = new ItemDataMapper();
            this._almacenDestino        = new ALMACEN();
            this._almacenProcedencia    = new ALMACEN();
            this._unidCliente           = new CLIENTE();
            this._clienteDestino        = new CLIENTE();
            this._clienteProcedencia    = new CLIENTE();
            this._unidFacturaVenta      = new FACTURA_VENTA();
            this._unidInfraestructura   = new INFRAESTRUCTURA();
            this._unidProveedor         = new PROVEEDOR();
            this._proveedorDestino      = new PROVEEDOR();
            this._proveedorProcedenia   = new PROVEEDOR();
            this._servicio         = new SERVICIO();
            this._unidSolicitante  = new SOLICITANTE();
            this._unidTecnico      = new TECNICO();
            this._unidTecnicoTrans = new TECNICO();
            this._tipoMovimientos  = new TIPO_MOVIMIENTO();
            this._transporte       = new TRANSPORTE();
            this._unidTecnicoTrans = new TECNICO();


            if (m.UNID_ALMACEN_DESTINO != null)
            {
                this._almacenDestino.UNID_ALMACEN = (long)m.UNID_ALMACEN_DESTINO;
            }

            if (m.UNID_ALMACEN_PROCEDENCIA != null)
            {
                this._almacenProcedencia.UNID_ALMACEN = (long)m.UNID_ALMACEN_PROCEDENCIA;
            }

            if (m.UNID_CLIENTE != null)
            {
                this._unidCliente.UNID_CLIENTE = (long)m.UNID_CLIENTE;
            }

            if (m.UNID_CLIENTE_DESTINO != null)
            {
                this._clienteDestino.UNID_CLIENTE = (long)m.UNID_CLIENTE_DESTINO;
            }

            if (m.UNID_CLIENTE_PROCEDENCIA != null)
            {
                this._clienteProcedencia.UNID_CLIENTE = (long)m.UNID_CLIENTE_PROCEDENCIA;
            }

            if (m.UNID_FACTURA_VENTA != null)
            {
                this._unidFacturaVenta.UNID_FACTURA_VENTA = (long)m.UNID_FACTURA_VENTA;
            }

            if (m.UNID_INFRAESTRUCTURA != null)
            {
                this._unidInfraestructura.UNID_INFRAESTRUCTURA = (long)m.UNID_INFRAESTRUCTURA;
            }

            if (m.UNID_MOVIMIENTO != null)
            {
                this._unidMovimiento = m.UNID_MOVIMIENTO;
            }

            if (m.UNID_PROVEEDOR != null)
            {
                this._unidProveedor.UNID_PROVEEDOR = (long)m.UNID_PROVEEDOR;
            }

            if (m.UNID_PROVEEDOR_DESTINO != null)
            {
                this._proveedorDestino.UNID_PROVEEDOR = (long)m.UNID_PROVEEDOR_DESTINO;
            }

            if (m.UNID_PROVEEDOR_PROCEDENCIA != null)
            {
                this._proveedorProcedenia.UNID_PROVEEDOR = (long)m.UNID_PROVEEDOR_PROCEDENCIA;
            }

            if (m.UNID_SERVICIO != null)
            {
                this._servicio.UNID_SERVICIO = (long)m.UNID_SERVICIO;
            }

            if (m.UNID_SOLICITANTE != null)
            {
                this._unidSolicitante.UNID_SOLICITANTE = (long)m.UNID_SOLICITANTE;
            }

            if (m.UNID_TECNICO != null)
            {
                this._unidTecnico.UNID_TECNICO = (long)m.UNID_TECNICO;
            }

            if (m.UNID_TECNICO_TRAS != null)
            {
                this._unidTecnicoTrans.UNID_TECNICO = (long)m.UNID_TECNICO_TRAS;
            }

            if (m.UNID_TIPO_MOVIMIENTO != null)
            {
                this._tipoMovimientos.UNID_TIPO_MOVIMIENTO = m.UNID_TIPO_MOVIMIENTO;
            }

            if (m.UNID_TRANSPORTE != null)
            {
                this._transporte.UNID_TRANSPORTE = (long)m.UNID_TRANSPORTE;
            }

            this._contacto    = m.CONTACTO;
            this._guia        = m.GUIA;
            this._sitioEnlace = m.SITIO_ENLACE;
            this._nombreSitio = m.NOMBRE_SITIO;
            this._tt          = m.TT;
            this._timeFecha   = m.FECHA_MOVIMIENTO;

            this.TotalItems = 0;
            FixupCollection <ItemModel> ic = new FixupCollection <ItemModel>();

            foreach (MOVIMIENTO_DETALLE detalle in m.MOVIMIENTO_DETALLE)
            {
                ITEM itLec = new ITEM();
                itLec.UNID_ITEM = (detalle.UNID_ITEM);
                itemsLectura    = this._dataMaperItemsLectura.getElementLectura(itLec);
                ITEM_STATUS itemStatus = new ITEM_STATUS();
                itemStatus.UNID_ITEM_STATUS = (long)detalle.UNID_ITEM_STATUS;
                ItemModel aux = new ItemModel((ITEM)itemsLectura, detalle.CANTIDAD, itemStatus);
                if (!String.IsNullOrEmpty(detalle.OBSERVACIONES))
                {
                    this._observaciones = detalle.OBSERVACIONES;
                }
                ic.Add(aux);
                this.ArticulosLectura = ic;
            }
        }
コード例 #21
0
 public ItemModel()
 {
     this._dataMapper  = new ItemDataMapper();
     this._dataMapper2 = new ItemStatusDataMapper();
     this.Detalles     = new ObservableCollection <DeleteFacturaDetalleModel>();
 }
コード例 #22
0
        /// <summary>
        /// Make a new item icon for the given item
        /// </summary>
        /// <returns></returns>
        public static ItemIconController Make(
            Item item,
            Transform parent        = null,
            bool loadShapedIcon     = false,
            bool isDraggable        = false,
            int stackIndex          = GridBasedInventory.EmptyGridSlot,
            Coordinate gridLocation = default,
            Player.InventoryTypes parentInventory = Player.InventoryTypes.None
            )
        {
            // make the icon under the given parent, or alone if we want
            GameObject icon = parent != null
        ? Instantiate(ItemDataMapper.ItemIconPrefab, parent)
        : Instantiate(ItemDataMapper.ItemIconPrefab);

            // move to the top
            if (parent != null)
            {
                icon.transform.SetAsFirstSibling();
            }

            ItemIconController iconController = icon.GetComponent <ItemIconController>();

            iconController.item            = item;
            iconController.backgroundImage = icon.transform.Find("Icon Background").GetComponent <Image>();

            /// add the drag controller.
            if (isDraggable)
            {
                iconController.dragController = icon.AddComponent <ItemInventoryDragController>();
                iconController.dragController.initialize(iconController, stackIndex, gridLocation, parentInventory);
            }

            // try to get the sprite
            if (item != null)
            {
                Sprite itemSprite = ItemDataMapper.GetIconFor(item);
                /// if we found a sprite
                if (itemSprite != null)
                {
                    /// load the regular icon
                    iconController.defaultIconScaler = icon.transform.Find("Small Icon Scaler").gameObject;
                    GameObject sprite = Instantiate(new GameObject(), iconController.defaultIconScaler.transform);
                    sprite.layer = 5;
                    SpriteRenderer spriteRenderer = sprite.AddComponent <SpriteRenderer>();
                    spriteRenderer.sprite = itemSprite;
                    // if we didn't, use the object as an icon.
                }
                else
                {
                    iconController.defaultIconScaler = icon.transform.Find("Model Icon Scaler").gameObject;
                    GameObject itemModel = Instantiate(ItemDataMapper.GetModelFor(item), iconController.defaultIconScaler.transform);
                    iconController.itemModelRenderers = itemModel.GetComponentsInChildren <Renderer>();
                }

                /// if we're also loading the shaped icon:
                if (loadShapedIcon)
                {
                    // get the shaped scaler
                    iconController.shapedIconScaler = icon.transform.Find("Shaped Icon Scaler").gameObject;

                    // make the prototype image object
                    GameObject imageObject = new GameObject {
                        layer = 5
                    };
                    imageObject.AddComponent <Image>();
                    // resize the sprite according to it's shape size.
                    RectTransform rectTransform = imageObject.GetComponent <RectTransform>();
                    rectTransform.anchorMax = (item.type.ShapeSize - item.type.ShapePivot).Vec2;
                    rectTransform.anchorMin = ((0, 0) - item.type.ShapePivot).Vec2;
                    rectTransform.SetLTRB(0);

                    // if we need a new icon for the shaped icon than the basic square icon, get it
                    if (item.type.ShapeSize > (1, 1))
                    {
                        Sprite shapedIcon      = ItemDataMapper.GetIconFor(item, true);
                        Image  shapedIconImage = Instantiate(imageObject, iconController.shapedIconScaler.transform).GetComponent <Image>();
                        shapedIconImage.sprite = shapedIcon;
                    }

                    // add the outline
                    Image outline = Instantiate(imageObject, iconController.shapedIconScaler.transform).GetComponent <Image>();
                    outline.sprite = ItemDataMapper.GetShapedOutlineFor(item);
                    outline.color  = new Color(1, 1, 0);
                }

                // set the correct icon scaler active
                iconController.defaultIconScaler.SetActive(true);

                /// set up the stack indicator
                iconController.itemStackSizeIndicator     = icon.transform.Find("Stack Quantity Indicator").GetComponent <RectTransform>();
                iconController.itemStackSizeIndicatorText = iconController.itemStackSizeIndicator.GetComponentInChildren <Text>();
                iconController.updateStackCount();
                if (item.type.StackSize > 1)
                {
                    iconController.itemStackSizeIndicator.gameObject.SetActive(true);
                }
            }
            else
            {
                iconController.itemStackSizeIndicator     = icon.transform.Find("Stack Quantity Indicator").GetComponent <RectTransform>();
                iconController.itemStackSizeIndicatorText = iconController.itemStackSizeIndicator.GetComponentInChildren <Text>();
                iconController.updateStackCount();
            }

            return(iconController);
        }
コード例 #23
0
 public CatalogItemModel(IDataMapper dataMapper)
 {
     this._dataMapper = new ItemDataMapper();
     this._itemModel  = new FixupCollection <ItemModel>();
     this.Mensaje3    = "";
 }
コード例 #24
0
        public void AttempGuardar()
        {
            //Agregar Factura detalle
            FacturaCompraDetalleModel fd = new FacturaCompraDetalleModel();

            fd.UnidFacturaCompraDetalle = UNID.getNewUNID();
            fd.Factura               = new FacturaCompraModel();
            fd.Factura.UnidFactura   = FacturaCollection[0].UnidFactura;
            fd.Articulo              = new ArticuloModel();
            fd.Articulo.UnidArticulo = ItemModelCollection[0].Articulo.UNID_ARTICULO;
            fd.Cantidad              = ItemModelCollection[0].CantidadItem;
            fd.CostoUnitario         = ItemModelCollection[0].CostoUnitario;
            fd.ImpuestoUnitario      = FacturaCollection[0].PorIva;
            fd.Unidad            = new UnidadModel(null);
            fd.Unidad.UnidUnidad = ItemModelCollection[0].UnidUnidad;
            fd.saveFacturaDetalle();

            //Agregar el item
            DAL.POCOS.ITEM pItem = new DAL.POCOS.ITEM()
            {
                UNID_ITEM = UNID.getNewUNID()
                ,
                SKU = ItemModel.Sku
                ,
                NUMERO_SERIE = ItemModel.NumeroSerie
                ,
                UNID_ITEM_STATUS = UltimoMovimiento[0].ItemStatus2.UNID_ITEM_STATUS
                ,
                COSTO_UNITARIO = ItemModelCollection[0].CostoUnitario
                ,
                UNID_FACTURA_DETALE = fd.UnidFacturaCompraDetalle
                ,
                UNID_ARTICULO = ItemModelCollection[0].Articulo.UNID_ARTICULO
                ,
                PEDIMENTO_EXPO = 0
                ,
                PEDIMENTO_IMPO = 0
                ,
                CANTIDAD = ItemModelCollection[0].CantidadItem
                ,
                IS_ACTIVE = true
                ,
                UNID_PROPIEDAD = ItemModelCollection[0].Propiedad.UNID_PROPIEDAD
            };
            ItemDataMapper itemDataMapper = new ItemDataMapper();

            itemDataMapper.insertElement(pItem);

            //Agregar movimiento Dummy
            DAL.POCOS.MOVIMENTO mov = new DAL.POCOS.MOVIMENTO()
            {
                UNID_MOVIMIENTO = UNID.getNewUNID()
                ,
                FECHA_MOVIMIENTO = DateTime.Now
                ,
                UNID_TIPO_MOVIMIENTO = 16
                ,
                IS_ACTIVE = false
                ,
                IS_MODIFIED = true
            };
            MovimientoDataMapper movDataMapper = new MovimientoDataMapper();

            movDataMapper.insertElement(mov);

            foreach (UltimoMovimientoModel um in UltimoMovimiento)
            {
                //Agregar detalle del movimiento
                DAL.POCOS.MOVIMIENTO_DETALLE movDetalle = new DAL.POCOS.MOVIMIENTO_DETALLE()
                {
                    UNID_MOVIMIENTO = mov.UNID_MOVIMIENTO
                    ,
                    UNID_ITEM = pItem.UNID_ITEM
                    ,
                    UNID_MOVIMIENTO_DETALLE = UNID.getNewUNID()
                    ,
                    CANTIDAD = um.Cantidad
                    ,
                    UNID_ITEM_STATUS = um.ItemStatus2.UNID_ITEM_STATUS
                    ,
                    IS_ACTIVE = true
                };
                MovimientoDetalleDataMapper mdDataMapper = new MovimientoDetalleDataMapper();
                mdDataMapper.insertElement(movDetalle);

                //Actualizar el último movimiento
                DAL.POCOS.ULTIMO_MOVIMIENTO ulitmoMovto = new DAL.POCOS.ULTIMO_MOVIMIENTO()
                {
                    UNID_ITEM               = pItem.UNID_ITEM,
                    UNID_ALMACEN            = um.UnidAlmacen,
                    UNID_PROVEEDOR          = um.UnidProveedor,
                    UNID_CLIENTE            = um.UnidCliente,
                    UNID_MOVIMIENTO_DETALLE = movDetalle.UNID_MOVIMIENTO_DETALLE,
                    CANTIDAD         = um.Cantidad,
                    UNID_ITEM_STATUS = um.ItemStatus2.UNID_ITEM_STATUS,
                    IS_ACTIVE        = true
                };
                UltimoMovimientoDataMapper umDataMapper = new UltimoMovimientoDataMapper();
                umDataMapper.insertElement(ulitmoMovto);
            }

            MessageBox.Show("Se ha agregado el Item correctamente");

            this.ItemModel.NumeroSerie = "";
            this.ItemModel.Sku         = "";
            this.CatalogPropiedad.Propiedad.Clear();

            this.CatalogProveedor.Proveedor.Clear();
            this.UltimoMovimiento.Clear();

            this.FillWithItemDetallesAnterior = true;
            this.FillWithDestinos             = false;
            this.FillWithDestinos2            = false;
            this.FillWithIFactura             = false;
            this.FillWithItemDetalles         = false;

            this.Sku         = null;
            this.NumeroSerie = null;
            this.Error       = null;

            this.ItemModel           = new AgregarItemModel();
            this.ItemModelCollection = new ObservableCollection <AgregarItemModel>();
            this.Factura             = new FacturaCompraModel();
            this.FacturaCollection   = new ObservableCollection <FacturaCompraModel>();
            this.CatalogProveedor    = new CatalogProveedorModel(new ProveedorDataMapper());
            if (this.CatalogProveedor != null && this.CatalogProveedor.Proveedor.Count > 1)
            {
                this.ItemModel.Proveedor = this.CatalogProveedor.Proveedor[1];
            }

            this.CatalogStatus    = new CatalogItemStatusModel(new ItemStatusDataMapper());
            this.UltimoMovimiento = new ObservableCollection <UltimoMovimientoModel>();
            this.CatalogPropiedad = new CatalogPropiedadModel(new PropiedadDataMapper());
        }