private void add_course_Click(object sender, EventArgs e) { COURSE crs = new COURSE(); crs.COUR_CODE = txt_new_crs_code.Text; crs.COUR_NAME = txt_new_crs_name.Text; crs.COUR_DESCRIPTION = txt_new__crs_desc.Text; crs.COUR_HOUR = int.Parse(txt_new_crs_hours.Text); crs.COUR_SEMESTER = int.Parse(txt_new_crs_semester.Text); Context.AddToCOURSE(crs); Context.SaveChanges(); CB_sec_crs.DataSource = null; }
/// <summary> /// Create a new COURSE object. /// </summary> /// <param name="cOUR_ID">Initial value of the COUR_ID property.</param> /// <param name="cOUR_CODE">Initial value of the COUR_CODE property.</param> /// <param name="cOUR_NAME">Initial value of the COUR_NAME property.</param> /// <param name="cOUR_SEMESTER">Initial value of the COUR_SEMESTER property.</param> /// <param name="cOUR_HOUR">Initial value of the COUR_HOUR property.</param> /// <param name="cOUR_DEPARTMENTID">Initial value of the COUR_DEPARTMENTID property.</param> public static COURSE CreateCOURSE(global::System.Int32 cOUR_ID, global::System.String cOUR_CODE, global::System.String cOUR_NAME, global::System.Int32 cOUR_SEMESTER, global::System.Int32 cOUR_HOUR, global::System.Int32 cOUR_DEPARTMENTID) { COURSE cOURSE = new COURSE(); cOURSE.COUR_ID = cOUR_ID; cOURSE.COUR_CODE = cOUR_CODE; cOURSE.COUR_NAME = cOUR_NAME; cOURSE.COUR_SEMESTER = cOUR_SEMESTER; cOURSE.COUR_HOUR = cOUR_HOUR; cOURSE.COUR_DEPARTMENTID = cOUR_DEPARTMENTID; return cOURSE; }
/// <summary> /// Deprecated Method for adding a new object to the COURSE EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCOURSE(COURSE cOURSE) { base.AddObject("COURSE", cOURSE); }