public void MostrarE() { try { Dock = DockStyle.Fill; dataGridViewEmpleado.DataSource = Lempleado.MostrarE(); } catch (Exception ex) { mesajerror(ex.Message); } }
private void btnguardar_Click(object sender, EventArgs e) { string rsp = ""; try { if (this.txtdnie.Text == string.Empty && this.txtnombre.Text == string.Empty) { mesajerror("No puede dejar nombre de campo vacío"); erroricono.SetError(txtdnie, "Debe ingresar DNI de CLIENTE"); } if (this.isnuevo) { this.txtidtelefe.Text = this.txtdnie.Text; this.txtiddiree.Text = this.txtdnie.Text; this.txtdnietelf.Text = this.txtdnie.Text; this.txtdniedir.Text = this.txtdnie.Text; //this.txtfi.Text = (this.dtpikeringreso.Text); //this.txtfe.Text = (this.dtpikeringreso.Text); if (this.rbtfi.Checked) { this.lblfi.Visible = true; this.lblfe.Visible = false; this.txtfi.Text = this.dtpikeringreso.Text; //Convert.ToDateTime(this.txtfi.Text); this.txtfe.Text = "''"; } else { this.lblfe.Visible = true; this.lblfi.Visible = false; this.txtfe.Text = this.dtpikeringreso.Text; //Convert.ToDateTime(this.txtfe.Text); this.txtfi.Text = "''"; } rsp = Lproveedor_telef.InsertarTP(Convert.ToInt32(this.txtidtelefe.Text), Convert.ToInt32(this.txtPartic.Text), Convert.ToInt32(this.txtCelul.Text), Convert.ToInt32(this.txtfax.Text)); rsp = Lproveedor_direcc.InsertarPD(Convert.ToInt32(this.txtiddiree.Text), this.txtcalle.Text, Convert.ToInt32(this.txtNcalle.Text), this.txtProv.Text, this.txtlocalidad.Text, this.txtbarrio.Text, Convert.ToInt32(this.txtcp.Text)); rsp = Lempleado.InsertarE(Convert.ToInt32(this.txtdnie.Text), Convert.ToInt32(this.txtdnietelf.Text), Convert.ToInt32(this.txtdniedir.Text), this.PLMay(this.txtnombre.Text), this.PLMay(this.txtapellido.Text), this.txtmail.Text, this.txtestadoc.Text, (this.txtfi.Text), (this.txtfe.Text)); } //Convert.ToDateTime(this.dtpikeringreso.Text), Convert.ToDateTime(this.dtpikegreso.Text) if (rsp.Equals("Y")) { this.mesajeok("Se registró con exito"); _owner.MostrarE(); this.Close(); } else { this.mesajerror(rsp); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }