コード例 #1
0
 private void CreateItem()
 {
     DataAccess da = new DataAccess();
     account_type item = new account_type();
     item.name = edtName.Text;
     item.description = edtDescr.Text;
     da.AccountTypeCreate(item);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the account_type EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToaccount_type(account_type account_type)
 {
     base.AddObject("account_type", account_type);
 }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
ファイル: DataAccess.cs プロジェクト: bashlykevich/Bycar
 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();
     }
 }
コード例 #6
0
ファイル: DataAccess.cs プロジェクト: bashlykevich/Bycar
 public void AccountTypeCreate(account_type _obj)
 {
     _obj.created_on = DateTime.Now;
     objDataContext.AddToaccount_type(_obj);
     objDataContext.SaveChanges();
 }