コード例 #1
0
        private void changelabel_Click(object sender, EventArgs e)
        {
            panelpad.Hide();
            tipobox.Text = "DOP";
            tipo.Text    = "DOP";
            LoginClass AP = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            editbutton.Enabled   = false;
            quitarbutton.Enabled = false;



            if (DireccionGestor.getorigen() == "_payfor_table")
            {
                namecombo.Text   = "";
                cantidadbox.Text = "";
                palpad.BackColor = Color.Red;
                DireccionGestor.setorigen("_askfor_table");
                titlelabel.Text  = "CUENTAS POR COBRAR";
                changelabel.Text = "CUENTAS POR PAGAR";
                string orden = "SELECT DEUDOR,FECHA,CANTIDAD FROM  " + UserAccessForm.getusername() + "_askfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "';";
                AP.ShowDataGridfound(datagrid, orden);
                encontradolabel.Text = AP.getcuenta().ToString();
                titlepanel.Text      = "AGREGAR DEUDOR";
                orden = "SELECT SUM(CANTIDAD) FROM  " + UserAccessForm.getusername() + "_askfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "';";
                MovementsClass Ad = new MovementsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

                Ad.getsuma(totalalbel, tipobox.Text, orden, "CANTIDAD");
                AP = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                string orden2 = "SELECT DEUDOR FROM  " + UserAccessForm.getusername() + "_askfor_table ;";

                AP.Fillcombo(namecombo, orden2);
                panelpad.BackColor = Color.DarkRed;
            }
            else if (DireccionGestor.getorigen() == "_askfor_table")
            {
                namecombo.Text   = "";
                cantidadbox.Text = "";
                palpad.BackColor = Color.Blue;
                DireccionGestor.setorigen("_payfor_table");
                titlelabel.Text  = "CUENTAS POR PAGAR";
                changelabel.Text = "CUENTAS POR COBRAR";
                string orden = "SELECT COBRADOR,FECHA,CANTIDAD FROM  " + UserAccessForm.getusername() + "_payfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "';";
                AP.ShowDataGridfound(datagrid, orden);
                encontradolabel.Text = AP.getcuenta().ToString();
                titlepanel.Text      = "AGREGAR COBRADOR";
                panelpad.BackColor   = Color.MidnightBlue;
                orden = "SELECT SUM(CANTIDAD) FROM  " + UserAccessForm.getusername() + "_payfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "';";
                MovementsClass Ad = new MovementsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

                Ad.getsuma(totalalbel, tipobox.Text, orden, "CANTIDAD");
                AP = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                string orden2 = "SELECT COBRADOR FROM  " + UserAccessForm.getusername() + "_payfor_table ;";

                AP.Fillcombo(namecombo, orden2);
            }
        }