/// <summary>
        ///
        /// </summary>
        /// <param name="childrenInformation"></param>
        /// <returns></returns>
        public IChildrenInformationView CreateChildrenInformationById(IChildrenModel childrenInformation)
        {
            if (childrenInformation == null)
            {
                throw new ArgumentNullException(nameof(childrenInformation));
            }

            var view = new ChildrenInformationView
            {
                EmployeeId        = childrenInformation.EmployeeId,
                Address           = childrenInformation.Address,
                Email             = childrenInformation.Email,
                Mobile            = childrenInformation.Mobile,
                DateOfBirth       = childrenInformation.DateOfBirth,
                DateCreated       = childrenInformation.DateCreated,
                IsApproved        = false,
                DateModified      = childrenInformation.DateModified,
                IsActive          = childrenInformation.IsActive,
                ChildName         = childrenInformation.ChildName,
                ChildrenId        = childrenInformation.ChildrenId,
                ProcessingMessage = "",
            };

            return(view);
        }
Пример #2
0
        public ActionResult EditChildrenInformation(ChildrenInformationView information, string url)
        {
            if (information == null)
            {
                throw new ArgumentNullException(nameof(information));
            }


            //if (!ModelState.IsValid)
            //{
            //    // call service to generate the View and return Back
            //    var viewModel = this.employeeService.CreateChildrenInformationView(information, string.Empty);

            //    // return view
            //    return View("EditChildrenInformation", viewModel);
            //}

            //Register New Company
            var processingMessage = this.employeeService.ProcessEditChildrenInformation(information);

            ////Check If there is a Message from the Service
            //if (!string.IsNullOrEmpty(processingMessage))
            //{
            //    // call service to update parentCompany drop down list
            //    var viewModel = this.employeeService.CreateChildrenInformationView(information, processingMessage);

            //    // return the view
            //    return this.View("EditChildrenInformation", viewModel);
            //}

            var returnMessage = string.Format("Children Information Edited successfully");

            return(Redirect(url + "&message=" + returnMessage));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="employeeId"></param>
        /// <returns></returns>
        public IChildrenInformationView CreateChildrenInformation(int employeeId, string message)
        {
            if (employeeId <= 0)
            {
                throw new ArgumentNullException(nameof(employeeId));
            }

            var viewModel = new ChildrenInformationView
            {
                EmployeeId        = employeeId,
                ProcessingMessage = message
            };

            return(viewModel);
        }
Пример #4
0
        public ActionResult DeleteChildrenInformation(ChildrenInformationView information, string url)
        {
            if (information == null)
            {
                throw new ArgumentOutOfRangeException("employeeId");
            }

            var deleteBeneficiaries = this.employeeService.ProcessDeleteChildrenInformation(information);


            var returnMessage = string.Format(" Children Information Deleted");


            return(Redirect(url + "&message=" + returnMessage));
        }