public ClassSponsorService(IClassSponsorRepository ClassSponsorRepository, IMapper Mapper)
        {
            _ClassSponsorRepository = ClassSponsorRepository;

            _Mapper       = Mapper;
            _mainResponse = new MainResponse();
        }
        public MainResponse <List <RecordResponse> > ListRecords(RecordListRequest input)
        {
            List <RecordResponse> recordList = _db.Records
                                               .Where(x => x.RecordDate == input.RecordDate)
                                               .Include(x => x.Driver)
                                               .Include(x => x.CreatedBy)
                                               .Include(x => x.AreaGroup)
                                               .Select(e => new RecordResponse
            {
                AreaGroupId   = e.AreaGroupId,
                AreaGroupName = e.AreaGroup.GroupName,
                CreatedAt     = e.CreatedAt,
                CreatedBy     = e.CreatedById,
                CreatedByName = e.CreatedBy.FullName,
                DriverId      = e.DriverId,
                DriverName    = e.Driver != null ? e.Driver.DriverFullName : "",
                Id            = e.Id,
                IsActive      = e.IsActive,
                RecordDate    = e.RecordDate,
                RecordGuid    = e.RecordGuid,
                UpdatedAt     = e.UpdatedAt,
                UpdatedBy     = e.UpdatedBy
            })
                                               .OrderByDescending(x => x.Id)
                                               .Skip((input.PageNumber - 1) * input.PageSize).Take(input.PageSize)
                                               .ToList();


            MainResponse <List <RecordResponse> > finalResponse = new MainResponse <List <RecordResponse> >(recordList, _db.Records.Count());

            return(finalResponse);
        }
        public IActionResult GetClientAreaGroupsPrices(ClientAreaGroupPriceDto input)
        {
            IEnumerable <ClientAreaGroupPriceDto> list = (
                from area
                in _db.Areas
                where ((!input.AreaId.HasValue) || area.AreaGroupId == input.AreaId)
                from areaGroupsClientPrice
                in _db.AreaGroupClientPrices.Where(x => x.ClientId == input.ClientId && x.AreaId == area.Id).DefaultIfEmpty()
                select new ClientAreaGroupPriceDto {
                AreaId = area.Id,
                AreaName = area.AreaName,
                ClientId = input.ClientId,
                Price = areaGroupsClientPrice != null ? areaGroupsClientPrice.Price : 0,
                PriceId = areaGroupsClientPrice != null ? areaGroupsClientPrice.Id : 0
            }).ToList();

            int totalCount = list.Count();

            list = list
                   .Skip((input.PageNumber - 1) * input.PageSize).Take(input.PageSize);

            if (totalCount > 0)
            {
                MainResponse <IEnumerable <ClientAreaGroupPriceDto> > response = new MainResponse <IEnumerable <ClientAreaGroupPriceDto> >(list, totalCount);
                return(new OkObjectResult(response));
            }
            throw new Exception("لا يوجد بيانات");
        }
Beispiel #4
0
        public MainResponse <IEnumerable <DriverResponse> > GetAvailableDrivers(BaseRequest input)
        {
            IEnumerable <DriverResponse> driverList = _db.Drivers
                                                      .Where(x => x.IsActive)
                                                      .Include(x => x.User)
                                                      .Skip((input.PageNumber - 1) * input.PageSize).Take(input.PageSize)
                                                      .Select(x => new DriverResponse
            {
                Address              = x.Address,
                DriverFullName       = x.DriverFullName,
                DriverGuid           = x.DriverGuid,
                DrivingLisenceNumber = x.DrivingLisenceNumber,
                Id           = x.Id,
                Latitude     = x.User.Latitude,
                Longitude    = x.User.Longitude,
                MobileNumber = x.MobileNumber,
                Status       = x.Status,
                UserId       = x.UserId,
                Username     = x.User.UserName,
                IsActive     = x.IsActive
            })
                                                      .ToList();

            MainResponse <IEnumerable <DriverResponse> > finalResponse = new MainResponse <IEnumerable <DriverResponse> >(driverList, driverList.Count());

            return(finalResponse);
        }
Beispiel #5
0
        public async Task <IActionResult> List(ClientListRequest model)
        {
            IEnumerable <Client> clientList = await _db.Clients
                                              .Where(x =>
                                                     (string.IsNullOrEmpty(model.ClientFullName) || x.ClientFullName.Contains(model.ClientFullName)) &&
                                                     (string.IsNullOrEmpty(model.Address) || x.Address.Contains(model.Address)) &&
                                                     (string.IsNullOrEmpty(model.Email) || x.Email.Contains(model.Email)) &&
                                                     (string.IsNullOrEmpty(model.MobileNumber) || x.MobileNumber.Contains(model.MobileNumber)) &&
                                                     (!model.IsActive.HasValue || (bool)x.IsActive == model.IsActive)
                                                     )
                                              .OrderByDescending(c => c.CreatedAt).ToListAsync();

            int totalCount = clientList.Count();
            var result     = clientList.Skip((model.PageNumber - 1) * model.PageSize).Take(model.PageSize);
            IEnumerable <ClientResponse> mapped = _mapper.Map <IEnumerable <ClientResponse> >(result);

            if (mapped != null)
            {
                MainResponse <IEnumerable <ClientResponse> > response = new MainResponse <IEnumerable <ClientResponse> >(mapped, totalCount);
                return(new OkObjectResult(response));
            }


            throw new Exception("لا يوجد زبائن حاليا");
        }
        public async Task <IActionResult> GetEmployeesSalaries(EmployeeListRequest model)
        {
            IEnumerable <EmployeeSalaryResponse> employeeList = await _db.Employees.Where(x =>
                                                                                          (string.IsNullOrEmpty(model.FullNameAr) || x.FullNameAr.Contains(model.FullNameAr)) &&
                                                                                          (string.IsNullOrEmpty(model.FullNameEn) || x.FullNameEn.Contains(model.FullNameEn)) &&
                                                                                          (string.IsNullOrEmpty(model.MobileNumber) || x.MobileNumber.Contains(model.MobileNumber)) &&
                                                                                          (!model.From.HasValue || x.Transactions.Any(x => x.CreatedAt.Month == ((DateTime)model.From).AddDays(2).Month)))
                                                                .Include(x => x.Transactions)
                                                                .Skip((model.PageNumber - 1) * model.PageSize).Take(model.PageSize)
                                                                .Select(x => new EmployeeSalaryResponse
            {
                EmployeeId       = x.Id,
                EmployeeFullName = x.FullNameAr,
                MobileNumber     = x.MobileNumber,
                OriginalSalary   = x.Salary,
                RemainingSalary  = x.Transactions.Where(c => !model.From.HasValue || c.CreatedAt.Month == model.From.Value.Month).OrderByDescending(c => c.Id).FirstOrDefault().RemainingSalary
            })
                                                                //.Where(c => !model.From.HasValue || c.CreatedAt.Month == model.From.Value.Month)
                                                                .ToListAsync();

            if (employeeList.Count() > 0)
            {
                MainResponse <IEnumerable <EmployeeSalaryResponse> > response = new MainResponse <IEnumerable <EmployeeSalaryResponse> >(employeeList, _db.Employees.Count());
                return(new OkObjectResult(response));
            }
            throw new Exception("لا يوجد موظفين");
        }
        public async Task <ActionResult <MainResponse> > TestWord(UserSecretKeyRequest secretKeyRequest)
        {
            User user = HttpContext.GetUser();

            if (user == null)
            {
                return(Unauthorized());
            }

            KeySession keySession = await _context.KeySessions.FirstOrDefaultAsync(p => p.VerificationData == secretKeyRequest.IdentificationWord);

            if (keySession != null)
            {
                user.KeySession = keySession;
                user.UserState  = Enums.UserStates.Online;
                _context.Update(user);
                await _context.SaveChangesAsync();
            }

            UserSecretKeyResponse secretKeyResponse = new UserSecretKeyResponse()
            {
                UnknownKey = keySession == null
            };

            if (keySession != null)
            {
                secretKeyResponse.PublicKey           = keySession.RSAKeyPair.PublicKey;
                secretKeyResponse.EncryptedPrivateKey = keySession.RSAKeyPair.EncryptedPrivateKey;
                secretKeyResponse.KeyId = keySession.RSAKeyPair.Id;
            }

            return(MainResponse.GetSuccess(secretKeyResponse));
        }
Beispiel #8
0
        public IActionResult List(BaseRequest model)
        {
            IEnumerable <OrderReportReplaye> OrderReportList = _db.OrderReportReplayes.Where(x =>
                                                                                             (x.OrderReportId == model.OrderId) &&
                                                                                             (!model.From.HasValue || x.CreatedAt >= model.From) &&
                                                                                             (!model.To.HasValue || x.CreatedAt <= model.To)
                                                                                             ).Include(x => x.CreatedBy).ToList();

            IEnumerable <OrderReportReplayResponse> response = OrderReportList.Skip((model.PageNumber - 1) * model.PageSize).Take(model.PageSize).Select
                                                                   (x => new OrderReportReplayResponse
            {
                CreatedAt      = (DateTime)x.CreatedAt,
                CreatedById    = (long)x.CreatedById,
                CreatedByName  = x.CreatedBy.ClientFullName,
                ClientComments = x.ClientComment,
                Latitude       = x.DriverLatitude,
                Longitude      = x.DriverLongitude,
                OrderReportId  = x.OrderReportId
            }).ToList();
            int totalCount = OrderReportList.Count();

            if (response.Count() > 0)
            {
                MainResponse <IEnumerable <OrderReportReplayResponse> > finalResponse = new MainResponse <IEnumerable <OrderReportReplayResponse> >(response, totalCount);
                return(new OkObjectResult(finalResponse));
            }
            throw new Exception("لا يوجد ابلاغات");
        }
Beispiel #9
0
        public async Task <ActionResult <MainResponse> > GetContacts(GetContactsRequest request)
        {
            User user = HttpContext.GetUser();

            if (user == null)
            {
                return(Unauthorized());
            }

            Contact[] contacts = await _context.Contacts.Where(p => p.User1.Id == user.Id || p.User2.Id == user.Id).Skip(_serverConfig.Contacts.PartsSize.ContactsPerPart * (request.Part - 1)).Take(_serverConfig.Contacts.PartsSize.ContactsPerPart).ToArrayAsync().ConfigureAwait(false);

            List <ExtUser> extUsers = new List <ExtUser>();

            for (int i = 0; i < contacts.Length; i++)
            {
                extUsers.Add(contacts[i].User1.Id == user.Id ? (ExtUser)contacts[i].User2 : (ExtUser)contacts[i].User1);
                extUsers[i].Img?.SetPath(_serverConfig.General.ServerPath + _serverConfig.FileRoutes.UserImages.Route);
            }

            GetContactsResponse getContactsResponse = new GetContactsResponse()
            {
                Contacts = extUsers
            };

            return(MainResponse.GetSuccess(getContactsResponse));
        }
 public ExhibitorService(IExhibitorRepository exhibitorRepository, IAddressRepository addressRepository,
                         IExhibitorHorseRepository exhibitorHorseRepository, IHorseRepository horseRepository,
                         IGroupExhibitorRepository groupExhibitorRepository, IGlobalCodeRepository globalCodeRepository,
                         IExhibitorClassRepository exhibitorClassRepository, IClassRepository classRepository,
                         ISponsorExhibitorRepository sponsorExhibitorRepository, ISponsorRepository sponsorRepository,
                         IScanRepository scanRepository, IExhibitorPaymentDetailRepository exhibitorPaymentDetailRepository,
                         IApplicationSettingRepository applicationRepository, IEmailSenderRepository emailSenderRepository,
                         IClassSponsorRepository classSponsorRepository, IMapper mapper, IStallAssignmentRepository stallAssignmentRepository)
 {
     _exhibitorRepository              = exhibitorRepository;
     _addressRepository                = addressRepository;
     _exhibitorHorseRepository         = exhibitorHorseRepository;
     _horseRepository                  = horseRepository;
     _groupExhibitorRepository         = groupExhibitorRepository;
     _globalCodeRepository             = globalCodeRepository;
     _exhibitorClassRepository         = exhibitorClassRepository;
     _classRepository                  = classRepository;
     _sponsorExhibitorRepository       = sponsorExhibitorRepository;
     _sponsorRepository                = sponsorRepository;
     _scanRepository                   = scanRepository;
     _exhibitorPaymentDetailRepository = exhibitorPaymentDetailRepository;
     _applicationRepository            = applicationRepository;
     _emailSenderRepository            = emailSenderRepository;
     _classSponsorRepository           = classSponsorRepository;
     _mapper       = mapper;
     _mainResponse = new MainResponse();
     _stallAssignmentRepository = stallAssignmentRepository;
 }
Beispiel #11
0
        public async Task <ActionResult <MainResponse> > RemoveFromContacts(AddToContactsRequest request)
        {
            User user = HttpContext.GetUser();

            if (user == null)
            {
                return(StatusCode(401));
            }

            User friend = await _context.Users.FirstOrDefaultAsync(p => p.Id == request.Id);

            if (friend == null)
            {
                return(MainResponse.GetError(Enums.RequestError.UserNotFound));
            }

            if (await _context.Contacts.AnyAsync(p => (p.User1.Id == user.Id && p.User2.Id == friend.Id) || (p.User2.Id == user.Id && p.User1.Id == friend.Id)))
            {
                _context.Contacts.RemoveRange(_context.Contacts.Where(p => (p.User1.Id == user.Id && p.User2.Id == friend.Id) || (p.User2.Id == user.Id && p.User1.Id == friend.Id)));

                await _context.SaveChangesAsync().ConfigureAwait(false);
            }

            return(MainResponse.GetSuccess());
        }
Beispiel #12
0
        public async Task <ActionResult <MainResponse> > GetProfileData(GetProfileDataRequest request)
        {
            User user = await _context.Users.FirstOrDefaultAsync(p => p.Alias == request.UserAlias || p.Login == request.UserAlias);

            if (user == null)
            {
                return(MainResponse.GetError(Enums.RequestError.UserNotFound));
            }

            GetProfileResponse response = new GetProfileResponse()
            {
                UserData    = (ExtUser)user,
                UserProfile = user.UserProfile,
                Images      = new List <ExtFileData>()
            };

            response.UserData.Img?.SetPath(_serverConfig.General.ServerPath + _serverConfig.FileRoutes.UserImages.Route);

            FileData[] files = user.Files.Where(p => p.Type == Enums.FileType.Image).OrderByDescending(p => p.UploadDate).Take(_serverConfig.Users.PartsSize.PreviewImagesPartSize).ToArray();

            for (int i = 0; i < files.Length; i++)
            {
                response.Images.Add((ExtFileData)files[i]);
                response.Images[i].SetPath(_serverConfig.General.ServerPath + _serverConfig.FileRoutes.UserImages.Route);
            }
            return(MainResponse.GetSuccess(response));
        }
Beispiel #13
0
        public async Task <ActionResult <MainResponse> > GetConversations(GetChatsRequest request)
        {
            User user = HttpContext.GetUser();

            if (user == null || user.KeySession == null)
            {
                return(Unauthorized());
            }

            Chat[] chats = await _context.Chats.Where(p => p.EncryptionChatDatas.Where(c => c.KeySession != null && c.KeySession.Id == user.KeySession.Id).Count() > 0).OrderByDescending(p => p.LastMessageDate).Skip(_serverConfig.Chats.PartsSize.ChatsInPart * (request.Part - 1)).Take(_serverConfig.Chats.PartsSize.ChatsInPart).ToArrayAsync().ConfigureAwait(false);

            string[]  messageIds = chats.Select(p => p.LastMessageId).ToArray();
            Message[] messages   = await _context.Messages.Where(p => messageIds.Contains(p.Id)).ToArrayAsync();

            GetChatsResponse chatsResponse = new GetChatsResponse()
            {
                Chats = new List <ExtChat>()
            };

            EncryptionChatData encryptionChatData;

            for (int i = 0; i < chats.Length; i++)
            {
                encryptionChatData = chats[i].EncryptionChatDatas.FirstOrDefault(p => p?.KeySession?.Id == user.KeySession.Id);
                ExtChat extChat = (ExtChat)chats[i];
                extChat.LastMessage      = (ExtMessage)messages.FirstOrDefault(p => p.Id == chats[i].LastMessageId);
                extChat.EncryptedChatKey = encryptionChatData.AESEncryptedKey;
                extChat.Title            = encryptionChatData.EncryptedTitle;
                chatsResponse.Chats.Add(extChat);
            }

            return(MainResponse.GetSuccess(chatsResponse));
        }
        public async Task <IActionResult> EmailPasswordReset(ResetPasswordEmailRequest resetPasswordModel)
        {
            if (resetPasswordModel == null)
            {
                return(NotFound());
            }

            MainResponse passwordReset = await _identityService.EmailResetPassword(resetPasswordModel.Email, resetPasswordModel.Password, resetPasswordModel.Token);

            if (passwordReset.Success)
            {
                return(Ok(new SimpleSuccessResponse
                {
                    Success = true,
                    Message = "Password has been changed"
                }));
            }

            else
            {
                if (passwordReset.Errors.Count() > 1)
                {
                    return(BadRequest(new AuthenticationFailedResponse
                    {
                        Errors = passwordReset.Errors
                    }));
                }
                else
                {
                    return(BadRequest(passwordReset.Errors.ToList()[0]));
                }
            }
        }
Beispiel #15
0
        public async Task <ActionResult <MainResponse> > SetEndryptedPublicKey(SetEncryptedPublicKeyRequest request)
        {
            User user = HttpContext.GetUser();

            if (user == null)
            {
                return(Unauthorized());
            }

            User user1;

            for (int i = 0; i < request.EncryptedPublicKeys.Count; i++)
            {
                user1 = await _context.Users.FirstOrDefaultAsync(p => p.Id == request.EncryptedPublicKeys[i].UserId);

                if (user1 != null)
                {
                    if (!user.EncryptedPublicKeys.Any(p => p.RSAKeyPair.Id == user1.RSAKeyPair.Id))
                    {
                        EncryptedPublicKey encryptedPublicKey = new EncryptedPublicKey()
                        {
                            RSAKeyPair        = user1.RSAKeyPair,
                            EncryptedPubicKey = request.EncryptedPublicKeys[i].EncryptedPublicKey
                        };
                        _context.EncryptedPublicKeys.Add(encryptedPublicKey);
                        user.EncryptedPublicKeys.Add(encryptedPublicKey);
                        await _context.SaveChangesAsync();
                    }
                }
            }

            return(MainResponse.GetSuccess());
        }
Beispiel #16
0
        public async Task <ActionResult <MainResponse> > GetMessages(GetMessagesRequest request)
        {
            User user = HttpContext.GetUser();

            if (user.KeySession == null)
            {
                return(Unauthorized());
            }

            Chat chat = await _context.Chats.FirstOrDefaultAsync(p => p.Id == request.ChatId);

            if (chat == null)
            {
                return(MainResponse.GetError(Enums.RequestError.ChatNotFound));
            }

            Message[] messages = chat.Messages.OrderByDescending(p => p.Date).Skip(_serverConfig.Chats.PartsSize.MessagesInPart * (request.Part - 1)).Take(_serverConfig.Chats.PartsSize.MessagesInPart).ToArray();

            GetMessagesResponse getMessagesResponse = new GetMessagesResponse()
            {
                Messages = messages.GetExts()
            };

            return(MainResponse.GetSuccess(getMessagesResponse));
        }
Beispiel #17
0
        public async Task <ActionResult <MainResponse> > GetPublicKey(GetPublicKeyRequest request)
        {
            User user = HttpContext.GetUser();

            if (user == null)
            {
                return(Unauthorized());
            }

            User user1;

            GetPublicKeyResponse getPublicKeyResponse = new GetPublicKeyResponse()
            {
                PublicKeys = new List <GetPublicKeyResponseItem>()
            };

            for (int i = 0; i < request.UserIds.Count; i++)
            {
                user1 = await _context.Users.FirstOrDefaultAsync(p => p.Id == request.UserIds[i]);

                if (user1 != null)
                {
                    getPublicKeyResponse.PublicKeys.Add(new GetPublicKeyResponseItem()
                    {
                        PublicKey = user1.RSAKeyPair.PublicKey,
                        UserId    = user1.Id,
                        KeyId     = user1.RSAKeyPair.Id
                    });
                }
            }

            return(MainResponse.GetSuccess(getPublicKeyResponse));
        }
Beispiel #18
0
 public SponsorExhibitorService(ISponsorExhibitorRepository SponsorExhibitorRepository, ISponsorRepository SponsorRepository, IMapper Mapper)
 {
     _SponsorExhibitorRepository = SponsorExhibitorRepository;
     _SponsorRepository          = SponsorRepository;
     _Mapper       = Mapper;
     _mainResponse = new MainResponse();
 }
        public ActionResult AddExhibitorToClass(AddExhibitorToClass addExhibitorToClass)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.AddExhibitorToClass(addExhibitorToClass, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public ActionResult UpdateFinancialTransaction(UpdateFinancialRequest updateFinancialRequest)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.UpdateFinancialTransaction(updateFinancialRequest, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public ActionResult UploadFinancialDocument([FromForm] FinancialDocumentRequest financialDocumentRequest)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.UploadFinancialDocument(financialDocumentRequest, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public ActionResult RemoveExhibitorTransaction(int exhibitorPaymentId)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.RemoveExhibitorTransaction(exhibitorPaymentId, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public ActionResult DeleteUploadedDocuments([FromBody] DocumentDeleteRequest documentDeleteRequest)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.DeleteUploadedDocuments(documentDeleteRequest, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public ActionResult AddUpdateSponsorForExhibitor(AddSponsorForExhibitor addSponsorForExhibitor)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.AddSponsorForExhibitor(addSponsorForExhibitor, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
Beispiel #25
0
        public IActionResult DeleteAssignedStall(int StallAssignmentId)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _stallAssignmentService.DeleteAssignedStall(StallAssignmentId);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public ActionResult UpdateScratch(UpdateScratch updateScratch)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.UpdateScratch(updateScratch, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public ActionResult DeleteExhibitorHorse(int exhibitorHorseId)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.DeleteExhibitorHorse(exhibitorHorseId, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public ActionResult AddUpdateExhibitor([FromBody] ExhibitorRequest request)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.AddUpdateExhibitor(request, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public ActionResult RemoveSponsorFromExhibitor(int sponsorExhibitorId)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _exhibitorService.RemoveSponsorFromExhibitor(sponsorExhibitorId, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
Beispiel #30
0
        public IActionResult AddUpdateHorse(HorseAddRequest horseAddRequest)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _horseService.AddUpdateHorse(horseAddRequest, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }