/// <summary>
        /// Adds the claim note.
        /// </summary>
        /// <param name="claimNote">The claim note.</param>
        /// <returns></returns>
        public ClaimNote AddClaimNote(ClaimNote claimNote)
        {
            ClaimNote responseClaimNote = new ClaimNote();

            //Checks if input request is not null
            if (claimNote != null)
            {
                _databaseCommand = _databaseObj.GetStoredProcCommand("AddClaimNote");
                // Pass parameters to Stored Procedure(i.e., @ParamName), add values for
                _databaseObj.AddInParameter(_databaseCommand, "@ClaimID ", DbType.Int64, claimNote.ClaimId);
                _databaseObj.AddInParameter(_databaseCommand, "@ClaimNoteText", DbType.String, claimNote.ClaimNoteText.ToTrim());
                _databaseObj.AddInParameter(_databaseCommand, "@UserName", DbType.String, claimNote.UserName.ToTrim());
                _databaseObj.AddInParameter(_databaseCommand, "@FacilityName", DbType.String, claimNote.FacilityName);
                // Retrieve the results of the Stored Procedure in Datatable
                DataSet contractNotesDataSet = _databaseObj.ExecuteDataSet(_databaseCommand);

                if (contractNotesDataSet.IsTableDataPopulated(0))
                {
                    string localDateTime = Utilities.GetLocalTimeString(claimNote.CurrentDateTime,
                                                                        Convert.ToDateTime(contractNotesDataSet.Tables[0].Rows[0]["InsertDate"].ToString()));
                    responseClaimNote.ClaimNoteId = long.Parse(contractNotesDataSet.Tables[0].Rows[0]["InsertedId"].ToString());
                    responseClaimNote.InsertDate  = Convert.ToDateTime(localDateTime);
                }
            }
            //returns response to Business layer
            return(responseClaimNote);
        }
        public JsonResult DeleteClaimNote(int id)
        {
            ClaimNote claimNote = new ClaimNote {
                ClaimNoteId = id, UserName = GetCurrentUserName(), FacilityName = GetCurrentFacilityName()
            };
            bool isSuccess = PostApiResponse <bool>(Constants.ClaimSelection, Constants.DeleteClaimNote, claimNote);

            return(Json(new { sucess = isSuccess }));
        }
        public void DeleteClaimNoteTest()
        {
            var       repository     = new Mock <IClaimSelectorRepository>();
            ClaimNote claimNoteInput = new ClaimNote
            {
                ClaimId         = 421569877,
                ClaimNoteText   = "Test Claim Note",
                CurrentDateTime = DateTime.Now.ToLongDateString()
            };

            repository.Setup(x => x.DeleteClaimNote(claimNoteInput)).Returns(true);
            var mockAdjudicationEngine = new Mock <IAdjudicationEngine>();
            ClaimSelectorLogic target  = new ClaimSelectorLogic(repository.Object, mockAdjudicationEngine.Object);
            var result = target.DeleteClaimNote(claimNoteInput);

            Assert.IsTrue(result);
        }
        public JsonResult SaveClaimNote(ClaimNote claimNote)
        {
            //Get the Name of User logged in
            claimNote.UserName     = GetCurrentUserName();
            claimNote.FacilityName = GetCurrentFacilityName();
            ClaimNote responseClaimNote = PostApiResponse <ClaimNote>(Constants.ClaimSelection, Constants.AddClaimNote, claimNote);

            if (responseClaimNote.ClaimNoteId > 0)
            {
                return
                    (Json(
                         new
                {
                    sucess = true,
                    Id = responseClaimNote.ClaimNoteId,
                    userName = GetCurrentUserName(),
                    insertedTime = Convert.ToDateTime(responseClaimNote.InsertDate).ToString(Constants.DateTimeFormatWithSecond)
                }));
            }
            return(Json(new { sucess = false }));
        }
        /// <summary>
        /// Deletes the claim note.
        /// </summary>
        /// <param name="claimNote">The claim note.</param>
        /// <returns></returns>
        public bool DeleteClaimNote(ClaimNote claimNote)
        {
            //holds the response data
            bool returnvalue = false;

            // Initialize the Stored Procedure
            _databaseCommand = _databaseObj.GetStoredProcCommand("DeleteClaimNoteByID");
            // Pass parameters to Stored Procedure(i.e., @ParamName), add values for
            _databaseObj.AddInParameter(_databaseCommand, "@ClaimNoteID ", DbType.Int64, claimNote.ClaimNoteId);
            _databaseObj.AddInParameter(_databaseCommand, "@UserName ", DbType.String, claimNote.UserName);
            _databaseObj.AddInParameter(_databaseCommand, "@FacilityName", DbType.String, claimNote.FacilityName);
            // Retrieve the results of the Stored Procedure in Datatable
            int updatedRow = _databaseObj.ExecuteNonQuery(_databaseCommand);

            //returns response to Business layer
            if (updatedRow > 0)
            {
                returnvalue = true;
            }
            //returns false if any exception occurs
            return(returnvalue);
        }
Exemplo n.º 6
0
        public static ClaimNote Map(ClaimNotesViewModel viewModel, ClaimNote entity)
        {
            if (viewModel == null || entity == null)
            {
                return(null);
            }

            entity.NoteId         = viewModel.NoteId;
            entity.ClaimId        = viewModel.ClaimId;
            entity.Title          = viewModel.Title;
            entity.Description    = viewModel.Description;
            entity.IsTask         = !string.IsNullOrWhiteSpace(viewModel.Type) && viewModel.Type.Equals("Task", StringComparison.InvariantCultureIgnoreCase) ? true : false;
            entity.TaskDueDate    = !string.IsNullOrWhiteSpace(viewModel.Type) && viewModel.Type.Equals("Task", StringComparison.InvariantCultureIgnoreCase) ? DateTime.ParseExact(viewModel.TaskEndDate, "M/d/yyyy", CultureInfo.InvariantCulture) : (DateTime?)null;
            entity.AssignedTo     = viewModel.AssignedToUser != null ? viewModel.AssignedToUser.UserId : null;
            entity.CreatedDate    = !string.IsNullOrWhiteSpace(viewModel.CreatedDate) ? viewModel.CreatedDate : DateTime.Now.Date.ToString("M/d/yyyy");
            entity.CreatedBy      = viewModel.CreatedBy;
            entity.CreatedOn      = viewModel.CreatedOn;
            entity.LastModifiedBy = viewModel.LastModifiedBy;
            entity.LastModifiedOn = viewModel.LastModifiedOn;
            entity.IsActive       = viewModel.IsActive;

            return(entity);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Deletes the claim note.
 /// </summary>
 /// <param name="claimNote">The claim note.</param>
 /// <returns></returns>
 public bool DeleteClaimNote(ClaimNote claimNote)
 {
     return(_claimSelectorRepository.DeleteClaimNote(claimNote));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Adds the claim note.
 /// </summary>
 /// <param name="claimNote">The claim note.</param>
 /// <returns></returns>
 public ClaimNote AddClaimNote(ClaimNote claimNote)
 {
     return(_claimSelectorRepository.AddClaimNote(claimNote));
 }
 public bool DeleteClaimNote(ClaimNote claimNote)
 {
     return(_claimSelectorLogic.DeleteClaimNote(claimNote));
 }
 public ClaimNote AddClaimNote(ClaimNote claimNote)
 {
     return(_claimSelectorLogic.AddClaimNote(claimNote));
 }