protected void Button_Delete_Click(object sender, EventArgs e) { string course_schedule_id = Input_Delete_Course_Schedule_ID.Text; bool isChanged = CourseScheduleDBUtil.Delete(course_schedule_id); if (isChanged) { string toastrScript = ToastrHelper.GetToastrScript("success", "提示", "删除课程安排信息成功。"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "script", toastrScript, true); } else { string toastrScript = ToastrHelper.GetToastrScript("danger", "提示", "删除课程安排信息失败。"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "script", toastrScript, true); } Data_Bind(); }
protected void Button_Update_Click(object sender, EventArgs e) { string course_schedule_id = Input_Update_Course_Schedule_ID.Text; string update_item_select = Input_Update_Item_Select.Value.ToString(); string update_value = Input_Update_Value.Text; bool isChanged = false; switch (update_item_select) { case "课程安排编号": isChanged = CourseScheduleDBUtil.UpdateID(course_schedule_id, update_value); break; case "课程编号": isChanged = CourseScheduleDBUtil.UpdateCourseID(course_schedule_id, update_value); break; case "面向院系编号": isChanged = CourseScheduleDBUtil.UpdateDeptID(course_schedule_id, update_value); break; case "课程安排类型": isChanged = CourseScheduleDBUtil.UpdateType(course_schedule_id, update_value); break; case "课程安排容量": isChanged = CourseScheduleDBUtil.UpdateCapacity(course_schedule_id, update_value); break; case "课程安排状态": isChanged = CourseScheduleDBUtil.UpdateStatus(course_schedule_id, update_value); break; } if (isChanged) { string toastrScript = ToastrHelper.GetToastrScript("success", "提示", "修改课程安排信息成功。"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "script", toastrScript, true); } else { string toastrScript = ToastrHelper.GetToastrScript("danger", "提示", "修改课程安排信息失败。"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "script", toastrScript, true); } Data_Bind(); }
protected void Button_Add_Click(object sender, EventArgs e) { string course_schedule_id = Input_Add_Course_Schedule_ID.Text; string course_id = Input_Add_Course_ID.Text; string department_id = Input_Add_Department_ID.Text; string course_schedule_type = Input_Add_Course_Schedule_Type.Value; string course_schedule_capacity = Input_Add_Course_Schedule_Capacity.Text; string course_schedule_status = Input_Add_Course_Schedule_Status.Text; bool isChanged = CourseScheduleDBUtil.Add(course_schedule_id, course_id, department_id, course_schedule_type, course_schedule_capacity, course_schedule_status); if (isChanged) { string toastrScript = ToastrHelper.GetToastrScript("success", "提示", "添加课程安排信息成功。"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "script", toastrScript, true); } else { string toastrScript = ToastrHelper.GetToastrScript("danger", "提示", "添加课程安排信息失败。"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "script", toastrScript, true); } Data_Bind(); }