예제 #1
0
        public JsonResult SaveTaskDetails(FormCollection form)
        {
            var loggedInuser = (UserViewModal)Session["User"];
            TaskDetailsByWeekPeriodViewModal taskDetail = new TaskDetailsByWeekPeriodViewModal();

            taskDetail.EmployerID       = loggedInuser.EmployerID;
            taskDetail.EmployeeID       = loggedInuser.Id;
            taskDetail.EmployeeName     = Convert.ToString(form["EmployeeName"].ToString());
            taskDetail.WeekPeriod       = Convert.ToString(form["WeekPeriod"].ToString());
            taskDetail.HoursBilled      = Convert.ToDecimal(form["HoursBilled"] != null ? form["HoursBilled"].ToString() : "0");
            taskDetail.TaskDetails      = Convert.ToString(form["TaskDetails"].ToString());
            taskDetail.AnyIssues        = Convert.ToString(form["AnyIssues"].ToString());
            taskDetail.Solution         = Convert.ToString(form["Solution"].ToString());
            taskDetail.PercentCompleted = Convert.ToString(form["PercentCompleted"].ToString());
            taskDetail.SubmissionDate   = Convert.ToDateTime(form["SubmissionDate"] != "null" ? form["SubmissionDate"].ToString() : "1970/1/1");
            taskDetail.TaskContinueFromLastWeekPeriod = Convert.ToString(form["TaskContinueFromLastWeekPeriod"].ToString());
            taskDetail.TaskContinueToNextWeekPeriod   = Convert.ToString(form["TaskContinueToNextWeekPeriod"].ToString());



            var result = _taskRepo.AddUpdateTaskDetails(taskDetail);

            if (result == -1)
            {
                SendTaskReportedEmail(loggedInuser.PrimaryEmail, taskDetail);
                return(Json(new { Code = 1, Message = "Task Details are saved successfully." }));
            }
            else
            {
                return(Json(new { Code = 0, Message = "Something wrong occured! Please try again!" }));
            }
        }
예제 #2
0
 public int UpdateTaskReview(TaskDetailsByWeekPeriodViewModal taskDetails)
 {
     using (var db = new E2EWebPortalEntities())
     {
         return(db.sp_UpdateTaskReview(taskDetails.EmployerID, taskDetails.ReviewerID, taskDetails.EmployeeID, taskDetails.TaskID, taskDetails.WeekPeriod, taskDetails.TaskSubmissionStatus, taskDetails.ReviewDate, taskDetails.ReviewerComments));
     }
 }
        private void SendTaskReviewedEmailToReviewer(string email, TaskDetailsByWeekPeriodViewModal task)
        {
            string emailBody = "Hi, You have been reviewed task successfully. Below are details for task. <br/><br/>"
                               + "Beneficiary Name: " + task.EmployeeName + "<br/>"
                               + "Week Period: " + task.WeekPeriod + "<br/>"
                               + "Task Status: " + task.TaskSubmissionStatus + " " + task.ReviewerName + ", " + (task.ReviewDate.HasValue ? task.ReviewDate.Value.ToShortDateString() : "") + "<br/>"
                               + "<br/><br/> Regards,<br/> E2EWebPortal";
            string From = ConfigurationManager.AppSettings["FromEmail"] != null ? ConfigurationManager.AppSettings["FromEmail"].ToString() : "";

            EmailHelper.SendEmail(From, email, "Task Reviewed", emailBody, null, "", true);
        }
예제 #4
0
        private void SendTaskReportedEmail(string email, TaskDetailsByWeekPeriodViewModal task)
        {
            string emailBody = "Hi, You have successfully reported your task. Below are details for your task. <br/><br/>"
                               + "Beneficiary Name: " + task.EmployeeName + "<br/>"
                               + "Week Period: " + task.WeekPeriod + "<br/>"
                               + "Task Status: Task Reported.<br/>"
                               + "Hours Worked: " + task.HoursBilled + "<br/>"
                               + "Percent Completed: " + task.PercentCompleted + "<br/>"
                               + "<br/><br/> Regards,<br/> E2EWebPortal";
            string From = ConfigurationManager.AppSettings["FromEmail"] != null ? ConfigurationManager.AppSettings["FromEmail"].ToString() : "";

            EmailHelper.SendEmail(From, email, "Task Reported", emailBody, null, "", true);
        }
예제 #5
0
        private void SendTaskReportedEmail(string email, TaskDetailsByWeekPeriodViewModal task)
        {
            string emailBody = "Hi " + task.EmployeeName + ", <br/><br/>This is to confirm that you have successfully reported task details for following week period. This task details will be reviewed by employer’s designated reviewer. <br/><br/>"
                               + "End-Client Name: " + task.EndClientBusinessName + "<br/>"
                               + "Week Period: " + task.WeekPeriod.Substring(0, 24) + "<br/>"
                               + "Task Status: Task Reported<br/>"
                               + "Hours Worked: " + task.HoursBilled + "<br/>"
                               + "Percent Completed: " + task.PercentCompleted + "<br/>"
                               + "<br/><br/>Thank you!!<br/> " + task.EmployerName
                               + "<br/><br/>IMPORTANT NOTICE:  The information contained in this electronic e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or legally protected.  If any reader of this communication is not the intended recipient, unauthorized use, disclosure, or copying is strictly prohibited, and may be unlawful.  If you have received this communication in error, please immediately notify the sender by replying this e-mail or forwarding this email to [email protected] with subject 'OPT-OUT'. Also,delete the original message and all copies from your system.";

            string From = ConfigurationManager.AppSettings["FromEmail"] != null ? ConfigurationManager.AppSettings["FromEmail"].ToString() : "";

            EmailHelper.SendEmail(From, email, "Task Reported – Week period : " + task.WeekPeriod.Substring(0, 24), emailBody, null, "", true);
        }
예제 #6
0
 public int AddUpdateTaskDetails(TaskDetailsByWeekPeriodViewModal taskDetails)
 {
     using (var db = new E2EWebPortalEntities())
     {
         return(db.sp_AddUpdateTaskDetails(taskDetails.EmployerID
                                           , taskDetails.EmployeeID
                                           , taskDetails.WeekPeriod
                                           , taskDetails.HoursBilled
                                           , taskDetails.TaskDetails
                                           , taskDetails.AnyIssues
                                           , taskDetails.Solution
                                           , taskDetails.PercentCompleted
                                           , taskDetails.SubmissionDate
                                           , taskDetails.TaskContinueFromLastWeekPeriod
                                           , taskDetails.TaskContinueToNextWeekPeriod));
     }
 }
예제 #7
0
        private void SendTaskReviewedEmailToReviewer(string email, TaskDetailsByWeekPeriodViewModal task)
        {
            string emailBody = "Hi, <br/><br/You have been reviewed task successfully. Below are details for task. <br/><br/>"
                               + "End-Client Name: " + task.EndClientBusinessName + "<br/>"
                               + "Beneficiary Name: " + task.EmployeeName + "<br/>"
                               + "Week Period: " + task.WeekPeriod + "<br/>"
                               + "Task Status: " + task.TaskSubmissionStatus + "<br/>"
                               + "Reviewer: " + task.ReviewerName + "<br/>"
                               + "Review Date: " + (task.ReviewDate.HasValue ? task.ReviewDate.Value.ToShortDateString() : "") + "<br/>"
                               + "<br/><br/>If Task status is ‘Task Completed’, no additional action needed. "
                               + "<br/>If Task status is ‘Task Re-assigned’, please take an action as mentioned and resubmit task details with required information. "
                               + "<br/><br/> If you have any additional questions regarding this week task submission and review, please contact to your Employer Administrator or Reviewer."
                               + "<br/><br/> Thank you!!<br/>" + task.EmployerName
                               + "<br/><br/>IMPORTANT NOTICE:  The information contained in this electronic e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or legally protected.  If any reader of this communication is not the intended recipient, unauthorized use, disclosure, or copying is strictly prohibited, and may be unlawful.  If you have received this communication in error, please immediately notify the sender by replying this e-mail or forwarding this email to [email protected] with subject 'OPT-OUT'. Also,delete the original message and all copies from your system.";
            string From = ConfigurationManager.AppSettings["FromEmail"] != null ? ConfigurationManager.AppSettings["FromEmail"].ToString() : "";

            EmailHelper.SendEmail(From, email, "Task Reviewed – Week period : " + task.WeekPeriod, emailBody, null, "", true);
        }
예제 #8
0
        public JsonResult SaveTaskDetails(FormCollection form)
        {
            var loggedInuser      = (UserViewModal)Session["User"];
            var NumberOfTask      = Convert.ToString(form["NumberOfTask"].ToString());
            var TaskIds           = Convert.ToString(form["TaskIds"].ToString()).Split(',');
            var CurrentWeekPeriod = Convert.ToString(form["CurrentWeekPeriod"].ToString());

            TaskDetailsByWeekPeriodViewModal taskDetail = new TaskDetailsByWeekPeriodViewModal();

            taskDetail.EmployerID = loggedInuser.EmployerID;
            taskDetail.ReviewerID = loggedInuser.Id;
            taskDetail.WeekPeriod = CurrentWeekPeriod;


            foreach (string taskId in TaskIds)
            {
                var IsChecked = Convert.ToString(form["SelectTask_" + taskId].ToString());
                if (IsChecked != "1")
                {
                    continue;
                }
                taskDetail.EmployeeID           = Convert.ToInt16(form["EmployeeID_" + taskId] != null ? form["EmployeeID_" + taskId].ToString() : "0");
                taskDetail.TaskID               = Convert.ToInt16(form["TaskID_" + taskId] != null ? form["TaskID_" + taskId].ToString() : "0");
                taskDetail.TaskSubmissionStatus = Convert.ToString(form["TaskSubmissionStatus_" + taskId].ToString());
                taskDetail.ReviewDate           = Convert.ToDateTime(form["ReviewDate_" + taskId] != "null" ? form["ReviewDate_" + taskId].ToString() : "1970/1/1");
                taskDetail.ReviewerComments     = Convert.ToString(form["ReviewerComments_" + taskId].ToString());
                taskDetail.EmployeeName         = Convert.ToString(form["EmployeeName_" + taskId].ToString());
                taskDetail.ReviewerName         = Convert.ToString(form["ReviewerName_" + taskId].ToString());

                taskDetail.EmployerName          = Convert.ToString(form["EmployerName_" + taskId].ToString());
                taskDetail.EndClientBusinessName = Convert.ToString(form["EndClientBusinessName_" + taskId].ToString());

                var result   = _taskRepo.UpdateTaskReview(taskDetail);
                var employee = _userRepo.GetEmployeeByID(taskDetail.EmployeeID);
                SendTaskReviewedEmail(employee.PrimaryEmail, taskDetail);
                SendTaskReviewedEmailToReviewer(loggedInuser.PrimaryEmail, taskDetail);
            }

            return(Json(new { Code = 1, Message = "Task Details are saved successfully." }));
        }