/// <summary>
 /// Create a new Agent object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static Agent CreateAgent(global::System.Int32 id)
 {
     Agent agent = new Agent();
     agent.Id = id;
     return agent;
 }
        public ActionResult Create(AgentCreateViewModel model)
        {
            Agent newAgent = new Agent();
            newAgent.Username = model.newAgent.Username;
            newAgent.Password = model.newAgent.Password;
            newAgent.StatusId = model.newAgent.StatusId;
            newAgent.FistName = model.newAgent.FistName;
            newAgent.LastName = model.newAgent.LastName;
            newAgent.Address = model.newAgent.Address;
            newAgent.Phone = model.newAgent.Phone;
            newAgent.Email = model.newAgent.Email;
            newAgent.Comment = model.newAgent.Comment;

            bool bSuccess = AgentBUS.AdđItem(newAgent);

            if (bSuccess == true)
                return RedirectToAction("Browse");

            return View(model);
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Agents EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAgents(Agent agent)
 {
     base.AddObject("Agents", agent);
 }