using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

namespace LLNet.BLL.Reports
{
    public class Reports
    {
        //private static BLL.BLLServer bll;
        

        public Reports()
        { 
        }

        public static void ImpresionGarantias(BLL.BLLServer bllInstance, DAL.IDAL moduleInstance, ref object[] pArgs)
        {

            try
            {
                moduleInstance.BeginTransaction();
                Model.Reports.DsRepGarantia dsGarantias = (Model.Reports.DsRepGarantia)pArgs[0];
                Utils.QueryParams qParams = new LLNet.Utils.QueryParams();
                qParams.Clear();
                qParams.AddReplaceParam("DOCUMENTO", pArgs[1].ToString());
                qParams.AddReplaceParam("SKU", Utils.Helpers.Nvl(pArgs[2],"SKU").ToString());                
                bllInstance.ExecuteSql("ExecImpresionGarantias", qParams, "Reports");
                dsGarantias.TDA_V_IMPRESION_GARANTIAS.Clear();
                dsGarantias.Merge(bllInstance.getTypedDataSet(pArgs[0].GetType(), dsGarantias.TDA_V_IMPRESION_GARANTIAS.TableName, qParams, "dsGarantias.TDA_V_IMPRESION_GARANTIAS"));
                dsGarantias.AcceptChanges();
                moduleInstance.Commit();
            }
            catch (Exception e)
            {
                moduleInstance.Rollback();
                throw new Exception(e.Message);
            }
        }

    }
}
