예제 #1
0
        public async Task <ResponseAC> EditOperatorCallLog(long userId, OperatorCallLogDetailAC operatorCallLogDetailAC, string loginUserName)
        {
            ResponseAC      response     = new ResponseAC();
            Operatorcalllog operatorCall = await _dbTeleBilling_V01Context.Operatorcalllog.FirstAsync(x => x.Id == operatorCallLogDetailAC.Id);

            #region Transaction Log Entry
            if (operatorCall.TransactionId == null)
            {
                operatorCall.TransactionId = _iLogManagement.GenerateTeleBillingTransctionID();
            }

            var jsonSerailzeObj = JsonConvert.SerializeObject(operatorCall);
            await _iLogManagement.SaveRequestTraseLog(Convert.ToInt64(operatorCall.TransactionId), userId, Convert.ToInt64(EnumList.TransactionTraseLog.UpdateRecord), jsonSerailzeObj);

            #endregion

            operatorCall             = _mapper.Map(operatorCallLogDetailAC, operatorCall);
            operatorCall.UpdatedBy   = userId;
            operatorCall.UpdatedDate = DateTime.Now;

            _dbTeleBilling_V01Context.Update(operatorCall);
            await _dbTeleBilling_V01Context.SaveChangesAsync();

            await _iLogManagement.SaveAuditActionLog((int)EnumList.AuditLogActionType.EditOperatorCallLog, loginUserName, userId, "Operator call log(Dialed Number:" + operatorCall.DialedNumber + "Extensino Number:" + operatorCall.ExtensionNumber + ")", (int)EnumList.ActionTemplateTypes.Edit, operatorCall.Id);

            response.Message    = _iStringConstant.OperatorCallLogUpdateSuccessfully;
            response.StatusCode = Convert.ToInt16(EnumList.ResponseType.Success);
            return(response);
        }
예제 #2
0
        public async Task <IActionResult> EditOperatorCallLog(OperatorCallLogDetailAC operatorCallLogDetailAC)
        {
            string userId = HttpContext.User.Claims.FirstOrDefault(c => c.Type == "user_id").Value;

            operatorCallLogDetailAC.CallDate = operatorCallLogDetailAC.CallDate.AddDays(1);
            string fullname = HttpContext.User.Claims.FirstOrDefault(c => c.Type == "fullname").Value;

            return(Ok(await _iOperatorRepository.EditOperatorCallLog(Convert.ToInt64(userId), operatorCallLogDetailAC, fullname)));
        }
예제 #3
0
        public async Task <OperatorCallLogDetailAC> GetOperatorCallLog(long id)
        {
            Operatorcalllog operatorCallLog = await _dbTeleBilling_V01Context.Operatorcalllog.Include(x => x.Employee).Include(x => x.Employee.Department).FirstAsync(x => x.Id == id);

            OperatorCallLogDetailAC operatorCallLogDetailAC = _mapper.Map <OperatorCallLogDetailAC>(operatorCallLog);

            operatorCallLogDetailAC.EmployeeAC             = new EmployeeAC();
            operatorCallLogDetailAC.EmployeeAC.FullName    = operatorCallLog.Employee.FullName;
            operatorCallLogDetailAC.EmployeeAC.Department  = operatorCallLog.Employee.Department.Name;
            operatorCallLogDetailAC.EmployeeAC.EmpPfnumber = operatorCallLog.Employee.EmpPfnumber;
            operatorCallLogDetailAC.EmployeeAC.UserId      = operatorCallLog.Employee.UserId;
            return(operatorCallLogDetailAC);
        }
예제 #4
0
        public async Task <ResponseAC> AddOperatorCallLog(long userId, OperatorCallLogDetailAC operatorCallLogDetailAC, string loginUserName)
        {
            ResponseAC      response     = new ResponseAC();
            Operatorcalllog operatorCall = _mapper.Map <Operatorcalllog>(operatorCallLogDetailAC);

            operatorCall.CreatedBy     = userId;
            operatorCall.CreatedDate   = DateTime.Now;
            operatorCall.TransactionId = _iLogManagement.GenerateTeleBillingTransctionID();
            await _dbTeleBilling_V01Context.AddAsync(operatorCall);

            await _dbTeleBilling_V01Context.SaveChangesAsync();

            await _iLogManagement.SaveAuditActionLog((int)EnumList.AuditLogActionType.AddOperatorCallLog, loginUserName, userId, "Operator call log(Dialed Number:" + operatorCall.DialedNumber + "Extensino Number:" + operatorCall.ExtensionNumber + ")", (int)EnumList.ActionTemplateTypes.Add, operatorCall.Id);

            response.Message    = _iStringConstant.OperatorCallLogAddedSuccessfully;
            response.StatusCode = Convert.ToInt16(EnumList.ResponseType.Success);
            return(response);
        }