public ReportViewSalesCheck(int outgoId) { InitializeComponent(); DataAccess da = new DataAccess(); SpareOutgoId = outgoId; Outgo = da.SpareOutgoGet(outgoId); }
public ReportViewSpareOutgoTTNAppendix(int outgoId) { InitializeComponent(); DataAccess da = new DataAccess(); SpareOutgoId = outgoId; Outgo = da.SpareOutgoGet(outgoId); }
private spare_outgo getItemFromFields() { spare_outgo item = new spare_outgo(); item.id = _id; item.IDN = Int32.Parse(edtNumber.Text); item.created_on = edtDate.SelectedDate.HasValue ? edtDate.SelectedDate.Value : DateTime.Now; item.description = edtDescription.Text; item.accepter = edtAccepter.Text; item.address = edtAddress.Text; item.basement = edtBasement.Text; if (Invoice != null) { if (Invoice.account == null) if (Invoice.accountReference != null) Invoice.accountReference.Load(); if (Invoice.account != null) item.AccountID = Invoice.account.id; } else { if (edtCustomer.SelectedItem != null) item.AccountID = (edtCustomer.SelectedItem as AccountView).id; } item.deliverer = edtDeliverer.Text; item.driver = edtDriver.Text; item.warrant = edtProcuration.Text; item.trailer = edtTrailer.Text; item.tripsheet = edtTripSheet.Text; item.truck = edtTruck.Text; item.truckowner = edtTruckOwner.Text; item.unloading = edtUnloading.Text; item.unn = edtUNN.Text; if (cbEmptySpareOutgo.IsChecked.Value) item.isGhost = 1; else item.isGhost = 0; return item; }
/// <summary> /// Create a new spare_outgo object. /// </summary> /// <param name="id">Initial value of the id property.</param> public static spare_outgo Createspare_outgo(global::System.Int32 id) { spare_outgo spare_outgo = new spare_outgo(); spare_outgo.id = id; return spare_outgo; }
/// <summary> /// Deprecated Method for adding a new object to the spare_outgo EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTospare_outgo(spare_outgo spare_outgo) { base.AddObject("spare_outgo", spare_outgo); }
public void SpareOutgoEdit(spare_outgo i, string CurrencyCode) { spare_outgo o = objDataContext.spare_outgo.FirstOrDefault(b => b.id == i.id); if (o != null) { o.currency = objDataContext.currencies.FirstOrDefault(c => c.code == CurrencyCode); o.description = i.description; o.unn = i.unn; o.unloading = i.unloading; o.truckowner = i.truckowner; o.truck = i.truck; o.tripsheet = i.tripsheet; o.trailer = i.trailer; o.driver = i.driver; o.deliverer = i.deliverer; o.AccountID = i.AccountID; o.basement = i.basement; o.address = i.address; o.accepter = i.accepter; o.warrant = i.warrant; objDataContext.SaveChanges(); } }
public int SpareOutgoCreate(spare_outgo _obj, string CurrencyCode) { _obj.currency = objDataContext.currencies.FirstOrDefault(i => i.code == CurrencyCode); objDataContext.AddTospare_outgo(_obj); objDataContext.SaveChanges(); return _obj.id; }