Exemple #1
0
        public int ManageReportingTo(ReportingToViewModel reportingToViewModel)
        {
            int isManaged = 0;

            try
            {
                if (!reportingToViewModel.IsUserDelete)
                {
                    isManaged = _context.usp_UsersReporting_Insert(reportingToViewModel.UserID,
                                                                   reportingToViewModel.RepotingToUserID, reportingToViewModel.IsDirectReportingTo,
                                                                   reportingToViewModel.ManagedBy);
                }
                else
                {
                    isManaged = _context.usp_UsersReporting_DeletetByUserID(reportingToViewModel.UserID,
                                                                            reportingToViewModel.RepotingToUserID);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(isManaged);
        }