Example #1
0
        private void BtnAgregarCuenta_Click(object sender, EventArgs e)
        {
            CN_con_pc objPlaCue = new CN_con_pc();
            DataTable dtPlaCue  = new DataTable();

            objPlaCue.mysConec = mysConec;
            objPlaCue.Listar(STU_SISTEMA.EMPRESAID);
            dtPlaCue = objPlaCue.dtLista;

            DataTable dtResult = objPlaCue.BuscarCuenta(dtPlaCue);

            if (dtResult != null)
            {
                if (dtResult.Rows.Count != 0)
                {
                    int          idCuenta     = Convert.ToInt32(dtResult.Rows[0]["n_id"]);
                    ConfigValCue configValCue = m_ConfigVal.ConfigValCues
                                                .Where(o => o.n_idcue == idCuenta).FirstOrDefault();

                    if (configValCue != null)
                    {
                        throw new Exception("La cuenta seleccionada ya se encuentra agregada");
                    }
                    else
                    {
                        m_ConfigVal.ConfigValCues.Add(new ConfigValCue
                        {
                            n_idcue  = idCuenta,
                            c_descue = dtResult.Rows[0]["c_des"].ToString()
                        });
                    }
                }
            }
        }
Example #2
0
 private void ToolSalir_Click(object sender, EventArgs e)
 {
     objRegistros = null;
     objFormVis   = null;
     this.Close();
 }