예제 #1
0
        protected void rgPuesto_DeleteCommand(object sender, GridCommandEventArgs e)
        {
            var             editableItem = ((GridEditableItem)e.Item);
            Nullable <Guid> ID;
            int             validarEliminar = 0;
            BL_PERSONAL     BL_PERSONAL     = new BL_PERSONAL();
            BL_PUESTO       BL_PUESTO       = new BL_PUESTO();

            if (editableItem.GetDataKeyValue("ID") != null)
            {
                ID = Guid.Parse(editableItem.GetDataKeyValue("ID").ToString());
            }
            else
            {
                ID = Guid.Empty;
            }

            //Validar que el área a eliminar no esté asociada a ninguna personal
            List <BE_PERSONAL> lstPersonal = BL_PERSONAL.SeleccionarPersonalPorArea((Guid)ID);

            if (lstPersonal == null || lstPersonal.Count == 0)
            {
                validarEliminar += 1;
            }

            if (validarEliminar > 0)
            {
                BL_PUESTO.EliminarPuesto((Guid)ID);
                rgPuesto.DataBind();
            }
            else
            {
                string message        = "'No puede eliminar un Puesto asociada a una o más Personas'";
                string javaScriptCode = "Sys.Application.add_load(function() {showRadConfirm(" + message + ");});";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "RadConfirmStart", javaScriptCode, true);
            }
        }
예제 #2
0
 public Boolean EliminarPuesto(Guid puesto_id)
 {
     return(BL_PUESTO.EliminarPuesto(puesto_id));
 }
예제 #3
0
        protected void GrabarActualizar(object sender, GridCommandEventArgs e, String action)
        {
            var editableItem = ((GridEditableItem)e.Item);
            //create new entity
            BL_PUESTO BL_PUESTO = new BL_PUESTO();
            //populate its properties
            Hashtable values = new Hashtable();

            editableItem.ExtractValues(values);

            RadComboBox oRadComboBox2      = (RadComboBox)e.Item.FindControl("rcbEmpresa");
            RadComboBox oRadComboBox_Nivel = (RadComboBox)e.Item.FindControl("rcbNivel");

            BE_PUESTO oentidad = new BE_PUESTO();

            Nullable <Guid> ID;

            if (e.CommandName == RadGrid.PerformInsertCommandName)
            {
                ID = Guid.Empty;
            }
            else
            {
                ID = Guid.Parse(editableItem.GetDataKeyValue("ID").ToString());
            }

            oentidad.ID          = (Guid)ID;
            oentidad.CODIGO      = values["CODIGO"].ToString();
            oentidad.DESCRIPCION = values["DESCRIPCION"].ToString();
            if (!String.IsNullOrEmpty(oRadComboBox_Nivel.SelectedValue))
            {
                oentidad.NIVEL = Int32.Parse(oRadComboBox_Nivel.SelectedValue);
            }
            else
            {
                e.Canceled = true;
                oRadComboBox_Nivel.Text = String.Empty;
                return;
            }
            if (!String.IsNullOrEmpty(oRadComboBox2.SelectedValue))
            {
                oentidad.EMPRESA_ID = Guid.Parse(oRadComboBox2.SelectedValue);
            }
            else
            {
                e.Canceled         = true;
                oRadComboBox2.Text = String.Empty;
                return;
            }

            if (action == "add")
            {
                oentidad.USUARIO_CREACION = USUARIO;
                oentidad.ESTADO           = 1;
                BL_PUESTO.InsertarPuesto(oentidad);
            }
            else
            {
                oentidad.USUARIO_CREACION = USUARIO;
                oentidad.ESTADO           = 1;
                BL_PUESTO.ActualizarPuesto(oentidad);
            }
        }
예제 #4
0
 public Boolean InsertarPuesto(BE_PUESTO oBE_PUESTO)
 {
     return(BL_PUESTO.InsertarPuesto(oBE_PUESTO));
 }
예제 #5
0
 public Boolean ActualizarPuesto(BE_PUESTO oBE_PUESTO)
 {
     return(BL_PUESTO.ActualizarPuesto(oBE_PUESTO));
 }
예제 #6
0
 public List <BE_PUESTO> SeleccionarPuestoPorArea(Guid area_id)
 {
     return(BL_PUESTO.SeleccionarPuestoPorArea(area_id));
 }
예제 #7
0
 public List <BE_PUESTO> SeleccionarPuestoPorCoordinacion(Guid coordinacion_id)
 {
     return(BL_PUESTO.SeleccionarPuestoPorCoordinacion(coordinacion_id));
 }
예제 #8
0
 public List <BE_PUESTO> SeleccionarPuestoPorGerencia(Guid gerencia_id)
 {
     return(BL_PUESTO.SeleccionarPuestoPorGerencia(gerencia_id));
 }
예제 #9
0
 public List <BE_PUESTO> SeleccionarPuestoPorPresidencia(Guid presidencia_id)
 {
     return(BL_PUESTO.SeleccionarPuestoPorPresidencia(presidencia_id));
 }
예제 #10
0
 public BE_PUESTO SeleccionarPuestoPorId(Guid puesto_id)
 {
     return(BL_PUESTO.SeleccionarPuestoPorId(puesto_id));
 }
예제 #11
0
 public List <BE_PUESTO> SeleccionarPuestosPorEmpresa(Guid empresa_id)
 {
     return(BL_PUESTO.SeleccionarPuestoPorEmpresa(empresa_id));
 }
예제 #12
0
 public List <BE_PUESTO> SeleccionarPuestos()
 {
     return(BL_PUESTO.SeleccionarPuestos());
 }