private void CreateItem() { DataAccess da = new DataAccess(); account_type item = new account_type(); item.name = edtName.Text; item.description = edtDescr.Text; da.AccountTypeCreate(item); }
private void EditItem() { DataAccess da = new DataAccess(); account_type item = new account_type(); item.id = _id; item.name = edtName.Text; item.description = edtDescr.Text; da.AccountTypeEdit(item); }
/// <summary> /// Deprecated Method for adding a new object to the account_type EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToaccount_type(account_type account_type) { base.AddObject("account_type", account_type); }
/// <summary> /// Create a new account_type object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> public static account_type Createaccount_type(global::System.Int32 id, global::System.String name) { account_type account_type = new account_type(); account_type.id = id; account_type.name = name; return account_type; }
public void AccountTypeEdit(account_type item) { account_type original = objDataContext.account_type.FirstOrDefault(b => b.id == item.id); if (original != null) { original.name = item.name; original.description = item.description; if (original.created_on == null) original.created_on = DateTime.Now; objDataContext.SaveChanges(); } }
public void AccountTypeCreate(account_type _obj) { _obj.created_on = DateTime.Now; objDataContext.AddToaccount_type(_obj); objDataContext.SaveChanges(); }