private void CreateBank() { DataAccess da = new DataAccess(); bank item = new bank(); item.mfo = edtMFO.Text; item.fax = edtFax.Text; item.address = edtAddress.Text; item.name = edtName.Text; item.phone = edtPhone.Text; da.BankCreate(item); }
private void EditBank() { DataAccess da = new DataAccess(); bank item = new bank(); item.id = this._ID; item.mfo = edtMFO.Text; item.fax = edtFax.Text; item.address = edtAddress.Text; item.name = edtName.Text; item.phone = edtPhone.Text; da.BankEdit(item); }
/// <summary> /// Deprecated Method for adding a new object to the banks EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTobanks(bank bank) { base.AddObject("banks", bank); }
/// <summary> /// Create a new bank object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> /// <param name="created_on">Initial value of the created_on property.</param> public static bank Createbank(global::System.Int32 id, global::System.String name, global::System.DateTime created_on) { bank bank = new bank(); bank.id = id; bank.name = name; bank.created_on = created_on; return bank; }
public void BankEdit(bank item) { bank original = objDataContext.banks.FirstOrDefault(b => b.id == item.id); original.name = item.name; original.address = item.address; original.fax = item.fax; original.mfo = item.mfo; original.phone = item.phone; if (original.created_on == null) original.created_on = DateTime.Now; objDataContext.SaveChanges(); }
public void BankCreate(bank _obj) { _obj.created_on = DateTime.Now; objDataContext.AddTobanks(_obj); objDataContext.SaveChanges(); }