Exemple #1
0
        private void btnguardar_Click(object sender, EventArgs e)
        {
            string rsp = "";


            try
            {
                if (this.txtnomcontat.Text == string.Empty && this.txtRZ.Text == string.Empty)
                {
                    mesajerror("No puede dejar nombre de campo vacío");
                    erroricono.SetError(txtdni, "Debe ingresar nombre de Proveedor");
                }

                if (this.isnuevo)

                {
                    this.txtdnipt.Text   = this.txtdni.Text;
                    this.txtdnipd.Text   = this.txtdni.Text;
                    this.txtiddire.Text  = this.txtdni.Text;
                    this.txtidtelef.Text = this.txtdni.Text;

                    rsp = Lproveedor_telef.InsertarTP(Convert.ToInt32(this.txtidtelef.Text), Convert.ToInt32(this.txtPartic.Text), Convert.ToInt32(this.txtCelul.Text), Convert.ToInt32(this.txtfax.Text));

                    rsp = Lproveedor_direcc.InsertarPD(Convert.ToInt32(this.txtiddire.Text), this.txtcalle.Text, Convert.ToInt32(this.txtNcalle.Text), this.txtProv.Text, this.txtlocalidad.Text, this.txtbarrio.Text, Convert.ToInt32(this.txtcp.Text));

                    rsp = Lproveedor_t_d.insertar(Convert.ToInt32(this.txtdnipt.Text), Convert.ToInt32(this.txtdnipd.Text), this.txtRZ.Text, this.txtnomcontat.Text, this.txtmail.Text, this.txtestado.Text, Convert.ToInt32(this.txtdni.Text));
                }


                if (rsp.Equals("Y"))
                {
                    this.mesajeok("Se registró con exito");

                    _owner.mostrarP();

                    this.Close();
                }
                else
                {
                    this.mesajerror(rsp);
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #2
0
        mostrarP()
        {
            try
            {
                this.Dock = DockStyle.Fill;
                this.dataGridViewProveedor.DataSource = Lproveedor_t_d.mostrarP();
                //this.dataGridViewProveedor.Columns[0].Visible = false;
                //this.ocultarcolumna();

                // lblTregistro.Text = Convert.ToString(dataGridViewCategoria.Rows.Count);
            }
            catch (Exception ex)
            {
                mesajerror(ex.Message);
            }
        }