public void InsertPegawai(string nama, string instansi, string username, string password, bool isAdmin) { try { using (DbBhmEntities db = new DbBhmEntities()) { Pegawai pegawai = new Pegawai(); pegawai.namaPgw = nama; pegawai.instansi = instansi; pegawai.usernamePgw = username; pegawai.passwordPgw = password; pegawai.isAdmin = isAdmin; db.Pegawais.AddObject(pegawai); db.SaveChanges(); } } catch { // Ignore exceptions } }
/// <summary> /// Deprecated Method for adding a new object to the Pegawais EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToPegawais(Pegawai pegawai) { base.AddObject("Pegawais", pegawai); }
/// <summary> /// Create a new Pegawai object. /// </summary> /// <param name="idPgw">Initial value of the idPgw property.</param> /// <param name="isAdmin">Initial value of the isAdmin property.</param> public static Pegawai CreatePegawai(global::System.Int32 idPgw, global::System.Boolean isAdmin) { Pegawai pegawai = new Pegawai(); pegawai.idPgw = idPgw; pegawai.isAdmin = isAdmin; return pegawai; }