public bool Remove(FuelDeliveryObject fuelDelivery) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "FuelDelivery_DELETE", CreateParameter("@fueldelID", SqlDbType.UniqueIdentifier, fuelDelivery.FuelDeliveryID, ParameterDirection.Input) ); return(true); } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void Save(FuelDeliveryObject fuelDelivery) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "FuelDelivery_SAVE", CreateParameter("@fueldelID", SqlDbType.UniqueIdentifier, fuelDelivery.FuelDeliveryID, ParameterDirection.InputOutput), CreateParameter("@supID", SqlDbType.UniqueIdentifier, fuelDelivery.Supplier.SupID), CreateParameter("@DateDelivery", SqlDbType.VarChar, fuelDelivery.DateDelivery), CreateParameter("@DateInvoice", SqlDbType.VarChar, fuelDelivery.DateInvoice), CreateParameter("@Quantity", SqlDbType.Decimal, fuelDelivery.Quantity), CreateParameter("@UnityPrice", SqlDbType.Decimal, fuelDelivery.UnityPrice), CreateParameter("@Location", SqlDbType.Int, (int)fuelDelivery.Location), CreateParameter("@Remark", SqlDbType.NVarChar, fuelDelivery.Remark) ); fuelDelivery.FuelDeliveryID = (Guid)cmd.Parameters["@fueldelID"].Value; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public static FuelDeliveryObject FuelDeliveryRowToObject(DataRow FuelDelivery) { FuelDeliveryObject obj = new FuelDeliveryObject(); try { if (FuelDelivery != null) { if (RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, false, DataRowVersion.Current) != Guid.Empty) { obj.FuelDeliveryID = RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, true, DataRowVersion.Current); obj.Supplier = SupplierConvertor.SupplierRowToObject(FuelDelivery); obj.DateDelivery = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_DELIVERY, false, DataRowVersion.Current); obj.DateInvoice = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_INVOICE, false, DataRowVersion.Current); obj.Quantity = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.QUANTITY, false, DataRowVersion.Current); obj.UnityPrice = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.UNITY_PRICE, false, DataRowVersion.Current); obj.Location = (Framework.Common.Enumeration.Fuel.Location)RowFunctions.GetValueFromRowToInteger(FuelDelivery, FuelDeliveryObject.LOCATION, false, DataRowVersion.Current); obj.Remark = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.REMARK, false, DataRowVersion.Current); } return obj; } obj = null; } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } return obj; }
public static FuelDeliveryObject FuelDeliveryRowToObject(DataRow FuelDelivery) { FuelDeliveryObject obj = new FuelDeliveryObject(); try { if (FuelDelivery != null) { if (RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, false, DataRowVersion.Current) != Guid.Empty) { obj.FuelDeliveryID = RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, true, DataRowVersion.Current); obj.Supplier = SupplierConvertor.SupplierRowToObject(FuelDelivery); obj.DateDelivery = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_DELIVERY, false, DataRowVersion.Current); obj.DateInvoice = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_INVOICE, false, DataRowVersion.Current); obj.Quantity = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.QUANTITY, false, DataRowVersion.Current); obj.UnityPrice = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.UNITY_PRICE, false, DataRowVersion.Current); obj.Location = (Framework.Common.Enumeration.Fuel.Location)RowFunctions.GetValueFromRowToInteger(FuelDelivery, FuelDeliveryObject.LOCATION, false, DataRowVersion.Current); obj.Remark = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.REMARK, false, DataRowVersion.Current); } return(obj); } obj = null; } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } return(obj); }
public void Save(FuelDeliveryObject fuelDelivery) { try { CheckTransaction(); new FuelDeliveryDataService(Transaction).Save(fuelDelivery); if (IsOwner) { Transaction.Commit(); } } catch (Exception exception1) { if (IsOwner) { Transaction.Rollback(); } Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (IsOwner) { Connection.Close(); } } }
public void Remove(FuelDeliveryObject value) { try { List.Remove(value); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public int Add(FuelDeliveryObject value) { try { return(List.Add(value)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
// Called by FuelDeliveryObject when it changes internal void FuelDeliveryObjectChanged(FuelDeliveryObject FuelDelivery) { try { int index = List.IndexOf(FuelDelivery); OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
// Methods. object IBindingList.AddNew() { try { FuelDeliveryObject FuelDelivery = new FuelDeliveryObject(); List.Add(FuelDelivery); return(FuelDelivery); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
protected override void OnRemoveComplete(int index, object value) { try { FuelDeliveryObject FuelDelivery = (FuelDeliveryObject)value; FuelDelivery.Parent = this; OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public void Remove(FuelDeliveryObject fuelDelivery) { try { CheckTransaction(); new FuelDeliveryDataService(Transaction).Remove(fuelDelivery); if (IsOwner) Transaction.Commit(); } catch (Exception exception1) { if (IsOwner) Transaction.Rollback(); Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (IsOwner) Connection.Close(); } }
private void gdvFuelDelivery_DoubleClick(object sender, EventArgs e) { try { GridView view = (GridView)sender; FuelDeliveryObject fuelDelivery = (FuelDeliveryObject)view.GetRow(view.FocusedRowHandle); TIS.Client.Fuel.FuelDeliveryDetail fuelDeliveryDetail = new FuelDeliveryDetail(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, fuelDelivery); if (fuelDeliveryDetail.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.FilterDelivery(); } } catch (System.Exception excepion1) { Cursor.Current = Cursors.Default; System.Exception thisException = excepion1; Management.ShowException(thisException); } }
protected override void OnSetComplete(int index, object oldValue, object newValue) { try { if (oldValue != newValue) { FuelDeliveryObject oldFuelDelivery = (FuelDeliveryObject)oldValue; FuelDeliveryObject newFuelDelivery = (FuelDeliveryObject)newValue; oldFuelDelivery.Parent = null; newFuelDelivery.Parent = this; OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index)); } } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public FuelDeliveryDetail(PROF_IT.Common.Enumerations.TypeForm typeForm) { try { InitializeComponent(); _typeForm = typeForm; if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm) { FuelDeliveryMember = new FuelDeliveryObject(); FindAll(); } else { throw new NotImplementedException(); } SetPermissions(); } catch (System.Exception exception1) { System.Exception innerException = exception1; throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
// Methods. object IBindingList.AddNew() { try { FuelDeliveryObject FuelDelivery = new FuelDeliveryObject(); List.Add(FuelDelivery); return FuelDelivery; } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public void Save(FuelDeliveryObject fuelDelivery) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "FuelDelivery_SAVE", CreateParameter("@fueldelID", SqlDbType.UniqueIdentifier, fuelDelivery.FuelDeliveryID, ParameterDirection.InputOutput), CreateParameter("@supID", SqlDbType.UniqueIdentifier, fuelDelivery.Supplier.SupID), CreateParameter("@DateDelivery", SqlDbType.VarChar, fuelDelivery.DateDelivery), CreateParameter("@DateInvoice", SqlDbType.VarChar, fuelDelivery.DateInvoice), CreateParameter("@Quantity", SqlDbType.Decimal, fuelDelivery.Quantity), CreateParameter("@UnityPrice", SqlDbType.Decimal, fuelDelivery.UnityPrice), CreateParameter("@Location", SqlDbType.Int, (int)fuelDelivery.Location), CreateParameter("@Remark",SqlDbType.NVarChar, fuelDelivery.Remark) ); fuelDelivery.FuelDeliveryID = (Guid)cmd.Parameters["@fueldelID"].Value; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public int Add(FuelDeliveryObject value) { try { return List.Add(value); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public bool Remove(FuelDeliveryObject fuelDelivery) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "FuelDelivery_DELETE", CreateParameter("@fueldelID", SqlDbType.UniqueIdentifier, fuelDelivery.FuelDeliveryID, ParameterDirection.Input) ); return true; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }