Example #1
0
        /// <summary>
        /// Creates the edit type of exit view.
        /// </summary>
        /// <param name="typeOfExit">The type of exit.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">typeOfExit</exception>
        public ITypeOfExitView CreateEditTypeOfExitView(ITypeOfExit typeOfExit)
        {
            if (typeOfExit == null)
            {
                throw new ArgumentNullException(nameof(typeOfExit));
            }

            var viewResult = new TypeOfExitView
            {
                TypeOfExitId   = typeOfExit.TypeOfExitId,
                TypeOfExitName = typeOfExit.TypeOfExitName,
                CompanyId      = typeOfExit.CompanyId,
                IsActive       = typeOfExit.IsActive
            };

            return(viewResult);
        }
Example #2
0
        /// <summary>
        /// </summary>
        /// <param name="companyCollection"></param>
        /// <param name="typeOfExitCollection"></param>
        /// <param name="employeeCollection"></param>
        /// <param name="typeOfExitInfo"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public ITypeOfExitView CreateTypeOfExitView(int companyId, IList <ITypeOfExit> typeOfExitCollection, IList <IEmployee> employeeCollection, ITypeOfExit typeOfExitInfo, string message)
        {
            //if (typeOfExitId == null) throw new ArgumentNullException(nameof(typeOfExitId));

            var employeeDDL   = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var typeOfExitDDL = GetDropDownList.TypeOfExitListItems(typeOfExitCollection, -1);

            var viewModel = new TypeOfExitView
            {
                EmployeeDropDown    = employeeDDL,
                InterViewerDropDown = employeeDDL,
                ProcessingMessage   = string.Empty,
                CompanyId           = companyId
            };

            return(viewModel);
        }