public override bool Editar() { ObjEntEmpresa = new Entidade_Empresa(); mEmpresa = new Model_Empresa(); cModGeral = new C_ModuloGeral(); ObjEntEmpresa.CdCnpj = cModGeral.TiraCampos(MskCnpj.Text); ObjEntEmpresa.NomeRazaoSocial = TxtRazaoSocial.Text; ObjEntEmpresa.NomeFantasia = TxtFantasia.Text; ObjEntEmpresa.TipoRegimeTributario = TipoRegime(); ObjEntEmpresa.NmLogradouro = TxtNmLogradouro.Text; ObjEntEmpresa.NrLogradouro = TxtNumero.Text; ObjEntEmpresa.NmComplemento = TxtComplemento.Text; ObjEntEmpresa.CdUF = CboUf.Text; //ObjEntEmpresa.CdMunicipio = int.Parse(CboMunicipio.SelectedValue.ToString()); ObjEntEmpresa.CdMunicipio = 0; mEmpresa.Update(ObjEntEmpresa); return true; }
private void btnEditar_Click(object sender, EventArgs e) { cModGeral = new C_ModuloGeral(); DataGridViewRow Row = grdBase.CurrentRow; TpAcao = TipoAcao.Editar; PesquisarDados(string.Empty, cModGeral.TiraCampos(Row.Cells[0].Value.ToString())); tcBase.SelectedTab = tpDados; }
public override bool ValidaCampos() { cModGeral = new C_ModuloGeral(); if (MskCnpj.Text == string.Empty) { MessageBox.Show("O campo cnpj e obrigatorio.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return false; } else if (TxtRazaoSocial.Text.Trim() == string.Empty) { MessageBox.Show("O campo Razao Social e obrigatorio.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return false; } else if (TxtFantasia.Text.Trim() == string.Empty) { MessageBox.Show("O campo Nome Fantasia e obrigatorio.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return false; } else if (TxtNmLogradouro.Text.Trim() == string.Empty) { MessageBox.Show("O campo Logradouro e obrigadorio.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return false; } else if (TxtNumero.Text.Trim() == string.Empty) { MessageBox.Show("O campo número e obrigatorio.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return false; } //else if (CboUf.Text == string.Empty) //{ // MessageBox.Show("O campo UF obrigatorio.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); // return false; //} //else if (CboMunicipio.Text.Trim() == string.Empty) //{ // MessageBox.Show("O campo Municipio obrigatorio.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); // return false; //} else return true; }
public override bool Salvar() { ObjProduto = new Entidade_Produto(); ObjGrupo = new Grupo(); ObjEUnidade = new Entidade_Unidade(); mCGeral = new C_ModuloGeral(); mProduto = new Model_Produto(); ObjProduto.IdProduto = Convert.ToInt32(TxtID.Text); ObjProduto.NmProduto = TxtDescPro.Text; ObjGrupo.IDGrupo = ucGrupo1.IdGrupo; ObjProduto.IdGrupo = ObjGrupo; ObjEUnidade.Unidade = ucUnidade1.Unidade; ObjProduto.Unidade = ObjEUnidade; ObjProduto.TpOrigemMercadoria = CboOrigemMercadoria.Text.Substring(0, 1); ObjProduto.VlPreco = Convert.ToDouble(mCGeral.FormatValoresBanco(TxtVlPreco.Text)); ObjProduto.VlPercSub = TxtVlPercSub.Text.Trim() == string.Empty ? 0 : Convert.ToDouble(mCGeral.FormatValoresBanco(TxtVlPercSub.Text)); ObjProduto.VlPercRed = TxtVlPercRerd.Text.Trim() == string.Empty ? 0 : Convert.ToDouble(mCGeral.FormatValoresBanco(TxtVlPercRerd.Text)); ObjProduto.NCM = TxtNCM.Text; ObjProduto.CodEnqLegal = TxtCodEntLegal.Text; ObjProduto.CdCstIcms = UCIcms.Icms; ObjProduto.CdCstIpi = UCIcms.Ipi; ObjProduto.CdCstPis = UCIcms.Pis; ObjProduto.CdCstCofins = UCIcms.Cofins; if (mProduto.Incluir(ObjProduto)) return true; else return false; }