public ActionResult AssignCourseToUser(string jsonData, int id)
        {
            try
            {
                TblUser              sessionUser     = (TblUser)Session["UserSession"];
                List <tblCourse>     objCourse       = new List <tblCourse>();
                JavaScriptSerializer json_serializer = new JavaScriptSerializer();
                json_serializer.MaxJsonLength = int.MaxValue;
                object[] objData = null;
                if (!string.IsNullOrEmpty(jsonData))
                {
                    objData = (object[])json_serializer.DeserializeObject(jsonData);
                }
                var result = cc.AssignCourseTouser(objData, id);
                //if (result == 1)
                //{
                //    // TblUser sessionUser = (TblUser)Session["UserSession"];
                //    var lstTemplate = etr.GetEmailTemplateAssigns(sessionUser.TenantId);
                //    objCourse = cc.GetCourseById(id);
                //    foreach (Dictionary<string, object> item in objData)
                //    {
                //        var emailBody = lstTemplate[3].EmailBody;
                //        var objUser = userRepository.GetUserById(Convert.ToInt32(item["LearnerId"]));
                //        emailBody = emailBody.Replace("{UserName}", objUser[0].FirstName + " " + objUser[0].LastName);
                //        emailBody = emailBody.Replace("{CourseName}", objCourse[0].ContentModuleName);
                //        emailBody = emailBody.Replace("{DueDate}", Convert.ToString(item["DueDate"]));
                //        emailBody = emailBody.Replace("{Admin}", objUser[0].TenantName);
                //        var emailSubject = lstTemplate[3].EmailSubject + "-" + objCourse[0].ContentModuleName;
                //        tblEmails objEmail = new tblEmails();

                //        objEmail.EmailTo = objUser[0].EmailId;
                //        objEmail.EmailSubject = emailSubject;
                //        objEmail.EmailBody = emailBody;
                //        objEmail.Activityid = id;
                //        objEmail.Activitytype = "Course";
                //        objEmail.Duedate = Convert.ToDateTime(item["DueDate"]);
                //        bool status = cc.CheckInsertEmail(objEmail);
                //        if (status)
                //        {

                //        }
                //        else
                //        {
                //            var emailResult = userRepository.InsertEmail(objEmail);
                //        }

                //    }
                //}
            }
            catch (Exception ex)
            {
                newException.AddException(ex);
            }

            return(Json(HttpStatusCode.OK, JsonRequestBehavior.AllowGet));
        }