コード例 #1
0
        public static string InsUpdHotels(BEHotel obj)
        {
            IHotels IService = new IHotels();
            string  fdoc     = obj.fechaDocumento.Substring(6, 4) + obj.fechaDocumento.Substring(3, 2) + obj.fechaDocumento.Substring(0, 2);

            obj.fechaDocumento = fdoc;

            if (obj.idHospedaje == "0")
            {
                if (obj.ingresoPais.Trim().Length > 8)
                {
                    obj.ingresoPais = obj.ingresoPais.Substring(6, 4) + obj.ingresoPais.Substring(3, 2) + obj.ingresoPais.Substring(0, 2);
                }

                if (obj.fechaIngresoHotel.Trim().Length > 8)
                {
                    obj.fechaIngresoHotel = obj.fechaIngresoHotel.Substring(6, 4) + obj.fechaIngresoHotel.Substring(3, 2) + obj.fechaIngresoHotel.Substring(0, 2);
                }

                if (obj.fechaSalidaHotel.Trim().Length > 8)
                {
                    obj.fechaSalidaHotel = obj.fechaSalidaHotel.Substring(6, 4) + obj.fechaSalidaHotel.Substring(3, 2) + obj.fechaSalidaHotel.Substring(0, 2);
                }
            }

            return(obj.idHospedaje == "0" ? IService.IInsHotels(obj) : IService.IUpdHotels(obj));
        }