public void InserirSocio() { if ((vTP_Modo.Equals(TTpModo.tm_Insert) || vTP_Modo.Equals(TTpModo.tm_Edit)) && (BS_CadEmpresa.Current != null)) { using (TFSociosEmpresa fSocio = new TFSociosEmpresa()) { if (fSocio.ShowDialog() == DialogResult.OK) { if (fSocio.rSocio != null) { if ((BS_CadEmpresa.Current as TRegistro_CadEmpresa).lSocios.Exists(p => p.Cd_clifor.Trim().Equals(fSocio.rSocio.Cd_clifor.Trim()))) { (BS_CadEmpresa.Current as TRegistro_CadEmpresa).lSocios.Find(p => p.Cd_clifor.Trim().Equals(fSocio.rSocio.Cd_clifor.Trim())).Ds_funcao = fSocio.rSocio.Ds_funcao; (BS_CadEmpresa.Current as TRegistro_CadEmpresa).lSocios.Find(p => p.Cd_clifor.Trim().Equals(fSocio.rSocio.Cd_clifor.Trim())).Dt_inclusao = fSocio.rSocio.Dt_inclusao; (BS_CadEmpresa.Current as TRegistro_CadEmpresa).lSocios.Find(p => p.Cd_clifor.Trim().Equals(fSocio.rSocio.Cd_clifor.Trim())).Dt_saida = fSocio.rSocio.Dt_saida; (BS_CadEmpresa.Current as TRegistro_CadEmpresa).lSocios.Find(p => p.Cd_clifor.Trim().Equals(fSocio.rSocio.Cd_clifor.Trim())).St_responsavel = fSocio.rSocio.St_responsavel; } else { (BS_CadEmpresa.Current as TRegistro_CadEmpresa).lSocios.Add(fSocio.rSocio); } BS_CadEmpresa.ResetCurrentItem(); } } } } }
private void InserirInsc() { if ((vTP_Modo.Equals(TTpModo.tm_Insert) || vTP_Modo.Equals(TTpModo.tm_Edit)) && (BS_CadEmpresa.Current != null)) { using (TFInscSubstEmpresa fInsc = new TFInscSubstEmpresa()) { if (fInsc.ShowDialog() == DialogResult.OK) { if (fInsc.rInsc != null) { if ((BS_CadEmpresa.Current as TRegistro_CadEmpresa).lInsc.Exists(p => p.Cd_uf.Trim().Equals(fInsc.rInsc.Cd_uf.Trim()))) { (BS_CadEmpresa.Current as TRegistro_CadEmpresa).lInsc.Find(p => p.Cd_uf.Trim().Equals(fInsc.rInsc.Cd_uf.Trim())).Insc_estadual_subst = fInsc.rInsc.Insc_estadual_subst; } else { (BS_CadEmpresa.Current as TRegistro_CadEmpresa).lInsc.Add(fInsc.rInsc); } BS_CadEmpresa.ResetCurrentItem(); } } } } }
public override void afterCancela() { bb_visualiazarAcamp.Enabled = false; bb_visualizarGarantia.Enabled = false; bb_visualizarLaudo.Enabled = false; bb_visualizarOS.Enabled = false; bb_visualizarEntrega.Enabled = false; bb_loadEntrega.Enabled = false; bb_loadGarantia.Enabled = false; bb_loadLaudo.Enabled = false; bb_loadOS.Enabled = false; bb_loadAcomp.Enabled = false; base.afterCancela(); if (this.vTP_Modo == TTpModo.tm_Insert) { BS_CadEmpresa.RemoveCurrent(); } buscarlogo.Enabled = false; bb_excluirLogo.Enabled = false; Modelo_OS = string.Empty; Modelo_Entrega = string.Empty; Modelo_Garantia = string.Empty; Modelo_Laudo = string.Empty; Modelo_Acompanhamento = string.Empty; }
private void bb_excluirLogo_Click(object sender, EventArgs e) { if (BS_CadEmpresa.Current != null) { (BS_CadEmpresa.Current as TRegistro_CadEmpresa).Img = null; BS_CadEmpresa.ResetCurrentItem(); } }
private void BS_CadEmpresa_PositionChanged(object sender, EventArgs e) { if (BS_CadEmpresa.Current != null) { (BS_CadEmpresa.Current as TRegistro_CadEmpresa).lSocios = TCN_SociosEmpresa.Buscar((BS_CadEmpresa.Current as TRegistro_CadEmpresa).Cd_empresa, string.Empty, null); (BS_CadEmpresa.Current as TRegistro_CadEmpresa).lInsc = TCN_InscSubstEmpresa.Buscar((BS_CadEmpresa.Current as TRegistro_CadEmpresa).Cd_empresa, string.Empty, null); BS_CadEmpresa.ResetCurrentItem(); } }
private void AlterarInsc() { if ((vTP_Modo.Equals(TTpModo.tm_Insert) || vTP_Modo.Equals(TTpModo.tm_Edit)) && (bsInsc.Current != null)) { using (TFInscSubstEmpresa fInsc = new TFInscSubstEmpresa()) { string insc = (bsInsc.Current as TRegistro_InscSubstEmpresa).Insc_estadual_subst; if (fInsc.ShowDialog() != DialogResult.OK) { (bsSocios.Current as TRegistro_InscSubstEmpresa).Insc_estadual_subst = insc; } BS_CadEmpresa.ResetCurrentItem(); } } }
public override void afterNovo() { if ((this.vTP_Modo == TTpModo.tm_busca) || (this.vTP_Modo == TTpModo.tm_Standby)) { BS_CadEmpresa.AddNew(); base.afterNovo(); pParametros.HabilitarControls(true, this.vTP_Modo); pDocumentos.HabilitarControls(true, this.vTP_Modo); if (!(CD_Empresa.Focus())) { NM_Empresa.Focus(); } buscarlogo.Enabled = true; bb_excluirLogo.Enabled = true; } }
private void bucar_logo_Click(object sender, EventArgs e) { try { if ((BS_CadEmpresa.Current != null) && ((vTP_Modo == TTpModo.tm_Insert) || (vTP_Modo == TTpModo.tm_Edit))) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "IMAGENS|*.jpg"; if (ofd.ShowDialog() == DialogResult.OK) { if (System.IO.File.Exists(ofd.FileName)) { (BS_CadEmpresa.Current as TRegistro_CadEmpresa).LogoEmpresa = Image.FromFile(ofd.FileName); BS_CadEmpresa.ResetCurrentItem(); } } } } catch (Exception ex) { MessageBox.Show("Erro localizar imagem: " + ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public override void afterExclui() { try { if ((this.vTP_Modo == TTpModo.tm_Standby) || (this.vTP_Modo == TTpModo.tm_busca)) { if (MessageBox.Show("Confirma Exclusão do Registro?", "Mensagem", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes) { TCN_CadEmpresa.Excluir((BS_CadEmpresa.Current as TRegistro_CadEmpresa), null); BS_CadEmpresa.RemoveCurrent(); pDados.LimparRegistro(); afterBusca(); } } } catch (Exception e) { MessageBox.Show("" + e.Message); } }
public void AlterarSocio() { if ((vTP_Modo.Equals(TTpModo.tm_Insert) || vTP_Modo.Equals(TTpModo.tm_Edit)) && (bsSocios.Current != null)) { using (TFSociosEmpresa fSocio = new TFSociosEmpresa()) { string funcao = (bsSocios.Current as TRegistro_SociosEmpresa).Ds_funcao; DateTime?dt_inc = (bsSocios.Current as TRegistro_SociosEmpresa).Dt_inclusao; DateTime?dt_sai = (bsSocios.Current as TRegistro_SociosEmpresa).Dt_saida; string st_res = (bsSocios.Current as TRegistro_SociosEmpresa).St_responsavel; fSocio.rSocio = bsSocios.Current as TRegistro_SociosEmpresa; if (fSocio.ShowDialog() != DialogResult.OK) { (bsSocios.Current as TRegistro_SociosEmpresa).Ds_funcao = funcao; (bsSocios.Current as TRegistro_SociosEmpresa).Dt_inclusao = dt_inc; (bsSocios.Current as TRegistro_SociosEmpresa).Dt_saida = dt_sai; (bsSocios.Current as TRegistro_SociosEmpresa).St_responsavel = st_res; } BS_CadEmpresa.ResetCurrentItem(); } } }
public override int buscarRegistros() { TList_CadEmpresa lista = TCN_CadEmpresa.Busca(CD_Empresa.Text, NM_Empresa.Text, "", null); if (lista != null) { if (lista.Count > 0) { this.Lista = lista; BS_CadEmpresa.DataSource = lista; BS_CadEmpresa_PositionChanged(this, new EventArgs()); } else if ((vTP_Modo == TTpModo.tm_Standby) || (vTP_Modo == TTpModo.tm_busca)) { BS_CadEmpresa.Clear(); } return(lista.Count); } else { return(0); } }