public JsonResult UploadAssignments(StudentUploadAssignment Info) { ResultInfo <string> ResultInfo = new ResultInfo <string>() { Status = false, Description = "Failed|Login" }; try { if (Info != null) { SchoolStudent Obj = new SchoolStudent(); ResultInfo.Info = Obj.UploadAssignment(Info); if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Updation Sucess"; ResultInfo.Status = true; } } } catch (Exception ex) { } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
static void Main() { Console.WriteLine("What kind of student are you"); Console.WriteLine("1. School Student"); Console.WriteLine("2. College Student"); Console.WriteLine("Enter Your Choice"); int Choice = int.Parse(Console.ReadLine()); switch (Choice) { case 1: { Console.WriteLine("Enter Your details: in the order Class, RollNo, Full Name"); var SStud = new SchoolStudent(int.Parse(Console.ReadLine())); Console.WriteLine("The Details you entered are :"); SStud.DisplayDetails(); } break; case 2: { Console.WriteLine("Enter Your details: in the order Course, Year, RollNo, Full Name"); var CStud = new CollegeStudent(Console.ReadLine(), int.Parse(Console.ReadLine())); Console.WriteLine("The Details you entered are :"); CStud.DisplayDetails(); } break; default: Console.WriteLine("Error in choice"); break; } }
public JsonResult RefreshComment(long CommentID, long UID) { ResultInfo <SubjectForumTopicComment> ResultInfo = new ResultInfo <SubjectForumTopicComment>() { Status = false, Description = "Failed|Login" }; SchoolStudent PageObj = new SchoolStudent(); SubjectForumTopicComment temp = new SubjectForumTopicComment(); if (CommentID != 0) { temp = PageObj.RefreshCommentByUserID(CommentID, UID); ResultInfo.Info = temp; if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Get Details "; ResultInfo.Status = true; } } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult DeleteSubForumComment(long UID, long CommID) { ResultInfo <string> ResultInfo = new ResultInfo <string>() { Status = false, Description = "Failed|Login" }; try { if (UID > 0 && CommID > 0) { SchoolStudent PageObj = new SchoolStudent(); ResultInfo.Info = PageObj.DeleteComment(UID, CommID); // ResultInfo.Info = PageObj.UpdateStudygrpCommentstatus(Info); if (ResultInfo.Info != null) { ResultInfo.Description = "Success| deleted"; ResultInfo.Status = true; } } } catch (Exception ex) { ResultInfo.Description = ex.Message; } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
static void Main(string[] args) { SchoolStudent schoolStudentObject = new SchoolStudent(); schoolStudentObject.name = "Xameer"; CollageStudent collageStudentObject = new CollageStudent(); collageStudentObject.name = "Zameer"; int i = 5; Console.WriteLine($"schoolStudentObject is a school going student : {(IsImplementation.Is<ISchool>(schoolStudentObject))}"); Console.WriteLine($"collageStudentObject is a school going student : {(IsImplementation.Is<ISchool>(collageStudentObject))}"); Console.WriteLine($"i is 5 : {(IsImplementation.Is(i,5))}"); Console.WriteLine($"i is 50 : {(IsImplementation.Is(i,50))}"); double?z = AsImplementation.As <int>(i); string result = "The value inside 'z' is "; result += (z == null) ? "null" : $"{z}"; System.Console.WriteLine(result); Student resultObject = (AsImplementation.As <Student>(schoolStudentObject)); result = (resultObject == null) ? "This is not a student !!!" : $"This is a student, and his/her name is {resultObject.name}"; System.Console.WriteLine(result); System.Console.ReadLine(); }
public JsonResult EditSubForumComment(long ForumCommID, long UID) { ResultInfo <ForumDetails> ResultInfo = new ResultInfo <ForumDetails>() { Status = false, Description = "Failed|Login" }; ForumDetails temp = new ForumDetails(); SchoolStudent obj = new SchoolStudent(); try { if (ForumCommID > 0 && UID > 0) { temp.singleComment = obj.EditSubForumComment(ForumCommID, UID); ResultInfo.Info = temp; } if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Get Details Of SocialStudent"; ResultInfo.Status = true; } } catch (Exception ex) { } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult AddLikeORDislikeOFComment(SubjectForum_Like_OR_Dislike Info) { OnlineCommunityComment CommentInfo = new OnlineCommunityComment(); ResultInfo <string> ResultInfo = new ResultInfo <string>() { Status = false, Description = "Failed|Login" }; try { if (Info != null) { SchoolStudent PageObj = new SchoolStudent(); ResultInfo.Info = PageObj.InsertLikeOrDislikeValueOfSubjectForum(Info); ResultInfo.Info = PageObj.UpdateLikesDislikesInCommentTable(Info.CommentID, Info.LikeVal, Info.UID); if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Insert Like or dislike"; ResultInfo.Status = true; } } } catch (Exception ex) { ResultInfo.Description = ex.Message; } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult InsertCommentByTopicID(SubjectForumTopicComment Info) { //List<SubjectForumTopicComment> CommentInfo = new List<SubjectForumTopicComment>(); ResultInfo <string> ResultInfo = new ResultInfo <string>() { Status = false, Description = "Failed|Login" }; try { if (Info != null) { SchoolStudent PageObj = new SchoolStudent(); ResultInfo.Info = PageObj.InsertCommentByTopicID(Info); if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Insert comment"; ResultInfo.Status = true; } } } catch (Exception ex) { ResultInfo.Description = ex.Message; } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult ForumTopicComments(long TopicID) { ResultInfo <ForumDetails> CommentList = new ResultInfo <ForumDetails>() { Status = false, Description = "Failed|Login" }; List <SubjectForumTopicComment> AllCommentList = new List <SubjectForumTopicComment>(); ForumDetails DetailsInfo = new ForumDetails(); // List<ForumTopicComment> CommentDetails = new List<ForumTopicComment>(); List <SubjectForumTopics> TopicDetails = new List <SubjectForumTopics>(); SchoolStudent PageObj = new SchoolStudent(); AllCommentList = PageObj.AllCommentsOfTopic(TopicID); DetailsInfo.comments = AllCommentList; // DetailsInfo.ComID=AllCommentLi // DetailsInfo.singleComment= TopicDetails = PageObj.getDetailsOfComment(TopicID); if (TopicDetails != null && TopicDetails.Count > 0) { DetailsInfo.Topic = TopicDetails.FirstOrDefault().TopicName; DetailsInfo.TopicCreatedByName = TopicDetails.FirstOrDefault().CreatedByName; DetailsInfo.TopicCreatedDate = TopicDetails.FirstOrDefault().TopicCreatedDate; //DetailsInfo.Topic_CreatedDate = TopicDetails.FirstOrDefault().Topic_CreatedDate; DetailsInfo.TopicID = TopicDetails.FirstOrDefault().TopicID; DetailsInfo.IsStudent = TopicDetails.FirstOrDefault().IsStudent; DetailsInfo.IsTeacher = TopicDetails.FirstOrDefault().IsTeacher; } CommentList.Info = DetailsInfo; CommentList.Description = "Success| Get all comment by TopicId"; CommentList.Status = true; return(Json(CommentList, JsonRequestBehavior.AllowGet)); }
public JsonResult InsertRatingByStudent(StudentRateLesson Info) { ResultInfo <string> ResultInfo = new ResultInfo <string>() { Status = false, Description = "Failed|Login" }; try { if (Info != null) { SchoolStudent Obj = new SchoolStudent(); ResultInfo.Info = Obj.InsertRating(Info); if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Updation Sucess"; ResultInfo.Status = true; } } } catch (Exception ex) { // throw; } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public ActionResult DeleteConfirmed(int id) { SchoolStudent schoolStudent = db.SchoolStudents.Find(id); db.SchoolStudents.Remove(schoolStudent); db.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult UpdateSchoolStudent([FromBody] SchoolStudent model) { var mappedSchool = _mapper.Map <SchoolStudent>(model); _studentSchoolService.UpdateSchoolStudent(mappedSchool); return(Ok( new { Status = StatusResponse.OK } )); }
public async void ChangePassword(EditText newPass) { //TODO: Change token signature switch (Token) { case "Admin": //Update in Admins Admin admin = await firebaseHelper.GetData <Admin>(Token + "s", EmailAddress); admin.Password = encryption.EncodePassword(newPass.Text); await firebaseHelper.UpdatePassword(admin, Token + "s", EmailAddress); break; case "User": //Update in Users User user = await firebaseHelper.GetData <User>(Token + "s", EmailAddress); user.Password = encryption.EncodePassword(newPass.Text); await firebaseHelper.UpdatePassword(user, Token + "s", EmailAddress); break; case "Teacher": //Update in Teachers Teacher teacher = await firebaseHelper.GetData <Teacher>(Token + "s", EmailAddress); teacher.Password = encryption.EncodePassword(newPass.Text); await firebaseHelper.UpdatePassword(teacher, Token + "s", EmailAddress); break; case "SchoolStudent": //Update in SchoolStudents SchoolStudent schoolStudent = await firebaseHelper.GetData <SchoolStudent>(Token + "s", EmailAddress); schoolStudent.Password = encryption.EncodePassword(newPass.Text); await firebaseHelper.UpdatePassword(schoolStudent, Token + "s", EmailAddress); break; case "UniversityStudent": //Update in UniversityStudents UniversityStudent universityStudent = await firebaseHelper.GetData <UniversityStudent>(Token + "s", EmailAddress); universityStudent.Password = encryption.EncodePassword(newPass.Text); await firebaseHelper.UpdatePassword(universityStudent, Token + "s", EmailAddress); break; } //Update in Login Login login = await firebaseHelper.GetLogin(EmailAddress); login.Password = encryption.EncodePassword(newPass.Text); await firebaseHelper.UpdatePassword <Login>(login, "Login", EmailAddress); }
public static void Main() { SchoolStudent schoolStudent = new SchoolStudent(); CollegeStudent collegeStudent = new CollegeStudent(); schoolStudent.TemplateMethod(); collegeStudent.TemplateMethod(); Console.ReadKey(); }
private void BtnStudentRegister_Click(object sender, EventArgs e) { if (Verify() == true && VerifyStudent() == true) { SchoolStudent schoolStudent = new SchoolStudent(etFirstName.Text, etLastName.Text, etEmail.Text, etPassword.Text = encryption.EncodePassword(etPassword.Text), Convert.ToInt16(etAge.Text), Convert.ToInt16(etClass.Text), etSchool.Text, etCity.Text, etCountry.Text); Login login = new Login(etEmail.Text, etPassword.Text, "SchoolStudent"); UserToAdd(schoolStudent, login, etEmail.Text, "SchoolStudents"); } }
public void UpdateSchoolStudent(SchoolStudent model) { var result = _schoolStudentRepository.Get(obj => obj.SchoolId == model.SchoolId); if (result != null) { result.SchoolId = model.SchoolId; result.StudentId = model.StudentId; _schoolStudentRepository.Update(model); _schoolStudentRepository.SaveChanges(); } }
// GET: SchoolStudents/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SchoolStudent schoolStudent = db.SchoolStudents.Find(id); if (schoolStudent == null) { return(HttpNotFound()); } return(View(schoolStudent)); }
public IActionResult InsertSchoolStudent([FromBody] SchoolStudent model) { var mappedSchool = _mapper.Map <SchoolStudent>(model); //var School = new School //{ // Name = model.Name, // Age = model.Age //}; _studentSchoolService.InsertSchoolStudent(mappedSchool); return(Ok( new { Status = StatusResponse.OK } )); }
public ActionResult Edit([Bind(Include = "ID,StudentID,CurrentSchool,PreviousSchool1,PreviousSchool2,PreviousSchool3")] SchoolStudent schoolStudent) { if (ModelState.IsValid) { db.Entry(schoolStudent).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CurrentSchool = new SelectList(db.Schools, "ID", "Name", schoolStudent.CurrentSchool); ViewBag.PreviousSchool1 = new SelectList(db.Schools, "ID", "Name", schoolStudent.PreviousSchool1); ViewBag.PreviousSchool2 = new SelectList(db.Schools, "ID", "Name", schoolStudent.PreviousSchool2); ViewBag.PreviousSchool3 = new SelectList(db.Schools, "ID", "Name", schoolStudent.PreviousSchool3); ViewBag.StudentID = new SelectList(db.Students, "ID", "LastName", schoolStudent.StudentID); return(View(schoolStudent)); }
public JsonResult SubForAssignmentUpload(int level_id) { ResultInfo <StudentUploadAssignment> ResultInfo = new ResultInfo <StudentUploadAssignment>() { Status = false, Description = "Failed|Login" }; SchoolStudent pageobj = new SchoolStudent(); StudentUploadAssignment upld = new StudentUploadAssignment(); if (level_id > 0) { upld.subjs = pageobj.GetSubjectByLevelID(level_id); } ResultInfo.Info = upld; return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult HomeWorkList(long SubjectID) { ResultInfo <STUDENT_ASSIGNMENTS> ResultInfo = new ResultInfo <STUDENT_ASSIGNMENTS>() { Status = false, Description = "Failed|Login" }; SchoolStudent pageobj = new SchoolStudent(); STUDENT_ASSIGNMENTS upld = new STUDENT_ASSIGNMENTS(); if (SubjectID > 0) { upld.Asslist = pageobj.HomeworkList(SubjectID); } ResultInfo.Info = upld; return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult SubjectsByClassID(long SchoolID, long ClassID) { ResultInfo <ClassForum> ResultInfo = new ResultInfo <ClassForum>() { Status = false, Description = "Failed|Login" }; ClassForum obj = new ClassForum(); SchoolStudent pageobj = new SchoolStudent(); if (SchoolID > 0 && ClassID > 0) { obj.subs = pageobj.SubjectByClassId(SchoolID, ClassID); } ResultInfo.Info = obj; return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult SubForumListByClassID(long SchoolID, long ClassID) { ResultInfo <List <SubjectForum> > ResultInfo = new ResultInfo <List <SubjectForum> >() { Status = false, Description = "Failed|Login" }; SchoolStudent PageObj = new SchoolStudent(); ResultInfo.Info = PageObj.SubjectForumByClassID(SchoolID, ClassID); if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Get all community By StudentID"; ResultInfo.Status = true; } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
// GET: SchoolStudents/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SchoolStudent schoolStudent = db.SchoolStudents.Find(id); if (schoolStudent == null) { return(HttpNotFound()); } ViewBag.CurrentSchool = new SelectList(db.Schools, "ID", "Name", schoolStudent.CurrentSchool); ViewBag.PreviousSchool1 = new SelectList(db.Schools, "ID", "Name", schoolStudent.PreviousSchool1); ViewBag.PreviousSchool2 = new SelectList(db.Schools, "ID", "Name", schoolStudent.PreviousSchool2); ViewBag.PreviousSchool3 = new SelectList(db.Schools, "ID", "Name", schoolStudent.PreviousSchool3); ViewBag.StudentID = new SelectList(db.Students, "ID", "LastName", schoolStudent.StudentID); return(View(schoolStudent)); }
public JsonResult SubjectsForLessonRating(long ClassID, long SchoolID) { ResultInfo <StudentRateLesson> ResultInfo = new ResultInfo <StudentRateLesson>() { Status = false, Description = "Failed|Login" }; SchoolStudent pageobj = new SchoolStudent(); StudentRateLesson assign = new StudentRateLesson(); if (SchoolID > 0 && ClassID > 0) { //assign.LevelID = pageobj.GetDivIdByClassID(ClassID, SchoolID); //if (assign.LevelID > 0) //{ assign.subjs = pageobj.SubForTeacherRating(ClassID, SchoolID); //} } ResultInfo.Info = assign; return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult GetSubjectsForAssignment(long ClassID, long SchoolID) { ResultInfo <STUDENT_ASSIGNMENTS> ResultInfo = new ResultInfo <STUDENT_ASSIGNMENTS>() { Status = false, Description = "Failed|Login" }; SchoolStudent pageobj = new SchoolStudent(); STUDENT_ASSIGNMENTS assign = new STUDENT_ASSIGNMENTS(); if (SchoolID > 0 && ClassID > 0) { assign.Level_ID = pageobj.GetDivIdByClassID(ClassID, SchoolID); if (assign.Level_ID > 0) { assign.subjs = pageobj.GetSubjectByLevelID(assign.Level_ID); } } ResultInfo.Info = assign; return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult GetTeacherID(long TopicID) { ResultInfo <StudentRateLesson> ResultInfo = new ResultInfo <StudentRateLesson>() { Status = false, Description = "Failed|Login" }; SchoolStudent pageobj = new SchoolStudent(); StudentRateLesson assign = new StudentRateLesson(); if (TopicID > 0) { assign.SubjectID = pageobj.GetSubIdByTopicID(TopicID); if (assign.SubjectID > 0) { assign.TeacherID = pageobj.GetTeacherIDBySubID(assign.SubjectID); } } ResultInfo.Info = assign; return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult GetClassListByLevelID(int Level_ID, long School_ID) { ResultInfo <List <ClassDetails> > ResultInfo = new ResultInfo <List <ClassDetails> >() { Status = false, Description = "Failed|Login" }; List <ClassDetails> nm = new List <ClassDetails>(); SchoolStudent PageObj = new SchoolStudent(); if (Level_ID > 0) { nm = PageObj.GetClassByLevelID(Level_ID, School_ID); ResultInfo.Info = nm; } if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Get class name with id"; ResultInfo.Status = true; } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult TopicListBySubID(long SubjectID) { ResultInfo <List <SchoolSyllabusTopic> > ResultInfo = new ResultInfo <List <SchoolSyllabusTopic> >() { Status = false, Description = "Failed|Login" }; List <SchoolSyllabusTopic> nm = new List <SchoolSyllabusTopic>(); SchoolStudent PageObj = new SchoolStudent(); if (SubjectID > 0) { nm = PageObj.GetTopicsForAssignment(SubjectID); ResultInfo.Info = nm; } if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Get level name with id"; ResultInfo.Status = true; } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public JsonResult EditProfileSchoolStu(long UID, long SchoolID) { ResultInfo <SchoolStudentEdit> ResultInfo = new ResultInfo <SchoolStudentEdit>() { Status = false, Description = "Failed|Login" }; SchoolStudent obj = new SchoolStudent(); SchoolStudentEdit demo = new SchoolStudentEdit(); try { if (UID > 0) { demo = obj.EditSchoolStudentProfile(UID); if (demo.DivisionID > 0) { demo.Levels = obj.GetlevelListByDivID(demo.DivisionID); } if (demo.Level_ID > 0) { demo.ClassObj = obj.GetClassByLevelID(demo.Level_ID, demo.School_ID); } demo.GenderInfo = obj.GetAllGender(); demo.Divisions = obj.GetDivisionList(); } ResultInfo.Info = demo; if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Get all School Student Details"; ResultInfo.Status = true; } } catch (Exception ex) { } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }