コード例 #1
0
ファイル: CN_vta_pedidocen.cs プロジェクト: slotcore/ssf-net
        public bool Insertar(BE_VTA_PEDIDOCEN entPedido, List <BE_VTA_PEDIDOCENDET> lstDetalle)
        {
            CD_vta_pedidocen miFun = new CD_vta_pedidocen();
            bool             booOk = false;

            miFun.mysConec = mysConec;
            booOk          = miFun.Insertar(entPedido, lstDetalle);

            b_OcurrioError = miFun.b_OcurrioError;
            c_ErrorMensaje = miFun.c_ErrorMensaje;
            n_ErrorNumber  = miFun.n_ErrorNumber;

            return(booOk);
        }
コード例 #2
0
ファイル: CN_vta_pedidocen.cs プロジェクト: slotcore/ssf-net
        public bool ProcesarCEN()
        {
            bool b_result = false;

            //bool b_result = false;
            Helper.Cls_IO funIO = new Helper.Cls_IO();
            string[]      c_ListaArchivos;
            int           n_numnarc = 0;
            int           n_row     = 0;
            string        c_nomarc  = "";
            int           n_numarch = 0;
            DataTable     dtOC      = new DataTable();

            // CARGAMOS TODOS LOS ARCHIVOS ZIP
            c_ListaArchivos = funIO.Dir_LeerDirectorio("C:\\SSF-NET\\PEDIDOS", "*.txt");
            n_numnarc       = Convert.ToInt32(c_ListaArchivos.GetLongLength(0));

            for (n_row = 0; n_row <= n_numnarc - 1; n_row++)
            {
                c_nomarc = c_ListaArchivos[n_row];
                LeerPedidoCEN(c_nomarc);

                PrepararEntidad(a_CabeceraCEN, a_DetalleCEN);

                CD_vta_pedidocen miFun = new CD_vta_pedidocen();
                bool             booOk = false;

                miFun.mysConec       = mysConec;
                entRegistro.n_anotra = STU_SISTEMA.ANOTRABAJO;
                entRegistro.n_mestra = STU_SISTEMA.MESTRABAJO;
                entRegistro.n_idemp  = STU_SISTEMA.EMPRESAID;

                miFun.Consulta1(STU_SISTEMA.EMPRESAID, a_CabeceraCEN[0]);
                dtOC = miFun.dtLista;

                if (dtOC.Rows.Count == 0)
                {
                    if (miFun.Insertar(entRegistro, LstDetalle) == false)
                    {
                        MessageBox.Show("¡ No se pudo cargar el siguiente archivo : " + c_nomarc + " !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                        return(b_result);
                    }
                    else
                    {
                        n_numarch = n_numarch + 1;
                        funIO.Fil_EliminarArchivo(c_nomarc);
                    }
                }
                else
                {
                    MessageBox.Show("¡ El pedido Nº " + a_CabeceraCEN[0] + " ya existe !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                    funIO.Fil_EliminarArchivo(c_nomarc);
                }
            }

            if (n_numarch > 0)
            {
                MessageBox.Show("¡ Se importaron " + n_numarch.ToString() + " pedidos del cliente CENCOSUD !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            }
            else
            {
                MessageBox.Show("¡ No se encontraron pedidos para importar del cliente CENCOSUD !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            }
            b_result = true;
            return(b_result);
        }