예제 #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
 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
 public void AccountTypeCreate(account_type _obj)
 {
     _obj.created_on = DateTime.Now;
     objDataContext.AddToaccount_type(_obj);
     objDataContext.SaveChanges();
 }