Exemplo n.º 1
0
        public string Insert()
        {
            using (JuizoFinalDataContext db = new JuizoFinalDataContext(DAO.Constantes.ConnectionString))
            {
                try
                {
                    this.FillEmptyStringInNullFields();

                    db.Juizofinal_jazigos.InsertOnSubmit(this);
                    db.SubmitChanges();
                    return("");
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
        public void UpdateRegistro()
        {
            using (JuizoFinalDataContext db = new JuizoFinalDataContext(DAO.Constantes.ConnectionString))
            {
                try
                {
                    var obj = (from Objs in db.Juizofinal_clientes
                               where Objs.ID_cliente == this.ID_cliente
                               select Objs).Single();

                    Map(obj, this);

                    db.SubmitChanges();
                }
                catch (Exception ex)
                {
                    // TODO: Gerar log de erro
                    throw;
                }
            }
        }