예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string[] carroArray = cmbCarro.Text.Split(',');
                long     idVehicle  = long.Parse(carroArray[0]);

                string[] infractionArray = cmbInfracao.Text.Split(',');
                int      idInfraction    = int.Parse(infractionArray[0]);

                string[] CompanyArray = cmbInfracao.Text.Split(',');
                long     idCompany    = long.Parse(CompanyArray[0]);

                float preco = float.Parse(txtPreco.Text.Replace(".", ","));



                TblMultasModel multasModel = new TblMultasModel(null, idVehicle, idInfraction, dtpMulta.Value, txtCodBarra.Text, idCompany, preco);
                multasModel.State = EntityState.Add;
                MessageBox.Show(multasModel.saveChange(), "Sistema ABC");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Sistema ABC");
            }
        }
예제 #2
0
        private void FrmMultas_Load(object sender, EventArgs e)
        {
            TblMultasModel multasModel = new TblMultasModel();

            dgvUsers.DataSource = multasModel.GetAll();
        }