public void IngresarStockTransfer(EntityConnectionStringBuilder connection, StockTransferencia sk)
        {
            var context = new samEntities(connection.ToString());

            context.INSERT_Stock_Transfer_MDL(sk.WERKS,
                                              sk.MATNR,
                                              sk.UMLMC,
                                              sk.XCHPF,
                                              sk.MEINS,
                                              sk.MAKTX,
                                              sk.MAKTX_E,
                                              "",
                                              sk.LVORM,
                                              sk.LGORT,
                                              sk.CHARG,
                                              sk.SOBKZ,
                                              sk.KDAUF,
                                              sk.KDPOS,
                                              sk.UMLGO);
        }
        public void IngresarStockTransferencia(EntityConnectionStringBuilder connection, StockTransferencia sk)
        {
            var context = new samEntities(connection.ToString());

            context.InsertStockTransferecia_MDL(sk.WERKS,
                                                sk.MATNR,
                                                sk.UMLMC,
                                                sk.XCHPF,
                                                sk.MEINS,
                                                sk.MAKTX,
                                                sk.MAKTX_E,
                                                sk.UMLMC,
                                                sk.LVORM);
        }
        public void ActualizarStockTransfer313(EntityConnectionStringBuilder connection, StockTransferencia st, string stock)
        {
            var context = new samEntities(connection.ToString());

            context.UPDATE_Stock_Transferencia_313_MDL(st.WERKS,
                                                       st.MATNR,
                                                       st.LGORT,
                                                       st.CHARG,
                                                       st.SOBKZ,
                                                       st.KDAUF,
                                                       st.KDPOS,
                                                       st.UMLGO,
                                                       stock,
                                                       stock,
                                                       st.LVORM,
                                                       st.XCHPF);
        }
        public void ActualizarMaterialStockTransfer(EntityConnectionStringBuilder connection, StockTransferencia sk)
        {
            var context = new samEntities(connection.ToString());

            context.UPDATE_STOCK_TRANS_MDL(sk.WERKS,
                                           sk.MATNR,
                                           sk.UMLMC,
                                           sk.XCHPF,
                                           sk.MEINS,
                                           sk.MAKTX,
                                           sk.MAKTX_E,
                                           "",
                                           sk.LVORM,
                                           sk.LGORT,
                                           sk.CHARG,
                                           sk.SOBKZ,
                                           sk.KDAUF,
                                           sk.KDPOS,
                                           sk.UMLGO);
        }
        public IEnumerable <SELECT_MATERIAL_STOCK_TRANSFER_MDL_Result> ValidarMaterialST(EntityConnectionStringBuilder connection, StockTransferencia almid)
        {
            var context = new samEntities(connection.ToString());

            try
            {
                return(context.SELECT_MATERIAL_STOCK_TRANSFER_MDL(almid.WERKS,
                                                                  almid.MATNR,
                                                                  almid.LGORT,
                                                                  almid.CHARG,
                                                                  almid.KDAUF,
                                                                  almid.KDPOS,
                                                                  almid.UMLGO,
                                                                  almid.SOBKZ));
            }
            catch (Exception)
            {
                return(context.SELECT_MATERIAL_STOCK_TRANSFER_MDL(almid.WERKS,
                                                                  almid.MATNR,
                                                                  almid.LGORT,
                                                                  almid.CHARG,
                                                                  almid.KDAUF,
                                                                  almid.KDPOS,
                                                                  almid.UMLGO,
                                                                  almid.SOBKZ));
            }
        }