예제 #1
0
        private void btnCalcular1_Click(object sender, EventArgs e)
        {
            Notas    notas = new Notas();
            clsNotas cls   = new clsNotas();

            String num1 = txtLab1.Text;
            String num2 = txtPar1.Text;

            Double r1 = cls.funcPromedio1(num1, num2);

            notas.Pro1 = r1;

            txtPro1.Text = Convert.ToString(r1);
            //--------------------------------------------------
            String num3 = txtLab2.Text;
            String num4 = txtPar2.Text;

            Double r2 = cls.funcPromedio2(num3, num4);

            notas.Pro2 = r2;

            txtPro2.Text = Convert.ToString(r2);
            //--------------------------------------------------
            String num5 = txtLab3.Text;
            String num6 = txtPar3.Text;

            Double r3 = cls.funcPromedio3(num5, num6);

            notas.Pro3 = r3;

            txtPro3.Text = Convert.ToString(r3);
            //--------------------------------------------------

            Double pro1 = notas.Pro1;
            Double pro2 = notas.Pro2;
            Double pro3 = notas.Pro3;

            Double r = cls.funcProFinal(pro1, pro2, pro3);

            txtResultado.Text = Convert.ToString(r);

            if (r >= 6)
            {
                txtResultado.Text = "Aprobado-->" + r;
            }
            else
            {
                txtResultado.Text = "Reprobado-->" + r;
            }
        }
예제 #2
0
    protected void rdgNotas_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        try
        {
            string            strResultado = string.Empty;
            GridEditableItem  ObjItem      = (GridEditableItem)e.Item;
            Hashtable         ObjHashTable = new Hashtable();
            incription_course objIns       = new incription_course();

            ObjItem.ExtractValues(ObjHashTable);

            objIns.id          = Convert.ToInt32(ObjHashTable["id"]);
            objIns.note        = IsNull(ObjHashTable["nota"]) ? -1 : Convert.ToInt32(ObjHashTable["nota"]);
            objIns.observation = IsNull(ObjHashTable["observacion"]) ? "" : ObjHashTable["observacion"].ToString();
            objIns.id_state    = IsNull(ObjHashTable["estado"]) ? 1 : Convert.ToInt32(ObjHashTable["estado"].ToString());

            strResultado = ReglasNegocio(objIns);

            if (strResultado.Equals(string.Empty))
            {
                clsNotas notas = new clsNotas();
                notas.prInscripcion = objIns;

                strResultado = notas.ActualizarNota();

                if (strResultado.Equals(string.Empty))
                {
                    base.EnvioMensaje("Nota actualizada correctamente.", 2, this.Manejador);
                    this.rdgNotas.Rebind();
                }
                else
                {
                    base.EnvioMensaje(strResultado, 2, this.Manejador);
                }
            }
            else
            {
                base.EnvioMensaje(strResultado, 1, this.Manejador);
            }
        }
        catch (Exception ex)
        {
            this.rdgNotas.MasterTableView.ClearEditItems();
            base.EnvioMensaje("Error al actualizar datos: " + ex.Message.ToString(), 1, this.Manejador);
        }
    }