public static string[] liquidation(string _co, string _ordersChain, Transporters_Guides shipping, string _newStatus, Decimal _varpercepcion)
        {
            string[] resultDoc = new string[2];
            return(resultDoc);
            //string sqlCommand = "logistica.sp_createliquidation";
            //try
            //{
            //    //
            //    Database db = DatabaseFactory.CreateDatabase(_conn);
            //    DbCommand dbCommandWrapper = db.GetStoredProcCommand(sqlCommand);

            //    // Comenzar una transaccion y si todo resulta bien cerrarla realizando los cambios en la base de datos
            //    using (DbConnection connection = db.CreateConnection())
            //    {
            //        connection.Open();
            //        DbTransaction transaction = connection.BeginTransaction();
            //        try
            //        {
            //            /*PARAMETERS*/
            //            dbCommandWrapper = db.GetStoredProcCommand(sqlCommand, _co, _ordersChain, 0, _newStatus, _varpercepcion);
            //            db.ExecuteNonQuery(dbCommandWrapper, transaction);

            //            resultDoc[0] = db.GetParameterValue(dbCommandWrapper, "p_lhv_liquidation_no").ToString();

            //            //** Quitar cuando el sistema funcione con los cambios en la tabla transporters_guides
            //            if (shipping._configShipping)
            //            {
            //                /* Solo para cuando este activo la nueva creacion de guias*/
            //                // Registro info destinatario
            //                sqlCommand = "logistica.sp_addguide_shipping";
            //                //
            //                dbCommandWrapper = db.GetStoredProcCommand(sqlCommand, _co, 12, DBNull.Value, shipping._tgn_transport, shipping._tgv_name_cust, shipping._tgv_phone_cust,
            //                    shipping._tgv_movil_cust, shipping._tgv_shipp_add, shipping._tgv_shipp_block, shipping._tgv_city, shipping._tgv_depto, resultDoc[0]);
            //                db.ExecuteNonQuery(dbCommandWrapper, transaction);
            //            }
            //            // Commit the transaction.
            //            transaction.Commit();
            //        }
            //        catch (Exception ex)
            //        {
            //            // Roll back the transaction.
            //            transaction.Rollback();
            //            resultDoc[0] = "-1";
            //            resultDoc[1] = ex.Message;//"-1";
            //            //return ex.Message;
            //        }
            //        connection.Close();
            //    }
            //}
            //catch (Exception ex)
            //{
            //    resultDoc[0] = "-1";
            //    resultDoc[1] = ex.Message;
            //}
            //return resultDoc;
        }
Example #2
0
        //



        public static string[] saveOrder_And_Liquidation_POS_BL(string _co, decimal _idCust, string _reference, decimal _discCommPctg,
                                                                decimal _discCommValue, string _shipTo, string _specialInstr, List <Order_Dtl> _itemsDetail,
                                                                Transporters_Guides shipping, string _newStatus, string varNumTarjeta, string varNumVoucher,
                                                                decimal varMonto, decimal usuCre, String TipoPago, decimal _varpercepcion, string listdoc)
        {
            string[] resultDoc = new string[3];
            return(resultDoc);
            //try
            //{
            //    Database db = DatabaseFactory.CreateDatabase(_conn);
            //    //string resultDoc = "";

            //    string sqlCommand = "logistica.sp_add_order_hdr";

            //    DbCommand dbCommandWrapper = db.GetStoredProcCommand(sqlCommand);

            //    // Recoleccion de la informacion necesaria para crear el registro de la cabecera del pedido
            //    db.AddInParameter(dbCommandWrapper, "p_ohv_co", DbType.String, _co);

            //    // Output parameters specify the size of the return data.
            //    db.AddOutParameter(dbCommandWrapper, "p_ohv_order_no", DbType.String, 12);

            //    // Id del promotor
            //    db.AddInParameter(dbCommandWrapper, "p_ohn_customer_id", DbType.Decimal, _idCust);

            //    db.AddInParameter(dbCommandWrapper, "p_ohv_reference", DbType.String, _reference);
            //    db.AddInParameter(dbCommandWrapper, "p_ohn_disc_comm_pctg", DbType.Decimal, _discCommPctg);
            //    db.AddInParameter(dbCommandWrapper, "p_ohn_disc_comm_value", DbType.Decimal, _discCommValue);

            //    db.AddInParameter(dbCommandWrapper, "p_ohv_ship_to", DbType.String, _shipTo);
            //    db.AddInParameter(dbCommandWrapper, "p_ohv_special_instr", DbType.String, _specialInstr);

            //    db.AddInParameter(dbCommandWrapper, "p_ohv_Percepcion", DbType.Decimal, _varpercepcion);

            //    // Comenzar una transaccion y si todo resulta bien cerrarla realizando los cambios en la base de datos
            //    using (DbConnection connection = db.CreateConnection())
            //    {
            //        connection.Open();
            //        DbTransaction transaction = connection.BeginTransaction();

            //        try
            //        {
            //            db.ExecuteNonQuery(dbCommandWrapper, transaction);

            //            resultDoc[0] = (string)db.GetParameterValue(dbCommandWrapper, "p_ohv_order_no");

            //            int i = 1;
            //            // Recorrer todas las lineas adicionAQUARELLAs al detalle
            //            foreach (Order_Dtl item in _itemsDetail)
            //            {
            //                sqlCommand = "logistica.sp_add_order_dtl";
            //                dbCommandWrapper = db.GetStoredProcCommand(sqlCommand,
            //                    _co,
            //                    resultDoc[0],
            //                    i,// Linea
            //                    item._code,
            //                    item._size,
            //                    item._qty,
            //                    item._qtyCancel,
            //                    item._dsctoPerc,// % de descuento
            //                    item._dscto,// Valor de descuento
            //                    item._commissionPctg,// % de comision
            //                    item._commission//valor de comision
            //                    );
            //                db.ExecuteNonQuery(dbCommandWrapper, transaction);
            //                i++;
            //            }

            //            //-- liquidation
            //            sqlCommand = "FINANCIERA.sp_POS_automatic_clear_UNICA";
            //            dbCommandWrapper = db.GetStoredProcCommand(sqlCommand, _co, resultDoc[0], 0, _newStatus, varNumTarjeta, varNumVoucher, varMonto, TipoPago, usuCre, _varpercepcion, listdoc);
            //            db.ExecuteNonQuery(dbCommandWrapper, transaction);

            //            resultDoc[1] = db.GetParameterValue(dbCommandWrapper, "p_lhv_liquidation_no").ToString();

            //            //** Quitar cuando el sistema funcione con los cambios en la tabla transporters_guides
            //            if (shipping._configShipping)
            //            {
            //                /* Solo para cuando este activo la nueva creacion de guias*/
            //                // Registro info destinatario
            //                sqlCommand = "logistica.sp_addguide_shipping";
            //                //
            //                dbCommandWrapper = db.GetStoredProcCommand(sqlCommand, _co, 12, DBNull.Value, shipping._tgn_transport, shipping._tgv_name_cust, shipping._tgv_phone_cust,
            //                    shipping._tgv_movil_cust, shipping._tgv_shipp_add, shipping._tgv_shipp_block, shipping._tgv_city, shipping._tgv_depto, resultDoc[1]);
            //                db.ExecuteNonQuery(dbCommandWrapper, transaction);
            //            }


            //            // Commit the transaction.
            //            transaction.Commit();
            //        }
            //        catch (Exception ex)
            //        {
            //            // Roll back the transaction.
            //            transaction.Rollback();
            //            resultDoc[0] = "-1";
            //            resultDoc[1] = "-1";
            //            resultDoc[2] = ex.Message;//"-1";
            //            //return ex.Message;
            //        }
            //        connection.Close();
            //    }
            //}
            //catch (Exception ex)
            //{
            //    resultDoc[0] = "-1";
            //    resultDoc[1] = "-1";
            //    resultDoc[2] = ex.Message;
            //}
            //return resultDoc;
        }
Example #3
0
        //

        //vamos a pagar un pedido con pago POS
        public static string[] saveOrder_And_ped_POS_BL(string _co, decimal _idCust, string _reference, decimal _discCommPctg,
                                                        decimal _discCommValue, string _shipTo, string _specialInstr, List <Order_Dtl> _itemsDetail,
                                                        Transporters_Guides shipping, string _newStatus, string varNumTarjeta, string varNumVoucher,
                                                        decimal varMonto, decimal usuCre, String TipoPago, decimal _varpercepcion, string listdoc, string vped)
        {
            string[] resultDoc = new string[3];
            return(resultDoc);
            //try
            //{
            //    Database db = DatabaseFactory.CreateDatabase(_conn);
            //    //string resultDoc = "";

            //    string sqlCommand = "FINANCIERA.sp_POS_automatic_clear_UNICA";


            //    DbCommand dbCommandWrapper = db.GetStoredProcCommand(sqlCommand);
            //    resultDoc[0] = vped;

            //    // Comenzar una transaccion y si todo resulta bien cerrarla realizando los cambios en la base de datos
            //    using (DbConnection connection = db.CreateConnection())
            //    {
            //        connection.Open();
            //        DbTransaction transaction = connection.BeginTransaction();

            //        try
            //        {


            //            //-- liquidation

            //            dbCommandWrapper = db.GetStoredProcCommand(sqlCommand, _co, resultDoc[0], 0, _newStatus, varNumTarjeta, varNumVoucher, varMonto, TipoPago, usuCre, _varpercepcion, listdoc);
            //            db.ExecuteNonQuery(dbCommandWrapper, transaction);

            //            resultDoc[1] = db.GetParameterValue(dbCommandWrapper, "p_lhv_liquidation_no").ToString();

            //            //** Quitar cuando el sistema funcione con los cambios en la tabla transporters_guides
            //            if (shipping._configShipping)
            //            {
            //                /* Solo para cuando este activo la nueva creacion de guias*/
            //                // Registro info destinatario
            //                sqlCommand = "logistica.sp_addguide_shipping";
            //                //
            //                dbCommandWrapper = db.GetStoredProcCommand(sqlCommand, _co, 12, DBNull.Value, shipping._tgn_transport, shipping._tgv_name_cust, shipping._tgv_phone_cust,
            //                    shipping._tgv_movil_cust, shipping._tgv_shipp_add, shipping._tgv_shipp_block, shipping._tgv_city, shipping._tgv_depto, resultDoc[1]);
            //                db.ExecuteNonQuery(dbCommandWrapper, transaction);
            //            }


            //            // Commit the transaction.
            //            transaction.Commit();
            //        }
            //        catch (Exception ex)
            //        {
            //            // Roll back the transaction.
            //            transaction.Rollback();
            //            resultDoc[0] = "-1";
            //            resultDoc[1] = "-1";
            //            resultDoc[2] = ex.Message;//"-1";
            //            //return ex.Message;
            //        }
            //        connection.Close();
            //    }
            //}
            //catch (Exception ex)
            //{
            //    resultDoc[0] = "-1";
            //    resultDoc[1] = "-1";
            //    resultDoc[2] = ex.Message;
            //}
            //return resultDoc;
        }