private currency getItemFromFields() { currency item = new currency(); item.id = _id; item.name = edtName.Text; item.code = edtCode.Text; item.short_name = edtShortName.Text; item.is_basic = edtBasic.IsChecked.HasValue ? (edtBasic.IsChecked.Value ? 1 : 0) : 0; return item; }
/// <summary> /// Deprecated Method for adding a new object to the currencies EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTocurrencies(currency currency) { base.AddObject("currencies", currency); }
public void CurrencyEdit(currency i) { currency original = objDataContext.currencies.FirstOrDefault(b => b.id == i.id); if (original != null) { original.name = i.name; original.short_name = i.short_name; original.code = i.code; original.is_basic = i.is_basic; if (i.is_basic > 0) { SetBasicCurrency(original.id); } objDataContext.SaveChanges(); } }
/// <summary> /// Create a new currency object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> /// <param name="short_name">Initial value of the short_name property.</param> public static currency Createcurrency(global::System.Int32 id, global::System.String name, global::System.String short_name) { currency currency = new currency(); currency.id = id; currency.name = name; currency.short_name = short_name; return currency; }
public void CurrencyCreate(currency _obj) { //_obj.created_on = DateTime.Now; objDataContext.AddTocurrencies(_obj); objDataContext.SaveChanges(); if (_obj.is_basic > 0) { SetBasicCurrency(_obj.id); } }