protected void Page_Load(object sender, EventArgs e)
    {
        string pagename = Path.GetFileName(Request.PhysicalPath);

        if (Session["admin"] != null)
        {
            string action = Request.QueryString["action"];
            id = int.Parse(Request.QueryString["Timetableid"]);
            if (!IsPostBack)
            {
                DBFunctions db = new DBFunctions();
                if (action == "update")
                {
                    CourseList.DataSource     = db.getcourselist();
                    CourseList.DataValueField = "ID";
                    CourseList.DataTextField  = "Course";
                    CourseList.DataBind();
                    // Courses_tbl course = db.getcourses(id);
                    TimeTable_tbl ds = db.getTimeTable(id);
                    DropDownDay.SelectedValue = ds.Day;
                    STime.Text = ds.StartTime;
                    ETime.Text = ds.EndTime;
                    TeacherList.SelectedValue = ds.Teacher;
                }
                else
                {
                }
            }
        }
        else
        {
            Response.Redirect("Login.aspx?Redirecturl=" + pagename);
        }
    }
Ejemplo n.º 2
0
    protected void TimeTableBtn_Click(object sender, EventArgs e)
    {
        DBFunctions db        = new DBFunctions();
        int         course    = int.Parse(CourseList.SelectedValue);
        string      starttime = STime.Text;
        string      endtime   = ETime.Text;
        string      day       = DropDownDay.SelectedValue;

        TimeTable_tbl dsFlag = db.checkTimeTable(course, starttime, endtime, day);

        if (dsFlag != null)
        {
            Span1.InnerText = "TimeTable Already Exist";
        }
        else
        {
            //Program_tbl prgram = new Program_tbl { ProgramName = ProgrammeNametxt.Text, SecondChoice = int.Parse(dropdownSecondChoise.SelectedValue), HasCampus = int.Parse(dropdownCampus.SelectedValue), ApplicationFee = txtApplicationFee.Text, FormNumber = txtFormCh.Text, ProgrameType = dropdownPrograms.SelectedValue, HasJambData = int.Parse(dropdownJamb.SelectedValue), HasBioDataSection = int.Parse(dropdownBioData.SelectedValue), HasPreviousRecord = int.Parse(dropdownPreviousRecord.SelectedValue), HasCBTSchedule = int.Parse(dropdownCbtSchedule.SelectedValue), HasOlevelResult = int.Parse(dropdownOlevel.SelectedValue), Enable = true, DeptID = int.Parse(DropDownDept.SelectedValue), CutoffPoints = Cuttofpointstxt.Text, DateCreated = DateTime.Now.Date, AcceptenceFee = txtAcceptenceFee.Text, FormCh = txtFormCh.Text };
            TimeTable_tbl ttable = new TimeTable_tbl {
                CourseID = int.Parse(CourseList.SelectedValue), StartTime = STime.Text, EndTime = ETime.Text, Day = DropDownDay.SelectedItem.ToString(), Teacher = ""
            };
            db.addTimeTable(ttable);
        }

        Response.Redirect("AddTimeTable.aspx");
    }
    protected void TimeTableUpdateBtn_Click(object sender, EventArgs e)
    {
        DBFunctions db = new DBFunctions();

        // Program_tbl prgram = new Program_tbl { ID = id, ProgramName = ProgrammeNametxt.Text, SecondChoice = int.Parse(dropdownSecondChoise.SelectedValue), HasCampus = int.Parse(dropdownCampus.SelectedValue), ApplicationFee = txtApplicationFee.Text, FormNumber = txtFormNum.Text, ProgrameType = dropdownPrograms.SelectedValue, HasJambData = int.Parse(dropdownJamb.SelectedValue), HasBioDataSection = int.Parse(dropdownBioData.SelectedValue), HasPreviousRecord = int.Parse(dropdownPreviousRecord.SelectedValue), HasCBTSchedule = int.Parse(dropdownCbtSchedule.SelectedValue), HasOlevelResult = int.Parse(dropdownOlevel.SelectedValue), Enable = true, DeptID = int.Parse(DropDownDept.SelectedValue), CutoffPoints = Cuttofpointstxt.Text, DateCreated = DateTime.Now.Date, AcceptenceFee = txtAcceptenceFee.Text, FormCh = txtFormCh.Text };
        TimeTable_tbl timetable = new TimeTable_tbl { ID = id,CourseID = int.Parse(CourseList.SelectedValue), StartTime = STime.Text, EndTime = ETime.Text,Day=DropDownDay.SelectedValue,Teacher=TeacherList.SelectedValue };
        db.updateTimeTable(timetable);
        Response.Redirect("AddTimeTable.aspx");
    }
    protected void TimeTableUpdateBtn_Click(object sender, EventArgs e)
    {
        DBFunctions db = new DBFunctions();

        // Program_tbl prgram = new Program_tbl { ID = id, ProgramName = ProgrammeNametxt.Text, SecondChoice = int.Parse(dropdownSecondChoise.SelectedValue), HasCampus = int.Parse(dropdownCampus.SelectedValue), ApplicationFee = txtApplicationFee.Text, FormNumber = txtFormNum.Text, ProgrameType = dropdownPrograms.SelectedValue, HasJambData = int.Parse(dropdownJamb.SelectedValue), HasBioDataSection = int.Parse(dropdownBioData.SelectedValue), HasPreviousRecord = int.Parse(dropdownPreviousRecord.SelectedValue), HasCBTSchedule = int.Parse(dropdownCbtSchedule.SelectedValue), HasOlevelResult = int.Parse(dropdownOlevel.SelectedValue), Enable = true, DeptID = int.Parse(DropDownDept.SelectedValue), CutoffPoints = Cuttofpointstxt.Text, DateCreated = DateTime.Now.Date, AcceptenceFee = txtAcceptenceFee.Text, FormCh = txtFormCh.Text };
        TimeTable_tbl timetable = new TimeTable_tbl {
            ID = id, CourseID = int.Parse(CourseList.SelectedValue), StartTime = STime.Text, EndTime = ETime.Text, Day = DropDownDay.SelectedValue, Teacher = TeacherList.SelectedValue
        };

        db.updateTimeTable(timetable);
        Response.Redirect("AddTimeTable.aspx");
    }
Ejemplo n.º 5
0
    protected void TimeTableBtn_Click(object sender, EventArgs e)
    {
        DBFunctions db = new DBFunctions();
        int course = int.Parse(CourseList.SelectedValue);
        string starttime = STime.Text;
        string endtime = ETime.Text;
        string day = DropDownDay.SelectedValue;
        
        TimeTable_tbl dsFlag = db.checkTimeTable(course,starttime,endtime,day);
        if (dsFlag != null)
        {
            Span1.InnerText = "TimeTable Already Exist";
        }
        else
        {

            //Program_tbl prgram = new Program_tbl { ProgramName = ProgrammeNametxt.Text, SecondChoice = int.Parse(dropdownSecondChoise.SelectedValue), HasCampus = int.Parse(dropdownCampus.SelectedValue), ApplicationFee = txtApplicationFee.Text, FormNumber = txtFormCh.Text, ProgrameType = dropdownPrograms.SelectedValue, HasJambData = int.Parse(dropdownJamb.SelectedValue), HasBioDataSection = int.Parse(dropdownBioData.SelectedValue), HasPreviousRecord = int.Parse(dropdownPreviousRecord.SelectedValue), HasCBTSchedule = int.Parse(dropdownCbtSchedule.SelectedValue), HasOlevelResult = int.Parse(dropdownOlevel.SelectedValue), Enable = true, DeptID = int.Parse(DropDownDept.SelectedValue), CutoffPoints = Cuttofpointstxt.Text, DateCreated = DateTime.Now.Date, AcceptenceFee = txtAcceptenceFee.Text, FormCh = txtFormCh.Text };
            TimeTable_tbl ttable = new TimeTable_tbl { CourseID = int.Parse(CourseList.SelectedValue), StartTime = STime.Text, EndTime = ETime.Text, Day = DropDownDay.SelectedItem.ToString(), Teacher = "" };
            db.addTimeTable(ttable);
        }

        Response.Redirect("AddTimeTable.aspx");
    }
Ejemplo n.º 6
0
   public void updateTimeTable(TimeTable_tbl updatedts)
   {
       db = new CollegeERPDBEntities();

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

       db.SaveChanges();

   }
Ejemplo n.º 7
0
 public void addTimeTable(TimeTable_tbl ttable)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.TimeTable_tbl.Add(ttable);
         db.SaveChanges();
     }
 }