public static bool Update(Agent entity) { MoneyPacificDataContext mpdb = new MoneyPacificDataContext(); Agent existAgent = DataAccessLayer.GetConnection.Agents .Where(p => p.UserId.Equals(entity.UserId)) .SingleOrDefault(); existAgent.Address = entity.Address; //existAgent.Block = entity.Block; //existAgent.CreateDate = entity.CreateDate; //existAgent.Email = entity.Email; //existAgent.FirstName = entity.FirstName; //existAgent.LastName = entity.LastName; //existAgent.LastVisitDate = entity.LastVisitDate; //existAgent.Password = entity.Password; existAgent.Phone = entity.Phone; existAgent.StatusId = entity.StatusId; //existAgent.Username = entity.Username; DataAccessLayer.GetConnection.SubmitChanges(); mpdb.Connection.Close(); return true; }
public void CopyFrom(Agent entity) { // this.UserId = // .. this.StatusId = entity.StatusId; this.Phone = entity.Phone; this.Address = entity.Address; }
public static bool AddNew(Agent entity) { MoneyPacificDataContext mpdb = new MoneyPacificDataContext(); mpdb.Agents.InsertOnSubmit(entity); mpdb.SubmitChanges(); mpdb.Connection.Close(); return true; }
partial void DeleteAgent(Agent instance);
partial void UpdateAgent(Agent instance);
partial void InsertAgent(Agent instance);
private void detach_Agents(Agent entity) { this.SendPropertyChanging(); entity.AgentState = null; }
private void attach_Agents(Agent entity) { this.SendPropertyChanging(); entity.AgentState = this; }
public bool IsExist(Agent entity) { // TODO: return true; }