Ejemplo n.º 1
0
        public JsonResult GetCurrentDealershipInfo()
        {
            try
            {
                var service               = new DealershipAccountService(db);
                var currentId             = service.GetCurrentUserDealershipIdFromIdentity();
                var dealership            = db.Dealerships.FirstOrDefault(x => x.Id == currentId);
                var dealershipEditManager = new DealershipManager
                {
                    Id          = dealership.Id,
                    CompanyName = dealership.CompanyName,
                    Email       = dealership.Email,
                    City        = dealership.City,
                    State       = dealership.State,
                    ZipCode     = dealership.ZipCode,
                    Notes       = dealership.Notes,
                    PhoneNumber = dealership.PhoneNumber,
                    FaxNumber   = dealership.FaxNumber
                };

                return(Json(dealershipEditManager, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                var errorService = new ErrorService(db);
                errorService.logError(ex);

                throw (ex);
            }
        }
Ejemplo n.º 2
0
        public JsonResult GetDealershipInfo(int id)
        {
            try
            {
                var service               = new DealershipAccountService(db);
                var dealership            = service.GetDealership(id);
                var dealershipEditManager = new DealershipManager
                {
                    Id          = dealership.Id,
                    CompanyName = dealership.CompanyName,
                    Email       = dealership.Email,
                    City        = dealership.City,
                    State       = dealership.State,
                    ZipCode     = dealership.ZipCode,
                    Notes       = dealership.Notes,
                    PhoneNumber = dealership.PhoneNumber,
                    FaxNumber   = dealership.FaxNumber
                };

                return(Json(dealershipEditManager, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                var errorService = new ErrorService(db);
                errorService.logError(ex);

                throw (ex);
            }
        }
Ejemplo n.º 3
0
        public JsonResult GetCurrentDealershipInfo()
        {
            try
            {
                var service               = new DealershipAccountService(db);
                var currentId             = service.GetCurrentUserDealershipIdFromIdentity();
                var dealership            = db.Dealerships.FirstOrDefault(x => x.Id == currentId);
                var dealershipEditManager = new DealershipManager
                {
                    Id          = dealership.Id,
                    CompanyName = dealership.CompanyName,
                    Email       = dealership.Email,
                    City        = dealership.City,
                    State       = dealership.State,
                    ZipCode     = dealership.ZipCode,
                    Notes       = dealership.Notes,
                    PhoneNumber = dealership.PhoneNumber
                };

                /*
                 * var companyName = dealership.CompanyName;
                 * var email = dealership.Email;
                 * var city = dealership.City;
                 * var state = dealership.State;
                 * var zipcode = dealership.ZipCode;
                 * var notes = dealership.Notes;
                 * var phone = dealership.PhoneNumber;
                 */

                return(Json(dealershipEditManager, JsonRequestBehavior.AllowGet));
            }catch (Exception exception)
            {
                throw (exception);
            }
        }