Example #1
0
       public void addQuestion(string Question,string[] answers)
       {
           using (db = new CollegeERPDBEntities())
           {
               Questionaire_tbl qstn = new Questionaire_tbl { Question = Question };
               db.Questionaire_tbl.Add(qstn);
               db.SaveChanges();
               foreach (string ans in answers)
               {
                   Answers_tbl anss = new Answers_tbl { Q_ID = qstn.Q_ID, Answer = ans };
                   db.Answers_tbl.Add(anss);
                   db.SaveChanges();
               }
           }

       }
Example #2
0
 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();
 }
Example #3
0
       public void AddRegistrationNotice(Mails_tbl t)
       {
           db = new CollegeERPDBEntities();

           db.Mails_tbl.Add(t);
           db.SaveChanges();


       }
Example #4
0
 public int AddCandidate(Candidate_tbl candidate)
 {
     db = new CollegeERPDBEntities();
     
         db.Candidate_tbl.Add(candidate);
         db.SaveChanges();
         return candidate.ID;
     
 }
Example #5
0
 public void addNotice(Notices_tbl nttable)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.Notices_tbl.Add(nttable);
         db.SaveChanges();
     }
 }
Example #6
0
 public Discussions_tbl adddiscussion(Discussions_tbl dis)
 {
     db = new CollegeERPDBEntities();
     db.Discussions_tbl.Add(dis);
     db.SaveChanges();
     
     var topic= db.DiscussionTopics_tbl.Where(x=>x.ID==dis.TopicID).FirstOrDefault();
     topic.DateCreated = DateTime.Now;
     db.SaveChanges();
     return dis;
     
 }
Example #7
0
 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);
 }
Example #8
0
 public void addbook(Book book)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.Books.Add(book);
         db.SaveChanges();
     }
 }
Example #9
0
 public void assigncouresefee(int sid,int cid)
 {
     db = new CollegeERPDBEntities();
     db.CourseFee_tbl.Add(new CourseFee_tbl {StudentID=sid,CourseID=cid,Status=0});
     db.SaveChanges();
 }
Example #10
0
    public void addadmssion(List<Candidate_tbl> candidatelist)
    {
        db = new CollegeERPDBEntities();
        int prgid=-1;
foreach(var cand in candidatelist)
{
    
    string matricno=DateTime.Now.Year+"-"+cand.Program_tbl.ProgramName+"-"+cand.ID;
    var std = db.AddmissionList_tbl.Where(x=>x.UserID==cand.ID).FirstOrDefault();
    var info = db.StudentInfo_tbl.Where(x => x.UserId == cand.ID).FirstOrDefault();
    
    if(std==null&&info==null){
       StudentInfo_tbl student = new StudentInfo_tbl { ProgramID = cand.ProgrammeID, StudentLevel = "ND1", UserId = cand.ID, Semester = 0, DeptID = cand.Program_tbl.DeptID, FeeDiscount = "0", AcadamicYear = DateTime.Now.Year.ToString() };
    StudentAcceptanceFee_tbl accfee = new StudentAcceptanceFee_tbl { ProgramID = cand.ProgrammeID, Userid = cand.ID, Status = 0 };
    Mails_tbl mail = new Mails_tbl { RecieverID = cand.ID, Message ="Acceptence Fee Of "+ cand.Program_tbl.AcceptenceFee + " Has Been Assigned to You <br> Please Submit This Fees with in One Week", Subject = "Acceptence Fee", Date = DateTime.Now,Status=0 };
    addmail(mail);
        db.StudentInfo_tbl.Add(student);
        int Year = Convert.ToInt16(student.AcadamicYear);
        Batches_table temp = db.Batches_table.Where(x => x.BatchYear == Year).FirstOrDefault();
        AddmissionList_tbl admission = new AddmissionList_tbl { ProgrameID = cand.ProgrammeID, Status = 0, route = "Merit", UserID = cand.ID, MetricNo = matricno, Password = cand.Password,BatchID=temp.ID };

    db.AddmissionList_tbl.Add(admission);
    db.StudentAcceptanceFee_tbl.Add(accfee);
       

    prgid = cand.ProgrammeID.Value;
}
    var candidates = db.Candidate_tbl.Where(x => x.ProgrammeID == prgid).OrderByDescending(x => x.CuttoffPoints).Skip(100).ToList();
       foreach(var c in candidates)
       {
           c.Status = -1;
       }
       var addmittedcandidates = db.Candidate_tbl.Where(x => x.ProgrammeID == prgid).OrderByDescending(x => x.CuttoffPoints).Take(100).ToList();
       foreach (var c in addmittedcandidates)
       {
           c.Status = 1;
       }
}
        
db.SaveChanges();
    }
Example #11
0
 public int adddiscussiontopic(DiscussionTopics_tbl topic)
 {
     db = new CollegeERPDBEntities();
     db.DiscussionTopics_tbl.Add(topic);
     db.SaveChanges();
     return topic.ID;
 }
Example #12
0
 public void addDateSheet(DateSheet_tbl DStable)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.DateSheet_tbl.Add(DStable);
         db.SaveChanges();
     }
 }
Example #13
0
 public void addTimeTable(TimeTable_tbl ttable)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.TimeTable_tbl.Add(ttable);
         db.SaveChanges();
     }
 }
Example #14
0
 public int addcourse(Courses_tbl course)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.Courses_tbl.Add(course);
         db.SaveChanges();
     }
     return course.ID;
 }
Example #15
0
   public void UpdateCreditHours(StudentSelectedCredit t)
   {

       db = new CollegeERPDBEntities();
       db.StudentSelectedCredits.Attach(t);
       db.Entry(t).State = EntityState.Modified;
      
       db.SaveChanges();
   }
Example #16
0
 public int AddCreditHours(StudentSelectedCredit obj)
 {
     
     using (db = new CollegeERPDBEntities())
     {
         db.StudentSelectedCredits.Add(obj);
         db.SaveChanges();
     }
     return obj.ID;
 }
Example #17
0
   public void updatequestion(Support_tbl ques)
   {
       db = new CollegeERPDBEntities();

       db.Support_tbl.Attach(ques);
       // var progrm = db.Program_tbl.Where(x => x.ID == id).FirstOrDefault();
       db.Entry(ques).State = EntityState.Modified;

       db.SaveChanges();
       Mails_tbl mail = new Mails_tbl { RecieverID =ques.UserID, Date = DateTime.Now.Date, Message =ques.Answer, Status = 0, Subject = "Admin Answer" };
       addmail(mail);  

   }
Example #18
0
 public void createApplication(Applications_tbl application)
 {
     db = new CollegeERPDBEntities();
     db.Applications_tbl.Add(application);
     db.SaveChanges();
 }
Example #19
0
 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);
 }
Example #20
0
 //txtHomeaddress.Text, int.Parse(dropdownSto.SelectedValue),int.Parse(dropdownLocalGovtarea.SelectedValue),Emailtxt.Text,dropdownDay.SelectedItem.Text + "-" + dropdownMonth.SelectedItem.Text + "-" + dropdownyears.SelectedItem.Text,Phonetxt.Text
 public void updatestudtent(int stdid,string Name,int prid,int semester,string feediscount,string address,int sto,int area,string email,string dob,string phone)
 {
      db = new CollegeERPDBEntities();
     var student= db.StudentInfo_tbl.Where(x=>x.UserId==stdid).FirstOrDefault();
     student.ProgramID = prid;
     student.Semester = semester;
     student.FeeDiscount = feediscount;
     student.Candidate_tbl.Name = Name;
     student.Candidate_tbl.ProgrammeID = prid;
     student.Candidate_tbl.HomeAdress = address;
     student.Candidate_tbl.LocalGovtArea = area;
     student.Candidate_tbl.Stateoforigin = sto;
     student.Candidate_tbl.Email = email;
     student.Candidate_tbl.Phone = phone;
     student.Candidate_tbl.DateofBirth = dob;
     db.SaveChanges();
 }
Example #21
0
    public Mails_tbl getusermail(int mid)
    {
        db = new CollegeERPDBEntities();

        var mail = db.Mails_tbl.Where(x => x.ID == mid).FirstOrDefault();
        mail.Status = 1;
        db.SaveChanges();
        return mail;
    }
Example #22
0
       public void addFormField(Forms_tbl form,string [] options)
       {
           using (db = new CollegeERPDBEntities())
           {
               db.Forms_tbl.Add(form);
               db.SaveChanges();

               if(form.FormControl!="Text")
               {
                   foreach (string option in options)
                       db.ControlOptions_tbl.Add(new ControlOptions_tbl { FieldID=form.ID,optionvalue=option});
               }
                   db.SaveChanges();
           }


       }
Example #23
0
    public void addmail(Mails_tbl mail)
    {
        db = new CollegeERPDBEntities();
        db.Mails_tbl.Add(mail);
        db.SaveChanges();

    }
Example #24
0
   public void updateenrollment(int appid,string status)
    {
        db = new CollegeERPDBEntities();
        Enroll_Course ec = db.Enroll_Course.Where(x => x.ID == appid).FirstOrDefault();
        ec.Status=int.Parse(status);
        db.SaveChanges();

       if(status=="1")
       {
           assigncouresefee(ec.Uid.Value, ec.CourseID.Value);
           Mails_tbl mail = new Mails_tbl { RecieverID = ec.Uid, Date = DateTime.Now.Date, Message = "Your Enrollment Application for " + ec.Courses_tbl.Course + " has been approved, Please Submit $"+ec.Courses_tbl.Fee, Status = 0, Subject = "Enrollment Applications" };
           addmail(mail);     
       }
       else if(status=="-1")
       {
           
           Mails_tbl mail = new Mails_tbl { RecieverID = ec.Uid, Date = DateTime.Now.Date, Message = "Your Enrollment Application for " + ec.Courses_tbl.Course + " has been Rejected", Status = 0, Subject = "Enrollment Applications" };
           addmail(mail);  
       }
    }
Example #25
0
 public int addresults(Results_tbl result)
 {
     db = new CollegeERPDBEntities();
     db.Results_tbl.Add(result);
     db.SaveChanges();
     return result.ID;
 }
Example #26
0
   public void updatecourse(Courses_tbl updatecrs)
   {
       db = new CollegeERPDBEntities();

       db.Courses_tbl.Attach(updatecrs);
       // var progrm = db.Program_tbl.Where(x => x.ID == id).FirstOrDefault();
       db.Entry(updatecrs).State = EntityState.Modified;

       db.SaveChanges();

   }
Example #27
0
 public void addattendance(Attendance_tbl attendance)
 {
     db = new CollegeERPDBEntities();
     DateTime date = DateTime.Now.Date;
     var check = db.Attendance_tbl.Where(x => x.Date == date && x.StudentID == attendance.StudentID&&x.CourseID==attendance.CourseID).FirstOrDefault();
     if(check==null)
     {
         
     db.Attendance_tbl.Add(attendance);
     db.SaveChanges();
     }
 }
Example #28
0
   public void UpdateStudentsCredits()
   {
       db = new CollegeERPDBEntities();

       var Students=db.StudentSelectedCredits.ToList();
       Students.ForEach(a => a.SelectedCourseCount = 0);
       db.SaveChanges();

   }
Example #29
0
 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);        
     }
 }
Example #30
0
   public void UpdateStudentSemester()
   {
       db = new CollegeERPDBEntities();

       var Students = db.StudentInfo_tbl.ToList();
       Students.ForEach(a => a.Semester = a.Semester+1);
       db.SaveChanges();

   }