Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string action = Request.QueryString["action"];

        id = int.Parse(Request.QueryString["Requestid"]);
        DBFunctions db = new DBFunctions();

        if (action == "accept")
        {
            StudentRoom_Mapping room = db.getRoomRequestById(id);
            hostelname.Text            = room.HostelRoom_tbl.Hostel_tbl.Name;
            price.Text                 = room.HostelRoom_tbl.Price.ToString();
            capacity.Text              = room.HostelRoom_tbl.Capacity.ToString();
            dept.Text                  = room.Candidate_tbl.StudentInfo_tbl.FirstOrDefault().Department_tbl.Department;
            acadamicYear.Text          = room.Candidate_tbl.StudentInfo_tbl.FirstOrDefault().AcadamicYear;
            studentname.Text           = room.Candidate_tbl.Name;
            btnacceptorderroom.Visible = true;
        }
        //else if(action=="accepted")
        //{
        //    StudentRoom_Mapping room = db.getRoomRequestById(id);
        //    hostelname.Text = room.HostelRoom_tbl.Hostel_tbl.Name;
        //    price.Text = room.HostelRoom_tbl.Price.ToString();
        //    capacity.Text = room.HostelRoom_tbl.Capacity.ToString();
        //    dept.Text = room.Candidate_tbl.StudentInfo_tbl.FirstOrDefault().Department_tbl.Department;
        //    acadamicYear.Text = room.Candidate_tbl.StudentInfo_tbl.FirstOrDefault().AcadamicYear;
        //    studentname.Text = room.Candidate_tbl.Name;

        //}
        else if (action == "reject")
        {
            StudentRoom_Mapping room = db.getRoomRequestById(id);
            hostelname.Text   = room.HostelRoom_tbl.Hostel_tbl.Name;
            price.Text        = room.HostelRoom_tbl.Price.ToString();
            capacity.Text     = room.HostelRoom_tbl.Capacity.ToString();
            dept.Text         = room.Candidate_tbl.StudentInfo_tbl.FirstOrDefault().Department_tbl.Department;
            acadamicYear.Text = room.Candidate_tbl.StudentInfo_tbl.FirstOrDefault().AcadamicYear;
            studentname.Text  = room.Candidate_tbl.Name;
            //btnacceptorderroom.Visible = false;
            btnrejectroom.Visible = true;
        }
        else if (action == "acceptleaveroom")
        {
            StudentRoom_Mapping room = db.getRoomRequestById(id);
            hostelname.Text   = room.HostelRoom_tbl.Hostel_tbl.Name;
            price.Text        = room.HostelRoom_tbl.Price.ToString();
            capacity.Text     = room.HostelRoom_tbl.Capacity.ToString();
            dept.Text         = room.Candidate_tbl.StudentInfo_tbl.FirstOrDefault().Department_tbl.Department;
            acadamicYear.Text = room.Candidate_tbl.StudentInfo_tbl.FirstOrDefault().AcadamicYear;
            studentname.Text  = room.Candidate_tbl.Name;
            //btnacceptorderroom.Visible = false;
            Acceptbtns.Visible = true;
        }
        else
        {
        }
    }
Example #2
0
    protected void btnLeaveroom_Click(object sender, EventArgs e)
    {
        DBFunctions db = new DBFunctions();

        StudentRoom_Mapping room = new StudentRoom_Mapping {
            RomID = id, StudentID = int.Parse(Session["userid"].ToString()), Status = 0
        };

        db.leaveroom(room);
        Response.Redirect("ViewRoom.aspx");
    }
Example #3
0
    protected void btnorderroom_Click(object sender, EventArgs e)
    {
        DBFunctions       db = new DBFunctions();
        DatabaseFunctions d  = new DatabaseFunctions();
        int StudentID        = d.GetCandidateID(UserID);

        if (StudentID != -1)
        {
            StudentRoom_Mapping room = new StudentRoom_Mapping {
                RomID = id, StudentID = StudentID, Status = 0
            };
            db.placeorder(room);
            Response.Redirect("ViewRoom.aspx");
        }
    }
    protected void btnLeaveroom_Click(object sender, EventArgs e)
    {
        DBFunctions db = new DBFunctions();

        StudentRoom_Mapping room = new StudentRoom_Mapping { RomID = id, StudentID = int.Parse(Session["userid"].ToString()), Status = 0 };
        db.leaveroom(room);
        Response.Redirect("ViewRoom.aspx");
    }
 protected void btnorderroom_Click(object sender, EventArgs e)
 {
     DBFunctions db = new DBFunctions();
     DatabaseFunctions d = new DatabaseFunctions();
     int StudentID = d.GetCandidateID(UserID);
     if (StudentID != -1)
     {
         StudentRoom_Mapping room = new StudentRoom_Mapping { RomID = id, StudentID = StudentID, Status = 0 };
         db.placeorder(room);
         Response.Redirect("ViewRoom.aspx");
     }
 }
Example #6
0
 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);
 }
Example #7
0
 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);  
     }
 }