private vat_rate getItemFromFields() { vat_rate item = new vat_rate(); item.id = this._id; item.name = edtName.Text; item.rate = 0; decimal tmp = 0; decimal.TryParse(edtRate.Text, out tmp); item.rate = tmp; return item; }
/// <summary> /// Create a new vat_rate object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> /// <param name="rate">Initial value of the rate property.</param> public static vat_rate Createvat_rate(global::System.Int32 id, global::System.String name, global::System.Decimal rate) { vat_rate vat_rate = new vat_rate(); vat_rate.id = id; vat_rate.name = name; vat_rate.rate = rate; return vat_rate; }
public void VATRateEdit(vat_rate item) { vat_rate original = objDataContext.vat_rate.FirstOrDefault(b => b.id == item.id); if (original != null) { original.name = item.name; original.rate = item.rate; //if (original.created_on == null) // original.created_on = DateTime.Now; objDataContext.SaveChanges(); } }
/// <summary> /// Deprecated Method for adding a new object to the vat_rate EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTovat_rate(vat_rate vat_rate) { base.AddObject("vat_rate", vat_rate); }
public void VATRateCreate(vat_rate _obj) { //_obj.created_on = DateTime.Now; objDataContext.AddTovat_rate(_obj); objDataContext.SaveChanges(); }