Ejemplo n.º 1
0
        public List <Entities.Program> Filter([FromBody] Entities.Program entity)
        {
            Expression <Func <Entities.Program, bool> > predicate = PredicateBuilder.New <Entities.Program>(true);

            if (entity.Ad != null)
            {
                predicate = predicate.And(x => x.Ad == entity.Ad);
            }



            return(_programRepo.Filter(predicate));
        }
Ejemplo n.º 2
0
        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";
                }
            }
        }
Ejemplo n.º 3
0
        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";
                }
            }
        }
Ejemplo n.º 4
0
        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";
                }
            }
        }
Ejemplo n.º 5
0
 public bool Delete([FromBody] Entities.Program entity)
 {
     return(_programRepo.Delete(entity));
 }
Ejemplo n.º 6
0
 public async Task <bool> Create([FromBody] Entities.Program program)
 {
     return(await _programRepo.CreateAsync(program));
 }
Ejemplo n.º 7
0
 public bool Update([FromBody] Entities.Program program)
 {
     return(_programRepo.Update(program));
 }