public int uspINS_EQUIPO_RESPONSABLE(BE_EQUIPO_RESPONSABLE oBE)
 {
     try
     {
         return(new DA_EQUIPO_RESPONSABLE().uspINS_EQUIPO_RESPONSABLE(oBE));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
        public int uspINS_EQUIPO_RESPONSABLE(BE_EQUIPO_RESPONSABLE oBE)
        {
            object[] Parametros = new[] {
                (object)UC_FormWeb.mSQLFieldOrNull(oBE.IDE_RESPONSABLE, tgSQLFieldType.NUMERIC),
                (object)UC_FormWeb.mSQLFieldOrNull(oBE.DNI_RESPONSABLE, tgSQLFieldType.TEXT),
                (object)UC_FormWeb.mSQLFieldOrNull(oBE.IP_CENTRO, tgSQLFieldType.TEXT),
                (object)UC_FormWeb.mSQLFieldOrNull(oBE.CENTRO, tgSQLFieldType.TEXT),
                (object)UC_FormWeb.mSQLFieldOrNull(oBE.FLG_ESTADO, tgSQLFieldType.NUMERIC),
            };

            return(Convert.ToInt32(new Utilitarios().ExecuteScalar("uspINS_EQUIPO_RESPONSABLE", Parametros)));
        }
    protected void btnAgregar_Click(object sender, EventArgs e)
    {
        string cleanMessage = string.Empty;

        if (ddlPersonal.SelectedValue == string.Empty)
        {
            cleanMessage = "Falta indicar personal responsable";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else
        {
            int cantidad = 0;
            foreach (ListItem li in ddlCentro.Items)
            {
                if (li.Selected)
                {
                    string centro = li.Value;

                    //lblCodigo.Text = string.Empty;

                    BE_EQUIPO_RESPONSABLE oBESol = new BE_EQUIPO_RESPONSABLE();
                    oBESol.IDE_RESPONSABLE = 0;
                    oBESol.DNI_RESPONSABLE = ddlPersonal.SelectedValue.ToString();
                    oBESol.IP_CENTRO       = ddlGerencia.SelectedValue;
                    oBESol.CENTRO          = centro;
                    oBESol.FLG_ESTADO      = 1;

                    int dtrpta = 0;
                    dtrpta = new BL_EQUIPO_RESPONSABLE().uspINS_EQUIPO_RESPONSABLE(oBESol);
                    if (dtrpta > 0)
                    {
                        cantidad++;
                        CargarTrabajadores(dtrpta, centro);
                    }
                }
            }


            if (cantidad > 0)
            {
                ddlPersonal.Text = string.Empty;
                cleanMessage     = "Registro exitoso";
                ListarResponsables();
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
            else
            {
                cleanMessage = "Falta seleccionar centros de costos";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
        }
    }
    protected void Registrar()
    {
        string cleanMessage          = string.Empty;
        BE_EQUIPO_RESPONSABLE oBESol = new BE_EQUIPO_RESPONSABLE();

        oBESol.IDE_RESPONSABLE = 0;
        oBESol.DNI_RESPONSABLE = ddlPersonal.SelectedValue.ToString();
        oBESol.IP_CENTRO       = ddlGerencia.SelectedValue;
        oBESol.CENTRO          = ddlCentro.SelectedValue;
        oBESol.FLG_ESTADO      = 1;

        int dtrpta = 0;

        dtrpta = new BL_EQUIPO_RESPONSABLE().uspINS_EQUIPO_RESPONSABLE(oBESol);
        if (dtrpta > 0)
        {
            ddlPersonal.Text = string.Empty;
            cleanMessage     = "Registro exitoso";
            ListarResponsables();
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
    }