Exemple #1
0
 public string excluirUf(uf uf)
 {
     string erro = null;
     try
     {
         ufs.DeleteObject(uf);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         erro = ex.Message;
     }
     return erro;
 }
Exemple #2
0
 public string adicionarUf(uf uf)
 {
     string erro = null;
     try
     {
         ufs.AddObject(uf);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         erro = ex.Message;
     }
     return erro;
 }
Exemple #3
0
        public string editarUf(uf uf)
        {
            string erro = null;
            try
            {
                if (uf.EntityState == System.Data.EntityState.Detached)
                {
                    ufs.Attach(uf);
                }
                db.ObjectStateManager.ChangeObjectState(uf, System.Data.EntityState.Modified);

                db.SaveChanges();
            }
            catch (Exception ex)
            {
                erro = ex.Message;
            }
            return erro;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the uf EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTouf(uf uf)
 {
     base.AddObject("uf", uf);
 }
 /// <summary>
 /// Create a new uf object.
 /// </summary>
 /// <param name="uF">Initial value of the UF property.</param>
 /// <param name="estado">Initial value of the Estado property.</param>
 public static uf Createuf(global::System.String uF, global::System.String estado)
 {
     uf uf = new uf();
     uf.UF = uF;
     uf.Estado = estado;
     return uf;
 }