예제 #1
0
        public GeneralResponse QueueUpdatePersianName(IEnumerable <EditQueueRequest> requests)
        {
            GeneralResponse response = new GeneralResponse();

            try
            {
                foreach (var request in requests)
                {
                    Queue queue = new Queue();
                    queue = _queueRepository.FindBy(request.ID);
                    if (queue != null)
                    {
                        queue.PersianName = request.PersianName;
                    }
                    _queueRepository.Save(queue);
                }

                _uow.Commit();
            }
            catch (Exception ex)
            {
                response.ErrorMessages.Add(ex.Message);
                if (ex.InnerException != null)
                {
                    response.ErrorMessages.Add(ex.InnerException.Message);
                }
            }
            return(response);
        }
        public GeneralResponse AddQueueLocalPhoneStore(IEnumerable <AddQueueLocalPhoneRequest> requests, Guid OwnerEmployeeID,
                                                       Guid EmployeeID)
        {
            GeneralResponse response = new GeneralResponse();

            try
            {
                foreach (var request in requests)
                {
                    QueueLocalPhoneStore queueLocalPhoneStore = new QueueLocalPhoneStore();
                    queueLocalPhoneStore.ID               = Guid.NewGuid();
                    queueLocalPhoneStore.CreateDate       = PersianDateTime.Now;
                    queueLocalPhoneStore.CreateEmployee   = _employeeRepository.FindBy(EmployeeID);
                    queueLocalPhoneStore.DangerousRing    = request.DangerousRing;
                    queueLocalPhoneStore.DangerousSeconds = request.DangerousSeconds;
                    queueLocalPhoneStore.OwnerEmployee    =
                        _employeeRepository.FindBy(OwnerEmployeeID);
                    queueLocalPhoneStore.Queue      = _queueRepository.FindBy(request.QueueID);
                    queueLocalPhoneStore.RowVersion = 1;
                    queueLocalPhoneStore.SendSmsToOffLineUserOnDangerous = request.SendSmsToOffLineUserOnDangerous;
                    queueLocalPhoneStore.SendSmsToOnLineUserOnDangerous  = request.SendSmsToOnLineUserOnDangerous;
                    queueLocalPhoneStore.SmsText      = request.Smstext;
                    queueLocalPhoneStore.CanViewQueue = request.CanViewQueue;

                    _queueLocalPhoneStoreRepository.Add(queueLocalPhoneStore);
                }

                _uow.Commit();
            }
            catch (Exception ex)
            {
                response.ErrorMessages.Add(ex.Message);
                if (ex.InnerException != null)
                {
                    response.ErrorMessages.Add(ex.InnerException.Message);
                }
            }

            return(response);
        }