public AcademicOffer(Int32 code, Period oPeriod, Program oProgram, Course oCourse, Decimal price, ClassRoom oClassRoom, Schedule oSchedule, Teacher oteacher, int hours) { this.code = code; this.oPeriod = oPeriod; this.oProgram = oProgram; this.oCourse = oCourse; this.price = price; this.oClassRoom = oClassRoom; this.oSchedule = oSchedule; this.oteacher = oteacher; this.hours = hours; }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { Int32 records = 0; if (validateData()) { Entities.ClassRoom oClassRoom = new Entities.ClassRoom(); Entities.Program oProgram = new Entities.Program(); Entities.ActivesStatus oActivesStatus = new Entities.ActivesStatus(); Entities.Actives oActivesState = new Entities.Actives(); oActivesState.code = Convert.ToInt32(txtCode.Text.ToString()); oActivesState.codeAlphaNumeric = txtcodeAlphaNumeric.Text; oActivesState.description = txtDescription.Text; oClassRoom.code = Convert.ToInt32(cboClassroom.SelectedValue.ToString()); oProgram.code = Convert.ToInt32(cboprogram.SelectedValue.ToString()); oActivesStatus.activesSatus_ID = Convert.ToInt32(cboStatus.SelectedValue.ToString()); oActivesState.status = oActivesStatus; oActivesState.oClassRoom = oClassRoom; oActivesState.oProgram = oProgram; if (ActivesBLL.getInstance().exists(oActivesState.code)) { records = ActivesBLL.getInstance().modify(oActivesState); } else { if (ActivesBLL.getInstance().existsCodeAlphanumeric(txtcodeAlphaNumeric.Text)) { lblMessagecodeAlphaNumeric.Text = "Este codigo ya se ha utilizado"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "removeHasErrorcodeAlphaNumeric", "$('#ContentPlaceHolder1_txtcodeAlphaNumeric').removeClass('has-error');", true); return; } else { records = ActivesBLL.getInstance().insert(oActivesState); } } blockControls(); loadData(); if (records > 0) { lblMessage.Text = "Datos almacenados correctamente"; } } }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { Int32 records = 0; if (validateData()) { Entities.Period oPeriod = new Entities.Period(); Entities.Program oProgram = new Entities.Program(); Entities.Course oCourse = new Entities.Course(); Entities.ClassRoom oClassRoom = new Entities.ClassRoom(); Entities.Schedule oSchedule = new Entities.Schedule(); Entities.Teacher oteacher = new Entities.Teacher(); Int32 code = Convert.ToInt32(txtCode.Text.ToString()); oPeriod.code = Convert.ToInt32(cboPeriod.SelectedValue.ToString()); oProgram.code = Convert.ToInt32(cboProgram.SelectedValue.ToString()); oCourse.id = Convert.ToInt32(cboCourse.SelectedValue.ToString()); Decimal price = Convert.ToDecimal(txtPrice.Text.ToString()); oSchedule.code = Convert.ToInt32(cboSchedule.SelectedValue.ToString()); oClassRoom.code = Convert.ToInt32(cboRoom.SelectedValue.ToString()); oteacher.code = Convert.ToInt32(cboTeacher.SelectedValue.ToString()); Int32 hour = Convert.ToInt32(cboHours.SelectedValue.ToString()); Entities.AcademicOffer oAcademicOffer = new Entities.AcademicOffer(code, oPeriod, oProgram, oCourse, price, oClassRoom, oSchedule, oteacher, hour); if (BLL.AcademicOfferBLL.getInstance().exists(code)) { lblMessage.Text = "Esta solicitud no puede ser procesada"; } else { records = BLL.AcademicOfferBLL.getInstance().insert(oAcademicOffer); insertClasroomSchedule(oAcademicOffer); insertTeacherSchedule(oAcademicOffer); } blockControls(); loadData(); if (records > 0) { lblMessage.Text = "Datos almacenados correactamente"; } } }
protected void gvClassRoom_RowEditing(object sender, GridViewEditEventArgs e) { unlockControls(); Int32 code = Convert.ToInt32(gvClassRoom.Rows[e.NewEditIndex].Cells[0].Text); Entities.ClassRoom oClassRoom = ClassRoomBLL.getInstance().getClassRoom(code); txtCode.Text = oClassRoom.code.ToString(); txtDescription.Text = oClassRoom.num_room; txtSize.Text = oClassRoom.size.ToString(); cboState.SelectedValue = oClassRoom.state.ToString(); try { cboClassRoomType.SelectedValue = oClassRoom.oClassRoomsType.code.ToString(); } catch (Exception) { cboClassRoomType.SelectedValue = "0"; } try { cboLocation.SelectedValue = oClassRoom.oLocation.code.ToString(); } catch (Exception) { cboLocation.SelectedValue = "0"; } try { cboprogram.SelectedValue = oClassRoom.oProgram.code.ToString(); } catch (Exception) { cboprogram.SelectedValue = "0"; } ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "$('html, body').animate({ scrollTop: $('body').offset().top });", true); }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { Int32 records = 0; if (validateData()) { Entities.ClassRoom oClassRoom = new Entities.ClassRoom(); Entities.ClassRoomsType oClassRoomsType = new Entities.ClassRoomsType(); Entities.Location oLocation = new Entities.Location(); Entities.Program oProgram = new Entities.Program(); oClassRoom.code = Convert.ToInt32(txtCode.Text); oClassRoom.num_room = txtDescription.Text; oClassRoomsType.code = Convert.ToInt32(cboClassRoomType.SelectedValue); oLocation.code = Convert.ToInt32(cboLocation.SelectedValue); oClassRoom.size = Convert.ToInt32(txtSize.Text); oProgram.code = Convert.ToInt32(cboprogram.SelectedValue); oClassRoom.state = Convert.ToInt16(cboState.SelectedValue); oClassRoom.oClassRoomsType = oClassRoomsType; oClassRoom.oLocation = oLocation; oClassRoom.oProgram = oProgram; if (ClassRoomBLL.getInstance().exists(oClassRoom.code)) { records = ClassRoomBLL.getInstance().modify(oClassRoom); } else { records = ClassRoomBLL.getInstance().insert(oClassRoom); } blockControls(); loadData(); if (records > 0) { lblMessage.Text = "Datos almacenados correctamente"; } } }