public void DeleteAgent(clsAgent agent) { foreach (DataRow myrow in clsGlobal.tbAgents.Rows) { if (myrow["AgentID"].ToString() == agent.Id.ToString()) { myrow.Delete(); } } }
public void AddAgent(clsAgent agent) { DataRow myRow = clsGlobal.tbAgents.NewRow(); myRow["AgentID"] = agent.Id; myRow["Nom"] = agent.Name; myRow["Email"] = agent.Email; myRow["Cellulaire"] = agent.Phone; myRow["NAS"] = agent.Ssn; myRow["DateEmbauche"] = agent.Hire_date; myRow["Password"] = agent.Password; clsGlobal.tbAgents.Rows.Add(myRow); }
public void EditAgent(clsAgent agent) { foreach (DataRow myrow in clsGlobal.tbAgents.Rows) { if (myrow["AgentID"].ToString() == agent.Id.ToString()) { myrow["Nom"] = agent.Name; myrow["Email"] = agent.Email; myrow["Cellulaire"] = agent.Phone; myrow["NAS"] = agent.Ssn; myrow["DateEmbauche"] = agent.Hire_date; myrow["Password"] = agent.Password; } } }