public void AddQuestionare(int UserID) { db = new CollegeERPDBEntities(); AdminMails_tbl obj = new AdminMails_tbl {SenderID=UserID,Message="<a href=DownloadReport.aspx?senderid='"+UserID+"'>Download Questionair</a>",Subject="SuggestionRequest",Status=0,Date=DateTime.Now.Date}; db.AdminMails_tbl.Add(obj); db.SaveChanges(); }
public void placeOrder(IssueBook book) { using (db = new CollegeERPDBEntities()) { db.IssueBooks.Add(book); db.SaveChanges(); AdminMails_tbl amail = new AdminMails_tbl { SenderID = book.LibraryMember.UserID, Message = book.LibraryMember.Candidate_tbl.Name + " has Requested for " + book.Book.Title, Date = DateTime.Now.Date, Subject = "Book Request", Status = 0 }; addadminmail(amail); } }
public void addadminmail(AdminMails_tbl mail) { db = new CollegeERPDBEntities(); db.AdminMails_tbl.Add(mail); db.SaveChanges(); }
public void addQuestion(Support_tbl DStable) { using (db = new CollegeERPDBEntities()) { db.Support_tbl.Add(DStable); db.SaveChanges(); } AdminMails_tbl mail = new AdminMails_tbl { SenderID = DStable.UserID, Message = DStable.Question + "<br><br><br><a class='btn btn-primary' href='AnswerQuestion.aspx?Questionid=" + DStable.ID + "&action=update'>Answer Question</a>", Status = 0,Date=DateTime.Now,Subject="Question" }; addadminmail(mail); }
public void Enrollcourse(Enroll_Course enroll) { db = new CollegeERPDBEntities(); var ec = db.Enroll_Course.Where(x => x.Uid == enroll.Uid && x.CourseID == enroll.CourseID).FirstOrDefault(); if (ec==null) { db.Enroll_Course.Add(enroll); db.SaveChanges(); } else if(ec.Status==3) { ec.Status = 0; //Reenroll Course Request db.SaveChanges(); } var candidate = db.Candidate_tbl.Where(x=>x.ID==enroll.Uid).FirstOrDefault(); var course = db.Courses_tbl.Where(x=>x.ID==enroll.CourseID).FirstOrDefault(); AdminMails_tbl mail = new AdminMails_tbl {Date=DateTime.Now.Date, Subject = "Course Enrollment Application", SenderID = enroll.Uid, Status = 0, Message =candidate.Name + " Wants to enroll in " + course.Course + "<br/><br> <a href='EnrollmentAppications.aspx' class='btn btn-primary'>View Enrollment Application</a>" }; addadminmail(mail); }
public void requestlibrarymembership(LibraryMember member) { db = new CollegeERPDBEntities(); db.LibraryMembers.Add(member); db.SaveChanges(); var candidate = db.Candidate_tbl.Where(x => x.ID == member.UserID).FirstOrDefault(); // var course = db.Courses_tbl.Where(x => x.ID == member.CourseID).FirstOrDefault(); AdminMails_tbl mail = new AdminMails_tbl { Date = DateTime.Now.Date, Subject = "Library Membership Request", SenderID =member.UserID, Status = 0, Message = candidate.Name + " Requested Library Membership. <br/><br> <a href='../Library/MemberRequest.aspx' class='btn btn-primary'>View Membership Requests</a>" }; addadminmail(mail); }
public void leaveroom(StudentRoom_Mapping room) { db = new CollegeERPDBEntities(); var stdroom = db.StudentRoom_Mapping.Where(x => x.RomID == room.RomID && x.StudentID == room.StudentID).FirstOrDefault(); stdroom.Status = 2; db.SaveChanges(); var candidate = db.Candidate_tbl.Where(x => x.ID == room.StudentID).FirstOrDefault(); var hstlroom = db.HostelRoom_tbl.Where(x => x.ID == room.RomID).FirstOrDefault(); AdminMails_tbl amail = new AdminMails_tbl { SenderID = room.StudentID, Message = candidate.Name + " has Requested for Leaving Room No." + hstlroom.RoomNo + " in " + hstlroom.Hostel_tbl.Name + " Hostel <br><br> <a href='../Hostel/RoomLeaveRequests.aspx' class='btn btn-primary'>View Room Requests</a> ", Date = DateTime.Now.Date, Subject = "Leave Room Request", Status = 0 }; addadminmail(amail); }
public void placeorder(StudentRoom_Mapping hstl) { using (db = new CollegeERPDBEntities()) { db.StudentRoom_Mapping.Add(hstl); db.SaveChanges(); var candidate = db.Candidate_tbl.Where(x => x.ID == hstl.StudentID).FirstOrDefault(); var hstlroom = db.HostelRoom_tbl.Where(x => x.ID == hstl.RomID).FirstOrDefault(); AdminMails_tbl amail = new AdminMails_tbl { SenderID = hstl.StudentID, Message = candidate.Name + " has Requested for Room No." + hstlroom.RoomNo + " in " + hstlroom.Hostel_tbl.Name + " Hostel <br><br> <a href='../Hostel/RoomRequests.aspx' class='btn btn-primary'>View Room Requests</a>", Date = DateTime.Now.Date, Subject = "Room Request", Status = 0 }; addadminmail(amail); } }