示例#1
0
    private string Grabar(string strDatosBasicos, string strFiguras)
    {
        string sResul = "";
        int    nID    = -1;

        IB.SUPER.ADM.SIC.BLL.SubareaPreventa oElem = new IB.SUPER.ADM.SIC.BLL.SubareaPreventa();

        try
        {
            nID = oElem.Grabar(strDatosBasicos, strFiguras);
            if (nID == -1)
            {
                sResul = "AVISO@#@Ya existe un subárea con la misma denominación";
            }
            else
            {
                sResul = "OK@#@" + nID.ToString("#,###");
            }
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al grabar los datos de la subárea", ex, false);
        }
        finally
        {
            oElem.Dispose();
        }
        return(sResul);
    }
示例#2
0
    private string Eliminar(int nNivel, int nIDItem)
    {
        IB.SUPER.ADM.SIC.BLL.UnidadPreventa  oUnidad  = new IB.SUPER.ADM.SIC.BLL.UnidadPreventa();
        IB.SUPER.ADM.SIC.BLL.AreaPreventa    oArea    = new IB.SUPER.ADM.SIC.BLL.AreaPreventa();
        IB.SUPER.ADM.SIC.BLL.SubareaPreventa oSubArea = new IB.SUPER.ADM.SIC.BLL.SubareaPreventa();
        try
        {
            switch (nNivel)
            {
            case 1:
                oUnidad.Delete((short)nIDItem);
                oUnidad.Dispose();
                break;

            case 2:
                oArea.Delete(nIDItem);
                oArea.Dispose();
                break;

            case 3:
                oSubArea.Delete(nIDItem);
                oSubArea.Dispose();
                break;
            }

            return("OK@#@");
        }
        catch (Exception ex)
        {
            if (Errores.EsErrorIntegridad(ex))
            {
                return("Error@#@Operación rechazada.\n\n" + Errores.mostrarError("Error al obtener la estructura preventa", ex));
            }
            else
            {
                return("Error@#@" + Errores.mostrarError("Error al obtener la estructura preventa", ex));
            }
        }
        finally
        {
            switch (nNivel)
            {
            case 1:
                oUnidad.Dispose();
                break;

            case 2:
                oArea.Dispose();
                break;

            case 3:
                oSubArea.Dispose();
                break;
            }
        }
    }
示例#3
0
    private void CargarDatosItem(int idSubarea)
    {
        //PreventaSubarea oSubarea = PreventaSubarea.Select(null, idSubarea);
        IB.SUPER.ADM.SIC.Models.SubareaPreventa oSubArea = new IB.SUPER.ADM.SIC.Models.SubareaPreventa();
        IB.SUPER.ADM.SIC.BLL.SubareaPreventa    oElem    = new IB.SUPER.ADM.SIC.BLL.SubareaPreventa();

        oSubArea = oElem.Select2(idSubarea);

        txtID.Text = idSubarea.ToString();

        txtUnidad.Text   = oSubArea.ta199_denominacion;
        hdnIdUnidad.Text = oSubArea.ta199_idunidadpreventa.ToString();

        txtArea.Text   = oSubArea.ta200_denominacion;
        hdnIdArea.Text = oSubArea.ta200_idareapreventa.ToString();


        txtDenominacion.Text   = oSubArea.ta201_denominacion;
        hdnIDResponsable.Text  = oSubArea.t001_idficepi_responsable.ToString();
        txtDesResponsable.Text = oSubArea.Responsable;

        if (oSubArea.ta201_estadoactiva)
        {
            chkActivo.Checked = true;
        }
        else
        {
            chkActivo.Checked = false;
        }

        //if (oSubArea.ta201_permitirautoasignacionlider == "A")
        if (oSubArea.ta201_permitirautoasignacionlider)
        {
            chkLider.Checked = true;
        }
        else
        {
            chkLider.Checked = false;
        }

        oElem.Dispose();
    }