示例#1
0
        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;
        }
示例#2
0
 public void CopyFrom(Agent entity)
 {
     // this.UserId = // ..
     this.StatusId = entity.StatusId;
     this.Phone = entity.Phone;
     this.Address = entity.Address;
 }
示例#3
0
        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;
		}
示例#9
0
 public bool IsExist(Agent entity)
 {
     // TODO:
     return true;
 }