Inheritance: System.Data.Objects.DataClasses.EntityObject
示例#1
0
        public static void CreateClient(ClientModel clientModel)
        {
            if (UserHelper.UserID != null)
            {
                var storageDbEntities = new StorageDBEntities();

                Client newClient = new Client
                                       {
                                           Name = clientModel.Name,
                                           Address = clientModel.Address,
                                           Telephone = clientModel.Telephone,
                                           UserID = UserHelper.UserID.Value
                                       };

                storageDbEntities.Clients.AddObject(newClient);

                storageDbEntities.SaveChanges();
            }
        }
示例#2
0
 /// <summary>
 /// Create a new Client object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="telephone">Initial value of the Telephone property.</param>
 /// <param name="address">Initial value of the Address property.</param>
 /// <param name="userID">Initial value of the UserID property.</param>
 public static Client CreateClient(global::System.Int32 id, global::System.String name, global::System.String telephone, global::System.String address, global::System.Int32 userID)
 {
     Client client = new Client();
     client.ID = id;
     client.Name = name;
     client.Telephone = telephone;
     client.Address = address;
     client.UserID = userID;
     return client;
 }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Clients EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToClients(Client client)
 {
     base.AddObject("Clients", client);
 }