コード例 #1
0
        public JsonResult ProcReservarMatImovel(TipoReservaMatImovel TipoReserva, long IdPrenotacao, string NumMatricula)
        {
            bool                   resp          = false;
            string                 message       = string.Empty;
            DtoReservaImovel       reservaImovel = new DtoReservaImovel();
            List <ApplicationUser> listaUsrSist  = System.Web.HttpContext.Current.GetOwinContext().GetUserManager <ApplicationUserManager>().Users.OrderBy(u => u.UserName).ToList();

            try
            {
                using (AppServiceAtos appServiceAtos = new AppServiceAtos(this.UfwCartNew, this.IdCtaAcessoSist))
                {
                    appServiceAtos.ListaUsuariosSistema = listaUsrSist;
                    reservaImovel = appServiceAtos.ProcReservarMatImovel(TipoReserva, IdPrenotacao, NumMatricula, this.UsuarioAtual.Id);
                }

                resp    = reservaImovel.Resposta;
                message = reservaImovel.Msg;
            }
            catch (Exception ex)
            {
                TypeInfo t = this.GetType().GetTypeInfo();
                IOFunctions.GerarLogErro(t, ex);

                resp    = false;
                message = "Falha, ProcReservarMatImovel [" + ex.Message + "]";
            }

            var resultado = new
            {
                resposta = resp,
                operacao = reservaImovel.Operacao,
                tipoMsg  = reservaImovel.TipoMsg,
                msg      = message,
                Reserva  = reservaImovel
            };

            return(Json(resultado));
        }