Esempio n. 1
0
        internal int Guardar(ChequeraInfo info)
        {
            try
            {
                Logger.Info();
                var xml =
                    new XElement("ROOT",
                                 new XElement("Chequera",
                                              new XElement("ChequeraId", info.ChequeraId),
                                              new XElement("NumeroChequera", info.NumeroChequera),
                                              new XElement("ChequeIDInicial", info.ChequeInicial),
                                              new XElement("ChequeIDFinal", info.ChequeFinal),
                                              new XElement("OrganizacionId", info.CentroAcopio.OrganizacionID),
                                              new XElement("BancoId", info.Banco.BancoID),
                                              new XElement("Activo", info.ChequeraEtapas.EtapaId),
                                              new XElement("UsuarioCreacionID", info.UsuarioCreacionID)));

                var parametros = new Dictionary <string, object>
                {
                    { "@XmlChequera", xml.ToString() },
                };

                DataSet ds     = Retrieve("Chequera_Guardar", parametros);
                int     result = 0;
                if (ValidateDataSet(ds))
                {
                    var folio = MapChequeraDAL.ObtenerFolio(ds);
                    if (folio > 0)
                    {
                        result = folio;
                    }
                }
                return(result);
            }
            catch (SqlException ex)
            {
                Logger.Error(ex);
                throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
            }
            catch (DataException ex)
            {
                Logger.Error(ex);
                throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
        }