public string ConversieLaSir_PentruFisier() { string s = string.Format("{1}{0}{2}{0}{3}{0}{4}{0}{5}{0}{6}{0}{7}{0}{8}", SEPARATOR_PRINCIPAL_FISIER, Cod.ToString(), (Nume ?? "NECUNOSCUT"), (Prenume ?? " NECUNOSCUT "), (CNP ?? "NECUNOSCUT"), (NrTelefon ?? "NECUNOSCUT"), (Adresa ?? "NECUNOSCUT"), NrCarti.ToString(), ConversieLaSir_ImprumutID()); return(s); }
public string ConversieLaSir_PentruFisier() { string s = string.Format("{1}{0}{2}{0}{3}{0}{4}", SEPARATOR_PRINCIPAL_FISIER, Cod.ToString(), (Nume ?? "NECUNOSCUT"), (Prenume ?? " NECUNOSCUT "), NrCarti.ToString()); return(s); }
public void imprimir() { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("COD:{0}", Cod.ToString().PadLeft(8, '0')); Console.WriteLine("NOME:{0}", Nome.PadLeft(25, ' ')); Console.WriteLine("_".PadLeft(50, '_')); Console.ForegroundColor = ConsoleColor.Yellow; }
protected override int GetHashCodeCore() { unchecked { int hashCode = Cod.GetHashCode(); hashCode = (hashCode * 397) ^ Percentage.GetHashCode(); hashCode = (hashCode * 397) ^ ValidadePeriod.GetHashCode(); return(hashCode); } }
private void btnLimparProduto_Click(object sender, EventArgs e) { id.Clear(); Cod.Clear(); Produto.Clear(); Preco.Clear(); Estoque.Clear(); Unidade.Clear(); Desc.Clear(); tipoUnidade.SelectedIndex = -1; Ativo.Checked = false; Inativo.Checked = false; }
public static int DigitoModulo11(string area) { int Soma; int res; int X, Y; int dv; string Cod; Cod = (area).Trim(); if (Cod.Length < 1) { dv = 0; return(dv); } Soma = 0; Y = 2; for (X = (Cod.Length); X != 0; X--) { Soma = Soma + (Convert.ToInt32(Cod.Substring(X - 1, 1)) * Y); Y = Y + 1; if (Y == 10) { Y = 2; } } res = (Soma % 11); if (res != 0) { res = 11 - res; if (res == 10) { res = 0; } } dv = Convert.ToInt16((res).ToString()); return(dv); }
public override int GetHashCode() { var hashCode = 1398195996; hashCode = hashCode * -1521134295 + ra.GetHashCode(); hashCode = hashCode * -1521134295 + RA.GetHashCode(); hashCode = hashCode * -1521134295 + cod.GetHashCode(); hashCode = hashCode * -1521134295 + Cod.GetHashCode(); hashCode = hashCode * -1521134295 + nota.GetHashCode(); hashCode = hashCode * -1521134295 + Nota.GetHashCode(); hashCode = hashCode * -1521134295 + frequencia.GetHashCode(); hashCode = hashCode * -1521134295 + Frequencia.GetHashCode(); if (hashCode < 0) { hashCode = -hashCode; } return(hashCode); }
private int DeleteItens() { int rows = 0; MySqlConnection conn = Connection.GetInstance().GetConnection(); MySqlCommand cmd = conn.CreateCommand(); try { Messages.ShowSuccess(Cod.ToString()); cmd.CommandText = "DELETE FROM tb_itens_venda WHERE cod_venda = @cod"; cmd.Parameters.AddWithValue("@cod", Cod); rows = cmd.ExecuteNonQuery(); } catch (Exception erro) { Messages.ShowError("Erro: " + erro.Message); rows = -1; } finally { if (conn.State == ConnectionState.Open) { conn.Close(); } } return(rows); }
private void btnCadastrar_Click(object sender, EventArgs e) { try { DTO_Produto obj = new DTO_Produto(); obj.CodBarras = Cod.Text; obj.Nome = Produto.Text; obj.Preço = Preco.Text; obj.Estoque = Estoque.Text; obj.Unidade = Unidade.Text; obj.Tipo = tipoUnidade.Text; obj.Descricao = Desc.Text; if (Ativo.Checked == true) { obj.Ativo = "ativo"; } if (Inativo.Checked == true) { obj.Ativo = "inativo"; } obj.Acao = "cadastro"; string mensagem = BLL_Produto.CadProduto(obj); MessageBox.Show(mensagem, "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information); Cod.Clear(); Produto.Clear(); Preco.Clear(); Estoque.Clear(); Unidade.Clear(); Desc.Clear(); tipoUnidade.SelectedIndex = -1; Ativo.Checked = false; Inativo.Checked = false; } catch (Exception ex) { MessageBox.Show(ex.Message, "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public bool Equals(Curso other) => Cod.Equals(other.Cod);
public string ConversieLaSir() { return("#" + Cod.ToString() + " " + Nume + " " + Prenume + " - " + NrCarti.ToString() + " carti"); }
private void InsertVenda() { if (txtTipoPagamento.Text != "1") { frmDataVencimento data = new frmDataVencimento(); data.ShowDialog(); data1 = data.dataVencimento; } if (String.IsNullOrWhiteSpace(txtDesconto.Text)) { txtDesconto.Text = "0"; } sql = String.Format(@"insert into VENDA (IDFCFO, IDVENDEDOR, IDORDEM, TIPOPAGAMENTO, DESCONTO, OBSERVACAO, STATUS, DATAINCLUSAO, DATAPAGAMENTO, DATAVENCIMENTO) values( '{0}' ,{4}, null, '{1}' ,{2}, '{3}' , 'A' , getdate() , null, CONVERT(DATETIME, CONVERT(VARCHAR,'{5}', 121),103)) select SCOPE_IDENTITY()", txtIdCliente.Text, txtTipoPagamento.Text, txtDesconto.Text.Replace(".", "").Replace(",", "."), txtObservacao.Text, txtIdVendedor.Text, txtDataVencimento.Text); object IDVENDA = MetodosSql.ExecScalar(sql); txtCodigo.Text = IDVENDA.ToString(); string valor; char coCorretagem; double valorSeguralta; string query = @"INSERT INTO VENDACOMISSAO(IDVENDA, IDCLIENTE, VALORLIQUIDO, IOF, TOTALVENDA, COMISSAO, COMISSAOVENDA, COCORRETAGEM, VALORSEGURALTA) VALUES('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}')"; sql = String.Format(@"SELECT * FROM PORCENTAGENS "); double percCorretora = double.Parse(MetodosSql.GetField(sql, "PERCSEGURALTA")) / 100; double impostoNota = double.Parse(MetodosSql.GetField(sql, "PERCIMPOSTONOTA")) / 100; if (cbCoCorretagem.Checked == true) { coCorretagem = 'S'; valorSeguralta = (double.Parse(txtComissaoVenda.Text) * percCorretora); valor = valorSeguralta.ToString("F2", CultureInfo.InvariantCulture); sql = String.Format(query, /*{0}*/ IDVENDA, /*{1}*/ txtIdCliente.Text, /*{2}*/ txtValorLiquido.Text.Replace(".", "").Replace(",", "."), /*{3}*/ txtIof.Text.Replace(".", "").Replace(",", "."), /*{4}*/ txtTotalDesconto.Text.Replace(".", "").Replace(",", "."), /*{5}*/ txtComissao.Text.Replace(".", "").Replace(",", "."), /*{6}*/ txtComissaoVenda.Text.Replace(".", "").Replace(",", "."), /*{7}*/ coCorretagem, /*{8}*/ valor); } else { coCorretagem = 'N'; valorSeguralta = (double.Parse(txtComissaoVenda.Text) * percCorretora * impostoNota); valor = valorSeguralta.ToString("F2", CultureInfo.InvariantCulture); sql = String.Format(query, /*{0}*/ IDVENDA, /*{1}*/ txtIdCliente.Text, /*{2}*/ txtValorLiquido.Text.Replace(".", "").Replace(",", "."), /*{3}*/ txtIof.Text.Replace(".", "").Replace(",", "."), /*{4}*/ txtTotalDesconto.Text.Replace(".", "").Replace(",", "."), /*{5}*/ txtComissao.Text.Replace(".", "").Replace(",", "."), /*{6}*/ txtComissaoVenda.Text.Replace(".", "").Replace(",", "."), /*{7}*/ coCorretagem, /*{8}*/ valor); } MetodosSql.ExecQuery(sql); foreach (Produto p in produtos) { sql = String.Format("insert into ITEMMOVIMENTO (IDVENDA, IDPRODUTO, VALOR, QUANTIDADE, DATAINCLUSAO) values ('{0}','{1}','{2}','1', GETDATE())", /*{0}*/ IDVENDA.ToString(), /*{1}*/ p.IDPRODUTO, /*{2}*/ txtTotalDesconto.Text.Replace(".", "").Replace(",", ".")); MetodosSql.ExecQuery(sql); } Editar = true; InsertParcela(); if (vendaClick == false) { frmIdPagamento frm = new frmIdPagamento(false, null, true); frm.txtValorRestante.Enabled = false; frm.label7.Enabled = false; frm.CODIGOVENDA = IDVENDA.ToString(); frm.CODIGOPARCELA = Cod.ToString(); frm.CODIGOCLIENTE = txtIdCliente.Text; frm.ShowDialog(); } }
public bool Equals(Asignatura other) => Cod.Equals(other.Cod);
public bool Equals(Departamento other) => Cod.Equals(other.Cod);
public override string ToString() { return(Cod.ToString()); }
public string ConversieLaSir() { return("#" + Cod.ToString() + " - " + Titlu + " - " + Autor + " - " + Editura + "\nLimbă: " + Limba + "\nGen: " + GenToString + "\nNumăr de exemplare: " + NumarExemplare.ToString() + "\n"); }
public string ConversieLaSir_PentruFisier() { string s = string.Format("{1}{0}{2}{0}{3}{0}{4}{0}{5}{0}{6}{0}{7}{0}{8}{0}{9}", SEPARATOR_PRINCIPAL_FISIER, (Titlu ?? "NECUNOSCUT"), (Autor ?? " NECUNOSCUT "), (Editura ?? " NECUNOSCUT "), Cod.ToString(), NumarExemplare.ToString(), NumarImprumutate.ToString(), Limba, GenToString, dataActualizare.ToString()); return(s); }
public static Entity Create(this EntityType entityType, World world) { Entity entity = null; switch (entityType) { case EntityType.None: return(null); case EntityType.Chicken: entity = new Chicken(world); break; case EntityType.Cow: entity = new Cow(world); break; case EntityType.Pig: entity = new Pig(world); break; case EntityType.Sheep: entity = new Sheep(world); break; case EntityType.Wolf: entity = new Wolf(world); break; case EntityType.Villager: entity = new Villager(world); break; case EntityType.MushroomCow: entity = new Mooshroom(world); break; case EntityType.Squid: entity = new Squid(world); break; case EntityType.Rabbit: entity = new Rabbit(world); break; case EntityType.Bat: entity = new Bat(world); break; case EntityType.IronGolem: entity = new VillagerGolem(world); break; case EntityType.SnowGolem: entity = new Snowman(world); break; case EntityType.Ocelot: entity = new Ocelot(world); break; case EntityType.Zombie: entity = new Zombie(world); break; case EntityType.Creeper: entity = new Creeper(world); break; case EntityType.Skeleton: entity = new Skeleton(world); break; case EntityType.Spider: entity = new Spider(world); break; case EntityType.ZombiePigman: entity = new ZombiePigman(world); break; case EntityType.Slime: entity = new Slime(world); break; case EntityType.Endermite: entity = new Endermite(world); break; case EntityType.Enderman: entity = new Enderman(world); break; case EntityType.Silverfish: entity = new Silverfish(world); break; case EntityType.CaveSpider: entity = new CaveSpider(world); break; case EntityType.Ghast: entity = new Ghast(world); break; case EntityType.MagmaCube: entity = new MagmaCube(world); break; case EntityType.Blaze: entity = new Blaze(world); break; case EntityType.ZombieVillager: entity = new ZombieVillager(world); break; case EntityType.Witch: entity = new Witch(world); break; case EntityType.Stray: entity = new Stray(world); break; case EntityType.Husk: entity = new Husk(world); break; case EntityType.WitherSkeleton: entity = new WitherSkeleton(world); break; case EntityType.Guardian: entity = new Guardian(world); break; case EntityType.ElderGuardian: entity = new ElderGuardian(world); break; case EntityType.Horse: entity = new Horse(world); break; case EntityType.ZombieHorse: entity = new ZombieHorse(world); break; case EntityType.PolarBear: entity = new PolarBear(world); break; case EntityType.Shulker: entity = new Shulker(world); break; case EntityType.EnderDragon: entity = new EnderDragon(world); break; case EntityType.SkeletonHorse: entity = new SkeletonHorse(world); break; case EntityType.Wither: entity = new Wither(world); break; case EntityType.Evoker: entity = new EvocationIllager(world); break; case EntityType.Vindicator: entity = new VindicationIllager(world); break; case EntityType.Vex: entity = new Vex(world); break; case EntityType.FallingBlock: entity = new EntityFallingBlock(world); break; case EntityType.ArmorStand: entity = new EntityArmorStand(world, null); break; case EntityType.Arrow: entity = new ArrowEntity(world, null); break; case EntityType.Item: entity = new ItemEntity(world); break; case EntityType.Mooshroom: entity = new Mooshroom(world); break; case EntityType.Snowball: entity = new SnowballEntity(world, null); break; case EntityType.ThrownEgg: entity = new EggEntity(world, null); break; case EntityType.Donkey: entity = new Donkey(world); break; case EntityType.Llama: entity = new Llama(world); break; case EntityType.Mule: entity = new Mule(world); break; case EntityType.Fox: entity = new Fox(world); break; case EntityType.Parrot: entity = new Parrot(world); break; case EntityType.Phantom: entity = new Phantom(world); break; case EntityType.Bee: entity = new Bee(world); break; case EntityType.LlamaSpit: entity = new LlamaSpit(world); break; case EntityType.Cat: entity = new Cat(world); break; case EntityType.SmallFireball: entity = new SmallFireball(world); break; case EntityType.Fireball: entity = new Fireball(world); break; case EntityType.Dolphin: entity = new Dolphin(world); break; case EntityType.Cod: entity = new Cod(world); break; case EntityType.PufferFish: entity = new PufferFish(world); break; case EntityType.Salmon: entity = new Salmon(world); break; case EntityType.TropicalFish: entity = new TropicalFish(world); break; case EntityType.FireworkRocket: entity = new FireworkRocket(world, null); break; //case EntityType.Human: //entity = new PlayerMob("test", world, ); // break; default: return(null); } return(entity); }